diff --git a/.claude/skills/skill-authoring/SKILL.md b/.claude/skills/skill-authoring/SKILL.md new file mode 100644 index 00000000..3d113df7 --- /dev/null +++ b/.claude/skills/skill-authoring/SKILL.md @@ -0,0 +1,228 @@ +--- +name: skill-authoring +description: Guide for creating and maintaining user-facing agent skills +--- + +# Skill Authoring Guide + +This skill guides you through creating user-facing agent skills. For the canonical reference, see [agentskills.io](https://agentskills.io/home). + +## Skill Structure + +A skill is a folder containing a `SKILL.md` file with metadata and instructions: + +``` +my-skill/ +├── SKILL.md # Required: instructions + metadata +├── scripts/ # Optional: executable code +├── references/ # Optional: additional documentation +└── assets/ # Optional: templates, resources +``` + +## SKILL.md Format + +### Required Frontmatter + +```yaml +--- +name: skill-name +description: Brief description of what the skill does +--- +``` + +- **name**: Unique identifier (lowercase, hyphens) +- **description**: One-line summary (loaded at startup for all skills) + +### Instructions Body + +The body contains markdown instructions that tell the agent how to perform the task. + +```markdown +--- +name: my-skill +description: Does something useful +--- + +# Skill Title + +Brief overview of what this skill helps accomplish. + +## When to Use + +Describe scenarios when this skill applies. + +## How to Use + +Step-by-step instructions or patterns. + +## Examples + +Concrete examples demonstrating usage. + +## Reference + +- [Detailed Reference](references/REFERENCE.md) - Link to additional docs +``` + +## Progressive Disclosure + +Structure skills for efficient context usage: + +| Layer | Token Budget | When Loaded | +|-------|--------------|-------------| +| Metadata | ~100 tokens | At startup (all skills) | +| Instructions | < 5000 tokens | When skill activated | +| References | As needed | On demand | + +### Guidelines + +1. **Keep SKILL.md under 500 lines** - Move detailed content to references +2. **Front-load key information** - Put most important patterns first +3. **Use tables for quick reference** - Easy to scan +4. **Link to references** - Don't inline everything + +## Optional Directories + +### scripts/ + +Executable code that agents can run: + +``` +scripts/ +├── validate.sh # Validation script +├── generate.py # Code generator +└── setup.js # Setup helper +``` + +Scripts should: +- Be self-contained or document dependencies +- Include helpful error messages +- Handle edge cases gracefully + +### references/ + +Additional documentation loaded on demand: + +``` +references/ +├── PATTERNS.md # Common patterns +├── API.md # API reference +└── EXAMPLES.md # Extended examples +``` + +Keep individual reference files focused. Smaller files = less context usage. + +### assets/ + +Static resources: + +``` +assets/ +├── template.xml # File templates +├── schema.json # Schemas +└── diagram.png # Visual aids +``` + +## File References + +Use relative paths from the skill root: + +```markdown +See [the reference guide](references/REFERENCE.md) for details. + +Run the setup script: +scripts/setup.sh +``` + +Keep references one level deep. Avoid deeply nested chains. + +## Skill Categories + +### Developer Skills (`.claude/skills/`) + +Skills for contributors working on this codebase: + +- Command development patterns +- Testing approaches +- API client patterns +- Documentation standards + +### User-Facing Skills (`plugins/*/skills/`) + +Skills for users of the tool: + +- CLI command usage +- Platform-specific patterns (B2C Commerce) +- Integration guides + +## Writing Effective Skills + +### 1. Start with the User's Goal + +```markdown +## Overview + +This skill helps you [accomplish X] by [doing Y]. +``` + +### 2. Provide Quick Reference Tables + +```markdown +| Command | Description | +|---------|-------------| +| `cmd1` | Does X | +| `cmd2` | Does Y | +``` + +### 3. Show Concrete Examples + +```markdown +## Examples + +### Basic Usage + +\`\`\`bash +b2c command --flag value +\`\`\` + +### Advanced Usage + +\`\`\`bash +b2c command --complex-flag +\`\`\` +``` + +### 4. Explain When NOT to Use + +```markdown +## When NOT to Use + +- Scenario A (use skill-x instead) +- Scenario B (manual approach better) +``` + +### 5. Link to Authoritative Sources + +Reference official documentation rather than duplicating it: + +```markdown +## Reference + +For complete API documentation, see [Official Docs](https://example.com/docs). +``` + +## Validation Checklist + +Before publishing a skill: + +- [ ] Frontmatter has `name` and `description` +- [ ] SKILL.md under 500 lines +- [ ] Key information appears early +- [ ] Examples are concrete and runnable +- [ ] Reference links are valid +- [ ] No deeply nested reference chains +- [ ] Tested with target agent + +## Detailed Reference + +- [Patterns and Examples](references/PATTERNS.md) - Patterns from B2C skills diff --git a/.claude/skills/skill-authoring/references/PATTERNS.md b/.claude/skills/skill-authoring/references/PATTERNS.md new file mode 100644 index 00000000..d9e824f4 --- /dev/null +++ b/.claude/skills/skill-authoring/references/PATTERNS.md @@ -0,0 +1,384 @@ +# Skill Authoring Patterns + +Patterns and lessons learned from creating B2C Commerce skills. + +## Content Organization + +### Main SKILL.md Structure + +Effective skills follow this structure: + +```markdown +--- +name: skill-name +description: One-line description +--- + +# Skill Title + +Brief overview (2-3 sentences). + +## Overview / Quick Reference + +Tables or bullet points for quick scanning. + +## Core Concepts + +Key information the user needs to understand. + +## Patterns / How To + +Step-by-step instructions with examples. + +## Examples + +Complete, runnable examples. + +## Detailed References + +Links to reference files for deep dives. + +## Script API Classes (if applicable) + +Table of relevant classes/methods. +``` + +### Reference File Structure + +Reference files should be focused on one topic: + +```markdown +# Topic Reference + +Brief intro. + +## Subtopic A + +Details with examples. + +## Subtopic B + +Details with examples. + +## Complete Example + +Full working example if applicable. +``` + +## Effective Tables + +Tables provide quick reference without consuming much context: + +### Command Reference Table + +```markdown +| Command | Description | +|---------|-------------| +| `b2c cmd1` | Does X | +| `b2c cmd2` | Does Y | +``` + +### Parameter Table + +```markdown +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | Yes | The item name | +| `count` | int | No | Number of items | +``` + +### Feature Matrix Table + +```markdown +| Feature | Supported | Notes | +|---------|-----------|-------| +| Feature A | Yes | Full support | +| Feature B | Partial | Only in v2+ | +| Feature C | No | Use workaround | +``` + +## Code Examples + +### Inline Code + +For short snippets, use inline code: + +```markdown +Use `Logger.getLogger('category')` to get a logger instance. +``` + +### Code Blocks + +For complete examples, use fenced code blocks with language: + +````markdown +```javascript +var Logger = require('dw/system/Logger'); +var log = Logger.getLogger('checkout'); +log.info('Order {0} placed', orderNo); +``` +```` + +### Multi-file Examples + +When showing related files, use headers: + +````markdown +**package.json:** +```json +{ "name": "my-package" } +``` + +**index.js:** +```javascript +module.exports = function() {}; +``` +```` + +## XML Examples + +When documenting XML formats: + +1. **Always validate against XSD schemas** if available +2. **Show namespace declarations** in first example +3. **Use realistic but simple data** + +```xml + + + content + +``` + +## Referencing Official Documentation + +### When to Reference + +- API details that may change +- Complete specification documents +- Platform-specific configurations + +### How to Reference + +```markdown +For complete API documentation, see the [Official Guide](https://docs.example.com). + +The `Logger` class is documented in the [Script API Reference](https://docs.example.com/api/Logger). +``` + +### When to Inline + +- Frequently used patterns +- Information not easily found in docs +- Synthesized knowledge from multiple sources + +## Progressive Complexity + +Structure content from simple to complex: + +### Basic Pattern First + +```markdown +## Basic Usage + +```javascript +Logger.info('Simple message'); +``` +``` + +### Then Add Complexity + +```markdown +## With Parameters + +```javascript +Logger.info('Order {0} for customer {1}', orderNo, customerId); +``` +``` + +### Finally Show Advanced Cases + +```markdown +## Custom Log Files + +```javascript +var log = Logger.getLogger('prefix', 'category'); +log.info('Goes to custom-prefix-*.log'); +``` +``` + +## Common Skill Patterns + +### CLI Command Skill + +```markdown +--- +name: tool-command +description: Guide for using the tool command +--- + +# Tool Command + +Brief description of what the command does. + +## Quick Reference + +| Command | Description | +|---------|-------------| +| `tool cmd1` | Does X | +| `tool cmd2` | Does Y | + +## Examples + +### Basic Usage + +\`\`\`bash +tool command --flag value +\`\`\` + +### Common Workflows + +\`\`\`bash +# Workflow description +tool step1 +tool step2 +\`\`\` +``` + +### API/Framework Skill + +```markdown +--- +name: framework-feature +description: Guide for implementing feature with framework +--- + +# Feature Name + +Overview of the feature and when to use it. + +## Core Concepts + +| Concept | Description | +|---------|-------------| +| Concept A | What it is | +| Concept B | What it is | + +## Basic Pattern + +\`\`\`javascript +// Basic implementation +\`\`\` + +## Configuration + +| Setting | Default | Description | +|---------|---------|-------------| +| setting1 | value | What it does | + +## Detailed References + +- [Advanced Patterns](references/ADVANCED.md) +- [Configuration Options](references/CONFIG.md) +``` + +### XML/Configuration Skill + +```markdown +--- +name: config-format +description: Guide for XML/config file format +--- + +# Configuration Format + +Overview of the configuration file. + +## File Structure + +\`\`\` +project/ +├── config/ +│ └── settings.xml +└── data/ + └── values.xml +\`\`\` + +## XML Schema + +\`\`\`xml + + + + +\`\`\` + +## Element Reference + +| Element | Required | Description | +|---------|----------|-------------| +| `` | Yes | Purpose | +| `` | No | Purpose | + +## Complete Example + +[Full example with realistic data] +``` + +## Skill Maintenance + +### Version Control + +- Keep skills in version control with the codebase +- Update skills when features change +- Review skills during code reviews + +### Testing Skills + +- Manually test instructions work as documented +- Validate XML examples against schemas +- Verify links to references work + +### Updating Skills + +When updating: +1. Check if existing content is still accurate +2. Add new content in appropriate section +3. Update examples if APIs changed +4. Verify reference links still work + +## Anti-Patterns to Avoid + +### Too Much Content in SKILL.md + +**Bad:** 2000+ line SKILL.md with everything inlined + +**Good:** < 500 line SKILL.md with references for details + +### Missing Context + +**Bad:** +```markdown +Use `cmd --flag` to do the thing. +``` + +**Good:** +```markdown +Use `cmd --flag` to enable feature X, which allows Y: + +\`\`\`bash +cmd --flag value +\`\`\` +``` + +### Outdated Examples + +**Bad:** Examples using deprecated APIs or old syntax + +**Good:** Examples validated against current documentation/schemas + +### Deeply Nested References + +**Bad:** SKILL.md → ref1.md → ref2.md → ref3.md + +**Good:** SKILL.md → ref1.md (one level deep) diff --git a/AGENTS.md b/AGENTS.md index 49c50464..860fc3e5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,6 +37,20 @@ pnpm run -r format pnpm run -r lint ``` +## Copyright Header + +All TypeScript source files must include this exact copyright header block: + +```typescript +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +``` + +The header is enforced by eslint via `eslint-plugin-header`. The canonical definition is in `eslint.config.mjs` (root) as `copyrightHeader`. + ## Setup/Packaging - use `pnpm` over `npm` for package management diff --git a/docs/guide/agent-skills.md b/docs/guide/agent-skills.md index 1c3378a9..f4ce5701 100644 --- a/docs/guide/agent-skills.md +++ b/docs/guide/agent-skills.md @@ -2,54 +2,35 @@ The B2C Developer Tooling project provides agent skills that enhance the AI-assisted development experience when working with Salesforce B2C Commerce projects. -These skills follow the [Agent Skills](https://agentskills.io/home) standard and can be used with multiple agentic IDEs including [Claude Code](https://claude.ai/code), Cursor, GitHub Copilot, and OpenAI Codex. +These skills follow the [Agent Skills](https://agentskills.io/home) standard and can be used with multiple agentic IDEs including [Claude Code](https://claude.ai/code), Cursor, GitHub Copilot, and VS Code. ## Overview When installed, the skills teach AI assistants about B2C Commerce development, CLI commands, and best practices, enabling them to help you with: - **CLI Operations** - Deploying cartridges, running jobs, managing sandboxes, WebDAV operations -- **Custom API Development** - Building SCAPI Custom APIs with contracts, implementations, and mappings -- **Best Practices** - Authentication patterns, troubleshooting workflows, and development practices +- **B2C Development** - Controllers, ISML templates, forms, localization, logging, metadata +- **Web Services** - HTTP/SOAP/FTP integrations using the Service Framework +- **Custom APIs** - Building SCAPI Custom APIs with contracts, implementations, and mappings ## Available Plugins | Plugin | Description | |--------|-------------| | `b2c-cli` | Skills for B2C CLI commands and operations | -| `b2c` | Skills for B2C Commerce development practices | +| `b2c` | Skills for B2C Commerce development patterns | ### Plugin: b2c-cli -Skills for using the B2C CLI to manage your Commerce Cloud instances: +Skills for using the B2C CLI to manage your Commerce Cloud instances. Covers code deployment, job execution, site archive import/export, WebDAV file operations, On-Demand Sandbox management, and more. -| Skill | Description | -|-------|-------------| -| `b2c-code` | Code version deployment and management | -| `b2c-job` | Job execution and site archive import/export (IMPEX) | -| `b2c-sites` | Storefront sites listing and inspection | -| `b2c-webdav` | WebDAV file operations (ls, get, put, rm, zip, unzip) | -| `b2c-ods` | On-Demand Sandbox management | -| `b2c-mrt` | Managed Runtime project and deployment management | -| `b2c-slas` | SLAS client management | -| `b2c-scapi-custom` | Custom API endpoint status and management | +Browse skills: [plugins/b2c-cli/skills/](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c-cli/skills) ### Plugin: b2c -Skills for B2C Commerce development practices and patterns: +Skills for B2C Commerce development patterns and practices. Covers controllers, ISML templates, forms, localization, logging, metadata, web services, custom job steps, Page Designer, Business Manager extensions, and Custom API development. -| Skill | Description | -|-------|-------------| -| `b2c-custom-api-development` | Comprehensive guide for building SCAPI Custom APIs | - -The Custom API development skill covers: -- The three required components (contract, implementation, mapping) -- OAS 3.0 schema authoring with security schemes -- Implementation patterns with RESTResponseMgr -- Shopper vs Admin API differences -- Caching and remote includes -- Circuit breaker protection -- Troubleshooting workflows +Browse skills: [plugins/b2c/skills/](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c/skills) ## Installation with Claude Code @@ -122,36 +103,24 @@ claude plugin marketplace remove b2c-developer-tooling The B2C skills follow the [Agent Skills](https://agentskills.io/home) standard and can be used with other AI-powered development tools. -### CLI Setup Command - -::: warning Coming Soon -The `b2c setup skills` command is not yet available. Use the manual method below for now. -::: - -```bash -# Configure skills for your IDE (coming soon) -b2c setup skills --ide cursor -b2c setup skills --ide copilot -``` - -### Manual Setup +### Cursor -You can manually copy skill files from the GitHub repository to your IDE's configuration: +See the [Cursor Skills documentation](https://cursor.com/docs/context/skills) for configuration instructions. -- **b2c-cli skills**: [plugins/b2c-cli/skills/](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c-cli/skills) -- **b2c skills**: [plugins/b2c/skills/](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c/skills) +Copy skill files from the plugin directories to your Cursor skills location: -#### Cursor +- [b2c-cli skills](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c-cli/skills) +- [b2c skills](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c/skills) -Copy the `SKILL.md` files to `.cursor/rules/` in your project or configure globally in Cursor settings. +### VS Code with GitHub Copilot -#### GitHub Copilot +See the [VS Code Agent Skills documentation](https://code.visualstudio.com/docs/copilot/customization/agent-skills) for configuration instructions. -Append the skill content to `.github/copilot-instructions.md` in your repository. +You can also append skill content to `.github/copilot-instructions.md` in your repository. -#### OpenAI Codex +### Other IDEs -Configure per the OpenAI Codex documentation for custom instructions. +For other AI-powered IDEs, copy the `SKILL.md` files and any `references/` directories to your IDE's custom instructions location. ## Usage Examples @@ -172,10 +141,13 @@ Once installed, you can ask your AI assistant to help with B2C Commerce tasks: **Create a sandbox:** > "Create a new On-Demand Sandbox with TTL of 48 hours" -**Check Custom API status:** -> "Show me the status of my Custom API endpoints" - **Build a Custom API:** > "Help me create a Custom API for loyalty information" +**Add logging:** +> "Add logging to my checkout controller" + +**Create a web service:** +> "Create an HTTP service to call the payment gateway API" + The AI will use the appropriate skills and CLI commands based on your request. diff --git a/packages/b2c-cli/eslint.config.mjs b/packages/b2c-cli/eslint.config.mjs index 383bd079..228e20a7 100644 --- a/packages/b2c-cli/eslint.config.mjs +++ b/packages/b2c-cli/eslint.config.mjs @@ -25,6 +25,11 @@ export default [ plugins: { header: headerPlugin, }, + linterOptions: { + // Downgrade to warn - import/namespace behaves inconsistently across environments + // when parsing CJS modules like marked-terminal + reportUnusedDisableDirectives: 'warn', + }, rules: { 'header/header': ['error', 'block', copyrightHeader], ...sharedRules, diff --git a/packages/b2c-cli/package.json b/packages/b2c-cli/package.json index 89e1c9cb..b3319fc2 100644 --- a/packages/b2c-cli/package.json +++ b/packages/b2c-cli/package.json @@ -15,7 +15,9 @@ "@oclif/plugin-plugins": "^5", "@oclif/plugin-version": "^2", "@salesforce/b2c-tooling-sdk": "workspace:*", - "cliui": "^9.0.1" + "cliui": "^9.0.1", + "marked": "^15.0.0", + "marked-terminal": "^7.3.0" }, "bundleDependencies": [ "@oclif/core", @@ -25,7 +27,9 @@ "@oclif/plugin-plugins", "@oclif/plugin-version", "@salesforce/b2c-tooling-sdk", - "cliui" + "cliui", + "marked", + "marked-terminal" ], "devDependencies": { "@eslint/compat": "^1", @@ -88,6 +92,9 @@ "code": { "description": "Deploy and manage code versions on instances" }, + "docs": { + "description": "Search and read Script API documentation" + }, "job": { "description": "Run jobs and import/export site archives" }, diff --git a/packages/b2c-cli/src/commands/docs/download.ts b/packages/b2c-cli/src/commands/docs/download.ts new file mode 100644 index 00000000..42d2d6f5 --- /dev/null +++ b/packages/b2c-cli/src/commands/docs/download.ts @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +import {Args, Flags} from '@oclif/core'; +import {InstanceCommand} from '@salesforce/b2c-tooling-sdk/cli'; +import {downloadDocs, type DownloadDocsResult} from '@salesforce/b2c-tooling-sdk/operations/docs'; +import {t} from '../../i18n/index.js'; + +export default class DocsDownload extends InstanceCommand { + static args = { + output: Args.string({ + description: 'Output directory for extracted documentation', + required: true, + }), + }; + + static description = t( + 'commands.docs.download.description', + 'Download Script API documentation from a B2C Commerce instance', + ); + + static enableJsonFlag = true; + + static examples = [ + '<%= config.bin %> <%= command.id %> ./docs', + '<%= config.bin %> <%= command.id %> ./docs --keep-archive', + '<%= config.bin %> <%= command.id %> --server sandbox.demandware.net ./my-docs', + ]; + + static flags = { + ...InstanceCommand.baseFlags, + 'keep-archive': Flags.boolean({ + description: 'Keep the downloaded archive file', + default: false, + }), + }; + + async run(): Promise { + this.requireServer(); + this.requireWebDavCredentials(); + + const outputDir = this.args.output; + const keepArchive = this.flags['keep-archive']; + + this.log( + t('commands.docs.download.downloading', 'Downloading documentation from {{hostname}}...', { + hostname: this.resolvedConfig.hostname, + }), + ); + + const result = await downloadDocs(this.instance, { + outputDir, + keepArchive, + }); + + if (this.jsonEnabled()) { + return result; + } + + this.log( + t('commands.docs.download.success', 'Downloaded {{count}} documentation files to {{path}}', { + count: result.fileCount, + path: result.outputPath, + }), + ); + + if (result.archivePath) { + this.log( + t('commands.docs.download.archiveKept', 'Archive saved to: {{path}}', { + path: result.archivePath, + }), + ); + } + + return result; + } +} diff --git a/packages/b2c-cli/src/commands/docs/read.ts b/packages/b2c-cli/src/commands/docs/read.ts new file mode 100644 index 00000000..82aa3fad --- /dev/null +++ b/packages/b2c-cli/src/commands/docs/read.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +import {Args, Flags} from '@oclif/core'; +import {marked} from 'marked'; +// eslint-disable-next-line import/namespace +import {markedTerminal} from 'marked-terminal'; +import {BaseCommand} from '@salesforce/b2c-tooling-sdk/cli'; +import {readDocByQuery, type DocEntry} from '@salesforce/b2c-tooling-sdk/operations/docs'; +import {t} from '../../i18n/index.js'; + +interface ReadDocsResult { + entry: DocEntry; + content: string; +} + +// Configure marked with terminal renderer +marked.use( + markedTerminal({ + width: 80, + reflowText: true, + tableOptions: { + wordWrap: true, + colWidths: [35, 45], + }, + }), +); + +export default class DocsRead extends BaseCommand { + static args = { + query: Args.string({ + description: 'Search query for documentation (class name, module path, or partial match)', + required: true, + }), + }; + + static description = t('commands.docs.read.description', 'Read Script API documentation for a class or module'); + + static enableJsonFlag = true; + + static examples = [ + '<%= config.bin %> <%= command.id %> ProductMgr', + '<%= config.bin %> <%= command.id %> dw.catalog.ProductMgr', + '<%= config.bin %> <%= command.id %> "dw system Status"', + '<%= config.bin %> <%= command.id %> ProductMgr --raw', + '<%= config.bin %> <%= command.id %> ProductMgr --json', + ]; + + static flags = { + ...BaseCommand.baseFlags, + raw: Flags.boolean({ + char: 'r', + description: 'Output raw markdown without terminal formatting', + default: false, + }), + }; + + async run(): Promise { + const {query} = this.args; + const {raw} = this.flags; + + const result = readDocByQuery(query); + + if (!result) { + this.error(t('commands.docs.read.notFound', 'No documentation found matching: {{query}}', {query}), { + suggestions: ['Try a broader search term', 'Use "b2c docs search " to see available matches'], + }); + } + + if (this.jsonEnabled()) { + return result; + } + + // Determine if we should render markdown for terminal + const useRaw = raw || !process.stdout.isTTY; + + if (useRaw) { + process.stdout.write(result.content); + } else { + const rendered = marked.parse(result.content); + process.stdout.write(rendered as string); + } + + return result; + } +} diff --git a/packages/b2c-cli/src/commands/docs/schema.ts b/packages/b2c-cli/src/commands/docs/schema.ts new file mode 100644 index 00000000..84ee6ebc --- /dev/null +++ b/packages/b2c-cli/src/commands/docs/schema.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +import {Args, Flags} from '@oclif/core'; +import {BaseCommand} from '@salesforce/b2c-tooling-sdk/cli'; +import {readSchemaByQuery, listSchemas, type SchemaEntry} from '@salesforce/b2c-tooling-sdk/operations/docs'; +import {t} from '../../i18n/index.js'; + +interface SchemaResult { + entry: SchemaEntry; + content: string; +} + +interface ListResult { + entries: SchemaEntry[]; +} + +export default class DocsSchema extends BaseCommand { + static args = { + query: Args.string({ + description: 'Schema name or partial match (e.g., "catalog", "order")', + required: false, + }), + }; + + static description = t('commands.docs.schema.description', 'Read an XSD schema file'); + + static enableJsonFlag = true; + + static examples = [ + '<%= config.bin %> <%= command.id %> catalog', + '<%= config.bin %> <%= command.id %> order', + '<%= config.bin %> <%= command.id %> --list', + '<%= config.bin %> <%= command.id %> catalog --json', + ]; + + static flags = { + ...BaseCommand.baseFlags, + list: Flags.boolean({ + char: 'l', + description: 'List all available schemas', + default: false, + }), + }; + + async run(): Promise { + const {query} = this.args; + const {list} = this.flags; + + // List mode + if (list) { + const entries = listSchemas(); + + if (this.jsonEnabled()) { + return {entries}; + } + + this.log(t('commands.docs.schema.available', 'Available schemas:')); + for (const entry of entries) { + this.log(` ${entry.id}`); + } + this.log(''); + this.log(t('commands.docs.schema.count', '{{count}} schemas available', {count: entries.length})); + + return {entries}; + } + + // Read mode requires query + if (!query) { + this.error(t('commands.docs.schema.queryRequired', 'Schema name is required. Use --list to see all schemas.')); + } + + const result = readSchemaByQuery(query); + + if (!result) { + this.error(t('commands.docs.schema.notFound', 'No schema found matching: {{query}}', {query}), { + suggestions: ['Try a broader search term', 'Use "b2c docs schema --list" to see available schemas'], + }); + } + + if (this.jsonEnabled()) { + return result; + } + + // Output the schema content + process.stdout.write(result.content); + + return result; + } +} diff --git a/packages/b2c-cli/src/commands/docs/search.ts b/packages/b2c-cli/src/commands/docs/search.ts new file mode 100644 index 00000000..740d53be --- /dev/null +++ b/packages/b2c-cli/src/commands/docs/search.ts @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +import {Args, Flags, ux} from '@oclif/core'; +import {BaseCommand, createTable, type ColumnDef} from '@salesforce/b2c-tooling-sdk/cli'; +import {searchDocs, listDocs, type SearchResult, type DocEntry} from '@salesforce/b2c-tooling-sdk/operations/docs'; +import {t} from '../../i18n/index.js'; + +interface SearchDocsResponse { + query?: string; + results: SearchResult[]; +} + +interface ListDocsResponse { + entries: DocEntry[]; +} + +const COLUMNS: Record> = { + id: { + header: 'ID', + get: (r) => r.entry.id, + }, + title: { + header: 'Title', + get: (r) => r.entry.title, + }, + score: { + header: 'Match', + get(r) { + // Convert score to percentage (lower is better in Fuse.js) + const percent = Math.round((1 - r.score) * 100); + return `${percent}%`; + }, + }, +}; + +const DEFAULT_COLUMNS = ['id', 'title', 'score']; + +export default class DocsSearch extends BaseCommand { + static args = { + query: Args.string({ + description: 'Search query (fuzzy match against class/module names)', + required: false, + }), + }; + + static description = t('commands.docs.search.description', 'Search Script API documentation'); + + static enableJsonFlag = true; + + static examples = [ + '<%= config.bin %> <%= command.id %> ProductMgr', + '<%= config.bin %> <%= command.id %> "catalog product"', + '<%= config.bin %> <%= command.id %> status --limit 5', + '<%= config.bin %> <%= command.id %> --list', + ]; + + static flags = { + ...BaseCommand.baseFlags, + limit: Flags.integer({ + char: 'l', + description: 'Maximum number of results to display', + default: 20, + }), + list: Flags.boolean({ + description: 'List all available documentation entries', + default: false, + }), + }; + + async run(): Promise { + const {query} = this.args; + const {limit, list} = this.flags; + + // List mode + if (list) { + const entries = listDocs(); + + if (this.jsonEnabled()) { + return {entries}; + } + + // Convert to search results for table rendering + const results: SearchResult[] = entries.map((entry) => ({ + entry, + score: 0, + })); + + const listColumns: Record> = { + id: COLUMNS.id, + title: COLUMNS.title, + }; + + createTable(listColumns).render(results, ['id', 'title']); + + this.log( + t('commands.docs.search.totalCount', '{{count}} documentation entries available', {count: entries.length}), + ); + + return {entries}; + } + + // Search mode requires query + if (!query) { + this.error( + t('commands.docs.search.queryRequired', 'Query is required for search. Use --list to see all entries.'), + ); + } + + const results = searchDocs(query, limit); + + const response: SearchDocsResponse = { + query, + results, + }; + + if (this.jsonEnabled()) { + return response; + } + + if (results.length === 0) { + ux.stdout(t('commands.docs.search.noResults', 'No documentation found matching: {{query}}', {query})); + return response; + } + + createTable(COLUMNS).render(results, DEFAULT_COLUMNS); + + this.log( + t('commands.docs.search.resultCount', 'Found {{count}} matches for "{{query}}"', { + count: results.length, + query, + }), + ); + + return response; + } +} diff --git a/packages/b2c-cli/src/i18n/locales/en.ts b/packages/b2c-cli/src/i18n/locales/en.ts index 10678c91..abcca1f4 100644 --- a/packages/b2c-cli/src/i18n/locales/en.ts +++ b/packages/b2c-cli/src/i18n/locales/en.ts @@ -23,6 +23,32 @@ export const en = { error: 'Failed to fetch sites: {{message}}', }, }, + docs: { + search: { + description: 'Search Script API documentation', + queryRequired: 'Query is required for search. Use --list to see all entries.', + noResults: 'No documentation found matching: {{query}}', + resultCount: 'Found {{count}} matches for "{{query}}"', + totalCount: '{{count}} documentation entries available', + }, + read: { + description: 'Read Script API documentation for a class or module', + notFound: 'No documentation found matching: {{query}}', + }, + download: { + description: 'Download Script API documentation from a B2C Commerce instance', + downloading: 'Downloading documentation from {{hostname}}...', + success: 'Downloaded {{count}} documentation files to {{path}}', + archiveKept: 'Archive saved to: {{path}}', + }, + schema: { + description: 'Read an XSD schema file', + queryRequired: 'Schema name is required. Use --list to see all schemas.', + notFound: 'No schema found matching: {{query}}', + available: 'Available schemas:', + count: '{{count}} schemas available', + }, + }, code: { list: { description: 'List code versions on a B2C Commerce instance', diff --git a/packages/b2c-cli/src/types/marked-terminal.d.ts b/packages/b2c-cli/src/types/marked-terminal.d.ts new file mode 100644 index 00000000..0829f88d --- /dev/null +++ b/packages/b2c-cli/src/types/marked-terminal.d.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025, Salesforce, Inc. + * SPDX-License-Identifier: Apache-2 + * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * Type declarations for marked-terminal v7. + * These declarations are minimal and cover only the functionality we use. + */ +declare module 'marked-terminal' { + import type {MarkedExtension} from 'marked'; + + export interface TableOptions { + wordWrap?: boolean; + colWidths?: number[]; + colAligns?: ('left' | 'middle' | 'right')[]; + style?: { + 'padding-left'?: number; + 'padding-right'?: number; + head?: string[]; + border?: string[]; + compact?: boolean; + }; + } + + export interface MarkedTerminalOptions { + // Layout options + width?: number; + reflowText?: boolean; + tableOptions?: TableOptions; + // Renderer overrides + code?: (code: string) => string; + blockquote?: (quote: string) => string; + html?: (html: string) => string; + heading?: (text: string, level: number) => string; + firstHeading?: (text: string) => string; + hr?: () => string; + listitem?: (text: string) => string; + table?: (header: string, body: string) => string; + paragraph?: (text: string) => string; + strong?: (text: string) => string; + em?: (text: string) => string; + codespan?: (code: string) => string; + del?: (text: string) => string; + link?: (href: string, title: string, text: string) => string; + image?: (href: string, title: string, text: string) => string; + } + + export interface HighlightOptions { + language?: string; + ignoreIllegals?: boolean; + } + + export function markedTerminal(options?: MarkedTerminalOptions, highlightOptions?: HighlightOptions): MarkedExtension; + + export default class TerminalRenderer { + constructor(options?: MarkedTerminalOptions, highlightOptions?: HighlightOptions); + } +} diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.APIException.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.APIException.md new file mode 100644 index 00000000..fa76c554 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.APIException.md @@ -0,0 +1,119 @@ + +# Class APIException + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.APIException](TopLevel.APIException.md) + +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. + + + +## All Known Subclasses +[AspectAttributeValidationException](dw.experience.AspectAttributeValidationException.md), [CreateAgentBasketLimitExceededException](dw.order.CreateAgentBasketLimitExceededException.md), [CreateBasketFromOrderException](dw.order.CreateBasketFromOrderException.md), [CreateCouponLineItemException](dw.order.CreateCouponLineItemException.md), [CreateOrderException](dw.order.CreateOrderException.md), [CreateTemporaryBasketLimitExceededException](dw.order.CreateTemporaryBasketLimitExceededException.md), [ShopperContextException](dw.customer.shoppercontext.ShopperContextException.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [causeFullName](#causefullname): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the full name of the associated Java exception. | +| [causeMessage](#causemessage): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the message of the associated Java exception. | +| [causeName](#causename): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the simplified name of the associated Java exception. | +| [javaFullName](#javafullname): [String](TopLevel.String.md) | The full name of the underlying Java exception. | +| [javaMessage](#javamessage): [String](TopLevel.String.md) | The message of the underlying Java exception. | +| [javaName](#javaname): [String](TopLevel.String.md) | The simplified name of the underlying Java exception. | +| [type](#type): [String](TopLevel.String.md) | The name of the actual APIException type, without the package name. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [APIException](#apiexception)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### causeFullName +- causeFullName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the full name of the associated Java exception. + + + +--- + +### causeMessage +- causeMessage: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the message of the associated Java exception. + + + +--- + +### causeName +- causeName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the simplified name of the associated Java exception. + + + +--- + +### javaFullName +- javaFullName: [String](TopLevel.String.md) + - : The full name of the underlying Java exception. + + +--- + +### javaMessage +- javaMessage: [String](TopLevel.String.md) + - : The message of the underlying Java exception. + + +--- + +### javaName +- javaName: [String](TopLevel.String.md) + - : The simplified name of the underlying Java exception. + + +--- + +### type +- type: [String](TopLevel.String.md) + - : The name of the actual APIException type, without the package name. + + +--- + +## Constructor Details + +### APIException() +- APIException() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Array.md new file mode 100644 index 00000000..24e1ea3a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Array.md @@ -0,0 +1,732 @@ + +# Class Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Array](TopLevel.Array.md) + +An Array of items. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [length](#length): [Number](TopLevel.Number.md) | The length of the Array. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Array](#array)() | Constructs an Array. | +| [Array](#arraynumber)([Number](TopLevel.Number.md)) | Constructs an Array of the specified length. | +| [Array](#arrayobject)([Object...](TopLevel.Object.md)) | Constructs an Array using the specified values. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [concat](TopLevel.Array.md#concatobject)([Object...](TopLevel.Object.md)) | Constructs an Array by concatenating multiple values. | +| [copyWithin](TopLevel.Array.md#copywithinnumber-number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Copies elements within this array. | +| [entries](TopLevel.Array.md#entries)() | Returns an iterator containing all index/value pairs of this array. | +| [every](TopLevel.Array.md#everyfunction)([Function](TopLevel.Function.md)) | Returns true if every element in this array satisfies the test performed in the callback function. | +| [every](TopLevel.Array.md#everyfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Returns true if every element in the thisObject argument satisfies the test performed in the callback function, false otherwise. | +| [fill](TopLevel.Array.md#fillobject-number-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Sets multiple entries of this array to specific value. | +| [filter](TopLevel.Array.md#filterfunction)([Function](TopLevel.Function.md)) | Returns a new Array with all of the elements that pass the test implemented by the callback function. | +| [filter](TopLevel.Array.md#filterfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Returns a new Array with all of the elements that pass the test implemented by the callback function that is run against the specified Array, thisObject. | +| [find](TopLevel.Array.md#findfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Returns the first value within the array that satisfies the test defined in the callback function. | +| [findIndex](TopLevel.Array.md#findindexfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Returns the index of the first value within the array that satisfies the test defined in the callback function. | +| [forEach](TopLevel.Array.md#foreachfunction)([Function](TopLevel.Function.md)) | Runs the provided callback function once for each element present in the Array. | +| [forEach](TopLevel.Array.md#foreachfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Runs the provided callback function once for each element present in the specified Array, thisObject. | +| static [from](TopLevel.Array.md#fromobject-function-object)([Object](TopLevel.Object.md), [Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Creates a new array from an array-like object or an [Iterable](TopLevel.Iterable.md). | +| [includes](TopLevel.Array.md#includesobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Returns if the array contains a specific value. | +| [indexOf](TopLevel.Array.md#indexofobject)([Object](TopLevel.Object.md)) | Returns the first index at which a given element can be found in the array, or -1 if it is not present. | +| [indexOf](TopLevel.Array.md#indexofobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Returns the first index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present. | +| static [isArray](TopLevel.Array.md#isarrayobject)([Object](TopLevel.Object.md)) | Checks if the passed object is an array. | +| [join](TopLevel.Array.md#join)() | Converts all Array elements to Strings and concatenates them. | +| [join](TopLevel.Array.md#joinstring)([String](TopLevel.String.md)) | Converts all array elements to Strings and concatenates them. | +| [keys](TopLevel.Array.md#keys)() | Returns an iterator containing all indexes of this array. | +| [lastIndexOf](TopLevel.Array.md#lastindexofobject)([Object](TopLevel.Object.md)) | Returns the last index at which a given element can be found in the array, or -1 if it is not present. | +| [lastIndexOf](TopLevel.Array.md#lastindexofobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Returns the last index at which a given element can be found in the array starting at fromIndex, or -1 if it is not present. | +| [map](TopLevel.Array.md#mapfunction)([Function](TopLevel.Function.md)) | Creates a new Array with the results of calling the specified function on every element in this Array. | +| [map](TopLevel.Array.md#mapfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Creates a new Array with the results of calling the specified function on every element in the specified Array. | +| static [of](TopLevel.Array.md#ofobject)([Object...](TopLevel.Object.md)) | Creates a new array from a variable list of elements. | +| [pop](TopLevel.Array.md#pop)() | Removes and returns the last element of the Array. | +| [push](TopLevel.Array.md#pushobject)([Object...](TopLevel.Object.md)) | Appends elements to the Array. | +| [reverse](TopLevel.Array.md#reverse)() | Reverses the order of the elements in the Array. | +| [shift](TopLevel.Array.md#shift)() | Shifts elements down in the Array and returns the former first element. | +| [slice](TopLevel.Array.md#slicenumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new Array containing a portion of the Array using the specified start and end positions. | +| [some](TopLevel.Array.md#somefunction)([Function](TopLevel.Function.md)) | Returns true if any of the elements in the Array pass the test defined in the callback function, false otherwise. | +| [some](TopLevel.Array.md#somefunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Returns true if any of the elements in the specified Array pass the test defined in the callback function, false otherwise. | +| [sort](TopLevel.Array.md#sort)() | Sorts the elements of the Array in alphabetical order based on character encoding. | +| [sort](TopLevel.Array.md#sortfunction)([Function](TopLevel.Function.md)) | Sorts the elements of the Array in alphabetical order based on character encoding. | +| [splice](TopLevel.Array.md#splicenumber-number-object)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Object...](TopLevel.Object.md)) | Deletes the specified number of elements from the Array at the specified position, and then inserts values into the Array at that location. | +| [toLocaleString](TopLevel.Array.md#tolocalestring)() | Converts the Array to a localized String. | +| [toString](TopLevel.Array.md#tostring)() | Converts the Array to a String. | +| [unshift](TopLevel.Array.md#unshiftobject)([Object...](TopLevel.Object.md)) | Inserts elements at the beginning of the Array. | +| [values](TopLevel.Array.md#values)() | Returns an iterator containing all values of this array. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### length +- length: [Number](TopLevel.Number.md) + - : The length of the Array. + + +--- + +## Constructor Details + +### Array() +- Array() + - : Constructs an Array. + + +--- + +### Array(Number) +- Array(length: [Number](TopLevel.Number.md)) + - : Constructs an Array of the specified + length. + + + **Parameters:** + - length - the length of the Array. + + +--- + +### Array(Object...) +- Array(values: [Object...](TopLevel.Object.md)) + - : Constructs an Array using the specified values. + + **Parameters:** + - values - zero or more values that are stored in the Array. + + +--- + +## Method Details + +### concat(Object...) +- concat(values: [Object...](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Constructs an Array by concatenating multiple values. + + **Parameters:** + - values - one or more Array values. + + **Returns:** + - a new Array containing the concatenated values. + + +--- + +### copyWithin(Number, Number, Number) +- copyWithin(target: [Number](TopLevel.Number.md), start: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Array](TopLevel.Array.md) + - : Copies elements within this array. The array length is not changed. + + **Parameters:** + - target - The target of the first element to copy. + - start - Optional. The first index to copy. Default is 0. + - end - Optional. The index of the end. This element is not included. Default is copy all to the array end. + + **Returns:** + - This array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### entries() +- entries(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all index/value pairs of this array. + The iterator produces a series of two-element arrays with the first element as the index and the second element as the value. + + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### every(Function) +- every(callback: [Function](TopLevel.Function.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if every element in this array satisfies the test + performed in the callback function. The callback function is + invoked with three arguments: the value of the element, + the index of the element, and the Array object being traversed. + + + **Parameters:** + - callback - the function to call to determine if every element in this array satisfies the test defined by the function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + + **Returns:** + - true if every element in this array satisfies the test + performed in the callback function. + + + **See Also:** + - [Function](TopLevel.Function.md) + + +--- + +### every(Function, Object) +- every(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if every element in the thisObject argument satisfies the + test performed in the callback function, false otherwise. + The callback function is invoked with three arguments: the value of the + element, the index of the element, and the Array object being traversed. + + + **Parameters:** + - callback - the function to call to determine if every element in this array satisfies the test defined by the function. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - the Object to use as 'this' when executing callback. + + **Returns:** + - true if every element in thisObject satisfies the test + performed in the callback function, false otherwise. + + + **See Also:** + - [Function](TopLevel.Function.md) + + +--- + +### fill(Object, Number, Number) +- fill(value: [Object](TopLevel.Object.md), start: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Array](TopLevel.Array.md) + - : Sets multiple entries of this array to specific value. + + **Parameters:** + - value - The value to set. + - start - Optional. The first index to copy. Default is 0. + - end - Optional. The index of the end. This element is not included. Default is copy all to the array end. + + **Returns:** + - This array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### filter(Function) +- filter(callback: [Function](TopLevel.Function.md)): [Array](TopLevel.Array.md) + - : Returns a new Array with all of the elements that pass the test + implemented by the callback function. The callback function is + invoked with three arguments: the value of the element, + the index of the element, and the Array object being traversed. + + + **Parameters:** + - callback - the function that is called on this Array and which returns a new Array containing the elements that satisfy the function's test. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + + **Returns:** + - a new Array containing the elements that satisfy the + function's test. + + + +--- + +### filter(Function, Object) +- filter(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns a new Array with all of the elements that pass the test + implemented by the callback function that is run against the + specified Array, thisObject. The callback function is + invoked with three arguments: the value of the element, + the index of the element, and the Array object being traversed. + + + **Parameters:** + - callback - the function that is called on the thisObject Array and which returns a new Array containing the elements that satisfy the function's test. The callback function is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - the Object to use as 'this' when executing callback. + + **Returns:** + - a new Array containing the elements that satisfy the + function's test. + + + +--- + +### find(Function, Object) +- find(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Returns the first value within the array that satisfies the test + defined in the callback function. + + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - The object to use as 'this' when executing callback. + + **Returns:** + - The first value within the array that satisfies the test + defined in the callback function, `undefined` if no matching value was found. + + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### findIndex(Function, Object) +- findIndex(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Number](TopLevel.Number.md) + - : Returns the index of the first value within the array that satisfies the test + defined in the callback function. + + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - The object to use as 'this' when executing callback. + + **Returns:** + - The index of the first value within the array that satisfies the test + defined in the callback function, `-1` if no matching value was found. + + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### forEach(Function) +- forEach(callback: [Function](TopLevel.Function.md)): void + - : Runs the provided callback function once for each element present in + the Array. The callback function is invoked only for indexes of the + Array which have assigned values; it is not invoked for indexes which + have been deleted or which have never been assigned a value. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + + +--- + +### forEach(Function, Object) +- forEach(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): void + - : Runs the provided callback function once for each element present in + the specified Array, thisObject. The callback function is invoked only + for indexes of the Array which have assigned values; it is not invoked + for indexes which have been deleted or which have never been assigned + a value. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - the Object to use as 'this' when executing callback. + + +--- + +### from(Object, Function, Object) +- static from(arrayLike: [Object](TopLevel.Object.md), mapFn: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Creates a new array from an array-like object or an [Iterable](TopLevel.Iterable.md). + + **Parameters:** + - arrayLike - An array-like object or an iterable that provides the elements for the new array. + - mapFn - Optional. A function that maps the input elements into the value for the new array. + - thisObject - Optional. The Object to use as 'this' when executing mapFn. + + **Returns:** + - The newly created array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### includes(Object, Number) +- includes(valueToFind: [Object](TopLevel.Object.md), fromIndex: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if the array contains a specific value. + + **Parameters:** + - valueToFind - The value to look for. + - fromIndex - Optional. The index to start from. + + **Returns:** + - `true` if the value is found in the array else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### indexOf(Object) +- indexOf(elementToLocate: [Object](TopLevel.Object.md)): [Number](TopLevel.Number.md) + - : Returns the first index at which a given element can be found in the + array, or -1 if it is not present. + + + **Parameters:** + - elementToLocate - the element to locate in the Array. + + **Returns:** + - the index of the element or -1 if it is no preset. + + +--- + +### indexOf(Object, Number) +- indexOf(elementToLocate: [Object](TopLevel.Object.md), fromIndex: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the first index at which a given element can be found in the + array starting at fromIndex, or -1 if it is not present. + + + **Parameters:** + - elementToLocate - the element to locate in the Array. + - fromIndex - the index from which to start looking for the element. + + **Returns:** + - the index of the element or -1 if it is no preset. + + +--- + +### isArray(Object) +- static isArray(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Checks if the passed object is an array. + + **Parameters:** + - object - The object to ckeck. + + **Returns:** + - `true` if the passed object is an array else `false`. + + +--- + +### join() +- join(): [String](TopLevel.String.md) + - : Converts all Array elements to Strings and concatenates them. + + **Returns:** + - a concatenated list of all Array elements as a String. + + +--- + +### join(String) +- join(separator: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Converts all array elements to Strings and concatenates them. + + **Parameters:** + - separator - an optional character or string used to separate one element of the Array from the next element in the return String. + + **Returns:** + - a concatenated list of all Array elements as a String where the + specified delimiter is used to separate elements. + + + +--- + +### keys() +- keys(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all indexes of this array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### lastIndexOf(Object) +- lastIndexOf(elementToLocate: [Object](TopLevel.Object.md)): [Number](TopLevel.Number.md) + - : Returns the last index at which a given element can be found in the + array, or -1 if it is not present. The array is searched backwards. + + + **Parameters:** + - elementToLocate - the element to locate in the Array. + + **Returns:** + - the index of the element or -1 if it is no preset. + + +--- + +### lastIndexOf(Object, Number) +- lastIndexOf(elementToLocate: [Object](TopLevel.Object.md), fromIndex: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the last index at which a given element can be found in the + array starting at fromIndex, or -1 if it is not present. + The array is searched backwards. + + + **Parameters:** + - elementToLocate - the element to locate in the Array. + - fromIndex - the index from which to start looking for the element. The array is searched backwards. + + **Returns:** + - the index of the element or -1 if it is no present. + + +--- + +### map(Function) +- map(callback: [Function](TopLevel.Function.md)): [Array](TopLevel.Array.md) + - : Creates a new Array with the results of calling the specified function + on every element in this Array. The callback function is invoked only + for indexes of the Array which have assigned values; it is not invoked + for indexes which have been deleted or which have never been assigned + values. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + + **Returns:** + - a new Array with the results of calling the specified function + on every element in this Array. + + + +--- + +### map(Function, Object) +- map(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Creates a new Array with the results of calling the specified function + on every element in the specified Array. The callback function is invoked only + for indexes of the Array which have assigned values; it is not invoked + for indexes which have been deleted or which have never been assigned + values. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - the Object to use as 'this' when executing callback. + + **Returns:** + - a new Array with the results of calling the specified function + on every element in this Array. + + + +--- + +### of(Object...) +- static of(values: [Object...](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Creates a new array from a variable list of elements. + + **Parameters:** + - values - The array values. + + **Returns:** + - The newly created array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### pop() +- pop(): [Object](TopLevel.Object.md) + - : Removes and returns the last element of the Array. + + **Returns:** + - the last element of the Array. + + +--- + +### push(Object...) +- push(values: [Object...](TopLevel.Object.md)): [Number](TopLevel.Number.md) + - : Appends elements to the Array. + + **Parameters:** + - values - one or more values that will be appended to the Array. + + **Returns:** + - the new length of the Array. + + +--- + +### reverse() +- reverse(): void + - : Reverses the order of the elements in the Array. + + +--- + +### shift() +- shift(): [Object](TopLevel.Object.md) + - : Shifts elements down in the Array and returns the + former first element. + + + **Returns:** + - the former first element. + + +--- + +### slice(Number, Number) +- slice(start: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Array](TopLevel.Array.md) + - : Returns a new Array containing a portion of the + Array using the specified start and end positions. + + + **Parameters:** + - start - the location in the Array to start the slice operation. + - end - the location in the Array to stop the slice operation. + + **Returns:** + - a new Array containing the members bound by + start and end. + + + +--- + +### some(Function) +- some(callback: [Function](TopLevel.Function.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if any of the elements in the Array pass the test + defined in the callback function, false otherwise. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + + **Returns:** + - true if any of the elements in the Array pass the test + defined in the callback function, false otherwise. + + + +--- + +### some(Function, Object) +- some(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if any of the elements in the specified Array pass the test + defined in the callback function, false otherwise. + + + **Parameters:** + - callback - the function to call, which is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed. + - thisObject - the Object to use as 'this' when executing callback. + + **Returns:** + - true if any of the elements in the Array pass the test + defined in the callback function, false otherwise. + + + +--- + +### sort() +- sort(): [Array](TopLevel.Array.md) + - : Sorts the elements of the Array in alphabetical order based on character encoding. + + + This sort is guaranteed to be _stable_: equal elements will not be reordered as a result of the sort. + + + **Returns:** + - a reference to the Array. + + +--- + +### sort(Function) +- sort(function: [Function](TopLevel.Function.md)): [Array](TopLevel.Array.md) + - : Sorts the elements of the Array in alphabetical + order based on character encoding. + + + + This sort is guaranteed to be _stable_: equal elements will not be reordered as a result of the sort. + + + **Parameters:** + - function - a Function used to specify the sorting order. + + **Returns:** + - a reference to the Array. + + **See Also:** + - [Function](TopLevel.Function.md) + + +--- + +### splice(Number, Number, Object...) +- splice(start: [Number](TopLevel.Number.md), deleteCount: [Number](TopLevel.Number.md), values: [Object...](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Deletes the specified number of elements from the Array at the specified position, + and then inserts values into the Array at that location. + + + **Parameters:** + - start - the start location. + - deleteCount - the number of items to delete. + - values - zero or more values to be inserted into the Array. + + +--- + +### toLocaleString() +- toLocaleString(): [String](TopLevel.String.md) + - : Converts the Array to a localized String. + + **Returns:** + - a localized String representing the Array. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Converts the Array to a String. + + **Returns:** + - a String representation of the Array. + + +--- + +### unshift(Object...) +- unshift(values: [Object...](TopLevel.Object.md)): [Number](TopLevel.Number.md) + - : Inserts elements at the beginning of the Array. + + **Parameters:** + - values - one or more vales that will be inserted into the beginning of the Array. + + **Returns:** + - the new length of the Array. + + +--- + +### values() +- values(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all values of this array. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.ArrayBuffer.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ArrayBuffer.md new file mode 100644 index 00000000..7feb2cca --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ArrayBuffer.md @@ -0,0 +1,97 @@ + +# Class ArrayBuffer + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.ArrayBuffer](TopLevel.ArrayBuffer.md) + +The ArrayBuffer represents a generic array of bytes with fixed length. + +To access and manipulate content, use [DataView](TopLevel.DataView.md) or a typed array. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ArrayBuffer](#arraybuffer)() | Creates an empty array buffer. | +| [ArrayBuffer](#arraybuffernumber)([Number](TopLevel.Number.md)) | Creates an array buffer with the given number of bytes. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [isView](TopLevel.ArrayBuffer.md#isviewobject)([Object](TopLevel.Object.md)) | Returns if the given object is one of the views for an ArrayBuffer, such as a typed array or a [DataView](TopLevel.DataView.md). | +| [slice](TopLevel.ArrayBuffer.md#slicenumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array buffer with a copy of the data of this buffer. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer. + + +--- + +## Constructor Details + +### ArrayBuffer() +- ArrayBuffer() + - : Creates an empty array buffer. + + +--- + +### ArrayBuffer(Number) +- ArrayBuffer(byteLength: [Number](TopLevel.Number.md)) + - : Creates an array buffer with the given number of bytes. + + **Parameters:** + - byteLength - The number of bytes. + + +--- + +## Method Details + +### isView(Object) +- static isView(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if the given object is one of the views for an ArrayBuffer, such as a typed array or a [DataView](TopLevel.DataView.md). + + **Parameters:** + - object - The object to check. + + **Returns:** + - `true` if the passed object is a view to an array buffer else return false. + + +--- + +### slice(Number, Number) +- slice(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : Returns a new array buffer with a copy of the data of this buffer. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.BigInt.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.BigInt.md new file mode 100644 index 00000000..2568e7e9 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.BigInt.md @@ -0,0 +1,154 @@ + +# Class BigInt + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.BigInt](TopLevel.BigInt.md) + +A BigInt object is a wrapper for a primitive `bigint` value. +`bigint` values can be numbers too large to be stored as `number` values. + + +A `bigint` literal in code is an integer number with an appended `n`. + + +Example: + +``` +var hugeNumber = 1245678901234567890n; +var hugeNumberObject = BigInt( hugeNumber ); +``` + + +**API Version:** +:::note +Available from version 22.7. +::: + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [BigInt](#bigint)() | Constructs a BigInt with value 0. | +| [BigInt](#bigintbigint)([BigInt](TopLevel.BigInt.md)) | Constructs a new BigInt using the specified BigInt. | +| [BigInt](#bigintstring)([String](TopLevel.String.md)) | Constructs a BigInt using the specified value. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [asIntN](TopLevel.BigInt.md#asintnnumber-bigint)([Number](TopLevel.Number.md), [BigInt](TopLevel.BigInt.md)) | Clamps the given BigInt value to a signed integer with a given precision. | +| static [asUintN](TopLevel.BigInt.md#asuintnnumber-bigint)([Number](TopLevel.Number.md), [BigInt](TopLevel.BigInt.md)) | Clamps the given BigInt value to an unsigned integer with a given precision. | +| [toLocaleString](TopLevel.BigInt.md#tolocalestring)() | Converts this BigInt to a String using local number formatting conventions. | +| [toString](TopLevel.BigInt.md#tostring)() | A String representation of this BigInt. | +| [toString](TopLevel.BigInt.md#tostringnumber)([Number](TopLevel.Number.md)) | Converts the BigInt into a string using the specified radix (base). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### BigInt() +- BigInt() + - : Constructs a BigInt with value 0. + + +--- + +### BigInt(BigInt) +- BigInt(value: [BigInt](TopLevel.BigInt.md)) + - : Constructs a new BigInt using the specified BigInt. + + **Parameters:** + - value - the BigInt to use. + + +--- + +### BigInt(String) +- BigInt(value: [String](TopLevel.String.md)) + - : Constructs a BigInt using the specified value. + + + Beside decimal numbers also binary, octal and hexadecimal numbers are supported: + + ``` + var decimal = BigInt( "12" ); + var binary = BigInt( "0b1100" ); + var octal = BigInt( "0o14" ); + var hex = BigInt( "0xC" ); + ``` + + + **Parameters:** + - value - the value to use when creating the BigInt. + + +--- + +## Method Details + +### asIntN(Number, BigInt) +- static asIntN(bits: [Number](TopLevel.Number.md), value: [BigInt](TopLevel.BigInt.md)): [BigInt](TopLevel.BigInt.md) + - : Clamps the given BigInt value to a signed integer with a given precision. + + **Parameters:** + - bits - Number of bits required for resulting integer. + - value - The value to be clamped to the given number of bits. + + **Returns:** + - The `value` modulo 2`bits`, as a signed integer. + + +--- + +### asUintN(Number, BigInt) +- static asUintN(bits: [Number](TopLevel.Number.md), value: [BigInt](TopLevel.BigInt.md)): [BigInt](TopLevel.BigInt.md) + - : Clamps the given BigInt value to an unsigned integer with a given precision. + + **Parameters:** + - bits - Number of bits required for resulting integer. + - value - The value to be clamped to the given number of bits. + + **Returns:** + - The `value` modulo 2`bits`, as an unsigned integer. + + +--- + +### toLocaleString() +- toLocaleString(): [String](TopLevel.String.md) + - : Converts this BigInt to a String using local number formatting conventions. + + The current implementation actually only returns the same as [toString()](TopLevel.BigInt.md#tostring). + + + **Returns:** + - a String using local number formatting conventions. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : A String representation of this BigInt. + + **Returns:** + - a String representation of this BigInt. + + +--- + +### toString(Number) +- toString(radix: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Converts the BigInt into a string using the specified radix (base). + + **Parameters:** + - radix - the radix to use. + + **Returns:** + - a String representation of this BigInt. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Boolean.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Boolean.md new file mode 100644 index 00000000..852024fa --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Boolean.md @@ -0,0 +1,83 @@ + +# Class Boolean + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Boolean](TopLevel.Boolean.md) + +Provides support for boolean values. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Boolean](#booleanstring)([String](TopLevel.String.md)) | Constructs the Boolean using the specified String value. | +| [Boolean](#booleannumber)([Number](TopLevel.Number.md)) | Constructs the Boolean using the specified Number value. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [toString](TopLevel.Boolean.md#tostring)() | Returns true or false depending on the value used to create the Boolean. | +| [valueOf](TopLevel.Boolean.md#valueof)() | Returns the primitive boolean contained in the Boolean object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### Boolean(String) +- Boolean(value: [String](TopLevel.String.md)) + - : Constructs the Boolean using the specified + String value. + + + **Parameters:** + - value - the String value to use to construct the Boolean. If _value_ is null or an empty String, the Boolean is set to false. + + +--- + +### Boolean(Number) +- Boolean(value: [Number](TopLevel.Number.md)) + - : Constructs the Boolean using the specified + Number value. + + + **Parameters:** + - value - the Number value to use to construct the Boolean. If _value_ is null or 0, the Boolean is set to false. + + +--- + +## Method Details + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns true or false depending on the value used to create + the Boolean. + + + **Returns:** + - true or false depending on the value used to create + the Boolean. + + + +--- + +### valueOf() +- valueOf(): [Object](TopLevel.Object.md) + - : Returns the primitive boolean contained in the Boolean + object. + + + **Returns:** + - the primitive boolean contained in the Boolean + object. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.ConversionError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ConversionError.md new file mode 100644 index 00000000..ac741bbf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ConversionError.md @@ -0,0 +1,51 @@ + +# Class ConversionError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.ConversionError](TopLevel.ConversionError.md) + +Represents a conversion error. + +**API Version:** +:::note +No longer available as of version 21.2. +::: + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ConversionError](#conversionerror)() | Constructs the error. | +| [ConversionError](#conversionerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### ConversionError() +- ConversionError() + - : Constructs the error. + + +--- + +### ConversionError(String) +- ConversionError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the conversion error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.DataView.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.DataView.md new file mode 100644 index 00000000..f2c89456 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.DataView.md @@ -0,0 +1,271 @@ + +# Class DataView + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.DataView](TopLevel.DataView.md) + +The DataView provides low level access to [ArrayBuffer](TopLevel.ArrayBuffer.md). + +**API Version:** +:::note +Available from version 21.2. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this view. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this view. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this view within the array buffer. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [DataView](#dataviewarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a data view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getFloat32](TopLevel.DataView.md#getfloat32number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 32-bit floating point number at the given offset. | +| [getFloat64](TopLevel.DataView.md#getfloat64number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 64-bit floating point number at the given offset. | +| [getInt16](TopLevel.DataView.md#getint16number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 16-bit signed integer number at the given offset. | +| [getInt32](TopLevel.DataView.md#getint32number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 32-bit signed integer number at the given offset. | +| [getInt8](TopLevel.DataView.md#getint8number)([Number](TopLevel.Number.md)) | Returns the 8-bit signed integer number at the given offset. | +| [getUint16](TopLevel.DataView.md#getuint16number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 16-bit unsigned integer number at the given offset. | +| [getUint32](TopLevel.DataView.md#getuint32number-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Returns the 32-bit unsigned integer number at the given offset. | +| [getUint8](TopLevel.DataView.md#getuint8number)([Number](TopLevel.Number.md)) | Returns the 8-bit unsigned integer number at the given offset. | +| [setFloat32](TopLevel.DataView.md#setfloat32number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 32-bit floating point number into the byte array at the given offset. | +| [setFloat64](TopLevel.DataView.md#setfloat64number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 64-bit floating point number into the byte array at the given offset. | +| [setInt16](TopLevel.DataView.md#setint16number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 16-bit signed integer number into the byte array at the given offset. | +| [setInt32](TopLevel.DataView.md#setint32number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 32-bit signed integer number into the byte array at the given offset. | +| [setInt8](TopLevel.DataView.md#setint8number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Writes an 8-bit signed integer number into the byte array at the given offset. | +| [setUint16](TopLevel.DataView.md#setuint16number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 16-bit unsigned integer number into the byte array at the given offset. | +| [setUint32](TopLevel.DataView.md#setuint32number-number-boolean)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) | Writes a 32-bit unsigned integer number into the byte array at the given offset. | +| [setUint8](TopLevel.DataView.md#setuint8number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Writes an 8-bit unsigned integer number into the byte array at the given offset. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this view. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this view. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this view within the array buffer. + + +--- + +## Constructor Details + +### DataView(ArrayBuffer, Number, Number) +- DataView(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), byteLength: [Number](TopLevel.Number.md)) + - : Creates a data view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - byteLength - Optional. The number of bytes visible to this view. + + +--- + +## Method Details + +### getFloat32(Number, Boolean) +- getFloat32(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 32-bit floating point number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getFloat64(Number, Boolean) +- getFloat64(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 64-bit floating point number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getInt16(Number, Boolean) +- getInt16(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 16-bit signed integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getInt32(Number, Boolean) +- getInt32(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 32-bit signed integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getInt8(Number) +- getInt8(byteOffset: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the 8-bit signed integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + + +--- + +### getUint16(Number, Boolean) +- getUint16(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 16-bit unsigned integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getUint32(Number, Boolean) +- getUint32(byteOffset: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): [Number](TopLevel.Number.md) + - : Returns the 32-bit unsigned integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - littleEndian - Optional. Default is false. Use true if the number is stored in little-endian format. + + +--- + +### getUint8(Number) +- getUint8(byteOffset: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the 8-bit unsigned integer number at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + + +--- + +### setFloat32(Number, Number, Boolean) +- setFloat32(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 32-bit floating point number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setFloat64(Number, Number, Boolean) +- setFloat64(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 64-bit floating point number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setInt16(Number, Number, Boolean) +- setInt16(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 16-bit signed integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setInt32(Number, Number, Boolean) +- setInt32(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 32-bit signed integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setInt8(Number, Number) +- setInt8(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md)): void + - : Writes an 8-bit signed integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + + +--- + +### setUint16(Number, Number, Boolean) +- setUint16(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 16-bit unsigned integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setUint32(Number, Number, Boolean) +- setUint32(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md), littleEndian: [Boolean](TopLevel.Boolean.md)): void + - : Writes a 32-bit unsigned integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + - littleEndian - Optional. Default is false. Use true if the little-endian format is to be used. + + +--- + +### setUint8(Number, Number) +- setUint8(byteOffset: [Number](TopLevel.Number.md), value: [Number](TopLevel.Number.md)): void + - : Writes an 8-bit unsigned integer number into the byte array at the given offset. + + **Parameters:** + - byteOffset - The offset within the view. + - value - The value to be written. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Date.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Date.md new file mode 100644 index 00000000..abf28b67 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Date.md @@ -0,0 +1,688 @@ + +# Class Date + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Date](TopLevel.Date.md) + +A Date object contains a number indicating a particular instant in time to within a millisecond. The number may also +be NaN, indicating that the Date object does not represent a specific instant of time. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Date](#date)() | Constructs the Date instance using the current date and time. | +| [Date](#datenumber)([Number](TopLevel.Number.md)) | Constructs the Date instance using the specified milliseconds. | +| [Date](#datenumber-number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Constructs the Date instance using the specified year and month. | +| [Date](#datestring)([String](TopLevel.String.md)) | Constructs the Date instance by parsing the specified String. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [UTC](TopLevel.Date.md#utcnumber-number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Returns the number of milliseconds since midnight of January 1, 1970 according to universal time. | +| [getDate](TopLevel.Date.md#getdate)() | Returns the day of the month where the value is a Number from 1 to 31. | +| [getDay](TopLevel.Date.md#getday)() | Returns the day of the week where the value is a Number from 0 to 6. | +| [getFullYear](TopLevel.Date.md#getfullyear)() | Returns the year of the Date in four-digit format. | +| [getHours](TopLevel.Date.md#gethours)() | Return the hours field of the Date where the value is a Number from 0 (midnight) to 23 (11 PM). | +| [getMilliseconds](TopLevel.Date.md#getmilliseconds)() | Returns the milliseconds field of the Date. | +| [getMinutes](TopLevel.Date.md#getminutes)() | Return the minutes field of the Date where the value is a Number from 0 to 59. | +| [getMonth](TopLevel.Date.md#getmonth)() | Returns the month of the year as a value between 0 and 11. | +| [getSeconds](TopLevel.Date.md#getseconds)() | Return the seconds field of the Date where the value is a Number from 0 to 59. | +| [getTime](TopLevel.Date.md#gettime)() | Returns the internal, millisecond representation of the Date object. | +| [getTimezoneOffset](TopLevel.Date.md#gettimezoneoffset)() | Returns the difference between local time and Greenwich Mean Time (GMT) in minutes. | +| [getUTCDate](TopLevel.Date.md#getutcdate)() | Returns the day of the month where the value is a Number from 1 to 31 when date is expressed in universal time. | +| [getUTCDay](TopLevel.Date.md#getutcday)() | Returns the day of the week where the value is a Number from 0 to 6 when date is expressed in universal time. | +| [getUTCFullYear](TopLevel.Date.md#getutcfullyear)() | Returns the year when the Date is expressed in universal time. | +| [getUTCHours](TopLevel.Date.md#getutchours)() | Return the hours field, expressed in universal time, of the Date where the value is a Number from 0 (midnight) to 23 (11 PM). | +| [getUTCMilliseconds](TopLevel.Date.md#getutcmilliseconds)() | Returns the milliseconds field, expressed in universal time, of the Date. | +| [getUTCMinutes](TopLevel.Date.md#getutcminutes)() | Return the minutes field, expressed in universal time, of the Date where the value is a Number from 0 to 59. | +| [getUTCMonth](TopLevel.Date.md#getutcmonth)() | Returns the month of the year that results when the Date is expressed in universal time. | +| [getUTCSeconds](TopLevel.Date.md#getutcseconds)() | Return the seconds field, expressed in universal time, of the Date where the value is a Number from 0 to 59. | +| static [now](TopLevel.Date.md#now)() | Returns the number of milliseconds since midnight of January 1, 1970 up until now. | +| static [parse](TopLevel.Date.md#parsestring)([String](TopLevel.String.md)) | Takes a date string and returns the number of milliseconds since midnight of January 1, 1970. | +| [setDate](TopLevel.Date.md#setdatenumber)([Number](TopLevel.Number.md)) | Sets the day of the month where the value is a Number from 1 to 31. | +| [setFullYear](TopLevel.Date.md#setfullyearnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the full year of Date where the value must be a four-digit Number. | +| [setHours](TopLevel.Date.md#sethoursnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the hours field of this Date instance. | +| [setMilliseconds](TopLevel.Date.md#setmillisecondsnumber)([Number](TopLevel.Number.md)) | Sets the milliseconds field of this Date instance. | +| [setMinutes](TopLevel.Date.md#setminutesnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the minutes field of this Date instance. | +| [setMonth](TopLevel.Date.md#setmonthnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the month of the year where the value is a Number from 0 to 11. | +| [setSeconds](TopLevel.Date.md#setsecondsnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the seconds field of this Date instance. | +| [setTime](TopLevel.Date.md#settimenumber)([Number](TopLevel.Number.md)) | Sets the number of milliseconds between the desired date and time and January 1, 1970. | +| [setUTCDate](TopLevel.Date.md#setutcdatenumber)([Number](TopLevel.Number.md)) | Sets the day of the month, expressed in universal time, where the value is a Number from 1 to 31. | +| [setUTCFullYear](TopLevel.Date.md#setutcfullyearnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the full year, expressed in universal time, of Date where the value must be a four-digit Number. | +| [setUTCHours](TopLevel.Date.md#setutchoursnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the hours field, expressed in universal time, of this Date instance. | +| [setUTCMilliseconds](TopLevel.Date.md#setutcmillisecondsnumber)([Number](TopLevel.Number.md)) | Sets the milliseconds field, expressed in universal time, of this Date instance. | +| [setUTCMinutes](TopLevel.Date.md#setutcminutesnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the minutes field, expressed in universal time, of this Date instance. | +| [setUTCMonth](TopLevel.Date.md#setutcmonthnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the month of the year, expressed in universal time, where the value is a Number from 0 to 11. | +| [setUTCSeconds](TopLevel.Date.md#setutcsecondsnumber-number)([Number](TopLevel.Number.md), [Number...](TopLevel.Number.md)) | Sets the seconds field, expressed in universal time, of this Date instance. | +| [toDateString](TopLevel.Date.md#todatestring)() | Returns the Date as a String value where the value represents the _date_ portion of the Date in the default locale (en\_US). | +| [toISOString](TopLevel.Date.md#toisostring)() | This function returns a string value represent the instance in time represented by this Date object. | +| [toJSON](TopLevel.Date.md#tojsonstring)([String](TopLevel.String.md)) | This function returns the same string as Date.prototype.toISOString(). | +| [toLocaleDateString](TopLevel.Date.md#tolocaledatestring)() | Returns the Date as a String value where the value represents the _date_ portion of the Date in the default locale (en\_US). | +| [toLocaleString](TopLevel.Date.md#tolocalestring)() | Returns the Date as a String using the default locale (en\_US). | +| [toLocaleTimeString](TopLevel.Date.md#tolocaletimestring)() | Returns the Date as a String value where the value represents the _time_ portion of the Date in the default locale (en\_US). | +| [toTimeString](TopLevel.Date.md#totimestring)() | Returns the Date as a String value where the value represents the _time_ portion of the Date in the default locale (en\_US). | +| [toUTCString](TopLevel.Date.md#toutcstring)() | Returns a String representation of this Date, expressed in universal time. | +| [valueOf](TopLevel.Date.md#valueof)() | Returns the value of this Date represented in milliseconds. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### Date() +- Date() + - : Constructs the Date instance using the current date and time. + + +--- + +### Date(Number) +- Date(millis: [Number](TopLevel.Number.md)) + - : Constructs the Date instance using the specified milliseconds. + + **Parameters:** + - millis - the number of milliseconds between the desired date and January 1, 1970 (UTC). For example, value of 10000 would create a Date instance representing 10 seconds past midnight on January 1, 1970. + + +--- + +### Date(Number, Number, Number...) +- Date(year: [Number](TopLevel.Number.md), month: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)) + - : Constructs the Date instance using the specified year and month. Optionally, you can pass up to five additional + arguments representing date, hours, minutes, seconds, and milliseconds. + + + **Parameters:** + - year - a number representing the year. + - month - a number representing the month. + - args - a set of numbers representing the date, hours, minutes, seconds, and milliseconds. + + +--- + +### Date(String) +- Date(dateString: [String](TopLevel.String.md)) + - : Constructs the Date instance by parsing the specified String. + + **Parameters:** + - dateString - represents a Date in a valid date format. + + +--- + +## Method Details + +### UTC(Number, Number, Number...) +- static UTC(year: [Number](TopLevel.Number.md), month: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the number of milliseconds since midnight of January 1, 1970 according to universal time. Optionally, you + can pass up to five additional arguments representing date, hours, minutes, seconds, and milliseconds. + + + **Parameters:** + - year - a number representing the year. + - month - a number representing the month. + - args - a set of numbers representing the date, hours, minutes, seconds, and milliseconds. + + **Returns:** + - the number of milliseconds since midnight of January 1, 1970 according to universal time. + + +--- + +### getDate() +- getDate(): [Number](TopLevel.Number.md) + - : Returns the day of the month where the value is a Number from 1 to 31. + + **Returns:** + - the day of the month where the value is a Number from 1 to 31. + + +--- + +### getDay() +- getDay(): [Number](TopLevel.Number.md) + - : Returns the day of the week where the value is a Number from 0 to 6. + + **Returns:** + - the day of the month where the value is a Number from 0 to 6. + + +--- + +### getFullYear() +- getFullYear(): [Number](TopLevel.Number.md) + - : Returns the year of the Date in four-digit format. + + **Returns:** + - the year of the Date in four-digit format. + + +--- + +### getHours() +- getHours(): [Number](TopLevel.Number.md) + - : Return the hours field of the Date where the value is a Number from 0 (midnight) to 23 (11 PM). + + **Returns:** + - the hours field of the Date where the value is a Number from 0 (midnight) to 23 (11 PM). + + +--- + +### getMilliseconds() +- getMilliseconds(): [Number](TopLevel.Number.md) + - : Returns the milliseconds field of the Date. + + **Returns:** + - the milliseconds field of the Date. + + +--- + +### getMinutes() +- getMinutes(): [Number](TopLevel.Number.md) + - : Return the minutes field of the Date where the value is a Number from 0 to 59. + + **Returns:** + - the minutes field of the Date where the value is a Number from 0 to 59. + + +--- + +### getMonth() +- getMonth(): [Number](TopLevel.Number.md) + - : Returns the month of the year as a value between 0 and 11. + + **Returns:** + - the month of the year as a value between 0 and 11. + + +--- + +### getSeconds() +- getSeconds(): [Number](TopLevel.Number.md) + - : Return the seconds field of the Date where the value is a Number from 0 to 59. + + **Returns:** + - the seconds field of the Date where the value is a Number from 0 to 59. + + +--- + +### getTime() +- getTime(): [Number](TopLevel.Number.md) + - : Returns the internal, millisecond representation of the Date object. This value is independent of time zone. + + **Returns:** + - the internal, millisecond representation of the Date object. + + +--- + +### getTimezoneOffset() +- getTimezoneOffset(): [Number](TopLevel.Number.md) + - : Returns the difference between local time and Greenwich Mean Time (GMT) in minutes. + + **Returns:** + - the difference between local time and Greenwich Mean Time (GMT) in minutes. + + +--- + +### getUTCDate() +- getUTCDate(): [Number](TopLevel.Number.md) + - : Returns the day of the month where the value is a Number from 1 to 31 when date is expressed in universal time. + + **Returns:** + - the day of the month where the value is a Number from 1 to 31 when date is expressed in universal time. + + +--- + +### getUTCDay() +- getUTCDay(): [Number](TopLevel.Number.md) + - : Returns the day of the week where the value is a Number from 0 to 6 when date is expressed in universal time. + + **Returns:** + - the day of the week where the value is a Number from 0 to 6 when date is expressed in universal time. + + +--- + +### getUTCFullYear() +- getUTCFullYear(): [Number](TopLevel.Number.md) + - : Returns the year when the Date is expressed in universal time. The return value is a four-digit format. + + **Returns:** + - the year of the Date in four-digit form. + + +--- + +### getUTCHours() +- getUTCHours(): [Number](TopLevel.Number.md) + - : Return the hours field, expressed in universal time, of the Date where the value is a Number from 0 (midnight) to + 23 (11 PM). + + + **Returns:** + - the hours field, expressed in universal time, of the Date where the value is a Number from 0 (midnight) + to 23 (11 PM). + + + +--- + +### getUTCMilliseconds() +- getUTCMilliseconds(): [Number](TopLevel.Number.md) + - : Returns the milliseconds field, expressed in universal time, of the Date. + + **Returns:** + - the milliseconds field, expressed in universal time, of the Date. + + +--- + +### getUTCMinutes() +- getUTCMinutes(): [Number](TopLevel.Number.md) + - : Return the minutes field, expressed in universal time, of the Date where the value is a Number from 0 to 59. + + **Returns:** + - the minutes field, expressed in universal time, of the Date where the value is a Number from 0 to 59. + + +--- + +### getUTCMonth() +- getUTCMonth(): [Number](TopLevel.Number.md) + - : Returns the month of the year that results when the Date is expressed in universal time. The return value is a + Number betwee 0 and 11. + + + **Returns:** + - the month of the year as a value between 0 and 11. + + +--- + +### getUTCSeconds() +- getUTCSeconds(): [Number](TopLevel.Number.md) + - : Return the seconds field, expressed in universal time, of the Date where the value is a Number from 0 to 59. + + **Returns:** + - the seconds field, expressed in universal time, of the Date where the value is a Number from 0 to 59. + + +--- + +### now() +- static now(): [Number](TopLevel.Number.md) + - : Returns the number of milliseconds since midnight of January 1, 1970 up until now. + + **Returns:** + - the number of milliseconds since midnight of January 1, 1970. + + +--- + +### parse(String) +- static parse(dateString: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Takes a date string and returns the number of milliseconds since midnight of January 1, 1970. + + Supports: + + - RFC2822 date strings + - strings matching the exact ISO 8601 format 'YYYY-MM-DDTHH:mm:ss.sssZ' + + + **Parameters:** + - dateString - represents a Date in a valid date format. + + **Returns:** + - the number of milliseconds since midnight of January 1, 1970 or NaN if no date could be recognized. + + +--- + +### setDate(Number) +- setDate(date: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the day of the month where the value is a Number from 1 to 31. + + **Parameters:** + - date - the day of the month. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setFullYear(Number, Number...) +- setFullYear(year: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the full year of Date where the value must be a four-digit Number. Optionally, you can set the month and + date. + + + **Parameters:** + - year - the year as a four-digit Number. + - args - the month and day of the month. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setHours(Number, Number...) +- setHours(hours: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the hours field of this Date instance. The minutes value should be a Number from 0 to 23. Optionally, hours, + seconds and milliseconds can also be provided. + + + **Parameters:** + - hours - the minutes field of this Date instance. + - args - the hours, seconds and milliseconds values for this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setMilliseconds(Number) +- setMilliseconds(millis: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the milliseconds field of this Date instance. + + **Parameters:** + - millis - the milliseconds field of this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setMinutes(Number, Number...) +- setMinutes(minutes: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the minutes field of this Date instance. The minutes value should be a Number from 0 to 59. Optionally, + seconds and milliseconds can also be provided. + + + **Parameters:** + - minutes - the minutes field of this Date instance. + - args - the seconds and milliseconds value for this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setMonth(Number, Number...) +- setMonth(month: [Number](TopLevel.Number.md), date: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the month of the year where the value is a Number from 0 to 11. Optionally, you can set the day of the + month. + + + **Parameters:** + - month - the month of the year. + - date - the day of the month. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setSeconds(Number, Number...) +- setSeconds(seconds: [Number](TopLevel.Number.md), millis: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the seconds field of this Date instance. The seconds value should be a Number from 0 to 59. Optionally, + milliseconds can also be provided. + + + **Parameters:** + - seconds - the seconds field of this Date instance. + - millis - the milliseconds field of this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setTime(Number) +- setTime(millis: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the number of milliseconds between the desired date and time and January 1, 1970. + + **Parameters:** + - millis - the number of milliseconds between the desired date and time and January 1, 1970. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCDate(Number) +- setUTCDate(date: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the day of the month, expressed in universal time, where the value is a Number from 1 to 31. + + **Parameters:** + - date - the day of the month, expressed in universal time. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCFullYear(Number, Number...) +- setUTCFullYear(year: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the full year, expressed in universal time, of Date where the value must be a four-digit Number. Optionally, + you can set the month and date. + + + **Parameters:** + - year - the year as a four-digit Number, expressed in universal time. + - args - the month and day of the month. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCHours(Number, Number...) +- setUTCHours(hours: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the hours field, expressed in universal time, of this Date instance. The minutes value should be a Number + from 0 to 23. Optionally, seconds and milliseconds can also be provided. + + + **Parameters:** + - hours - the minutes field, expressed in universal time, of this Date instance. + - args - the seconds and milliseconds value, expressed in universal time, for this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCMilliseconds(Number) +- setUTCMilliseconds(millis: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the milliseconds field, expressed in universal time, of this Date instance. + + **Parameters:** + - millis - the milliseconds field, expressed in universal time, of this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCMinutes(Number, Number...) +- setUTCMinutes(minutes: [Number](TopLevel.Number.md), args: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the minutes field, expressed in universal time, of this Date instance. The minutes value should be a Number + from 0 to 59. Optionally, seconds and milliseconds can also be provided. + + + **Parameters:** + - minutes - the minutes field, expressed in universal time, of this Date instance. + - args - the seconds and milliseconds values, expressed in universal time, for this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCMonth(Number, Number...) +- setUTCMonth(month: [Number](TopLevel.Number.md), date: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the month of the year, expressed in universal time, where the value is a Number from 0 to 11. Optionally, + you can set the day of the month. + + + **Parameters:** + - month - the month of the year, expressed in universal time. + - date - the day of the month. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### setUTCSeconds(Number, Number...) +- setUTCSeconds(seconds: [Number](TopLevel.Number.md), millis: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Sets the seconds field, expressed in universal time, of this Date instance. The seconds value should be a Number + from 0 to 59. Optionally, milliseconds can also be provided. + + + **Parameters:** + - seconds - the seconds field, expressed in universal time, of this Date instance. + - millis - the milliseconds field, expressed in universal time, of this Date instance. + + **Returns:** + - the millisecond representation of the adjusted date. + + +--- + +### toDateString() +- toDateString(): [String](TopLevel.String.md) + - : Returns the Date as a String value where the value represents the _date_ portion of the Date in the default + locale (en\_US). To format a calendar object in an alternate format use the + `dw.util.StringUtils.formatCalendar()` functions instead. + + + **Returns:** + - the Date as a String value. + + +--- + +### toISOString() +- toISOString(): [String](TopLevel.String.md) + - : This function returns a string value represent the instance in time represented by this Date object. The date is + formatted with the Simplified ISO 8601 format as follows: YYYY-MM-DDTHH:mm:ss.sssTZ. The time zone is always UTC, + denoted by the suffix Z. + + + **Returns:** + - string representation of this date + + +--- + +### toJSON(String) +- toJSON(key: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : This function returns the same string as Date.prototype.toISOString(). The method is called when a Date object is + stringified. + + + **Parameters:** + - key - the name of the key, which is stringified + + **Returns:** + - JSON string representation of this date + + +--- + +### toLocaleDateString() +- toLocaleDateString(): [String](TopLevel.String.md) + - : Returns the Date as a String value where the value represents the _date_ portion of the Date in the default + locale (en\_US). To format a calendar object in an alternate format use the + `dw.util.StringUtils.formatCalendar()` functions instead. + + + **Returns:** + - returns the _date_ portion of the Date as a String. + + +--- + +### toLocaleString() +- toLocaleString(): [String](TopLevel.String.md) + - : Returns the Date as a String using the default locale (en\_US). To format a calendar object in an alternate format + use the `dw.util.StringUtils.formatCalendar()` functions instead. + + + **Returns:** + - the Date as a String using the default locale en\_US + + +--- + +### toLocaleTimeString() +- toLocaleTimeString(): [String](TopLevel.String.md) + - : Returns the Date as a String value where the value represents the _time_ portion of the Date in the default + locale (en\_US). To format a calendar object in an alternate format use the + `dw.util.StringUtils.formatCalendar()` functions instead. + + + **Returns:** + - returns the _time_ time's portion of the Date as a String. + + +--- + +### toTimeString() +- toTimeString(): [String](TopLevel.String.md) + - : Returns the Date as a String value where the value represents the _time_ portion of the Date in the default + locale (en\_US). To format a calendar object in an alternate format use the + `dw.util.StringUtils.formatCalendar()` functions instead. + + + **Returns:** + - the Date's time. + + +--- + +### toUTCString() +- toUTCString(): [String](TopLevel.String.md) + - : Returns a String representation of this Date, expressed in universal time. + + **Returns:** + - a String representation of this Date, expressed in universal time. + + +--- + +### valueOf() +- valueOf(): [Object](TopLevel.Object.md) + - : Returns the value of this Date represented in milliseconds. + + **Returns:** + - the value of this Date represented in milliseconds. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.ES6Iterator.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ES6Iterator.md new file mode 100644 index 00000000..1072bb6a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ES6Iterator.md @@ -0,0 +1,47 @@ + +# Class ES6Iterator + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.ES6Iterator](TopLevel.ES6Iterator.md) + +This isn't a built-in type. It describes the properties an object must have in order +to work as an iterator since ECMAScript 2015. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [next](TopLevel.ES6Iterator.md#next)() | Returns an iterator result object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### next() +- next(): [Object](TopLevel.Object.md) + - : Returns an iterator result object. + + + An iterator result object can have two properties: _done_ and _value_. + If _done_ is `false` or `undefined`, then the _value_ property contains an iterator value. + The _value_ property may not be present if the value would be `undefined`. + + + After a call that returns a result where _done_ equals + `true`, all subsequent calls must also return _done_ as `true`. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Error.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Error.md new file mode 100644 index 00000000..86f4eed3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Error.md @@ -0,0 +1,124 @@ + +# Class Error + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + +Error represents a generic exception. + + +## All Known Subclasses +[APIException](TopLevel.APIException.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [message](#message): [String](TopLevel.String.md) | An error message that provides details about the exception. | +| [name](#name): [String](TopLevel.String.md) | The name of the error based on the constructor used. | +| [stack](#stack): [String](TopLevel.String.md) | The script stack trace. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Error](#error)() | Constructs the Error object. | +| [Error](#errorstring)([String](TopLevel.String.md)) | Constructs the Error object using the specified message. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function)([Error](TopLevel.Error.md), [Function](TopLevel.Function.md)) | Fills the [stack](TopLevel.Error.md#stack) property for the passed error. | +| [toString](TopLevel.Error.md#tostring)() | Returns a String representation of the Error. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### message +- message: [String](TopLevel.String.md) + - : An error message that provides details about the exception. + + +--- + +### name +- name: [String](TopLevel.String.md) + - : The name of the error based on the constructor used. + + +--- + +### stack +- stack: [String](TopLevel.String.md) + - : The script stack trace. + + This property is filled on throwing or via an explicit call [captureStackTrace(Error, Function)](TopLevel.Error.md#capturestacktraceerror-function). + + + +--- + +## Constructor Details + +### Error() +- Error() + - : Constructs the Error object. + + +--- + +### Error(String) +- Error(msg: [String](TopLevel.String.md)) + - : Constructs the Error object + using the specified message. + + + **Parameters:** + - msg - the message to use,. + + +--- + +## Method Details + +### captureStackTrace(Error, Function) +- static captureStackTrace(error: [Error](TopLevel.Error.md), constructorOpt: [Function](TopLevel.Function.md)): void + - : Fills the [stack](TopLevel.Error.md#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); + } + ``` + + + **Parameters:** + - error - The error whose stack trace should be filled. + - constructorOpt - An optional filter to hide the topmost stack frames. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a String representation of the Error. + + **Returns:** + - a String representation of the Error. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.EvalError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.EvalError.md new file mode 100644 index 00000000..7bf5df80 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.EvalError.md @@ -0,0 +1,47 @@ + +# Class EvalError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.EvalError](TopLevel.EvalError.md) + +Represents an evaluation error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [EvalError](#evalerror)() | Constructs the error. | +| [EvalError](#evalerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### EvalError() +- EvalError() + - : Constructs the error. + + +--- + +### EvalError(String) +- EvalError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the evaluation error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Fault.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Fault.md new file mode 100644 index 00000000..38bfbc19 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Fault.md @@ -0,0 +1,133 @@ + +# Class Fault + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.Fault](TopLevel.Fault.md) + +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. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [causeFullName](#causefullname): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the full name of the associated Java exception. | +| [causeMessage](#causemessage): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the message of the associated Java exception. | +| [causeName](#causename): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the simplified name of the associated Java exception. | +| [faultActor](#faultactor): [String](TopLevel.String.md) | Provides some information on who cause the fault along the message path. | +| [faultCode](#faultcode): [String](TopLevel.String.md) | An identifier for the specific fault. | +| [faultDetail](#faultdetail): [String](TopLevel.String.md) | More detailed information about the fault. | +| [faultString](#faultstring): [String](TopLevel.String.md) | A human readable description for the fault. | +| [javaFullName](#javafullname): [String](TopLevel.String.md) | The full name of the underlying Java exception. | +| [javaMessage](#javamessage): [String](TopLevel.String.md) | The message of the underlying Java exception. | +| [javaName](#javaname): [String](TopLevel.String.md) | The simplified name of the underlying Java exception. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Fault](#fault)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### causeFullName +- causeFullName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the full name of the associated Java exception. + + + +--- + +### causeMessage +- causeMessage: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the message of the associated Java exception. + + + +--- + +### causeName +- causeName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the simplified name of the associated Java exception. + + + +--- + +### faultActor +- faultActor: [String](TopLevel.String.md) + - : Provides some information on who cause the fault along the message + path. + + + +--- + +### faultCode +- faultCode: [String](TopLevel.String.md) + - : An identifier for the specific fault. + + +--- + +### faultDetail +- faultDetail: [String](TopLevel.String.md) + - : More detailed information about the fault. + + +--- + +### faultString +- faultString: [String](TopLevel.String.md) + - : A human readable description for the fault. + + +--- + +### javaFullName +- javaFullName: [String](TopLevel.String.md) + - : The full name of the underlying Java exception. + + +--- + +### javaMessage +- javaMessage: [String](TopLevel.String.md) + - : The message of the underlying Java exception. + + +--- + +### javaName +- javaName: [String](TopLevel.String.md) + - : The simplified name of the underlying Java exception. + + +--- + +## Constructor Details + +### Fault() +- Fault() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float32Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float32Array.md new file mode 100644 index 00000000..dc50ee06 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float32Array.md @@ -0,0 +1,186 @@ + +# Class Float32Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Float32Array](TopLevel.Float32Array.md) + +An optimized array to store 32-bit floating point numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 4 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Float32Array](#float32array)() | Creates an empty array. | +| [Float32Array](#float32arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Float32Array](#float32arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Float32Array](#float32arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Float32Array](#float32arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Float32Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Float32Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Float32Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 4 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Float32Array() +- Float32Array() + - : Creates an empty array. + + +--- + +### Float32Array(Number) +- Float32Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Float32Array(Object) +- Float32Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Float32Array(Array) +- Float32Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Float32Array(ArrayBuffer, Number, Number) +- Float32Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Float32Array](TopLevel.Float32Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float64Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float64Array.md new file mode 100644 index 00000000..a4124bb8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Float64Array.md @@ -0,0 +1,186 @@ + +# Class Float64Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Float64Array](TopLevel.Float64Array.md) + +An optimized array to store 64-bit floating point numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 8 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Float64Array](#float64array)() | Creates an empty array. | +| [Float64Array](#float64arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Float64Array](#float64arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Float64Array](#float64arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Float64Array](#float64arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Float64Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Float64Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Float64Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 8 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Float64Array() +- Float64Array() + - : Creates an empty array. + + +--- + +### Float64Array(Number) +- Float64Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Float64Array(Object) +- Float64Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Float64Array(Array) +- Float64Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Float64Array(ArrayBuffer, Number, Number) +- Float64Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Float64Array](TopLevel.Float64Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Function.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Function.md new file mode 100644 index 00000000..58e1d3d8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Function.md @@ -0,0 +1,114 @@ + +# Class Function + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Function](TopLevel.Function.md) + +The Function class represent a JavaScript function. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [length](#length): [Number](TopLevel.Number.md) | The number of named arguments that were specified when the function was declared. | +| [prototype](#prototype): [Object](TopLevel.Object.md) | An object that defines properties and methods shared by all objects created with that constructor function. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Function](#functionstring)([String...](TopLevel.String.md)) | Constructs the function with the specified arguments where the last argument represents the function body and all preceeding arguments represent the function parameters. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [apply](TopLevel.Function.md#applyobject-array)([Object](TopLevel.Object.md), [Array](TopLevel.Array.md)) | Invokes this function as a method of the specified object passing the specified Array of arguments. | +| [call](TopLevel.Function.md#callobject-object)([Object](TopLevel.Object.md), [Object...](TopLevel.Object.md)) | Invokes this function as a method of the specified object passing the specified optional arguments. | +| [toString](TopLevel.Function.md#tostring)() | Returns a String representation of this function object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### length +- length: [Number](TopLevel.Number.md) + - : The number of named arguments that were specified + when the function was declared. + + + +--- + +### prototype +- prototype: [Object](TopLevel.Object.md) + - : An object that defines properties and methods + shared by all objects created with that + constructor function. + + + +--- + +## Constructor Details + +### Function(String...) +- Function(args: [String...](TopLevel.String.md)) + - : Constructs the function with the specified arguments where the + last argument represents the function body and all preceeding arguments represent + the function parameters. + + + **Parameters:** + - args - one or more Strings where the last argument in the list represents the function body and all preceeding arguments represent the function parameters. + + +--- + +## Method Details + +### apply(Object, Array) +- apply(thisobj: [Object](TopLevel.Object.md), args: [Array](TopLevel.Array.md)): [Object](TopLevel.Object.md) + - : Invokes this function as a method of the specified object + passing the specified Array of arguments. + + + **Parameters:** + - thisobj - the object to which the function is applied. + - args - Array of values or an arguments object to be passed as arguments to the function. + + **Returns:** + - whatever value is returned by the invocation of the function. + + +--- + +### call(Object, Object...) +- call(thisobj: [Object](TopLevel.Object.md), args: [Object...](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Invokes this function as a method of the specified object + passing the specified optional arguments. + + + **Parameters:** + - thisobj - the object to which the function is applied. + - args - an optional list of one or more arguments values that are passed as arguments to the function. + + **Returns:** + - whatever value is returned by the invocation of the function. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a String representation of this function object. + + **Returns:** + - a String representation of this function object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Generator.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Generator.md new file mode 100644 index 00000000..62723321 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Generator.md @@ -0,0 +1,132 @@ + +# Class Generator + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Generator](TopLevel.Generator.md) + +A generator is a special type of function that works as a factory for +iterators and it allows you to define an iterative algorithm by writing a +single function which can maintain its own state. A function becomes a +generator if it contains one or more **yield** statements. + + +When a generator function is called, the body of the function does not +execute straight away; instead, it returns a generator-iterator object. +Each call to the generator-iterator's next() method will execute the +body of the function up to the next **yield** statement and return its result. +When either the end of the function or a return statement is reached, +a StopIteration exception is thrown. + + +For example, the following fib() function is a Fibonacci number generator, +that returns the generator when it encounters the **yield** statement: + +``` +function fib() { + var fibNum = 0, j = 1; + while (true) { + **_yield_** fibNum; + var t = fibNum; + fibNum = j; + j += t; + } +} +``` + + +To use the generator, simply call the next() method to access the values +returned by the function: + +``` + var gen = fib(); + for (var i = 0; i < 10; i++) { + document.write(**_gen.next()_** " "); + } +``` + + +**See Also:** +- [Iterator](TopLevel.Iterator.md) +- [StopIteration](TopLevel.StopIteration.md) + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Generator](#generator)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](TopLevel.Generator.md#close)() | Closes the iteration of the generator. | +| [next](TopLevel.Generator.md#next)() | Resumes the iteration of the generator by continuing the function at the statement after the **yield** statement. | +| [send](TopLevel.Generator.md#sendobject)([Object](TopLevel.Object.md)) | Allows you to control the resumption of the iterative algorithm. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### Generator() +- Generator() + - : + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the iteration of the generator. Any finally clauses active in + the generator function are run. If a finally clause throws any + exception other than StopIteration, the exception is propagated to + the caller of the close() method. + + + +--- + +### next() +- next(): [Object](TopLevel.Object.md) + - : Resumes the iteration of the generator by continuing the function + at the statement after the **yield** statement. This function throws a + StopIterator exception when there are no additional iterative steps. + + + **Returns:** + - the result of resuming the iterative algorithm or a StopIterator + exception if the sequence is exhausted. + + + **See Also:** + - [StopIteration](TopLevel.StopIteration.md) + + +--- + +### send(Object) +- send(value: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Allows you to control the resumption of the iterative algorithm. Once a + generator has been started by calling its next() method, you can use + send() and pass a specific value that will be treated as the result + of the last **yield**. The generator will then return the operand of the + subsequent **yield**. + + + You can't start a generator at an arbitrary point; you must start + it with next() before you can send() it a specific value. Note that + calling send(undefined) is equivalent to calling next(). However, + starting a newborn generator with any value other than 'undefined' when + calling send() will result in a TypeError exception. + + + **Parameters:** + - value - the value to use. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.IOError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.IOError.md new file mode 100644 index 00000000..9e15c8e4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.IOError.md @@ -0,0 +1,98 @@ + +# Class IOError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.IOError](TopLevel.IOError.md) + +This error indicates an I/O related error in the system. The IOError +is always related to a systems internal Java exception. The class provides +access to some more details about this internal Java exception. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [causeFullName](#causefullname): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the full name of the associated Java exception. | +| [causeMessage](#causemessage): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the message of the associated Java exception. | +| [causeName](#causename): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the simplified name of the associated Java exception. | +| [javaFullName](#javafullname): [String](TopLevel.String.md) | The full name of the underlying Java exception. | +| [javaMessage](#javamessage): [String](TopLevel.String.md) | The message of the underlying Java exception. | +| [javaName](#javaname): [String](TopLevel.String.md) | The simplified name of the underlying Java exception. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [IOError](#ioerror)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### causeFullName +- causeFullName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the full name of the associated Java exception. + + + +--- + +### causeMessage +- causeMessage: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the message of the associated Java exception. + + + +--- + +### causeName +- causeName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the simplified name of the associated Java exception. + + + +--- + +### javaFullName +- javaFullName: [String](TopLevel.String.md) + - : The full name of the underlying Java exception. + + +--- + +### javaMessage +- javaMessage: [String](TopLevel.String.md) + - : The message of the underlying Java exception. + + +--- + +### javaName +- javaName: [String](TopLevel.String.md) + - : The simplified name of the underlying Java exception. + + +--- + +## Constructor Details + +### IOError() +- IOError() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int16Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int16Array.md new file mode 100644 index 00000000..13877a53 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int16Array.md @@ -0,0 +1,186 @@ + +# Class Int16Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Int16Array](TopLevel.Int16Array.md) + +An optimized array to store 16-bit signed integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 2 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Int16Array](#int16array)() | Creates an empty array. | +| [Int16Array](#int16arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Int16Array](#int16arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Int16Array](#int16arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Int16Array](#int16arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Int16Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Int16Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Int16Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 2 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Int16Array() +- Int16Array() + - : Creates an empty array. + + +--- + +### Int16Array(Number) +- Int16Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Int16Array(Object) +- Int16Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Int16Array(Array) +- Int16Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Int16Array(ArrayBuffer, Number, Number) +- Int16Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Int16Array](TopLevel.Int16Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int32Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int32Array.md new file mode 100644 index 00000000..60f39918 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int32Array.md @@ -0,0 +1,186 @@ + +# Class Int32Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Int32Array](TopLevel.Int32Array.md) + +An optimized array to store 32-bit signed integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 4 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Int32Array](#int32array)() | Creates an empty array. | +| [Int32Array](#int32arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Int32Array](#int32arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Int32Array](#int32arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Int32Array](#int32arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Int32Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Int32Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Int32Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 4 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Int32Array() +- Int32Array() + - : Creates an empty array. + + +--- + +### Int32Array(Number) +- Int32Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Int32Array(Object) +- Int32Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Int32Array(Array) +- Int32Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Int32Array(ArrayBuffer, Number, Number) +- Int32Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Int32Array](TopLevel.Int32Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int8Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int8Array.md new file mode 100644 index 00000000..aff7442b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Int8Array.md @@ -0,0 +1,186 @@ + +# Class Int8Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Int8Array](TopLevel.Int8Array.md) + +An optimized array to store 8-bit signed integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 1 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Int8Array](#int8array)() | Creates an empty array. | +| [Int8Array](#int8arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Int8Array](#int8arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Int8Array](#int8arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Int8Array](#int8arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Int8Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Int8Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Int8Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 1 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Int8Array() +- Int8Array() + - : Creates an empty array. + + +--- + +### Int8Array(Number) +- Int8Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Int8Array(Object) +- Int8Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Int8Array(Array) +- Int8Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Int8Array(ArrayBuffer, Number, Number) +- Int8Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Int8Array](TopLevel.Int8Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.InternalError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.InternalError.md new file mode 100644 index 00000000..2e42a1e2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.InternalError.md @@ -0,0 +1,47 @@ + +# Class InternalError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.InternalError](TopLevel.InternalError.md) + +Represents the an internal error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [InternalError](#internalerror)() | Constructs the error. | +| [InternalError](#internalerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### InternalError() +- InternalError() + - : Constructs the error. + + +--- + +### InternalError(String) +- InternalError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the internal error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterable.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterable.md new file mode 100644 index 00000000..57c96e65 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterable.md @@ -0,0 +1,44 @@ + +# Class Iterable + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Iterable](TopLevel.Iterable.md) + +All objects containing the property @@iterator with a function returning an [ES6Iterator](TopLevel.ES6Iterator.md) are said to be an Iterable. + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [iterator](TopLevel.Iterable.md#iterator)() | Returns an iterator to be used for iterating this object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### iterator() +- iterator(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator to be used for iterating this object. Typically returns a new iterator instance. + For iterators returns typically the iterator itself. + + + **Returns:** + - The iterator to be used for iterating this object. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterator.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterator.md new file mode 100644 index 00000000..315828f1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Iterator.md @@ -0,0 +1,89 @@ + +# Class Iterator + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Iterator](TopLevel.Iterator.md) + +An Iterator is a special object that lets you access items from a +collection one at a time, while keeping track of its current position +within that sequence. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Iterator](#iteratorobject)([Object](TopLevel.Object.md)) | Creates an Iterator instance for the specified object. | +| [Iterator](#iteratorobject-boolean)([Object](TopLevel.Object.md), [Boolean](TopLevel.Boolean.md)) | Creates an Iterator instance for the specified object's keys. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [next](TopLevel.Iterator.md#next)() | Returns the next item in the iterator. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### Iterator(Object) +- Iterator(object: [Object](TopLevel.Object.md)) + - : Creates an Iterator instance for the specified object. + The Iterator for the object is created by calling the + object's \_\_iterator\_\_ method. If there is no \_\_iterator\_\_ method, + a default iterator is created. The default iterator provides access to + the object's properties, according to the usual for...in and for + each...in model. + + If you want to provide a custom iterator, you should override + the \_\_iterator\_\_ method to return an instance of your custom iterator. + + + **Parameters:** + - object - the object whose values will be accessible via the Iterator. + + +--- + +### Iterator(Object, Boolean) +- Iterator(object: [Object](TopLevel.Object.md), keysOnly: [Boolean](TopLevel.Boolean.md)) + - : Creates an Iterator instance for the specified object's keys. + The Iterator for the object is created by calling the + object's \_\_iterator\_\_ method. If there is no \_\_iterator\_\_ method, + a default iterator is created. The default iterator provides access to + the object's properties, according to the usual for...in and for + each...in model. + + If you want to provide a custom iterator, you should override + the \_\_iterator\_\_ method to return an instance of your custom iterator. + + + **Parameters:** + - object - the object whose keys or values will be accessible via the Iterator. + - keysOnly - if true, provides access to the object's keys. If false, provides access to the object's values. + + +--- + +## Method Details + +### next() +- next(): [Object](TopLevel.Object.md) + - : Returns the next item in the iterator. If there are no items left, + the StopIteration exception is thrown. You should generally use this method + in the context of a try...catch block to handle the StopIteration case. + There is no guaranteed ordering of the data. + + + **Returns:** + - the next item in the iterator. + + **See Also:** + - [StopIteration](TopLevel.StopIteration.md) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.JSON.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.JSON.md new file mode 100644 index 00000000..3e2aa1a1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.JSON.md @@ -0,0 +1,173 @@ + +# Class JSON + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.JSON](TopLevel.JSON.md) + +The JSON object is a single object that contains two functions, parse and stringify, +that are used to parse and construct JSON texts. The JSON Data Interchange Format is +described in RFC 4627. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [JSON](#json)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [parse](TopLevel.JSON.md#parsestring)([String](TopLevel.String.md)) | The parse function parses a JSON text (a JSON formatted string) and produces an ECMAScript value. | +| static [parse](TopLevel.JSON.md#parsestring-function)([String](TopLevel.String.md), [Function](TopLevel.Function.md)) | The parse function parses a JSON text (a JSON formatted string) and produces an ECMAScript value. | +| static [stringify](TopLevel.JSON.md#stringifyobject)([Object](TopLevel.Object.md)) | The stringify function produces a JSON formatted string that captures information from a JavaScript value. | +| static [stringify](TopLevel.JSON.md#stringifyobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | The stringify function produces a JSON formatted string that captures information from a JavaScript value. | +| static [stringify](TopLevel.JSON.md#stringifyobject-object-string)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md), [String](TopLevel.String.md)) | The stringify function produces a JSON formatted string that captures information from a JavaScript value. | +| static [stringify](TopLevel.JSON.md#stringifyobject-object-number)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | The stringify function produces a JSON formatted string that captures information from a JavaScript value. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### JSON() +- JSON() + - : + + +--- + +## Method Details + +### parse(String) +- static parse(json: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : The parse function parses a JSON text (a JSON formatted string) and produces an ECMAScript + value. The JSON format is a restricted form of ECMAScript literal. JSON objects are realized + as ECMAScript objects. JSON Arrays are realized as ECMAScript arrays. JSON strings, numbers, + booleans, and null are realized as ECMAScript strings, numbers, booleans, and null. + + + **Parameters:** + - json - a JSON formatted string + + **Returns:** + - the object produced from the JSON string + + +--- + +### parse(String, Function) +- static parse(json: [String](TopLevel.String.md), reviver: [Function](TopLevel.Function.md)): [Object](TopLevel.Object.md) + - : The parse function parses a JSON text (a JSON formatted string) and produces an ECMAScript + value. The JSON format is a restricted form of ECMAScript literal. JSON objects are realized + as ECMAScript objects. JSON Arrays are realized as ECMAScript arrays. JSON strings, numbers, + booleans, and null are realized as ECMAScript strings, numbers, booleans, and null. + + The optional reviver parameter is a function that takes two parameters, (key, value). It can + filter and transform the results. It is called with each of the key/value pairs produced by the + parse, and its return value is used instead of the original value. If it returns what it + received, the structure is not modified. If it returns undefined then the member is deleted + from the result. + + + **Parameters:** + - json - a JSON formatted string + - reviver - a function, which is called with each key, value pair during parsing + + **Returns:** + - the object produced from the JSON string + + +--- + +### stringify(Object) +- static stringify(value: [Object](TopLevel.Object.md)): [String](TopLevel.String.md) + - : The stringify function produces a JSON formatted string that captures information + from a JavaScript value. The value parameter is a JavaScript value is usually an + object or array, although it can also be a string, boolean, number or null. + + Note: Stringifying API objects is not supported. + + + **Parameters:** + - value - the value which is stringified + + **Returns:** + - the JSON string + + +--- + +### stringify(Object, Object) +- static stringify(value: [Object](TopLevel.Object.md), replacer: [Object](TopLevel.Object.md)): [String](TopLevel.String.md) + - : The stringify function produces a JSON formatted string that captures information + from a JavaScript value. The value parameter is a JavaScript value is usually an + object or array, although it can also be a string, boolean, number or null. The + optional replacer parameter is either a function that alters the way objects and + arrays are stringified, or an array of strings that acts as an allowlist for selecting + the keys that will be stringified. + + Note: Stringifying API objects is not supported. + + + **Parameters:** + - value - the value which is stringified + - replacer - either a function, which is called with a key and value as parameter, or an array with an allowlist + + **Returns:** + - the JSON string + + +--- + +### stringify(Object, Object, String) +- static stringify(value: [Object](TopLevel.Object.md), replacer: [Object](TopLevel.Object.md), space: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : The stringify function produces a JSON formatted string that captures information + from a JavaScript value. The value parameter is a JavaScript value is usually an + object or array, although it can also be a string, boolean, number or null. The + optional replacer parameter is either a function that alters the way objects and + arrays are stringified, or an array of strings that acts as an allowlist for selecting + the keys that will be stringified. The optional space parameter is a string or number + that allows the result to have white space injected into it to improve human readability. + + Note: Stringifying API objects is not supported. + + + **Parameters:** + - value - the value which is stringified + - replacer - either a function, which is called with a key and value as parameter, or an array with an allowlist + - space - a string for indentation + + **Returns:** + - the JSON string + + +--- + +### stringify(Object, Object, Number) +- static stringify(value: [Object](TopLevel.Object.md), replacer: [Object](TopLevel.Object.md), space: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : The stringify function produces a JSON formatted string that captures information + from a JavaScript value. The value parameter is a JavaScript value is usually an + object or array, although it can also be a string, boolean, number or null. The + optional replacer parameter is either a function that alters the way objects and + arrays are stringified, or an array of strings that acts as an allowlist for selecting + the keys that will be stringified. The optional space parameter is a string or number + that allows the result to have white space injected into it to improve human readability. + + Note: Stringifying API objects is not supported. + + + **Parameters:** + - value - the value which is stringified + - replacer - either a function, which is called with a key and value as parameter, or an array with an allowlist + - space - the number of space for indenting + + **Returns:** + - the JSON string + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Map.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Map.md new file mode 100644 index 00000000..66ed1db4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Map.md @@ -0,0 +1,189 @@ + +# Class Map + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Map](TopLevel.Map.md) + +Map objects are collections of key/value pairs where both the keys and values may be arbitrary ECMAScript language +values. A distinct key value may only occur in one key/value pair within the Map's collection. Key/value pairs are stored +and iterated in insertion order. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [size](#size): [Number](TopLevel.Number.md) | Number of key/value pairs stored in this map. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Map](#map)() | Creates an empty map. | +| [Map](#mapiterable)([Iterable](TopLevel.Iterable.md)) | If the passed value is null or undefined then an empty map is constructed. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [clear](TopLevel.Map.md#clear)() | Removes all key/value pairs from this map. | +| [delete](TopLevel.Map.md#deleteobject)([Object](TopLevel.Object.md)) | Removes the entry for the given key. | +| [entries](TopLevel.Map.md#entries)() | Returns an iterator containing all key/value pairs of this map. | +| [forEach](TopLevel.Map.md#foreachfunction)([Function](TopLevel.Function.md)) | Runs the provided callback function once for each key/value pair present in this map. | +| [forEach](TopLevel.Map.md#foreachfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Runs the provided callback function once for each key/value pair present in this map. | +| [get](TopLevel.Map.md#getobject)([Object](TopLevel.Object.md)) | Returns the value associated with the given key. | +| [has](TopLevel.Map.md#hasobject)([Object](TopLevel.Object.md)) | Returns if this map has value associated with the given key. | +| [keys](TopLevel.Map.md#keys)() | Returns an iterator containing all keys of this map. | +| [set](TopLevel.Map.md#setobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Adds or updates a key/value pair to the map. | +| [values](TopLevel.Map.md#values)() | Returns an iterator containing all values of this map. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### size +- size: [Number](TopLevel.Number.md) + - : Number of key/value pairs stored in this map. + + +--- + +## Constructor Details + +### Map() +- Map() + - : Creates an empty map. + + +--- + +### Map(Iterable) +- Map(values: [Iterable](TopLevel.Iterable.md)) + - : If the passed value is null or undefined then an empty map is constructed. Else an iterator object is expected + that produces a two element array-like object whose first element is a value that will be used as a Map key and + whose second element is the value to associate with that key. + + + **Parameters:** + - values - The initial map values + + +--- + +## Method Details + +### clear() +- clear(): void + - : Removes all key/value pairs from this map. + + +--- + +### delete(Object) +- delete(key: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Removes the entry for the given key. + + **Parameters:** + - key - The key of the key/value pair to be removed from the map. + + **Returns:** + - `true` if the map contained an entry for the passed key that was removed. Else `false` is returned. + + +--- + +### entries() +- entries(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all key/value pairs of this map. + The iterator produces a series of two-element arrays with the first element as the key and the second element as the value. + + + +--- + +### forEach(Function) +- forEach(callback: [Function](TopLevel.Function.md)): void + - : Runs the provided callback function once for each key/value pair present in this map. + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the value of the element, the key of the element, and the Map object being iterated. + + +--- + +### forEach(Function, Object) +- forEach(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): void + - : Runs the provided callback function once for each key/value pair present in this map. + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the value of the element, the key of the element, and the Map object being iterated. + - thisObject - The Object to use as 'this' when executing callback. + + +--- + +### get(Object) +- get(key: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Returns the value associated with the given key. + + **Parameters:** + - key - The key to look for. + + **Returns:** + - The value associated with the given key if an entry with the key exists else `undefined` is returned. + + +--- + +### has(Object) +- has(key: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if this map has value associated with the given key. + + **Parameters:** + - key - The key to look for. + + **Returns:** + - `true` if an entry with the key exists else `false` is returned. + + +--- + +### keys() +- keys(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all keys of this map. + + +--- + +### set(Object, Object) +- set(key: [Object](TopLevel.Object.md), value: [Object](TopLevel.Object.md)): [Map](TopLevel.Map.md) + - : Adds or updates a key/value pair to the map. + + You can't use JavaScript bracket notation to access map entries. JavaScript bracket notation accesses only + properties for Map objects, not map entries. + + + **Parameters:** + - key - The key object. + - value - The value to be associated with the key. + + **Returns:** + - This map object. + + +--- + +### values() +- values(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all values of this map. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Math.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Math.md new file mode 100644 index 00000000..b04abce8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Math.md @@ -0,0 +1,948 @@ + +# Class Math + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Math](TopLevel.Math.md) + +Mathematical functions and constants. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [E](#e): [Number](TopLevel.Number.md) | The constant _e_, which is the base of natural logarithms. | +| [LN10](#ln10): [Number](TopLevel.Number.md) | The natural logarithm of 10. | +| [LN2](#ln2): [Number](TopLevel.Number.md) | The natural logarithm of 2. | +| [LOG10E](#log10e): [Number](TopLevel.Number.md) | The base-10 logarithm of _e_. | +| [LOG2E](#log2e): [Number](TopLevel.Number.md) | The base-2 logarithm of _e_. | +| [PI](#pi): [Number](TopLevel.Number.md) | The constant for PI. | +| [SQRT1_2](#sqrt1_2): [Number](TopLevel.Number.md) | 1 divided by the square root of 2. | +| [SQRT2](#sqrt2): [Number](TopLevel.Number.md) | The square root of 2. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Math](#math)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [abs](TopLevel.Math.md#absnumber)([Number](TopLevel.Number.md)) | Returns the absolute value of _x_. | +| static [acos](TopLevel.Math.md#acosnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the arc cosine of _x_. | +| static [acosh](TopLevel.Math.md#acoshnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the inverse hyperbolic cosine of _x_. | +| static [asin](TopLevel.Math.md#asinnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the arc sine of _x_. | +| static [asinh](TopLevel.Math.md#asinhnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the inverse hyperbolic sine of _x_. | +| static [atan](TopLevel.Math.md#atannumber)([Number](TopLevel.Number.md)) | Returns an approximation to the arc tangent of _x_. | +| static [atan2](TopLevel.Math.md#atan2number-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns an approximation to the arc tangent of the quotient y/x of the arguments _y_ and _x_, where the signs of _y_ and _x_ are used to determine the quadrant of the result. | +| static [atanh](TopLevel.Math.md#atanhnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the inverse hyperbolic tangent of _x_. | +| static [cbrt](TopLevel.Math.md#cbrtnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the cube root of _x_. | +| static [ceil](TopLevel.Math.md#ceilnumber)([Number](TopLevel.Number.md)) | Returns the smallest (closest to -∞) number value that is not less than _x_ and is equal to a mathematical integer. | +| static [clz32](TopLevel.Math.md#clz32number)([Number](TopLevel.Number.md)) | Returns the number of leading zero bits in the 32-bit binary representation of _x_. | +| static [cos](TopLevel.Math.md#cosnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the cosine of _x_. | +| static [cosh](TopLevel.Math.md#coshnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the hyperbolic cosine of _x_. | +| static [exp](TopLevel.Math.md#expnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the exponential function of _x_ (e raised to the power of x, where e is the base of the natural logarithms). | +| static [expm1](TopLevel.Math.md#expm1number)([Number](TopLevel.Number.md)) | Returns an approximation to subtracting 1 from the exponential function of _x_ (e raised to the power of _x_, where e is the base of the natural logarithms). | +| static [floor](TopLevel.Math.md#floornumber)([Number](TopLevel.Number.md)) | Returns the greatest (closest to +∞) number value that is not greater than _x_ and is equal to a mathematical integer. | +| static [fround](TopLevel.Math.md#froundnumber)([Number](TopLevel.Number.md)) | Returns the nearest 32-bit single precision float representation of _x_. | +| static [hypot](TopLevel.Math.md#hypotnumber)([Number...](TopLevel.Number.md)) | Returns an approximation of the square root of the sum of squares of the arguments. | +| static [imul](TopLevel.Math.md#imulnumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Performs a 32 bit integer multiplication, where the result is always a 32 bit integer value, ignoring any overflows. | +| static [log](TopLevel.Math.md#lognumber)([Number](TopLevel.Number.md)) | Returns an approximation to the natural logarithm of _x_. | +| static [log10](TopLevel.Math.md#log10number)([Number](TopLevel.Number.md)) | Returns an approximation to the base 10 logarithm of _x_. | +| static [log1p](TopLevel.Math.md#log1pnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the natural logarithm of of 1 + _x_. | +| static [log2](TopLevel.Math.md#log2number)([Number](TopLevel.Number.md)) | Returns an approximation to the base 2 logarithm of _x_. | +| static [max](TopLevel.Math.md#maxnumber)([Number...](TopLevel.Number.md)) | Returns the largest specified values. | +| static [min](TopLevel.Math.md#minnumber)([Number...](TopLevel.Number.md)) | Returns the smallest of the specified values. | +| static [pow](TopLevel.Math.md#pownumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns an approximation to the result of raising _x_ to the power _y_. | +| static [random](TopLevel.Math.md#random)() | Returns a number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy. | +| static [round](TopLevel.Math.md#roundnumber)([Number](TopLevel.Number.md)) | Returns the number value that is closest to _x_ and is equal to a mathematical integer. | +| static [sign](TopLevel.Math.md#signnumber)([Number](TopLevel.Number.md)) | Returns the sign of _x_, indicating whether _x_ is positive, negative, or zero. | +| static [sin](TopLevel.Math.md#sinnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the sine of _x_. | +| static [sinh](TopLevel.Math.md#sinhnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the hyperbolic sine of _x_. | +| static [sqrt](TopLevel.Math.md#sqrtnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the square root of _x_. | +| static [tan](TopLevel.Math.md#tannumber)([Number](TopLevel.Number.md)) | Returns an approximation to the tangent of _x_. | +| static [tanh](TopLevel.Math.md#tanhnumber)([Number](TopLevel.Number.md)) | Returns an approximation to the hyperbolic tangent of _x_. | +| static [trunc](TopLevel.Math.md#truncnumber)([Number](TopLevel.Number.md)) | Returns the integral part of the number _x_, removing any fractional digits. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### E + +- E: [Number](TopLevel.Number.md) + - : The constant _e_, which is the base of natural logarithms. + + +--- + +### LN10 + +- LN10: [Number](TopLevel.Number.md) + - : The natural logarithm of 10. + + +--- + +### LN2 + +- LN2: [Number](TopLevel.Number.md) + - : The natural logarithm of 2. + + +--- + +### LOG10E + +- LOG10E: [Number](TopLevel.Number.md) + - : The base-10 logarithm of _e_. + + +--- + +### LOG2E + +- LOG2E: [Number](TopLevel.Number.md) + - : The base-2 logarithm of _e_. + + +--- + +### PI + +- PI: [Number](TopLevel.Number.md) + - : The constant for PI. + + +--- + +### SQRT1_2 + +- SQRT1_2: [Number](TopLevel.Number.md) + - : 1 divided by the square root of 2. + + +--- + +### SQRT2 + +- SQRT2: [Number](TopLevel.Number.md) + - : The square root of 2. + + +--- + +## Constructor Details + +### Math() +- Math() + - : + + +--- + +## Method Details + +### abs(Number) +- static abs(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the absolute value of _x_. The result has the same magnitude as _x_ but has positive sign. + + - If _x_is NaN, the result is NaN. + - If _x_is -0, the result is +0. + - If _x_is -∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the absolute value of _x_. + + +--- + +### acos(Number) +- static acos(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the arc cosine of _x_. The result is expressed in radians and ranges from +0 to + +p. + + - If _x_is NaN, the result is NaN. + - If _x_is greater than 1, the result is NaN. + - If _x_is less than -1, the result is NaN. + - If _x_is exactly 1, the result is +0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the arc cosine of _x_. + + +--- + +### acosh(Number) +- static acosh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the inverse hyperbolic cosine of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than 1, the result is NaN. + - If _x_is exactly 1, the result is +0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the inverse hyperbolic cosine of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### asin(Number) +- static asin(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the arc sine of _x_. The result is expressed in radians and ranges from -p/2 to + +p/2. + + - If _x_is NaN, the result is NaN + - If _x_is greater than 1, the result is NaN. + - If _x_is less than -1, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the arc sine of _x_. + + +--- + +### asinh(Number) +- static asinh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the inverse hyperbolic sine of _x_. + + - If _x_is NaN, the result is NaN + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the inverse hyperbolic sine of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### atan(Number) +- static atan(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the arc tangent of _x_. The result is expressed in radians and ranges from -p/2 + to +p/2. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is an approximation to +p/2. + - If _x_is -∞, the result is an approximation to -p/2. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the arc tangent of _x_. + + +--- + +### atan2(Number, Number) +- static atan2(y: [Number](TopLevel.Number.md), x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the arc tangent of the quotient y/x of the arguments _y_ and _x_, where the + signs of _y_ and _x_ are used to determine the quadrant of the result. Note that it is intentional and + traditional for the two-argument arc tangent function that the argument named _y_ be first and the argument + named _x_ be second. The result is expressed in radians and ranges from -p to +p. + + - If either _x_or _y_is NaN, the result is NaN. + - If _y_>0 and _x_is +0, the result is an implementation-dependent approximation to +p/2. + - If _y_>0 and _x_is -0, the result is an implementation-dependent approximation to +p/2. + - If _y_is +0 and _x_>0, the result is +0. + - If _y_is +0 and _x_is +0, the result is +0. + - If _y_is +0 and _x_is -0, the result is an implementation-dependent approximation to +p. + - If _y_is +0 and _X_<0, the result is an implementation-dependent approximation to +p. + - If _y_is -0 and _x_>0, the result is -0. + - If _y_is -0 and _x_is +0, the result is -0. + - If _y_is -0 and _x_is -0, the result is an implementation-dependent approximation to -p. + - If _y_is -0 and _X_<0, the result is an implementation-dependent approximation to -p. + - If _y_<0 and _x_is +0, the result is an implementation-dependent approximation to -p/2. + - If _y_<0 and _x_is -0, the result is an implementation-dependent approximation to -p/2. + - If _y_>0 and _y_is finite and _x_is +∞, the result is +0. + - If _y_>0 and _y_is finite and _x_is -∞, the result if an implementation-dependent approximation to +p. + - If _y_<0 and _y_is finite and _x_is +∞, the result is -0. + - If _y_<0 and _y_is finite and _x_is -∞, the result is an implementation-dependent approximation to -p. + - If _y_is +∞and _x_is finite, the result is an implementation-dependent approximation to +p/2. + - If _y_is -∞and _x_is finite, the result is an implementation-dependent approximation to -p/2. + - If _y_is +∞and _x_is +∞, the result is an implementation-dependent approximation to +p/4. + - If _y_is +∞and _x_is -∞, the result is an implementation-dependent approximation to +3p/4. + - If _y_is -∞and _x_is +∞, the result is an implementation-dependent approximation to -p/4. + - If _y_is -∞and _x_is -∞, the result is an implementation-dependent approximation to -3p/4. + + + **Parameters:** + - y - the first argument. + - x - the second argument. + + **Returns:** + - approximation to the arc tangent of the quotient _y/x_ of the arguments _y_ and x, where the + signs of _y_ and _x_ are used to determine the quadrant of the result. + + + +--- + +### atanh(Number) +- static atanh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the inverse hyperbolic tangent of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than -1, the result is NaN. + - If _x_is greater than 1, the result is NaN. + - If _x_is exactly -1, the result is -∞. + - If _x_is exactly +1, the result is +∞. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the inverse hyperbolic tangent of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### cbrt(Number) +- static cbrt(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the cube root of _x_. + + - If _x_is NaN, the result is NaN + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the cube root of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### ceil(Number) +- static ceil(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the smallest (closest to -∞) number value that is not less than _x_ and is equal to a + mathematical integer. If _x_ is already an integer, the result is _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -∞. + - If _x_is less than 0 but greater than -1, the result is -0. + + The value of Math.ceil(x) is the same as the value of -Math.floor(-x). + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the smallest (closest to -∞) number value that is not less than _x_ and is equal to a + mathematical integer. + + + +--- + +### clz32(Number) +- static clz32(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the number of leading zero bits in the 32-bit binary representation of _x_. + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the number of leading zero bits in the 32-bit binary representation of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### cos(Number) +- static cos(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the cosine of _x_. The argument is expressed in radians. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is 1. + - If _x_is -0, the result is 1. + - If _x_is +∞, the result is NaN. + - If _x_is -∞, the result is NaN. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the cosine of _x_. + + +--- + +### cosh(Number) +- static cosh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the hyperbolic cosine of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is 1. + - If _x_is -0, the result is 1. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the hyperbolic cosine of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### exp(Number) +- static exp(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the exponential function of _x_ (e raised to the power + of x, where e is the base of the natural logarithms). + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is 1. + - If _x_is -0, the result is 1. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is +0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the exponential function of _x_. + + +--- + +### expm1(Number) +- static expm1(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to subtracting 1 from the exponential function of _x_ (e raised to the power of _x_, where e + is the base of the natural logarithms). The result is computed in a way that is accurate even when the value of _x_ + is close 0. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -1. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to subtracting 1 from the exponential function of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### floor(Number) +- static floor(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the greatest (closest to +∞) number value that is not greater than _x_ and is equal to a + mathematical integer. If _x_ is already an integer, the result is _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -∞. + - If _x_is greater than 0 but less than 1, the result is +0. + + The value of Math.floor(_x_) is the same as the value of -Math.ceil(_-x_). + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the greatest (closest to +∞) number value that is not greater than _x_ and is equal to a + mathematical integer. + + + +--- + +### fround(Number) +- static fround(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the nearest 32-bit single precision float representation of _x_. + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the nearest 32-bit single precision float representation of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### hypot(Number...) +- static hypot(values: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation of the square root of the sum of squares of the arguments. + + - If no arguments are passed, the result is +0. + - If any argument is +∞, the result is +∞. + - If any argument is -∞, the result is +∞. + - If no argument is +∞or -∞and any argument is NaN, the result is NaN. + - If all arguments are either +0 or -0, the result is +0. + + + **Parameters:** + - values - the Number values to operate on. + + **Returns:** + - an approximation of the square root of the sum of squares of the arguments. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### imul(Number, Number) +- static imul(x: [Number](TopLevel.Number.md), y: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Performs a 32 bit integer multiplication, where the result is always a 32 bit integer value, ignoring any overflows. + + **Parameters:** + - x - The first operand. + - y - The second operand. + + **Returns:** + - Returns the result of the 32 bit multiplication. The result is a 32 bit signed integer value. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### log(Number) +- static log(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the natural logarithm of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than 0, the result is NaN. + - If _x_is +0 or -0, the result is -∞. + - If _x_is 1, the result is +0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the natural logarithm of _x_. + + +--- + +### log10(Number) +- static log10(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the base 10 logarithm of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than 0, the result is NaN. + - If _x_is +0 or -0, the result is -∞. + - If _x_is 1, the result is +0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the base 10 logarithm of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### log1p(Number) +- static log1p(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the natural logarithm of of 1 + _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than -1, the result is NaN. + - If _x_is -1, the result is -∞. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the natural logarithm of of 1 + _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### log2(Number) +- static log2(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the base 2 logarithm of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is less than 0, the result is NaN. + - If _x_is +0 or -0, the result is -∞. + - If _x_is 1, the result is +0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the base 2 logarithm of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### max(Number...) +- static max(values: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the largest specified values. If no arguments are given, the result is -∞. If any value is NaN, the + result is NaN. + + + **Parameters:** + - values - zero or more values. + + **Returns:** + - the largest of the specified values. + + +--- + +### min(Number...) +- static min(values: [Number...](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the smallest of the specified values. If no arguments are given, the result is +∞. If any value is + NaN, the result is NaN. + + + **Parameters:** + - values - zero or more values. + + **Returns:** + - the smallest of the specified values. + + +--- + +### pow(Number, Number) +- static pow(x: [Number](TopLevel.Number.md), y: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the result of raising _x_ to the power _y_. + + - If _y_is NaN, the result is NaN. + - If _y_is +0, the result is 1, even if _x_is NaN. + - If _y_is -0, the result is 1, even if _x_is NaN. + - If _x_is NaN and _y_is nonzero, the result is NaN. + - If abs(_x_)>1 and _y_is +∞, the result is +∞. + - If abs(_x_)>1 and _y_is -∞, the result is +0. + - If abs(_x_)==1 and _y_is +∞, the result is NaN. + - If abs(_x_)==1 and _y_is -∞, the result is NaN. + - If abs(_x_)<1 and _y_is +∞, the result is +0. + - If abs(_x_)<1 and _y_is -∞, the result is +∞. + - If _x_is +∞and _y_>0, the result is +∞. + - If _x_is +∞and _y_<0, the result is +0. + - If _x_is -∞and _y_>0 and _y_is an odd integer, the result is -∞. + - If _x_is -∞and _y_>0 and _y_is not an odd integer, the result is +∞. + - If _x_is -∞and _y_<0 and _y_is an odd integer, the result is -0. + - If _x_is -∞and _y_<0 and _y_is not an odd integer, the result is +0. + - If _x_is +0 and _y_>0, the result is +0. + - If _x_is +0 and _y_<0, the result is +∞. + - If _x_is -0 and _y_>0 and _y_is an odd integer, the result is -0. + - If _x_is -0 and _y_>0 and _y_is not an odd integer, the result is +0. + - If _x_is -0 and _y_<0 and _y_is an odd integer, the result is -∞. + - If _x_is -0 and _y_<0 and _y_is not an odd integer, the result is +∞. + - If _X_<0 and _x_is finite and _y_is finite and _y_is not an integer, the result is NaN. + + + **Parameters:** + - x - a Number that will be raised to the power of _y_. + - y - the power by which _x_ will be raised. + + **Returns:** + - an approximation to the result of raising _x_ to the power _y_. + + +--- + +### random() +- static random(): [Number](TopLevel.Number.md) + - : Returns a number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo + randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or + strategy. + + + **Returns:** + - a Number greater than or equal to 0 but less than 1. + + +--- + +### round(Number) +- static round(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the number value that is closest to _x_ and is equal to a mathematical integer. If two integer + number values are equally close to x, then the result is the number value that is closer to +∞. If _x_ + is already an integer, the result is _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is -∞. + - If _x_is greater than 0 but less than 0.5, the result is +0. + - If _x_is less than 0 but greater than or equal to -0.5, the result is -0. + + Math.round(3.5) returns 4, but Math.round(-3.5) returns -3. The value of Math.round(_x_) is the same as the + value of Math.floor(_x_+0.5), except when _x_ is -0 or is less than 0 but greater than or equal to + -0.5; for these cases Math.round(_x_) returns -0, but Math.floor(_x_+0.5) returns +0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the number value that is closest to _x_ and is equal to a mathematical integer. + + +--- + +### sign(Number) +- static sign(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the sign of _x_, indicating whether _x_ is positive, negative, or zero. + + - If _x_is NaN, the result is NaN. + - If _x_is -0, the result is -0. + - If _x_is +0, the result is +0. + - If _x_is negative and not -0, the result is -1. + - If _x_is positive and not +0, the result is +1. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the sign of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### sin(Number) +- static sin(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the sine of _x_. The argument is expressed in radians. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞or -∞, the result is NaN. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the sine of _x_. + + +--- + +### sinh(Number) +- static sinh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the hyperbolic sine of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + - If _x_is -∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the hyperbolic sine of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### sqrt(Number) +- static sqrt(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the square root of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_isless than 0, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +∞. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the square root of _x_. + + +--- + +### tan(Number) +- static tan(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the tangent of _x_. The argument is expressed in radians. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞or -∞, the result is NaN. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the tangent of _x_. + + +--- + +### tanh(Number) +- static tanh(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns an approximation to the hyperbolic tangent of _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is +0, the result is +0. + - If _x_is -0, the result is -0. + - If _x_is +∞, the result is +1. + - If _x_is -∞, the result is -1. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - an approximation to the hyperbolic tangent of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### trunc(Number) +- static trunc(x: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the integral part of the number _x_, removing any fractional digits. If _x_ is already an integer, the result is _x_. + + - If _x_is NaN, the result is NaN. + - If _x_is -0, the result is -0. + - If _x_is +0, the result is +0. + - If _x_is -∞, the result is -∞. + - If _x_is +∞, the result is +∞. + - If _x_is greater than 0 but less than 1, the result is +0. + - If _x_is less than 0 but greater than -1, the result is -0. + + + **Parameters:** + - x - the Number to operate on. + + **Returns:** + - the integral part of the number of _x_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Module.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Module.md new file mode 100644 index 00000000..2bd20981 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Module.md @@ -0,0 +1,152 @@ + +# Class Module + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Module](TopLevel.Module.md) + +CommonJS modules are JavaScript files that are loaded using the [require(String)](TopLevel.global.md#requirestring) +function. This function returns a module object, which wraps the script code from the file. Within a module +implementation, the module object can be accessed via the [module](TopLevel.global.md#module) variable. + + +A module has a unique absolute id. The same module may be resolved by [require(String)](TopLevel.global.md#requirestring) +for different path arguments, like relative paths (starting with "./" or "../"), or absolute paths. See the +documentation of require for more details about the lookup procedure. + + +Every module object has an [exports](TopLevel.Module.md#exports) property which can be used by the module implementation to expose its +public functions or properties. Only functions and properties that are explicitly exported are accessible from other +modules, all others are private and not visible. For convenience, the global [exports](TopLevel.global.md#exports) variable +is by default also initialized with the [module.exports](TopLevel.Module.md#exports) property of the current module. +In the most simple case, module elements can be exposed by adding them to the exports object, like: + + +``` +// Greeting.js +exports.sayHello = function() { + return 'Hello World!'; +}; +``` + + +This is equivalent to: + + +``` +// Greeting.js +module.exports.sayHello = function() { + return 'Hello World!'; +}; +``` + + +With the above implementation, a caller (for example another module in the same directory) could call the module +function like this: + + +``` +var message = require('./Greeting').sayHello(); +``` + + +It is also possible to replace the whole module exports object with a completely different value, for example with a +function: + + +``` +// Greeting.js +module.exports = function sayHello() { + return 'Hi!'; +} +``` + + +Now the result of require would be a function, which can be invoked directly like: + + +``` +var message = require('./Greeting')(); +``` + + +This construction can be used for exporting constructor functions, so that a module becomes something like a class: + + +``` +// Greeting.js +function Greeting() +{ + this.message = 'Hi!'; +} + +Greeting.prototype.getMessage = function() { + return this.message; +} + +module.exports = Greeting; +``` + + +which would be used like: + + +``` +var Greeting = require('./Greeting'); +var m = new Greeting().getMessage(); +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [cartridge](#cartridge): [String](TopLevel.String.md) | The name of the cartridge which contains the module. | +| [exports](#exports): [Object](TopLevel.Object.md) | The exports of the module. | +| [id](#id): [String](TopLevel.String.md) | The absolute, normalized id of the module, which uniquely identifies it. | +| [superModule](#supermodule): [Module](TopLevel.Module.md) | The module (if exists) that is overridden by this module. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### cartridge +- cartridge: [String](TopLevel.String.md) + - : The name of the cartridge which contains the module. + + +--- + +### exports +- exports: [Object](TopLevel.Object.md) + - : The exports of the module. + + +--- + +### id +- id: [String](TopLevel.String.md) + - : The absolute, normalized id of the module, which uniquely identifies it. A call to the + [global.require(String)](TopLevel.global.md#requirestring) function with this id would resolve this module. + + + +--- + +### superModule +- superModule: [Module](TopLevel.Module.md) + - : The module (if exists) that is overridden by this module. The super module would have the same path as the + current module but its code location would be checked later in the lookup sequence. This property is useful to + reuse functionality implemented in overridden modules. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Namespace.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Namespace.md new file mode 100644 index 00000000..a02ff9bd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Namespace.md @@ -0,0 +1,152 @@ + +# Class Namespace + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Namespace](TopLevel.Namespace.md) + +Namespace objects represent XML namespaces and provide an +association between a namespace prefix and a Unique Resource +Identifier (URI). The prefix is either the undefined value +or a string value that may be used to reference the namespace +within the lexical representation of an XML value. When an +XML object containing a namespace with an undefined prefix is +encoded as XML by the method toXMLString(), the implementation +will automatically generate a prefix. +The URI is a string value used to uniquely identify the namespace. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [prefix](#prefix): [String](TopLevel.String.md) `(read-only)` | Returns the prefix of the Namespace object. | +| [uri](#uri): [String](TopLevel.String.md) `(read-only)` | Returns the Uniform Resource Identifier (URI) of the Namespace object. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Namespace](#namespace)() | Constructs a simple namespace where the _uri_ and _prefix_ properties are set to an empty string. | +| [Namespace](#namespaceobject)([Object](TopLevel.Object.md)) | Constructs a Namespace object and assigns values to the _uri_ and _prefix_ properties based on the type of _uriValue_. | +| [Namespace](#namespaceobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Constructs a Namespace object and assigns values to the _uri_ and _prefix_ properties. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getPrefix](TopLevel.Namespace.md#getprefix)() | Returns the prefix of the Namespace object. | +| [getUri](TopLevel.Namespace.md#geturi)() | Returns the Uniform Resource Identifier (URI) of the Namespace object. | +| [toString](TopLevel.Namespace.md#tostring)() | Returns a string representation of this Namespace object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### prefix +- prefix: [String](TopLevel.String.md) `(read-only)` + - : Returns the prefix of the Namespace object. + + +--- + +### uri +- uri: [String](TopLevel.String.md) `(read-only)` + - : Returns the Uniform Resource Identifier (URI) of the Namespace object. + + +--- + +## Constructor Details + +### Namespace() +- Namespace() + - : Constructs a simple namespace where the + _uri_ and _prefix_ properties are set to an empty string. + A namespace with URI set to the empty string represents no namespace. + No namespace is used in XML objects to explicitly specify + that a name is not inside a namespace and may never be + associated with a prefix other than the empty string. + + + +--- + +### Namespace(Object) +- Namespace(uriValue: [Object](TopLevel.Object.md)) + - : Constructs a Namespace object and assigns values to the + _uri_ and _prefix_ properties based on the type + of _uriValue_. If _uriValue_ is a + Namespace object, a copy of the Namespace is constructed. + If _uriValue_ is a QName object, the _uri_ property is + set to the QName object's _uri_ property. + Otherwise, _uriValue_ is converted into a string and + assigned to the _uri_ property. + + + **Parameters:** + - uriValue - the value to use when constructing the Namespace. + + +--- + +### Namespace(Object, Object) +- Namespace(prefixValue: [Object](TopLevel.Object.md), uriValue: [Object](TopLevel.Object.md)) + - : Constructs a Namespace object and assigns values to the + _uri_ and _prefix_ properties. + + The value of the _prefixValue_ parameter is assigned to the + _prefix_ property in the following manner: + + 1. If undefined is passed, prefix is set to undefined. + 2. If the argument is a valid XML name, it is converted to a string and assigned to the prefix property. + 3. If the argument is not a valid XML name, the prefix property is set to undefined. + + The value of the _uriValue_ parameter is assigned + to the _uri_ property in the following manner: + + 1. If a QName object is passed for the uriValue parameter, the uri property is set to the value of the QName object's uri property. + 2. If a QName object is not passed for the uriValue parameter, the uriValue parameter is converted to a string and assigned to the uri property. + + + **Parameters:** + - prefixValue - the prefix value to use when constructing the Namespace. + - uriValue - the value to use when constructing the Namespace. + + +--- + +## Method Details + +### getPrefix() +- getPrefix(): [String](TopLevel.String.md) + - : Returns the prefix of the Namespace object. + + **Returns:** + - the prefix of the Namespace object. + + +--- + +### getUri() +- getUri(): [String](TopLevel.String.md) + - : Returns the Uniform Resource Identifier (URI) of the Namespace object. + + **Returns:** + - the Uniform Resource Identifier (URI) of the Namespace object. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a string representation of this Namespace object. + + **Returns:** + - a string representation of this Namespace object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Number.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Number.md new file mode 100644 index 00000000..0084eb1f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Number.md @@ -0,0 +1,404 @@ + +# Class Number + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Number](TopLevel.Number.md) + +A Number object represents any numerical value, whether it is an integer +or floating-point number. Generally, you do not need to worry about a Number +object because a numerical value automatically becomes a Number object instance +when you use a numerical value or assign it to a variable. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [EPSILON](#epsilon): [Number](TopLevel.Number.md) | EPSILON is the Number value for the magnitude of the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 × 10-16. | +| [MAX_SAFE_INTEGER](#max_safe_integer): [Number](TopLevel.Number.md) | The maximum safe integer in JavaScript. | +| [MAX_VALUE](#max_value): [Number](TopLevel.Number.md) | The largest representable Number. | +| [MIN_SAFE_INTEGER](#min_safe_integer): [Number](TopLevel.Number.md) | The minimum safe integer in JavaScript. | +| [MIN_VALUE](#min_value): [Number](TopLevel.Number.md) | The smallest representable Number. | +| [NEGATIVE_INFINITY](#negative_infinity): [Number](TopLevel.Number.md) | Negative infinite value; returned on overflow; | +| [NaN](#nan): [Number](TopLevel.Number.md) | Not a Number. | +| [POSITIVE_INFINITY](#positive_infinity): [Number](TopLevel.Number.md) | Negative infinite value; returned on overflow; | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Number](#number)() | Constructs a Number with value 0 | +| [Number](#numbernumber)([Number](TopLevel.Number.md)) | Constructs a new Number using the specified Number. | +| [Number](#numberstring)([String](TopLevel.String.md)) | Constructs a Number using the specified value. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [isFinite](TopLevel.Number.md#isfiniteobject)([Object](TopLevel.Object.md)) | Determines whether the passed value is a finite number. | +| static [isInteger](TopLevel.Number.md#isintegerobject)([Object](TopLevel.Object.md)) | Determines whether the passed value is an integer number. | +| static [isNaN](TopLevel.Number.md#isnanobject)([Object](TopLevel.Object.md)) | Determines whether the passed value is `NaN`. | +| static [isSafeInteger](TopLevel.Number.md#issafeintegerobject)([Object](TopLevel.Object.md)) | Determines whether the passed value is a safe integer number. | +| static [parseFloat](TopLevel.Number.md#parsefloatstring)([String](TopLevel.String.md)) | Parses a String into an float Number. | +| static [parseInt](TopLevel.Number.md#parseintstring)([String](TopLevel.String.md)) | Parses a String into an integer Number. | +| static [parseInt](TopLevel.Number.md#parseintstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Parses a String into an integer Number using the specified radix. | +| [toExponential](TopLevel.Number.md#toexponential)() | Converts this Number to a String using exponential notation. | +| [toExponential](TopLevel.Number.md#toexponentialnumber)([Number](TopLevel.Number.md)) | Converts this Number to a String using exponential notation with the specified number of digits after the decimal place. | +| [toFixed](TopLevel.Number.md#tofixed)() | Converts a Number to a String that contains a no fractional part. | +| [toFixed](TopLevel.Number.md#tofixednumber)([Number](TopLevel.Number.md)) | Converts a Number to a String that contains a specified number of digits after the decimal place. | +| [toLocaleString](TopLevel.Number.md#tolocalestring)() | Converts this Number to a String using local number formatting conventions. | +| [toPrecision](TopLevel.Number.md#toprecisionnumber)([Number](TopLevel.Number.md)) | Converts a Number to a String using the specified number of significant digits. | +| [toString](TopLevel.Number.md#tostring)() | A String representation of this Number. | +| [toString](TopLevel.Number.md#tostringnumber)([Number](TopLevel.Number.md)) | Converts the number into a string using the specified radix (base). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### EPSILON + +- EPSILON: [Number](TopLevel.Number.md) + - : EPSILON is the Number value for the magnitude of the difference between 1 and the smallest + value greater than 1 that is representable as a Number value, which is approximately + 2.2204460492503130808472633361816 × 10-16. + + + **API Version:** +:::note +Available from version 22.7. +::: + +--- + +### MAX_SAFE_INTEGER + +- MAX_SAFE_INTEGER: [Number](TopLevel.Number.md) + - : The maximum safe integer in JavaScript. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### MAX_VALUE + +- MAX_VALUE: [Number](TopLevel.Number.md) + - : The largest representable Number. + + +--- + +### MIN_SAFE_INTEGER + +- MIN_SAFE_INTEGER: [Number](TopLevel.Number.md) + - : The minimum safe integer in JavaScript. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### MIN_VALUE + +- MIN_VALUE: [Number](TopLevel.Number.md) + - : The smallest representable Number. + + +--- + +### NEGATIVE_INFINITY + +- NEGATIVE_INFINITY: [Number](TopLevel.Number.md) + - : Negative infinite value; returned on overflow; + + +--- + +### NaN + +- NaN: [Number](TopLevel.Number.md) + - : Not a Number. + + +--- + +### POSITIVE_INFINITY + +- POSITIVE_INFINITY: [Number](TopLevel.Number.md) + - : Negative infinite value; returned on overflow; + + +--- + +## Constructor Details + +### Number() +- Number() + - : Constructs a Number with value 0 + + +--- + +### Number(Number) +- Number(num: [Number](TopLevel.Number.md)) + - : Constructs a new Number using the specified Number. + + **Parameters:** + - num - the Number to use. + + +--- + +### Number(String) +- Number(value: [String](TopLevel.String.md)) + - : Constructs a Number using the specified value. + + **Parameters:** + - value - the value to use when creating the Number. + + +--- + +## Method Details + +### isFinite(Object) +- static isFinite(value: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Determines whether the passed value is a finite number. + + **Parameters:** + - value - The value to check. + + **Returns:** + - `true` if the passed value is a finite number, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### isInteger(Object) +- static isInteger(value: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Determines whether the passed value is an integer number. + + **Parameters:** + - value - The value to check. + + **Returns:** + - `true` if the passed value is a finite integer number, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### isNaN(Object) +- static isNaN(value: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Determines whether the passed value is `NaN`. Unlike the global function, the passed parameter is not converted to number before doing the check. + + **Parameters:** + - value - The value to check. + + **Returns:** + - `true` if the passed value is the `NaN` number value, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### isSafeInteger(Object) +- static isSafeInteger(value: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Determines whether the passed value is a safe integer number. + + **Parameters:** + - value - The value to check. + + **Returns:** + - `true` if the passed value is a safe integer number, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### parseFloat(String) +- static parseFloat(s: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Parses a String into an float Number. + + **Parameters:** + - s - the String to parse. + + **Returns:** + - Returns the float as a Number. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### parseInt(String) +- static parseInt(s: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Parses a String into an integer Number. + This function is a short form for the call to [parseInt(String, Number)](TopLevel.Number.md#parseintstring-number) with automatic determination of the radix. + If the string starts with "0x" or "0X" then the radix is 16. In all other cases the radix is 10. + + + **Parameters:** + - s - the String to parse. + + **Returns:** + - Returns the integer as a Number. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### parseInt(String, Number) +- static parseInt(s: [String](TopLevel.String.md), radix: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Parses a String into an integer Number using the + specified radix. + + + **Parameters:** + - s - the String to parse. + - radix - the radix to use. + + **Returns:** + - Returns the integer as a Number. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### toExponential() +- toExponential(): [String](TopLevel.String.md) + - : Converts this Number to a String using exponential notation. + + **Returns:** + - a String using exponential notation. + + +--- + +### toExponential(Number) +- toExponential(digits: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Converts this Number to a String using exponential notation with + the specified number of digits after the decimal place. + + + **Parameters:** + - digits - the number of digits after the decimal place. + + **Returns:** + - a String using exponential notation with + the specified number of digits after the decimal place. + + + +--- + +### toFixed() +- toFixed(): [String](TopLevel.String.md) + - : Converts a Number to a String that contains a no fractional part. + + **Returns:** + - a String representation of the number + + +--- + +### toFixed(Number) +- toFixed(digits: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Converts a Number to a String that contains a specified number + of digits after the decimal place. + + + **Parameters:** + - digits - the number of digits after the decimal place. + + **Returns:** + - a String that contains a specified number + of digits after the decimal place. + + + +--- + +### toLocaleString() +- toLocaleString(): [String](TopLevel.String.md) + - : Converts this Number to a String using local number formatting conventions. + + The current implementation actually only returns the same as [toString()](TopLevel.Number.md#tostring). + + + **Returns:** + - a String using local number formatting conventions. + + +--- + +### toPrecision(Number) +- toPrecision(precision: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Converts a Number to a String using the specified number + of significant digits. Uses exponential or fixed point + notation depending on the size of the number and the number of + significant digits specified. + + + **Parameters:** + - precision - the precision to use when converting the Number to a String. + + **Returns:** + - a String using the specified number + of significant digits. + + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : A String representation of this Number. + + **Returns:** + - a String representation of this Number. + + +--- + +### toString(Number) +- toString(radix: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Converts the number into a string using the specified radix (base). + + **Parameters:** + - radix - the radix to use. + + **Returns:** + - a String representation of this Number. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Object.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Object.md new file mode 100644 index 00000000..72b516d6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Object.md @@ -0,0 +1,472 @@ + +# Class Object + +- [TopLevel.Object](TopLevel.Object.md) + +The _Object_ object is the foundation of all native JavaScript objects. Also, +the _Object_ object can be used to generate items in your scripts with behaviors +that are defined by custom properties and/or methods. You generally start by creating +a blank object with the constructor function and then assign values to new properties +of that object. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Object](#object)() | Object constructor. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [assign](TopLevel.Object.md#assignobject-object)([Object](TopLevel.Object.md), [Object...](TopLevel.Object.md)) | Copies the values of all of the enumerable own properties from one or more source objects to a target object. | +| static [create](TopLevel.Object.md#createobject)([Object](TopLevel.Object.md)) | Creates a new object based on a prototype object. | +| static [create](TopLevel.Object.md#createobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Creates a new object based on a prototype object and additional property definitions. | +| static [defineProperties](TopLevel.Object.md#definepropertiesobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Defines or modifies properties of the passed object. | +| static [defineProperty](TopLevel.Object.md#definepropertyobject-object-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Defines or modifies a single property of the passed object. | +| static [entries](TopLevel.Object.md#entriesobject)([Object](TopLevel.Object.md)) | Returns the enumerable property names and their values of the passed object. | +| static [freeze](TopLevel.Object.md#freezeobject)([Object](TopLevel.Object.md)) | Freezes the passed object. | +| static [fromEntries](TopLevel.Object.md#fromentriesiterable)([Iterable](TopLevel.Iterable.md)) | Creates a new object with defined properties. | +| static [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Returns the descriptor for a single property of the passed object. | +| static [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject)([Object](TopLevel.Object.md)) | Returns an arrays containing the names of all enumerable and non-enumerable properties owned by the passed object. | +| static [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject)([Object](TopLevel.Object.md)) | Returns an array containing the symbol of all symbol properties owned by the passed object. | +| static [getPrototypeOf](TopLevel.Object.md#getprototypeofobject)([Object](TopLevel.Object.md)) | Returns the prototype of the passed object. | +| [hasOwnProperty](TopLevel.Object.md#hasownpropertystring)([String](TopLevel.String.md)) | Returns Boolean true if at the time the current object's instance was created its constructor (or literal assignment) contained a property with a name that matches the parameter value. | +| static [is](TopLevel.Object.md#isobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Checks if the two values are equal in terms of being the same value. | +| static [isExtensible](TopLevel.Object.md#isextensibleobject)([Object](TopLevel.Object.md)) | Returns if new properties can be added to an object. | +| static [isFrozen](TopLevel.Object.md#isfrozenobject)([Object](TopLevel.Object.md)) | Returns if the object is frozen. | +| [isPrototypeOf](TopLevel.Object.md#isprototypeofobject)([Object](TopLevel.Object.md)) | Returns true if the current object and the object passed as a prameter conincide at some point along each object's prototype inheritance chain. | +| static [isSealed](TopLevel.Object.md#issealedobject)([Object](TopLevel.Object.md)) | Returns if the object is sealed. | +| static [keys](TopLevel.Object.md#keysobject)([Object](TopLevel.Object.md)) | Returns the enumerable property names of the passed object. | +| static [preventExtensions](TopLevel.Object.md#preventextensionsobject)([Object](TopLevel.Object.md)) | Makes the passed object non-extensible. | +| [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring)([String](TopLevel.String.md)) | Return true if the specified property exposes itself to for/in property inspection through the object. | +| static [seal](TopLevel.Object.md#sealobject)([Object](TopLevel.Object.md)) | Seals the passed object. | +| static [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Changes the prototype of the passed object. | +| [toLocaleString](TopLevel.Object.md#tolocalestring)() | Converts the object to a localized String. | +| [toString](TopLevel.Object.md#tostring)() | Converts the object to a String. | +| [valueOf](TopLevel.Object.md#valueof)() | Returns the object's value. | +| static [values](TopLevel.Object.md#valuesobject)([Object](TopLevel.Object.md)) | Returns the enumerable property values of the passed object. | + +## Constructor Details + +### Object() +- Object() + - : Object constructor. + + +--- + +## Method Details + +### assign(Object, Object...) +- static assign(target: [Object](TopLevel.Object.md), sources: [Object...](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Copies the values of all of the enumerable own properties from one or more source objects to a target object. + + **Parameters:** + - target - The target object. + - sources - The source objects. + + **Returns:** + - The target object. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### create(Object) +- static create(prototype: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Creates a new object based on a prototype object. + + **Parameters:** + - prototype - The prototype for the new object. + + **Returns:** + - The newly created object. + + +--- + +### create(Object, Object) +- static create(prototype: [Object](TopLevel.Object.md), properties: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Creates a new object based on a prototype object and additional property definitions. + The properties are given in the same format as described for [defineProperties(Object, Object)](TopLevel.Object.md#definepropertiesobject-object). + + + **Parameters:** + - prototype - The prototype for the new object. + - properties - The property definitions. + + **Returns:** + - The newly created object. + + +--- + +### defineProperties(Object, Object) +- static defineProperties(object: [Object](TopLevel.Object.md), properties: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Defines or modifies properties of the passed object. + A descriptor for a property supports these properties: configurable, enumerable, value, writable, set and get. + + + **Parameters:** + - object - The object to change. + - properties - The new property definitions. + + **Returns:** + - The modified object. + + +--- + +### defineProperty(Object, Object, Object) +- static defineProperty(object: [Object](TopLevel.Object.md), propertyKey: [Object](TopLevel.Object.md), descriptor: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Defines or modifies a single property of the passed object. + A descriptor for a property supports these properties: configurable, enumerable, value, writable, set and get. + + + **Parameters:** + - object - The object to change. + - propertyKey - The property name. + - descriptor - The property descriptor object. + + **Returns:** + - The modified object. + + +--- + +### entries(Object) +- static entries(object: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns the enumerable property names and their values of the passed object. + + **Parameters:** + - object - The object to get the enumerable property names from. + + **Returns:** + - An array of key/value pairs ( as two element arrays ) that holds all the enumerable properties of the given object. + + **API Version:** +:::note +Available from version 22.7. +::: + +--- + +### freeze(Object) +- static freeze(object: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Freezes the passed object. Properties can't be added or removed from the frozen object. Also, definitions of + existing object properties can't be changed. Although property values are immutable, setters and getters can be + called. + + + **Parameters:** + - object - The object to be frozen. + + **Returns:** + - The frozen object. + + +--- + +### fromEntries(Iterable) +- static fromEntries(properties: [Iterable](TopLevel.Iterable.md)): [Object](TopLevel.Object.md) + - : Creates a new object with defined properties. The properties are defined by an iterable that produces two element array like objects, which are the key-value pairs. + Iterables are e.g. [Array](TopLevel.Array.md), [Map](TopLevel.Map.md) or any other [Iterable](TopLevel.Iterable.md). + + + **Parameters:** + - properties - The properties. + + **Returns:** + - The newly created object. + + **API Version:** +:::note +Available from version 22.7. +::: + +--- + +### getOwnPropertyDescriptor(Object, Object) +- static getOwnPropertyDescriptor(object: [Object](TopLevel.Object.md), propertyKey: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Returns the descriptor for a single property of the passed object. + + **Parameters:** + - object - The property owning object. + - propertyKey - The property to look for. + + **Returns:** + - The descriptor object for the property or `undefined` if the property does not exist. + + +--- + +### getOwnPropertyNames(Object) +- static getOwnPropertyNames(object: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns an arrays containing the names of all enumerable and non-enumerable properties owned by the passed object. + + **Parameters:** + - object - The object owning properties. + + **Returns:** + - An array of strings that are the properties found directly in the passed object. + + +--- + +### getOwnPropertySymbols(Object) +- static getOwnPropertySymbols(object: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns an array containing the symbol of all symbol properties owned by the passed object. + + **Parameters:** + - object - The object owning properties. + + **Returns:** + - An array of symbol properties found directly in the passed object. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### getPrototypeOf(Object) +- static getPrototypeOf(object: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Returns the prototype of the passed object. + + **Parameters:** + - object - The object to get the prototype from. + + **Returns:** + - The prototype object or `null` if there is none. + + +--- + +### hasOwnProperty(String) +- hasOwnProperty(propName: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns Boolean true if at the time the current object's instance was created + its constructor (or literal assignment) contained a property with a name that + matches the parameter value. + + + **Parameters:** + - propName - the property name of the object's property. + + **Returns:** + - true if at the object contains a property that matches the parameter, + false otherwise. + + + +--- + +### is(Object, Object) +- static is(value1: [Object](TopLevel.Object.md), value2: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Checks if the two values are equal in terms of being the same value. No coercion is performed, thus -0 and + +0 is not equal and NaN is equal to NaN. + + + **Parameters:** + - value1 - The first value. + - value2 - The second value. + + **Returns:** + - `true` if both values are the same value else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### isExtensible(Object) +- static isExtensible(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if new properties can be added to an object. By default new objects are extensible. The methods + [freeze(Object)](TopLevel.Object.md#freezeobject), [seal(Object)](TopLevel.Object.md#sealobject) and [preventExtensions(Object)](TopLevel.Object.md#preventextensionsobject) make objects + non-extensible. + + + **Parameters:** + - object - The object to check. + + **Returns:** + - `true` if new properties can be added else `false`. + + +--- + +### isFrozen(Object) +- static isFrozen(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if the object is frozen. + + **Parameters:** + - object - The object to check. + + **Returns:** + - `true` if the object is frozen else `false`. + + +--- + +### isPrototypeOf(Object) +- isPrototypeOf(prototype: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the current object and the object passed as a prameter conincide + at some point along each object's prototype inheritance chain. + + + **Parameters:** + - prototype - the object to test. + + **Returns:** + - true if the current object and the object passed as a prameter conincide + at some point, false otherwise. + + + +--- + +### isSealed(Object) +- static isSealed(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if the object is sealed. + + **Parameters:** + - object - The object to check. + + **Returns:** + - `true` if the object is sealed else `false`. + + +--- + +### keys(Object) +- static keys(object: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns the enumerable property names of the passed object. + + **Parameters:** + - object - The object to get the enumerable property names from. + + **Returns:** + - An array of strings that holds all the enumerable properties of the given object. + + +--- + +### preventExtensions(Object) +- static preventExtensions(object: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Makes the passed object non-extensible. This means that no new properties can be added to this object. + + **Parameters:** + - object - The object to make non-extensible. + + **Returns:** + - The passed object. + + +--- + +### propertyIsEnumerable(String) +- propertyIsEnumerable(propName: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Return true if the specified property exposes itself to for/in property + inspection through the object. + + + **Parameters:** + - propName - the property to test. + + **Returns:** + - true if the specified property exposes itself to for/in property + inspection through the object, false otherwise. + + + +--- + +### seal(Object) +- static seal(object: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Seals the passed object. This means properties can't be added or removed. Also, property definitions of + existing properties can't be changed. + + + **Parameters:** + - object - The object to be frozen. + + **Returns:** + - The sealed object. + + +--- + +### setPrototypeOf(Object, Object) +- static setPrototypeOf(object: [Object](TopLevel.Object.md), prototype: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Changes the prototype of the passed object. + + **Parameters:** + - object - The object whose prototype should change. + - prototype - The object to set as the new prototype. + + **Returns:** + - The object with the changed prototype. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### toLocaleString() +- toLocaleString(): [String](TopLevel.String.md) + - : Converts the object to a localized String. + + **Returns:** + - a localized version of the object. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Converts the object to a String. + + **Returns:** + - the String representation of the object. + + +--- + +### valueOf() +- valueOf(): [Object](TopLevel.Object.md) + - : Returns the object's value. + + **Returns:** + - the object's value. + + +--- + +### values(Object) +- static values(object: [Object](TopLevel.Object.md)): [Array](TopLevel.Array.md) + - : Returns the enumerable property values of the passed object. + + **Parameters:** + - object - The object to get the enumerable property values from. + + **Returns:** + - An array of values that holds all the enumerable properties of the given object. + + **API Version:** +:::note +Available from version 22.7. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.QName.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.QName.md new file mode 100644 index 00000000..4e7d5721 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.QName.md @@ -0,0 +1,147 @@ + +# Class QName + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.QName](TopLevel.QName.md) + +QName objects are used to represent qualified names of XML +elements and attributes. Each QName object has a local name +of type string and a namespace URI of type string or null. +When the namespace URI is null, this qualified name matches +any namespace. + +If the QName of an XML element is specified without identifying a +namespace (i.e., as an unqualified identifier), the uri property +of the associated QName will be set to the in-scope default +namespace. If the QName of an XML attribute is +specified without identifying a namespace, the uri property of +the associated QName will be the empty string representing no namespace. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [localName](#localname): [String](TopLevel.String.md) `(read-only)` | Returns the local name of the QName object. | +| [uri](#uri): [String](TopLevel.String.md) `(read-only)` | Returns the Uniform Resource Identifier (URI) of the QName object. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [QName](#qname)() | Constructs a QName object where _localName_ is set to an empty String. | +| [QName](#qnameqname)([QName](TopLevel.QName.md)) | Constructs a QName object that is a copy of the specified _qname_. | +| [QName](#qnamenamespace-qname)([Namespace](TopLevel.Namespace.md), [QName](TopLevel.QName.md)) | Creates a QName object with a uri from a Namespace object and a localName from a QName object. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getLocalName](TopLevel.QName.md#getlocalname)() | Returns the local name of the QName object. | +| [getUri](TopLevel.QName.md#geturi)() | Returns the Uniform Resource Identifier (URI) of the QName object. | +| [toString](TopLevel.QName.md#tostring)() | Returns a string composed of the URI, and the local name for the QName object, separated by "::". | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### localName +- localName: [String](TopLevel.String.md) `(read-only)` + - : Returns the local name of the QName object. + + +--- + +### uri +- uri: [String](TopLevel.String.md) `(read-only)` + - : Returns the Uniform Resource Identifier (URI) of the QName object. + + +--- + +## Constructor Details + +### QName() +- QName() + - : Constructs a QName object where _localName_ + is set to an empty String. + + + +--- + +### QName(QName) +- QName(qname: [QName](TopLevel.QName.md)) + - : Constructs a QName object that is a copy of the specified + _qname_. If the argument is not + a QName object, the argument is converted to a string and assigned + to the localName property of the new QName instance. + + + **Parameters:** + - qname - the QName from which this QName will be constructed. + + +--- + +### QName(Namespace, QName) +- QName(uri: [Namespace](TopLevel.Namespace.md), localName: [QName](TopLevel.QName.md)) + - : Creates a QName object with a uri from a Namespace object and + a localName from a QName object. If either argument is not + the expected data type, the argument is converted to a string + and assigned to the corresponding property of the new QName object. + + + **Parameters:** + - uri - a Namespace object from which to copy the uri value. An argument of any other type is converted to a string. + - localName - a QName object from which to copy the localName value. An argument of any other type is converted to a string. + + +--- + +## Method Details + +### getLocalName() +- getLocalName(): [String](TopLevel.String.md) + - : Returns the local name of the QName object. + + **Returns:** + - the local name of the QName object. + + +--- + +### getUri() +- getUri(): [String](TopLevel.String.md) + - : Returns the Uniform Resource Identifier (URI) of the QName object. + + **Returns:** + - the Uniform Resource Identifier (URI) of the QName object. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a string composed of the URI, and the local name for the QName + object, separated by "::". The format depends on the uri property of + the QName object: + If uri == "" + toString returns localName + else if uri == null + toString returns \*::localName + else + toString returns uri::localNam + + + **Returns:** + - a string composed of the URI, and the local name for the QName + object, separated by "::". + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.RangeError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.RangeError.md new file mode 100644 index 00000000..22497532 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.RangeError.md @@ -0,0 +1,47 @@ + +# Class RangeError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.RangeError](TopLevel.RangeError.md) + +Represents a range error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [RangeError](#rangeerror)() | Constructs the error. | +| [RangeError](#rangeerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### RangeError() +- RangeError() + - : Constructs the error. + + +--- + +### RangeError(String) +- RangeError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the range error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.ReferenceError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ReferenceError.md new file mode 100644 index 00000000..86976b5d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.ReferenceError.md @@ -0,0 +1,47 @@ + +# Class ReferenceError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.ReferenceError](TopLevel.ReferenceError.md) + +Represents a reference error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ReferenceError](#referenceerror)() | Constructs the error. | +| [ReferenceError](#referenceerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### ReferenceError() +- ReferenceError() + - : Constructs the error. + + +--- + +### ReferenceError(String) +- ReferenceError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the reference error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.RegExp.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.RegExp.md new file mode 100644 index 00000000..6a5480af --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.RegExp.md @@ -0,0 +1,155 @@ + +# Class RegExp + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.RegExp](TopLevel.RegExp.md) + +The RegExp object is a static object that generates instances of a regular +expression for pattern matching and monitors all regular expressions in the +current window or frame. Consult ECMA standards for the format of the pattern +strings supported by these regular expressions. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [global](#global): [Boolean](TopLevel.Boolean.md) | If the regular expression instance has the _g_ modifier, then this property is set to true. | +| [ignoreCase](#ignorecase): [Boolean](TopLevel.Boolean.md) | If the regular expression instance has the _i_ modifier, then this property is set to true. | +| [lastIndex](#lastindex): [Number](TopLevel.Number.md) | This is the zero-based index value of the character within the String where the next search for the pattern begins. | +| [multiline](#multiline): [Boolean](TopLevel.Boolean.md) | If a search extends across multiple lines of test, the _multiline_ property is set to true. | +| [source](#source): [String](TopLevel.String.md) | A String version of the characters used to create the regular expression. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [RegExp](#regexpstring)([String](TopLevel.String.md)) | Constructs the regular expression using the specified pattern. | +| [RegExp](#regexpstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs the regular expression using the specified pattern and attributes. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [exec](TopLevel.RegExp.md#execstring)([String](TopLevel.String.md)) | Performs a search through the specified parameter for the current regular expression and returns an array of match information if successful. | +| [test](TopLevel.RegExp.md#teststring)([String](TopLevel.String.md)) | Returns true if there is a match of the regular expression anywhere in the specified parameter. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### global +- global: [Boolean](TopLevel.Boolean.md) + - : If the regular expression instance has the _g_ modifier, then + this property is set to true. + + + +--- + +### ignoreCase +- ignoreCase: [Boolean](TopLevel.Boolean.md) + - : If the regular expression instance has the _i_ modifier, then + this property is set to true. + + + +--- + +### lastIndex +- lastIndex: [Number](TopLevel.Number.md) + - : This is the zero-based index value of the character within the + String where the next search for the pattern begins. In a new + search, the value is zero. + + + +--- + +### multiline +- multiline: [Boolean](TopLevel.Boolean.md) + - : If a search extends across multiple lines of test, the _multiline_ + property is set to true. + + + +--- + +### source +- source: [String](TopLevel.String.md) + - : A String version of the characters used to create the regular + expression. The value does not include the forward slash delimiters that + surround the expression. + + + +--- + +## Constructor Details + +### RegExp(String) +- RegExp(pattern: [String](TopLevel.String.md)) + - : Constructs the regular expression using the specified + pattern. + + + **Parameters:** + - pattern - the regular expression pattern to use. + + +--- + +### RegExp(String, String) +- RegExp(pattern: [String](TopLevel.String.md), attributes: [String](TopLevel.String.md)) + - : Constructs the regular expression using the specified + pattern and attributes. See the class documentation for more information + on the pattern and attributes. + + + **Parameters:** + - pattern - the regular expression pattern to use. + - attributes - one or more attributes that control how the regular expression is executed. + + +--- + +## Method Details + +### exec(String) +- exec(string: [String](TopLevel.String.md)): [Array](TopLevel.Array.md) + - : Performs a search through the specified parameter for the + current regular expression and returns an array of match + information if successful. Returns null if the search produces + no results. + + + **Parameters:** + - string - the String to apply the regular expression. + + **Returns:** + - an array of match information if successful, null otherwise. + + +--- + +### test(String) +- test(string: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if there is a match of the regular expression anywhere in the + specified parameter. No additional information is + available about the results of the search. + + + **Parameters:** + - string - the String to apply the regular expression. + + **Returns:** + - true if there is a match of the regular expression anywhere in the + specified parameter, false otherwise. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Set.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Set.md new file mode 100644 index 00000000..834b43db --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Set.md @@ -0,0 +1,150 @@ + +# Class Set + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Set](TopLevel.Set.md) + +A Set can store any kind of element and ensures that no duplicates exist. +Objects are stored and iterated in insertion order. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [size](#size): [Number](TopLevel.Number.md) | Number of elements stored in this set. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Set](#set)() | Creates an empty Set. | +| [Set](#setiterable)([Iterable](TopLevel.Iterable.md)) | If the passed value is null or undefined then an empty set is constructed. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [add](TopLevel.Set.md#addobject)([Object](TopLevel.Object.md)) | Adds an element to the set. | +| [clear](TopLevel.Set.md#clear)() | Removes all elements from this set. | +| [delete](TopLevel.Set.md#deleteobject)([Object](TopLevel.Object.md)) | Removes the element from the set. | +| [entries](TopLevel.Set.md#entries)() | Returns an iterator containing all elements of this set. | +| [forEach](TopLevel.Set.md#foreachfunction)([Function](TopLevel.Function.md)) | Runs the provided callback function once for each element present in this set. | +| [forEach](TopLevel.Set.md#foreachfunction-object)([Function](TopLevel.Function.md), [Object](TopLevel.Object.md)) | Runs the provided callback function once for each element present in this set. | +| [has](TopLevel.Set.md#hasobject)([Object](TopLevel.Object.md)) | Returns if this set contains the given object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### size +- size: [Number](TopLevel.Number.md) + - : Number of elements stored in this set. + + +--- + +## Constructor Details + +### Set() +- Set() + - : Creates an empty Set. + + +--- + +### Set(Iterable) +- Set(values: [Iterable](TopLevel.Iterable.md)) + - : If the passed value is null or undefined then an empty set is constructed. Else an iterable object is expected + that delivers the initial set entries. + + + **Parameters:** + - values - The initial set entries. + + +--- + +## Method Details + +### add(Object) +- add(object: [Object](TopLevel.Object.md)): [Set](TopLevel.Set.md) + - : Adds an element to the set. Does nothing if the set already contains the element. + + **Parameters:** + - object - The object to add. + + **Returns:** + - This set object. + + +--- + +### clear() +- clear(): void + - : Removes all elements from this set. + + +--- + +### delete(Object) +- delete(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Removes the element from the set. + + **Parameters:** + - object - The object to be removed. + + **Returns:** + - `true` if the set contained the object that was removed. Else `false` is returned. + + +--- + +### entries() +- entries(): [ES6Iterator](TopLevel.ES6Iterator.md) + - : Returns an iterator containing all elements of this set. + + +--- + +### forEach(Function) +- forEach(callback: [Function](TopLevel.Function.md)): void + - : Runs the provided callback function once for each element present in this set. + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the element (as value), the element (as index), and the Set object being iterated. + + +--- + +### forEach(Function, Object) +- forEach(callback: [Function](TopLevel.Function.md), thisObject: [Object](TopLevel.Object.md)): void + - : Runs the provided callback function once for each element present in this set. + + **Parameters:** + - callback - The function to call, which is invoked with three arguments: the element (as value), the element (as index), and the Set object being iterated. + - thisObject - The Object to use as 'this' when executing callback. + + +--- + +### has(Object) +- has(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if this set contains the given object. + + **Parameters:** + - object - The object to look for. + + **Returns:** + - `true` if the set contains the object else `false` is returned. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.StopIteration.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.StopIteration.md new file mode 100644 index 00000000..4b3266cd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.StopIteration.md @@ -0,0 +1,36 @@ + +# Class StopIteration + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.StopIteration](TopLevel.StopIteration.md) + +A special type of exception that is thrown when an Iterator or Generator +sequence is exhausted. + + +**See Also:** +- [Generator.next()](TopLevel.Generator.md#next) +- [Iterator.next()](TopLevel.Iterator.md#next) + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [StopIteration](#stopiteration)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### StopIteration() +- StopIteration() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.String.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.String.md new file mode 100644 index 00000000..4346ef91 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.String.md @@ -0,0 +1,1060 @@ + +# Class String + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.String](TopLevel.String.md) + +The String object represents any sequence of zero or more characters that are to be +treated strictly as text. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [length](#length): [Number](TopLevel.Number.md) | The length of the String object. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [String](#string)() | Constructs the String. | +| [String](#stringnumber)([Number](TopLevel.Number.md)) | Constructs the String from the specified Number object. | +| [String](#stringstring)([String](TopLevel.String.md)) | Constructs a new String from the specified String object. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [charAt](TopLevel.String.md#charatnumber)([Number](TopLevel.Number.md)) | Returns a string containing the character at position _index_. | +| [charCodeAt](TopLevel.String.md#charcodeatnumber)([Number](TopLevel.Number.md)) | Returns the UTF-16 code unit at the given position index. | +| [codePointAt](TopLevel.String.md#codepointatnumber)([Number](TopLevel.Number.md)) | Returns the Unicode code point at the given position index. | +| [concat](TopLevel.String.md#concatstring)([String...](TopLevel.String.md)) | Returns a new String created by concatenating the string arguments together. | +| [endsWith](TopLevel.String.md#endswithstring)([String](TopLevel.String.md)) | Tests if this string ends with a given string. | +| [endsWith](TopLevel.String.md#endswithstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Tests if this string ends with a given string. | +| [equals](TopLevel.String.md#equalsobject)([Object](TopLevel.Object.md)) | Returns true if this string is equal to the string representation of the passed objects. | +| [equalsIgnoreCase](TopLevel.String.md#equalsignorecaseobject)([Object](TopLevel.Object.md)) | Returns true if this string is equal to the string representation of the passed objects. | +| static [fromCharCode](TopLevel.String.md#fromcharcodenumber)([Number...](TopLevel.Number.md)) | Returns a new String from one or more UTF-16 code units. | +| static [fromCodePoint](TopLevel.String.md#fromcodepointnumber)([Number...](TopLevel.Number.md)) | Returns a new String from one or more characters with Unicode code points. | +| [includes](TopLevel.String.md#includesstring)([String](TopLevel.String.md)) | Returns if _substring_ is contained in this String object. | +| [includes](TopLevel.String.md#includesstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns if _substring_ is contained in this String object. | +| [indexOf](TopLevel.String.md#indexofstring)([String](TopLevel.String.md)) | Returns the index of _substring_ in this String object. | +| [indexOf](TopLevel.String.md#indexofstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns the index of _substring_ in this String object using the specified _start_ value as the location to begin searching. | +| [lastIndexOf](TopLevel.String.md#lastindexofstring)([String](TopLevel.String.md)) | Returns the last index of _substring_ in this String object. | +| [lastIndexOf](TopLevel.String.md#lastindexofstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns the last index of _substring_ in this String object, using the specified _start_ position as the location from which to begin the search. | +| [localeCompare](TopLevel.String.md#localecomparestring)([String](TopLevel.String.md)) | Returns a number indicating whether the current String sorts before, the same as, or after the parameter _other_, based on browser and system-dependent string localization. | +| [match](TopLevel.String.md#matchregexp)([RegExp](TopLevel.RegExp.md)) | Returns an array of strings that match the regular expression _regexp_. | +| [normalize](TopLevel.String.md#normalize)() | Returns the normalized form of this Unicode string. | +| [normalize](TopLevel.String.md#normalizestring)([String](TopLevel.String.md)) | Returns the normalized form of this Unicode string according to the standard as described in [https://unicode.org/reports/tr15/](https://unicode.org/reports/tr15/). | +| [padEnd](TopLevel.String.md#padendnumber)([Number](TopLevel.Number.md)) | Appends space characters to the current string to ensure the resulting string reaches the given target length. | +| [padEnd](TopLevel.String.md#padendnumber-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Appends a string (possibly multiple times) to the current string to ensure the resulting string reaches the given target length. | +| [padStart](TopLevel.String.md#padstartnumber)([Number](TopLevel.Number.md)) | Prepends space characters to the current string to ensure the resulting string reaches the given target length. | +| [padStart](TopLevel.String.md#padstartnumber-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Prepends a string (possibly multiple times) to the current string to ensure the resulting string reaches the given target length. | +| static [raw](TopLevel.String.md#rawobject-string)([Object](TopLevel.Object.md), [String...](TopLevel.String.md)) | The static `String.raw()` method is a tag function of template literals. | +| [repeat](TopLevel.String.md#repeatnumber)([Number](TopLevel.Number.md)) | Returns a new string repeating this string the given number of times. | +| [replace](TopLevel.String.md#replaceregexp-function)([RegExp](TopLevel.RegExp.md), [Function](TopLevel.Function.md)) | Returns a new String that results when matches of the _regexp_ parameter are replaced by using the specified _function_. | +| [replace](TopLevel.String.md#replaceregexp-string)([RegExp](TopLevel.RegExp.md), [String](TopLevel.String.md)) | Returns a new String that results when matches of the _regexp_ parameter are replaced by the _replacement_ parameter. | +| [replace](TopLevel.String.md#replacestring-function)([String](TopLevel.String.md), [Function](TopLevel.Function.md)) | Returns a new String that results when matches of the _literal_ parameter are replaced by using the specified _function_. | +| ~~[replace](TopLevel.String.md#replacestring-function-string)([String](TopLevel.String.md), [Function](TopLevel.Function.md), [String](TopLevel.String.md))~~ | Returns a new String that results when matches of the _literal_ parameter are replaced by using the specified _function_. | +| [replace](TopLevel.String.md#replacestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns a new String that results when matches of the _literal_ parameter are replaced by the _replacement_ parameter. | +| ~~[replace](TopLevel.String.md#replacestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md))~~ | Returns a new String that results when matches of the _literal_ parameter are replaced by the _replacement_ parameter. | +| [search](TopLevel.String.md#searchregexp)([RegExp](TopLevel.RegExp.md)) | Searches for a match between the passed regular expression and this string and returns the zero-based index of the match, or -1 if no match is found. | +| [slice](TopLevel.String.md#slicenumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a substring of the current String where the specified _start_ and _end_ locations are used to delimit the String. | +| [split](TopLevel.String.md#splitregexp)([RegExp](TopLevel.RegExp.md)) | Returns an array of String instances created by splitting the current String based on the regular expression. | +| [split](TopLevel.String.md#splitregexp-number)([RegExp](TopLevel.RegExp.md), [Number](TopLevel.Number.md)) | Returns an array of String instances created by splitting the current String based on the regular expression and limited in size by the _limit_ parameter. | +| [split](TopLevel.String.md#splitstring)([String](TopLevel.String.md)) | Returns an array of String instances created by splitting the current String based on the delimiter. | +| [split](TopLevel.String.md#splitstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns an array of String instances created by splitting the current String based on the delimiter and limited in size by the _limit_ parameter. | +| [startsWith](TopLevel.String.md#startswithstring)([String](TopLevel.String.md)) | Tests if this string starts with a given string. | +| [startsWith](TopLevel.String.md#startswithstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Tests if this string starts with a given string. | +| [substr](TopLevel.String.md#substrnumber)([Number](TopLevel.Number.md)) | Creates and returns a new String by splitting the current string at the specified _start_ location until the end of the String. | +| [substr](TopLevel.String.md#substrnumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates and returns a new String by splitting the current string at the specified _start_ location and limited by the _length_ value. | +| [substring](TopLevel.String.md#substringnumber)([Number](TopLevel.Number.md)) | Creates and returns a new String by splitting the current string at the specified _from_ location until the end of the String. | +| [substring](TopLevel.String.md#substringnumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates and returns a new String by splitting the current string at the specified _from_ location until the specified _to_ location. | +| [toLocaleLowerCase](TopLevel.String.md#tolocalelowercase)() | Returns a copy of the current string in all lower-case letters. | +| [toLocaleUpperCase](TopLevel.String.md#tolocaleuppercase)() | Returns a copy of the current string in all upper-case letters. | +| [toLowerCase](TopLevel.String.md#tolowercase)() | Returns a copy of the current string in all lower-case letters. | +| [toString](TopLevel.String.md#tostring)() | Returns a String value of this object. | +| [toUpperCase](TopLevel.String.md#touppercase)() | Returns a copy of the current string in all upper-case letters. | +| [trim](TopLevel.String.md#trim)() | Removes white space characters at the start and the end of the string. | +| [trimEnd](TopLevel.String.md#trimend)() | Removes white space characters at the end of the string. | +| [trimLeft](TopLevel.String.md#trimleft)() | Removes white space characters at the start of the string. | +| [trimRight](TopLevel.String.md#trimright)() | Removes white space characters at the end of the string. | +| [trimStart](TopLevel.String.md#trimstart)() | Removes white space characters at the start of the string. | +| [valueOf](TopLevel.String.md#valueof)() | Returns a String value of this object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### length +- length: [Number](TopLevel.Number.md) + - : The length of the String object. + + +--- + +## Constructor Details + +### String() +- String() + - : Constructs the String. + + +--- + +### String(Number) +- String(num: [Number](TopLevel.Number.md)) + - : Constructs the String from the specified + Number object. + + + **Parameters:** + - num - the number that will be converted to a String. + + +--- + +### String(String) +- String(str: [String](TopLevel.String.md)) + - : Constructs a new String from the specified + String object. + + + **Parameters:** + - str - the String that will be converted to a new String. + + +--- + +## Method Details + +### charAt(Number) +- charAt(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns a string containing the character at position _index_. + You should use this method instead + of substring when you need only a single character. + + + **Parameters:** + - index - the index at which the character string is located. + + **Returns:** + - a string containing the character at position _index_. + + +--- + +### charCodeAt(Number) +- charCodeAt(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the UTF-16 code unit at the given position index. If the position is invalid `NaN` is returned. + + **Parameters:** + - index - The index of the code unit within the string. + + **Returns:** + - a non-negative integer representing a UTF-16 code unit or `NaN` if the index is not valid. + + +--- + +### codePointAt(Number) +- codePointAt(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the Unicode code point at the given position index. The index is a position within the string in UTF-16 + encoding. If the index points to the begin of a surrogate pair the only the code unit at the position is returned. + If the index is invalid `undefined` is returned. + + + **Parameters:** + - index - The index of the starting code unit within the string. + + **Returns:** + - The Unicode code point, an UTF-16 code unit or `undefined`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### concat(String...) +- concat(strings: [String...](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns a new String created by concatenating the string arguments together. + + **Parameters:** + - strings - zero, one, or more String arguments + + **Returns:** + - a new String created by concatenating the string arguments together. + + +--- + +### endsWith(String) +- endsWith(searchString: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Tests if this string ends with a given string. + + **Parameters:** + - searchString - The characters to be searched for this string. + + **Returns:** + - `true` if the search string was found else `false` + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### endsWith(String, Number) +- endsWith(searchString: [String](TopLevel.String.md), length: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Tests if this string ends with a given string. + + **Parameters:** + - searchString - The characters to be searched for this string. + - length - Assumes this string has only this given length. + + **Returns:** + - `true` if the search string was found else `false` + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### equals(Object) +- equals(obj: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this string is equal to the string representation of the + passed objects. + + + **Parameters:** + - obj - another object, typically another string + + +--- + +### equalsIgnoreCase(Object) +- equalsIgnoreCase(obj: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this string is equal to the string representation of the + passed objects. The comparison is done case insensitive. + + + **Parameters:** + - obj - another object, typically another string + + +--- + +### fromCharCode(Number...) +- static fromCharCode(c: [Number...](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns a new String from one or more UTF-16 code units. + + **Parameters:** + - c - zero, one, or more UTF-16 code units. + + +--- + +### fromCodePoint(Number...) +- static fromCodePoint(c: [Number...](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns a new String from one or more characters with Unicode code points. + + **Parameters:** + - c - zero, one, or more code points. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### includes(String) +- includes(substring: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if _substring_ is contained in this String object. + + **Parameters:** + - substring - the String to search for in this String. + + **Returns:** + - `true` if _substring_ occurs within the current string, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### includes(String, Number) +- includes(substring: [String](TopLevel.String.md), start: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if _substring_ is contained in this String object. + + **Parameters:** + - substring - the String to search for in this String. + - start - the location in the String from which to begin the search. + + **Returns:** + - `true` if _substring_ occurs within the current string, else `false`. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### indexOf(String) +- indexOf(substring: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Returns the index of _substring_ in this String object. + If there is no match, _-1_ is returned. + + + **Parameters:** + - substring - the String to search for in this String. + + **Returns:** + - the index of _substring_ or _-1_. + + +--- + +### indexOf(String, Number) +- indexOf(substring: [String](TopLevel.String.md), start: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the index of _substring_ in this String object using + the specified _start_ value as the location to begin searching. + If there is no match, _-1_ is returned. + + + **Parameters:** + - substring - the String to search for in this String. + - start - the location in the String from which to begin the search. + + **Returns:** + - the index of _substring_ or _-1_. + + +--- + +### lastIndexOf(String) +- lastIndexOf(substring: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Returns the last index of _substring_ in this String object. + If there is no match, _-1_ is returned. + + + **Parameters:** + - substring - the String to search for in this String. + + **Returns:** + - the last index of _substring_ or _-1_. + + +--- + +### lastIndexOf(String, Number) +- lastIndexOf(substring: [String](TopLevel.String.md), start: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the last index of _substring_ in this String object, + using the specified _start_ position as the location from which + to begin the search. + If there is no match, _-1_ is returned. + + + **Parameters:** + - substring - the String to search for in this String. + - start - the location from which to begin the search. + + **Returns:** + - the last index of _substring_ or _-1_. + + +--- + +### localeCompare(String) +- localeCompare(other: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Returns a number indicating whether the current String sorts before, the same as, + or after the parameter _other_, based on browser and system-dependent + string localization. + + + **Parameters:** + - other - the String to compare against this String. + + **Returns:** + - a number indicating whether the current String sorts before, the same as, + or after the parameter _other_. + + + +--- + +### match(RegExp) +- match(regexp: [RegExp](TopLevel.RegExp.md)): [String\[\]](TopLevel.String.md) + - : Returns an array of strings that match the regular expression + _regexp_. + + + **Parameters:** + - regexp - the regular expression to use. + + **Returns:** + - an array of strings that match the regular expression. + + +--- + +### normalize() +- normalize(): [String](TopLevel.String.md) + - : Returns the normalized form of this Unicode string. Same as calling [normalize(String)](TopLevel.String.md#normalizestring) with parameter **'NFC'**. + + **Returns:** + - The normalized form of this Unicode string. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### normalize(String) +- normalize(form: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the normalized form of this Unicode string according to the standard as described in [https://unicode.org/reports/tr15/](https://unicode.org/reports/tr15/). + In a normalized string, identical text is replaced by identical sequences of code points. + + + **Parameters:** + - form - The normalization variant to use. Must be one of **'NFC'**, **'NFD'**, **'NFKC'**, **'NFKD'**. + + **Returns:** + - The normalized form of this Unicode string. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### padEnd(Number) +- padEnd(targetLength: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Appends space characters to the current string to ensure the resulting string reaches the given target length. + + **Parameters:** + - targetLength - The length to be reached. + + **Returns:** + - This string if the string length is already greater than or equal to the target length. Else a new string with the _targetLength_ ending with space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### padEnd(Number, String) +- padEnd(targetLength: [Number](TopLevel.Number.md), fillString: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Appends a string (possibly multiple times) to the current string to ensure the resulting string reaches the given target length. + + **Parameters:** + - targetLength - The length to be reached. + - fillString - The string providing the characters to be used for filling. + + **Returns:** + - This string if the string length is already greater than or equal to the target length. Else a new string with the _targetLength_ with the (possibly multiple times) added and truncated _fillString_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### padStart(Number) +- padStart(targetLength: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Prepends space characters to the current string to ensure the resulting string reaches the given target length. + + **Parameters:** + - targetLength - The length to be reached. + + **Returns:** + - This string if the string length is already greater than or equal to the target length. Else a new string with the _targetLength_ starting with space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### padStart(Number, String) +- padStart(targetLength: [Number](TopLevel.Number.md), fillString: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Prepends a string (possibly multiple times) to the current string to ensure the resulting string reaches the given target length. + + **Parameters:** + - targetLength - The length to be reached. + - fillString - The string providing the characters to be used for filling. + + **Returns:** + - This string if the string length is already greater than or equal to the target length. Else a new string with the _targetLength_ with the (possibly multiple times) added and truncated _fillString_. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### raw(Object, String...) +- static raw(callSite: [Object](TopLevel.Object.md), substitutions: [String...](TopLevel.String.md)): [String](TopLevel.String.md) + - : The static `String.raw()` method is a tag function of template literals. + + + It can be used in different ways: + + ``` + String.raw`Hello\n${40+2}!`; + // returns: Hello\n42! + // \ is here not an escape character like in string literals + + String.raw({ raw: ['a', 'b', 'c'] }, '-', '.' ); + // returns: a-b.c + ``` + + + **Parameters:** + - callSite - A well-formed template call site object, like `{ raw: ['a', 'b', 'c'] }`. + - substitutions - The substitution values. + + **Returns:** + - A string constructed by the template with filled substitutions. + + **API Version:** +:::note +Available from version 22.7. +::: + +--- + +### repeat(Number) +- repeat(count: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns a new string repeating this string the given number of times. + + **Parameters:** + - count - The number of times this string should be repeated. Must be non-negative. + + **Returns:** + - A new string repeating this string the given number of times. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### replace(RegExp, Function) +- replace(regexp: [RegExp](TopLevel.RegExp.md), function: [Function](TopLevel.Function.md)): [String](TopLevel.String.md) + - : Returns a new String that results when matches of the _regexp_ + parameter are replaced by using the specified _function_. The + original String is not modified so you must capture the new String + in a variable to preserve changes. When you specify a function as the + second parameter, the function is invoked after the match has been performed. + + + **Parameters:** + - regexp - the regular expression to use. + - function - a Function that operates on matches of _regexp_ in the current String. + + **Returns:** + - a new String that results when matches of the _regexp_ + parameter are replaced by the _function_. + + + +--- + +### replace(RegExp, String) +- replace(regexp: [RegExp](TopLevel.RegExp.md), replacement: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns a new String that results when matches of the _regexp_ + parameter are replaced by the _replacement_ parameter. The + original String is not modified so you must capture the new String + in a variable to preserve changes. If regexp has the global flag set, + all occurrences are replaced, if the global flag is not set only the + first occurrence is replaced. + + + **Parameters:** + - regexp - the regular expression to use. + - replacement - a String that is to take the place of all matches of _regexp_ in the current String. + + **Returns:** + - a new String that results when matches of the _regexp_ + parameter are replaced by the _replacement_. + + + +--- + +### replace(String, Function) +- replace(literal: [String](TopLevel.String.md), function: [Function](TopLevel.Function.md)): [String](TopLevel.String.md) + - : Returns a new String that results when matches of the _literal_ + parameter are replaced by using the specified _function_. The + original String is not modified so you must capture the new String + in a variable to preserve changes. When you specify a function as the + second parameter, the function is invoked after the match has been + performed. + + + **Parameters:** + - literal - the literal string to locate. + - function - a Function that operates on the match of _literal_ in the current String. + + **Returns:** + - a new String that results when the first match of the _literal_ + parameter is replaced by the specified _function_. + + + +--- + +### replace(String, Function, String) +- ~~replace(literal: [String](TopLevel.String.md), function: [Function](TopLevel.Function.md), flags: [String](TopLevel.String.md)): [String](TopLevel.String.md)~~ + - : Returns a new String that results when matches of the _literal_ + parameter are replaced by using the specified _function_. The + original String is not modified so you must capture the new String + in a variable to preserve changes. When you specify a function as the + second parameter, the function is invoked after the match has been + performed. + + + **Parameters:** + - literal - the literal string to locate. + - function - a Function that operates on the match of _literal_ in the current String. + - flags - a String containing any combination of the Regular Expression flags of g - global match, i - ignore case, m - match over multiple lines. + + **Returns:** + - a new String that results when the first match of the _literal_ + parameter is replaced by the specified _function_. + + + **Deprecated:** +:::warning +Use [replace(RegExp, Function)](TopLevel.String.md#replaceregexp-function) instead. +::: + **API Version:** +:::note +No longer available as of version 21.2. +::: + +--- + +### replace(String, String) +- replace(literal: [String](TopLevel.String.md), replacement: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns a new String that results when matches of the _literal_ + parameter are replaced by the _replacement_ parameter. The + original String is not modified so you must capture the new String + in a variable to preserve changes. This method only replaces the first + occurrence of the literal. To replace all occurrences see the polymorphic + method with a regular expression as argument. + + + **Parameters:** + - literal - the literal string to locate. + - replacement - a String that is to take the place of all matches of _regexp_ in the current String. + + **Returns:** + - a new String that results when the first match of the _literal_ + parameter is replaced by the _replacement_ parameter. + + + +--- + +### replace(String, String, String) +- ~~replace(literal: [String](TopLevel.String.md), replacement: [String](TopLevel.String.md), flags: [String](TopLevel.String.md)): [String](TopLevel.String.md)~~ + - : Returns a new String that results when matches of the _literal_ + parameter are replaced by the _replacement_ parameter. The + original String is not modified so you must capture the new String + in a variable to preserve changes. This method only replaces the first + occurrence of the literal. To replace all occurrences see the polymorphic + method with a regular expression as argument. Note that if flags + + + **Parameters:** + - literal - the literal string to locate. + - replacement - a String that is to take the place of all matches of _regexp_ in the current String. + - flags - a String containing any combination of the Regular Expression flags of g - global match, i - ignore case, m - match over multiple lines. + + **Returns:** + - a new String that results when the first match of the _literal_ + parameter is replaced by the _replacement_ parameter. + + + **Deprecated:** +:::warning +Use [replace(RegExp, String)](TopLevel.String.md#replaceregexp-string) instead. +::: + **API Version:** +:::note +No longer available as of version 21.2. +::: + +--- + +### search(RegExp) +- search(regexp: [RegExp](TopLevel.RegExp.md)): [Number](TopLevel.Number.md) + - : Searches for a match between the passed regular expression and this + string and returns the zero-based index of the match, or -1 if no match + is found. + + + **Parameters:** + - regexp - the regular expression to use. + + **Returns:** + - the zero-based indexed value of the first character in the + current string that matches the pattern of the regular expression + _regexp_, or -1 if no match is found. + + + +--- + +### slice(Number, Number) +- slice(start: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns a substring of the current String where the + specified _start_ and _end_ locations are used + to delimit the String. + + + **Parameters:** + - start - the start position in the current String from which the slice will begin. + - end - the end position in the current String from which the slice will terminate. + + **Returns:** + - the String between the _start_ and _end_ positions. + + +--- + +### split(RegExp) +- split(regexp: [RegExp](TopLevel.RegExp.md)): [String\[\]](TopLevel.String.md) + - : Returns an array of String instances created by splitting the current + String based on the regular expression. + + + **Parameters:** + - regexp - the regular expression to use to split the string. + + **Returns:** + - an array of String instances created by splitting the current + String based on the regular expression. + + + +--- + +### split(RegExp, Number) +- split(regexp: [RegExp](TopLevel.RegExp.md), limit: [Number](TopLevel.Number.md)): [String\[\]](TopLevel.String.md) + - : Returns an array of String instances created by splitting the current + String based on the regular expression and limited in size by the _limit_ + parameter. + + + **Parameters:** + - regexp - the regular expression to use to split the string. + - limit - controls the maximum number of items that will be returned. + + **Returns:** + - an array of String instances created by splitting the current + String based on the regular expression and limited in size by the _limit_ + parameter. + + + +--- + +### split(String) +- split(delimiter: [String](TopLevel.String.md)): [String\[\]](TopLevel.String.md) + - : Returns an array of String instances created by splitting the current + String based on the delimiter. + + + **Parameters:** + - delimiter - the delimiter to use to split the string. + + **Returns:** + - an array of String instances created by splitting the current + String based on the delimiter. + + + +--- + +### split(String, Number) +- split(delimiter: [String](TopLevel.String.md), limit: [Number](TopLevel.Number.md)): [String\[\]](TopLevel.String.md) + - : Returns an array of String instances created by splitting the current + String based on the delimiter and limited in size by the _limit_ + parameter. + + + **Parameters:** + - delimiter - the delimiter to use to split the string. + - limit - controls the maximum number of items that will be returned. + + **Returns:** + - an array of String instances created by splitting the current + String based on the delimiter and limited in size by the _limit_ + parameter. + + + +--- + +### startsWith(String) +- startsWith(searchString: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Tests if this string starts with a given string. + + **Parameters:** + - searchString - The characters to be searched for this string. + + **Returns:** + - `true` if the search string was found else `false` + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### startsWith(String, Number) +- startsWith(searchString: [String](TopLevel.String.md), position: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Tests if this string starts with a given string. + + **Parameters:** + - searchString - The characters to be searched for this string. + - position - The position in this string at which to begin searching for searchString. + + **Returns:** + - `true` if the search string was found else `false` + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### substr(Number) +- substr(start: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Creates and returns a new String by splitting the current string + at the specified _start_ location until the end of the String. + + + **Parameters:** + - start - the start position in the current string from which the new string will be created. + + **Returns:** + - a new String created by splitting the current string + starting at the specified _start_ location until the end of the String. + + + +--- + +### substr(Number, Number) +- substr(start: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Creates and returns a new String by splitting the current string + at the specified _start_ location and limited by the _length_ + value. + + + **Parameters:** + - start - the start position in the current string from which the new string will be created. + - length - controls the length of the new string. + + **Returns:** + - a new String created by splitting the current string + starting at the specified _start_ location and limited by the _length_ + value. + + + +--- + +### substring(Number) +- substring(from: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Creates and returns a new String by splitting the current string + at the specified _from_ location until the end of the String. + + + **Parameters:** + - from - the start position in the current string from which the new string will be created. + + **Returns:** + - a new String created by splitting the current string + starting at the specified _from_ location until the end of the String. + + + +--- + +### substring(Number, Number) +- substring(from: [Number](TopLevel.Number.md), to: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Creates and returns a new String by splitting the current string + at the specified _from_ location until the specified _to_ location. + + + **Parameters:** + - from - the start position in the current string from which the new string will be created. + - to - the end position in the current string from which the new string will be created. + + **Returns:** + - a new String created by splitting the current string + starting at the specified _from_ location until the specified + _to_ location. + value. + + + +--- + +### toLocaleLowerCase() +- toLocaleLowerCase(): [String](TopLevel.String.md) + - : Returns a copy of the current string in all lower-case letters. + + **Returns:** + - a copy of the current string in all lower-case letters. + + +--- + +### toLocaleUpperCase() +- toLocaleUpperCase(): [String](TopLevel.String.md) + - : Returns a copy of the current string in all upper-case letters. + + **Returns:** + - a copy of the current string in all upper-case letters. + + +--- + +### toLowerCase() +- toLowerCase(): [String](TopLevel.String.md) + - : Returns a copy of the current string in all lower-case letters. + + **Returns:** + - a copy of the current string in all lower-case letters. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a String value of this object. + + **Returns:** + - a String value of this object. + + +--- + +### toUpperCase() +- toUpperCase(): [String](TopLevel.String.md) + - : Returns a copy of the current string in all upper-case letters. + + **Returns:** + - a copy of the current string in all upper-case letters. + + +--- + +### trim() +- trim(): [String](TopLevel.String.md) + - : Removes white space characters at the start and the end of the string. + + **Returns:** + - A new string without leading and ending white space characters. + + +--- + +### trimEnd() +- trimEnd(): [String](TopLevel.String.md) + - : Removes white space characters at the end of the string. + + **Returns:** + - A new string without ending white space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### trimLeft() +- trimLeft(): [String](TopLevel.String.md) + - : Removes white space characters at the start of the string. + [trimStart()](TopLevel.String.md#trimstart) should be used instead of this. + + + **Returns:** + - A new string without leading white space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### trimRight() +- trimRight(): [String](TopLevel.String.md) + - : Removes white space characters at the end of the string. + [trimEnd()](TopLevel.String.md#trimend) should be used instead of this. + + + **Returns:** + - A new string without ending white space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### trimStart() +- trimStart(): [String](TopLevel.String.md) + - : Removes white space characters at the start of the string. + + **Returns:** + - A new string without leading white space characters. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### valueOf() +- valueOf(): [String](TopLevel.String.md) + - : Returns a String value of this object. + + **Returns:** + - a String value of this object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Symbol.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Symbol.md new file mode 100644 index 00000000..402451bb --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Symbol.md @@ -0,0 +1,196 @@ + +# Class Symbol + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Symbol](TopLevel.Symbol.md) + +Symbol is a primitive data type that can serve as object properties. +Symbol instance can be created explicitly or via a global registry, see [for(String)](TopLevel.Symbol.md#forstring---variant-1). + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [hasInstance](#hasinstance): [Symbol](TopLevel.Symbol.md) | The symbol used by `instanceof`. | +| [isConcatSpreadable](#isconcatspreadable): [Symbol](TopLevel.Symbol.md) | The symbol used by [Array.concat(Object...)](TopLevel.Array.md#concatobject). | +| [iterator](#iterator): [Symbol](TopLevel.Symbol.md) | The symbol used by `for...of`. | +| [match](#match): [Symbol](TopLevel.Symbol.md) | The symbol used by [String.match(RegExp)](TopLevel.String.md#matchregexp). | +| [replace](#replace): [Symbol](TopLevel.Symbol.md) | The symbol used by `String.replace()`. | +| [search](#search): [Symbol](TopLevel.Symbol.md) | The symbol used by [String.search(RegExp)](TopLevel.String.md#searchregexp). | +| [species](#species): [Symbol](TopLevel.Symbol.md) | The symbol used to create derived objects. | +| [split](#split): [Symbol](TopLevel.Symbol.md) | The symbol used by `String.split()`. | +| [toPrimitive](#toprimitive): [Symbol](TopLevel.Symbol.md) | The symbol used to convert an object to a primitive value. | +| [toStringTag](#tostringtag): [Symbol](TopLevel.Symbol.md) | The symbol used by [Object.toString()](TopLevel.Object.md#tostring). | +| [unscopables](#unscopables): [Symbol](TopLevel.Symbol.md) | The symbol used by `with`. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Symbol](#symbol)() | Creates a new symbol. | +| [Symbol](#symbolstring)([String](TopLevel.String.md)) | Creates a new symbol. | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [for](TopLevel.Symbol.md#forstring---variant-1)([String](TopLevel.String.md)) | Obtains a symbol from the global registry. | +| static [keyFor](TopLevel.Symbol.md#keyforsymbol)([Symbol](TopLevel.Symbol.md)) | Returns the key within the global symbol registry under which the given symbol is stored. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### hasInstance + +- hasInstance: [Symbol](TopLevel.Symbol.md) + - : The symbol used by `instanceof`. + + +--- + +### isConcatSpreadable + +- isConcatSpreadable: [Symbol](TopLevel.Symbol.md) + - : The symbol used by [Array.concat(Object...)](TopLevel.Array.md#concatobject). + + +--- + +### iterator + +- iterator: [Symbol](TopLevel.Symbol.md) + - : The symbol used by `for...of`. + + +--- + +### match + +- match: [Symbol](TopLevel.Symbol.md) + - : The symbol used by [String.match(RegExp)](TopLevel.String.md#matchregexp). + + +--- + +### replace + +- replace: [Symbol](TopLevel.Symbol.md) + - : The symbol used by `String.replace()`. + + +--- + +### search + +- search: [Symbol](TopLevel.Symbol.md) + - : The symbol used by [String.search(RegExp)](TopLevel.String.md#searchregexp). + + +--- + +### species + +- species: [Symbol](TopLevel.Symbol.md) + - : The symbol used to create derived objects. + + +--- + +### split + +- split: [Symbol](TopLevel.Symbol.md) + - : The symbol used by `String.split()`. + + +--- + +### toPrimitive + +- toPrimitive: [Symbol](TopLevel.Symbol.md) + - : The symbol used to convert an object to a primitive value. + + +--- + +### toStringTag + +- toStringTag: [Symbol](TopLevel.Symbol.md) + - : The symbol used by [Object.toString()](TopLevel.Object.md#tostring). + + +--- + +### unscopables + +- unscopables: [Symbol](TopLevel.Symbol.md) + - : The symbol used by `with`. + + +--- + +## Constructor Details + +### Symbol() +- Symbol() + - : Creates a new symbol. Note that it must be called without `new`. + Symbols created via this method are always distinct. + + + +--- + +### Symbol(String) +- Symbol(description: [String](TopLevel.String.md)) + - : Creates a new symbol. Note that it must be called without `new`. + Symbols created via this method are always distinct. + + + **Parameters:** + - description - A description for this symbol. + + +--- + +## Method Details + +### for(String) - Variant 1 +- static for(key: [String](TopLevel.String.md)): [Symbol](TopLevel.Symbol.md) + - : Obtains a symbol from the global registry. If no symbol exists for the key within the registry a new symbol is + created and stored in the global registry. + + + **Parameters:** + - key - The key for a symbol within the global registry. + + **Returns:** + - The found or newly created symbol. + + **API Version:** +:::note +Available from version 21.2. +::: + +--- + +### keyFor(Symbol) +- static keyFor(symbol: [Symbol](TopLevel.Symbol.md)): [String](TopLevel.String.md) + - : Returns the key within the global symbol registry under which the given symbol is stored. + + **Parameters:** + - symbol - The symbol to look for. + + **Returns:** + - The key for the given symbol if the symbol is known to the global registry, else return `undefined`. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.SyntaxError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.SyntaxError.md new file mode 100644 index 00000000..16289ee2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.SyntaxError.md @@ -0,0 +1,47 @@ + +# Class SyntaxError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.SyntaxError](TopLevel.SyntaxError.md) + +Represents a syntax error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SyntaxError](#syntaxerror)() | Constructs the error. | +| [SyntaxError](#syntaxerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### SyntaxError() +- SyntaxError() + - : Constructs the error. + + +--- + +### SyntaxError(String) +- SyntaxError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the syntax error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.SystemError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.SystemError.md new file mode 100644 index 00000000..648bbfe7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.SystemError.md @@ -0,0 +1,99 @@ + +# Class SystemError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.SystemError](TopLevel.SystemError.md) + +This error indicates an error in the system, which doesn't fall into +any of the other error categories like for example IOError. The SystemError +is always related to a systems internal Java exception. The class provides +access to some more details about this internal Java exception. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [causeFullName](#causefullname): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the full name of the associated Java exception. | +| [causeMessage](#causemessage): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the message of the associated Java exception. | +| [causeName](#causename): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the simplified name of the associated Java exception. | +| [javaFullName](#javafullname): [String](TopLevel.String.md) | The full name of the underlying Java exception. | +| [javaMessage](#javamessage): [String](TopLevel.String.md) | The message of the underlying Java exception. | +| [javaName](#javaname): [String](TopLevel.String.md) | The simplified name of the underlying Java exception. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SystemError](#systemerror)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### causeFullName +- causeFullName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the full name of the associated Java exception. + + + +--- + +### causeMessage +- causeMessage: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the message of the associated Java exception. + + + +--- + +### causeName +- causeName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the simplified name of the associated Java exception. + + + +--- + +### javaFullName +- javaFullName: [String](TopLevel.String.md) + - : The full name of the underlying Java exception. + + +--- + +### javaMessage +- javaMessage: [String](TopLevel.String.md) + - : The message of the underlying Java exception. + + +--- + +### javaName +- javaName: [String](TopLevel.String.md) + - : The simplified name of the underlying Java exception. + + +--- + +## Constructor Details + +### SystemError() +- SystemError() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.TypeError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.TypeError.md new file mode 100644 index 00000000..d33268c3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.TypeError.md @@ -0,0 +1,47 @@ + +# Class TypeError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.TypeError](TopLevel.TypeError.md) + +Represents a type error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [TypeError](#typeerror)() | Constructs the error. | +| [TypeError](#typeerrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### TypeError() +- TypeError() + - : Constructs the error. + + +--- + +### TypeError(String) +- TypeError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the type error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.URIError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.URIError.md new file mode 100644 index 00000000..3c2990ea --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.URIError.md @@ -0,0 +1,47 @@ + +# Class URIError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.URIError](TopLevel.URIError.md) + +Represents a URI error. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [URIError](#urierror)() | Constructs the error. | +| [URIError](#urierrorstring)([String](TopLevel.String.md)) | Constructs the error with the specified message. | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### URIError() +- URIError() + - : Constructs the error. + + +--- + +### URIError(String) +- URIError(msg: [String](TopLevel.String.md)) + - : Constructs the error with the + specified message. + + + **Parameters:** + - msg - the URI error message. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint16Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint16Array.md new file mode 100644 index 00000000..79d6344a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint16Array.md @@ -0,0 +1,186 @@ + +# Class Uint16Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Uint16Array](TopLevel.Uint16Array.md) + +An optimized array to store 16-bit unsigned integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 2 | The number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Uint16Array](#uint16array)() | Creates an empty array. | +| [Uint16Array](#uint16arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Uint16Array](#uint16arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Uint16Array](#uint16arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Uint16Array](#uint16arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Uint16Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Uint16Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Uint16Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 2 + - : The number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Uint16Array() +- Uint16Array() + - : Creates an empty array. + + +--- + +### Uint16Array(Number) +- Uint16Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Uint16Array(Object) +- Uint16Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Uint16Array(Array) +- Uint16Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Uint16Array(ArrayBuffer, Number, Number) +- Uint16Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Uint16Array](TopLevel.Uint16Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint32Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint32Array.md new file mode 100644 index 00000000..60174393 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint32Array.md @@ -0,0 +1,186 @@ + +# Class Uint32Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Uint32Array](TopLevel.Uint32Array.md) + +An optimized array to store 32-bit unsigned integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 4 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Uint32Array](#uint32array)() | Creates an empty array. | +| [Uint32Array](#uint32arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Uint32Array](#uint32arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Uint32Array](#uint32arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Uint32Array](#uint32arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Uint32Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Uint32Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Uint32Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 4 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Uint32Array() +- Uint32Array() + - : Creates an empty array. + + +--- + +### Uint32Array(Number) +- Uint32Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Uint32Array(Object) +- Uint32Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Uint32Array(Array) +- Uint32Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Uint32Array(ArrayBuffer, Number, Number) +- Uint32Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Uint32Array](TopLevel.Uint32Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8Array.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8Array.md new file mode 100644 index 00000000..d263f2e2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8Array.md @@ -0,0 +1,186 @@ + +# Class Uint8Array + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Uint8Array](TopLevel.Uint8Array.md) + +An optimized array to store 8-bit unsigned integer numbers. Elements of this array are stored in an +[ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 1 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Uint8Array](#uint8array)() | Creates an empty array. | +| [Uint8Array](#uint8arraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Uint8Array](#uint8arrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Uint8Array](#uint8arrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Uint8Array](#uint8arrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Uint8Array.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Uint8Array.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Uint8Array.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 1 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Uint8Array() +- Uint8Array() + - : Creates an empty array. + + +--- + +### Uint8Array(Number) +- Uint8Array(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Uint8Array(Object) +- Uint8Array(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Uint8Array(Array) +- Uint8Array(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Uint8Array(ArrayBuffer, Number, Number) +- Uint8Array(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Uint8Array](TopLevel.Uint8Array.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8ClampedArray.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8ClampedArray.md new file mode 100644 index 00000000..2d3a7ea7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.Uint8ClampedArray.md @@ -0,0 +1,186 @@ + +# Class Uint8ClampedArray + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Uint8ClampedArray](TopLevel.Uint8ClampedArray.md) + +An optimized array to store 8-bit unsigned integer numbers. If a value outside of the range 0-255 is attempted to be +set, either 0 or 255 is set instead. Elements of this array are stored in an [ArrayBuffer](TopLevel.ArrayBuffer.md) object. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BYTES_PER_ELEMENT](#bytes_per_element): [Number](TopLevel.Number.md) = 1 | Number value of the element size. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [buffer](#buffer): [ArrayBuffer](TopLevel.ArrayBuffer.md) | The array buffer referenced by this typed array. | +| [byteLength](#bytelength): [Number](TopLevel.Number.md) | The number of bytes in the array buffer used by this typed array. | +| [byteOffset](#byteoffset): [Number](TopLevel.Number.md) | The start offset for this typed array within the array buffer. | +| [length](#length): [Number](TopLevel.Number.md) | The number of elements. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Uint8ClampedArray](#uint8clampedarray)() | Creates an empty array. | +| [Uint8ClampedArray](#uint8clampedarraynumber)([Number](TopLevel.Number.md)) | Creates an array with the given element count. | +| [Uint8ClampedArray](#uint8clampedarrayobject)([Object](TopLevel.Object.md)) | Creates an array as a copy of the passed typed array. | +| [Uint8ClampedArray](#uint8clampedarrayarray)([Array](TopLevel.Array.md)) | Creates an array as a copy of the passed array. | +| [Uint8ClampedArray](#uint8clampedarrayarraybuffer-number-number)([ArrayBuffer](TopLevel.ArrayBuffer.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). | + +## Method Summary + +| Method | Description | +| --- | --- | +| [get](TopLevel.Uint8ClampedArray.md#getnumber)([Number](TopLevel.Number.md)) | Returns the value at the specified index. | +| [set](TopLevel.Uint8ClampedArray.md#setobject-number)([Object](TopLevel.Object.md), [Number](TopLevel.Number.md)) | Copies all values from the source array into this typed array. | +| [subarray](TopLevel.Uint8ClampedArray.md#subarraynumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BYTES_PER_ELEMENT + +- BYTES_PER_ELEMENT: [Number](TopLevel.Number.md) = 1 + - : Number value of the element size. + + +--- + +## Property Details + +### buffer +- buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md) + - : The array buffer referenced by this typed array. + + +--- + +### byteLength +- byteLength: [Number](TopLevel.Number.md) + - : The number of bytes in the array buffer used by this typed array. + + +--- + +### byteOffset +- byteOffset: [Number](TopLevel.Number.md) + - : The start offset for this typed array within the array buffer. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of elements. + + +--- + +## Constructor Details + +### Uint8ClampedArray() +- Uint8ClampedArray() + - : Creates an empty array. + + +--- + +### Uint8ClampedArray(Number) +- Uint8ClampedArray(length: [Number](TopLevel.Number.md)) + - : Creates an array with the given element count. + + **Parameters:** + - length - The number of elements. + + +--- + +### Uint8ClampedArray(Object) +- Uint8ClampedArray(typedArray: [Object](TopLevel.Object.md)) + - : Creates an array as a copy of the passed typed array. + + **Parameters:** + - typedArray - The source typed array. + + +--- + +### Uint8ClampedArray(Array) +- Uint8ClampedArray(array: [Array](TopLevel.Array.md)) + - : Creates an array as a copy of the passed array. + + **Parameters:** + - array - The source array. + + +--- + +### Uint8ClampedArray(ArrayBuffer, Number, Number) +- Uint8ClampedArray(buffer: [ArrayBuffer](TopLevel.ArrayBuffer.md), byteOffset: [Number](TopLevel.Number.md), length: [Number](TopLevel.Number.md)) + - : Creates a typed array as a view on the given [ArrayBuffer](TopLevel.ArrayBuffer.md). + + **Parameters:** + - buffer - The array buffer storage object. + - byteOffset - Optional. The offset within the array buffer in bytes. + - length - Optional. The number of elements for the target typed array. The passed array buffer must be large enough to store the number of elements specified. + + +--- + +## Method Details + +### get(Number) +- get(index: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns the value at the specified index. + + Note: This is not ECMAScript standard. Use array element access syntax for single value access. + + + **Parameters:** + - index - The index to use. + + **Returns:** + - The value at the specified index. + + +--- + +### set(Object, Number) +- set(values: [Object](TopLevel.Object.md), offset: [Number](TopLevel.Number.md)): void + - : Copies all values from the source array into this typed array. + + **Parameters:** + - values - The source values. Can be an array or a typed array. + - offset - Optional. Target offset. + + +--- + +### subarray(Number, Number) +- subarray(begin: [Number](TopLevel.Number.md), end: [Number](TopLevel.Number.md)): [Uint8ClampedArray](TopLevel.Uint8ClampedArray.md) + - : Returns a new array object based on the same [ArrayBuffer](TopLevel.ArrayBuffer.md) store. + + **Parameters:** + - begin - Optional. The first included element. + - end - Optional. The index of the end. This element is not included. + + **Returns:** + - The new array object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakMap.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakMap.md new file mode 100644 index 00000000..b8036d9b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakMap.md @@ -0,0 +1,135 @@ + +# Class WeakMap + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.WeakMap](TopLevel.WeakMap.md) + +The WeakMap is map whose entries are subject to garbage collection if there are no more references to the keys. +Keys must be objects (no primitives). Elements can't be iterated. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [size](#size): [Number](TopLevel.Number.md) | Number of key/value pairs stored in this map. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakMap](#weakmap)() | Creates an empty map. | +| [WeakMap](#weakmapiterable)([Iterable](TopLevel.Iterable.md)) | If the passed value is null or undefined then an empty map is constructed. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [clear](TopLevel.WeakMap.md#clear)() | Removes all key/value pairs from this map. | +| [delete](TopLevel.WeakMap.md#deleteobject)([Object](TopLevel.Object.md)) | Removes the entry for the given key. | +| [get](TopLevel.WeakMap.md#getobject)([Object](TopLevel.Object.md)) | Returns the value associated with the given key. | +| [has](TopLevel.WeakMap.md#hasobject)([Object](TopLevel.Object.md)) | Returns if this map has value associated with the given key. | +| [set](TopLevel.WeakMap.md#setobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Adds or updates a key/value pair to the map. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### size +- size: [Number](TopLevel.Number.md) + - : Number of key/value pairs stored in this map. + + +--- + +## Constructor Details + +### WeakMap() +- WeakMap() + - : Creates an empty map. + + +--- + +### WeakMap(Iterable) +- WeakMap(values: [Iterable](TopLevel.Iterable.md)) + - : If the passed value is null or undefined then an empty map is constructed. Else an iterator object is expected + that produces a two-element array-like object whose first element is a value that will be used as a Map key and + whose second element is the value to associate with that key. + + + **Parameters:** + - values - The initial map values + + +--- + +## Method Details + +### clear() +- clear(): void + - : Removes all key/value pairs from this map. + + +--- + +### delete(Object) +- delete(key: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Removes the entry for the given key. + + **Parameters:** + - key - The key of the key/value pair to be removed from the map. + + **Returns:** + - `true` if the map contained an entry for the passed key that was removed. Else `false` is returned. + + +--- + +### get(Object) +- get(key: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : Returns the value associated with the given key. + + **Parameters:** + - key - The key to look for. + + **Returns:** + - The value associated with the given key if an entry with the key exists else `undefined` is returned. + + +--- + +### has(Object) +- has(key: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if this map has value associated with the given key. + + **Parameters:** + - key - The key to look for. + + **Returns:** + - `true` if an entry with the key exists else `false` is returned. + + +--- + +### set(Object, Object) +- set(key: [Object](TopLevel.Object.md), value: [Object](TopLevel.Object.md)): [WeakMap](TopLevel.WeakMap.md) + - : Adds or updates a key/value pair to the map. + + **Parameters:** + - key - The key object. + - value - The value to be associate with the key. + + **Returns:** + - This map object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakSet.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakSet.md new file mode 100644 index 00000000..c12d3741 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.WeakSet.md @@ -0,0 +1,96 @@ + +# Class WeakSet + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.WeakSet](TopLevel.WeakSet.md) + +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. + + +**API Version:** +:::note +Available from version 21.2. +::: + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakSet](#weakset)() | Creates an empty Set. | +| [WeakSet](#weaksetiterable)([Iterable](TopLevel.Iterable.md)) | If the passed value is null or undefined then an empty set is constructed. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [add](TopLevel.WeakSet.md#addobject)([Object](TopLevel.Object.md)) | Adds an element to the set. | +| [delete](TopLevel.WeakSet.md#deleteobject)([Object](TopLevel.Object.md)) | Removes the element from the set. | +| [has](TopLevel.WeakSet.md#hasobject)([Object](TopLevel.Object.md)) | Returns if this set contains the given object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### WeakSet() +- WeakSet() + - : Creates an empty Set. + + +--- + +### WeakSet(Iterable) +- WeakSet(values: [Iterable](TopLevel.Iterable.md)) + - : If the passed value is null or undefined then an empty set is constructed. Else an iterable object is expected + that delivers the initial set entries. + + + **Parameters:** + - values - The initial set entries. + + +--- + +## Method Details + +### add(Object) +- add(object: [Object](TopLevel.Object.md)): [WeakSet](TopLevel.WeakSet.md) + - : Adds an element to the set. Does nothing if the set already contains the element. + + **Parameters:** + - object - The object to add. + + **Returns:** + - This set object. + + +--- + +### delete(Object) +- delete(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Removes the element from the set. + + **Parameters:** + - object - The object to be removed. + + **Returns:** + - `true` if the set contained the object that was removed. Else `false` is returned. + + +--- + +### has(Object) +- has(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns if this set contains the given object. + + **Parameters:** + - object - The object to look for. + + **Returns:** + - `true` if the set contains the object else `false` is returned. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.XML.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XML.md new file mode 100644 index 00000000..efa8a40c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XML.md @@ -0,0 +1,922 @@ + +# Class XML + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.XML](TopLevel.XML.md) + +The XML object contains functions and properties for working with XML +instances. The XML object implements the powerful XML-handling standards +defined in the ECMA-357 specification (known as "E4X"). + + +Use the toXMLString() method to return a string representation of the XML +object regardless of whether the XML object has simple content or complex +content. + + +Do not create large XML objects in memory to avoid out-of-memory conditions. +When dealing with XML streams use [XMLStreamReader](dw.io.XMLStreamReader.md) and +[XMLStreamWriter](dw.io.XMLStreamWriter.md). The following example shows how: + + +``` +var id : String = "p42"; +var pname : String = "a product"; + +// use E4X syntax +var product : XML = + + {pname} + + ; + +product.shortdesc = "a fine product"; +product.longdesc = "this is a fine product"; + +var xmlString = product.toXMLString(); + +fileWriter.write(xmlString); +``` + + + + + +The code above will write the following to file: + + +``` + + a product + a fine product + this is a fine product + +``` + + + + + +Do not create large XML objects in memory to avoid out-of-memory conditions. +When dealing with XML streams use [XMLStreamReader](dw.io.XMLStreamReader.md) and +[XMLStreamWriter](dw.io.XMLStreamWriter.md). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ignoreComments](#ignorecomments): [Boolean](TopLevel.Boolean.md) | The ignoreComments property determines whether or not XML comments are ignored when XML objects parse the source XML data. | +| [ignoreProcessingInstructions](#ignoreprocessinginstructions): [Boolean](TopLevel.Boolean.md) | The ignoreProcessingInstructions property determines whether or not XML processing instructions are ignored when XML objects parse the source XML data. | +| [ignoreWhitespace](#ignorewhitespace): [Boolean](TopLevel.Boolean.md) | The ignoreWhitespace property determines whether or not white space characters at the beginning and end of text nodes are ignored during parsing. | +| [prettyIndent](#prettyindent): [Number](TopLevel.Number.md) | The prettyIndent property determines the amount of indentation applied by the toString() and toXMLString() methods when the XML.prettyPrinting property is set to true. | +| [prettyPrinting](#prettyprinting): [Boolean](TopLevel.Boolean.md) | The prettyPrinting property determines whether the toString() and toXMLString() methods normalize white space characters between some tags. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XML](#xml)() | Creates a new XML object. | +| [XML](#xmlobject)([Object](TopLevel.Object.md)) | Creates a new XML object. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addNamespace](TopLevel.XML.md#addnamespaceobject)([Object](TopLevel.Object.md)) | Adds a namespace to the set of in-scope namespaces for the XML object. | +| [appendChild](TopLevel.XML.md#appendchildobject)([Object](TopLevel.Object.md)) | Appends the specified child to the end of the object's properties. | +| [attribute](TopLevel.XML.md#attributestring)([String](TopLevel.String.md)) | Returns the attribute associated with this XML object that is identified by the specified name. | +| [attributes](TopLevel.XML.md#attributes)() | Returns an XMList of the attributes in this XML Object. | +| [child](TopLevel.XML.md#childobject)([Object](TopLevel.Object.md)) | Returns the children of the XML object based on the specified property name. | +| [childIndex](TopLevel.XML.md#childindex)() | Identifies the zero-based index of this XML object within the context of its parent, or -1 if this object has no parent. | +| [children](TopLevel.XML.md#children)() | Returns an XMLList containing the children of this XML object, maintaing the sequence in which they appear. | +| [comments](TopLevel.XML.md#comments)() | Returns the properties of the XML object that contain comments. | +| [contains](TopLevel.XML.md#containsxml)([XML](TopLevel.XML.md)) | Returns true if this XML object contains the specified XML object, false otherwise. | +| [copy](TopLevel.XML.md#copy)() | Returns a copy of the this XML object including duplicate copies of the entire tree of nodes. | +| static [defaultSettings](TopLevel.XML.md#defaultsettings)() | Returns a new Object with the following properties set to the default values: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. | +| [descendants](TopLevel.XML.md#descendants)() | Returns all descendents of the XML object. | +| [descendants](TopLevel.XML.md#descendantsstring)([String](TopLevel.String.md)) | Returns all descendents of the XML object that have the specified name parameter. | +| [elements](TopLevel.XML.md#elements)() | Returns a list of all of the elements of the XML object. | +| [elements](TopLevel.XML.md#elementsobject)([Object](TopLevel.Object.md)) | Returns a list of the elements of the XML object using the specified name to constrain the list. | +| [hasComplexContent](TopLevel.XML.md#hascomplexcontent)() | Returns a Boolean value indicating whether this XML object contains complex content. | +| [hasOwnProperty](TopLevel.XML.md#hasownpropertystring)([String](TopLevel.String.md)) | Returns a Boolean value indicating whether this object has the property specified by _prop_. | +| [hasSimpleContent](TopLevel.XML.md#hassimplecontent)() | Returns a Boolean value indicating whether this XML object contains simple content. | +| [inScopeNamespaces](TopLevel.XML.md#inscopenamespaces)() | Returns an Array of Namespace objects representing the namespaces in scope for this XML object in the context of its parent. | +| [insertChildAfter](TopLevel.XML.md#insertchildafterobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Inserts the specified _child2_ after the specified _child1_ in this XML object and returns this XML object. | +| [insertChildBefore](TopLevel.XML.md#insertchildbeforeobject-object)([Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) | Inserts the specified _child2_ before the specified _child1_ in this XML object and returns this XML object. | +| [length](TopLevel.XML.md#length)() | Returns a value of 1 for XML objects. | +| [localName](TopLevel.XML.md#localname)() | Returns the local name portion of the qualified name of the XML object. | +| [name](TopLevel.XML.md#name)() | Returns the qualified name for the XML object. | +| [namespace](TopLevel.XML.md#namespace)() | Returns the namespace associated with the qualified name of this XML object. | +| [namespace](TopLevel.XML.md#namespacestring)([String](TopLevel.String.md)) | Returns the namespace that matches the specified prefix and that is in scope for the XML object. | +| [namespaceDeclarations](TopLevel.XML.md#namespacedeclarations)() | Returns an Array of namespace declarations associated with the XML Obnject in the context of its parent. | +| [nodeKind](TopLevel.XML.md#nodekind)() | Returns the type of the XML object, such as _text_, _comment_, _processing-instruction_, or _attribute_. | +| [normalize](TopLevel.XML.md#normalize)() | Merges adjacent text nodes and eliminates and eliminates empty text nodes for this XML object and all its descendents. | +| [parent](TopLevel.XML.md#parent)() | Returns the parent of the XML object or null if the XML object does not have a parent. | +| [prependChild](TopLevel.XML.md#prependchildobject)([Object](TopLevel.Object.md)) | Inserts the specified child into this XML object prior to its existing XML properties and then returns this XML object. | +| [processingInstructions](TopLevel.XML.md#processinginstructions)() | Returns an XMLList containing all the children of this XML object that are processing-instructions. | +| [processingInstructions](TopLevel.XML.md#processinginstructionsstring)([String](TopLevel.String.md)) | Returns an XMLList containing all the children of this XML object that are processing-instructions with the specified _name_. | +| [propertyIsEnumerable](TopLevel.XML.md#propertyisenumerablestring)([String](TopLevel.String.md)) | Returns a Boolean indicating whether the specified _property_ will be included in the set of properties iterated over when this XML object is used in a _for..in_ statement. | +| [removeNamespace](TopLevel.XML.md#removenamespacenamespace)([Namespace](TopLevel.Namespace.md)) | Removes the specified namespace from the in scope namespaces of this object and all its descendents, then returns a copy of this XML object. | +| [replace](TopLevel.XML.md#replacestring-object)([String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Replaces the XML properties of this XML object specified by _propertyName_ with _value_ and returns this updated XML object. | +| [setChildren](TopLevel.XML.md#setchildrenobject)([Object](TopLevel.Object.md)) | Replaces the XML properties of this XML object with a new set of XML properties from _value_. | +| [setLocalName](TopLevel.XML.md#setlocalnamestring)([String](TopLevel.String.md)) | Replaces the local name of this XML object with a string constructed from the specified _name_. | +| [setName](TopLevel.XML.md#setnamestring)([String](TopLevel.String.md)) | Replaces the name of this XML object with a QName or AttributeName constructed from the specified _name_. | +| [setNamespace](TopLevel.XML.md#setnamespacenamespace)([Namespace](TopLevel.Namespace.md)) | Replaces the namespace associated with the name of this XML object with the specified _namespace_. | +| static [setSettings](TopLevel.XML.md#setsettings)() | Restores the default settings for the following XML properties:
  • XML.ignoreComments = true
  • XML.ignoreProcessingInstructions = true
  • XML.ignoreWhitespace = true
  • XML.prettyIndent = 2
  • XML.prettyPrinting = true
| +| static [setSettings](TopLevel.XML.md#setsettingsobject)([Object](TopLevel.Object.md)) | Updates the collection of global XML properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyPrinting, prettyIndent, and prettyPrinting. | +| static [settings](TopLevel.XML.md#settings)() | Returns the collection of global XML properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyPrinting, prettyIndent, and prettyPrinting. | +| [text](TopLevel.XML.md#text)() | Returns an XMLList containing all XML properties of this XML object that represent XML text nodes. | +| [toString](TopLevel.XML.md#tostring)() | Returns the String representation of the XML object. | +| [toXMLString](TopLevel.XML.md#toxmlstring)() | Returns a XML-encoded String representation of the XML object, including tag and attributed delimiters. | +| [valueOf](TopLevel.XML.md#valueof)() | Returns this XML object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ignoreComments +- ignoreComments: [Boolean](TopLevel.Boolean.md) + - : The ignoreComments property determines whether or not XML comments are + ignored when XML objects parse the source XML data. + + + +--- + +### ignoreProcessingInstructions +- ignoreProcessingInstructions: [Boolean](TopLevel.Boolean.md) + - : The ignoreProcessingInstructions property determines whether or not XML + processing instructions are ignored when XML objects parse the source XML data. + + + +--- + +### ignoreWhitespace +- ignoreWhitespace: [Boolean](TopLevel.Boolean.md) + - : The ignoreWhitespace property determines whether or not white space + characters at the beginning and end of text nodes are ignored during parsing. + + + +--- + +### prettyIndent +- prettyIndent: [Number](TopLevel.Number.md) + - : The prettyIndent property determines the amount of indentation applied by + the toString() and toXMLString() methods when the XML.prettyPrinting + property is set to true. + + + +--- + +### prettyPrinting +- prettyPrinting: [Boolean](TopLevel.Boolean.md) + - : The prettyPrinting property determines whether the toString() and toXMLString() + methods normalize white space characters between some tags. + + + +--- + +## Constructor Details + +### XML() +- XML() + - : Creates a new XML object. + + +--- + +### XML(Object) +- XML(value: [Object](TopLevel.Object.md)) + - : Creates a new XML object. + You must use the constructor to create an XML object before you + call any of the methods of the XML class. + Use the toXMLString() method to return a string representation + of the XML object regardless of whether the XML object has simple + content or complex content. + + + **Parameters:** + - value - any Object that can be converted to XML via the top-level XML() function. + + +--- + +## Method Details + +### addNamespace(Object) +- addNamespace(ns: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Adds a namespace to the set of in-scope namespaces for the XML object. + If the namespace already exists in the in-scope namespaces for the XML + object, then the prefix of the existing namespace is set to _undefined_. + If _ns_ is a Namespace instance, it is used directly. + However, if _ns_ is a QName instance, the input parameter's URI is used + to create a new namespace. If _ns_ is not a Namespace or QName instance, + _ns_ is converted to a String and a namespace is created from the String. + + + **Parameters:** + - ns - the namespace to add to the XML object. + + **Returns:** + - a new XML object, with the namespace added. + + +--- + +### appendChild(Object) +- appendChild(child: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Appends the specified child to the end of the object's properties. + _child_ should be a XML object, an XMLList object or any other + data type that will then be converted to a String. + + + **Parameters:** + - child - the object to append to this XML object. + + **Returns:** + - the XML object with the child appended. + + +--- + +### attribute(String) +- attribute(attributeName: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Returns the attribute associated with this XML object that + is identified by the specified name. + + + **Parameters:** + - attributeName - the name of the attribute. + + **Returns:** + - the value of the attribute as either an XMLList or an empty XMLList + + +--- + +### attributes() +- attributes(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMList of the attributes in this XML Object. + + **Returns:** + - an XMList of the attributes in this XML Object. + + +--- + +### child(Object) +- child(propertyName: [Object](TopLevel.Object.md)): [XMLList](TopLevel.XMLList.md) + - : Returns the children of the XML object based on the specified + property name. + + + **Parameters:** + - propertyName - the property name representing the children of this XML object. + + **Returns:** + - an XMLList of children that match the property name + parameter. + + + +--- + +### childIndex() +- childIndex(): [Number](TopLevel.Number.md) + - : Identifies the zero-based index of this XML object within + the context of its parent, or -1 if this object has no parent. + + + **Returns:** + - the index of this XML object in the context of + its parent, or -1 if this object has no parent. + + + +--- + +### children() +- children(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMLList containing the children of this XML object, maintaing + the sequence in which they appear. + + + **Returns:** + - an XMLList containing the children of this XML object. + + +--- + +### comments() +- comments(): [XMLList](TopLevel.XMLList.md) + - : Returns the properties of the XML object that contain comments. + + **Returns:** + - properties of the XML object that contain comments. + + +--- + +### contains(XML) +- contains(value: [XML](TopLevel.XML.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this XML object contains the specified + XML object, false otherwise. + + + **Parameters:** + - value - the object to locate in this XML object. + + **Returns:** + - true if this XML object contains the specified + XML object, false otherwise. + + + +--- + +### copy() +- copy(): [XML](TopLevel.XML.md) + - : Returns a copy of the this XML object including + duplicate copies of the entire tree of nodes. + The copied XML object has no parent. + + + **Returns:** + - the copy of the object. + + +--- + +### defaultSettings() +- static defaultSettings(): [Object](TopLevel.Object.md) + - : Returns a new Object with the following properties set to the default values: + ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, + and prettyPrinting. The default values are as follows: + + - ignoreComments = true + - ignoreProcessingInstructions = true + - ignoreWhitespace = true + - prettyIndent = 2 + - prettyPrinting = true + + + Be aware that this method does not apply the settings to an existing instance + of an XML object. Instead, this method returns an Object containing the + default settings. + + + **Returns:** + - an Object with properties set to the default settings. + + +--- + +### descendants() +- descendants(): [XMLList](TopLevel.XMLList.md) + - : Returns all descendents of the XML object. + + **Returns:** + - a list of all descendents of the XML object. + + +--- + +### descendants(String) +- descendants(name: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Returns all descendents of the XML object that + have the specified name parameter. To return all descendents, + use \* as the _name_ parameter. + + + **Parameters:** + - name - the name of the element to match. To return all descendents, use \* as the _name_ parameter. + + **Returns:** + - a list of all descendents constrained by the name parameter. + + +--- + +### elements() +- elements(): [XMLList](TopLevel.XMLList.md) + - : Returns a list of all of the elements of the XML object. + + +--- + +### elements(Object) +- elements(name: [Object](TopLevel.Object.md)): [XMLList](TopLevel.XMLList.md) + - : Returns a list of the elements of the XML object using the + specified name to constrain the list. _name_ can be a + QName, String, or any other data type that will be converted + to a string prior to performing the search for elements of that + name. + + To list all objects use \* for the value of _name_. + + + **Parameters:** + - name - the name of the elements to return or an \* to return all elements. + + **Returns:** + - a list of the elements of the XML object using the + specified name to constrain the list. + + + +--- + +### hasComplexContent() +- hasComplexContent(): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether + this XML object contains complex content. An XML object is considered + to contain complex content if it represents an XML element that has + child elements. XML objects representing attributes, comments, processing + instructions and text nodes do not have complex content. The existence of + attributes, comments, processing instructions and text nodes within an XML + object is not significant in determining if it has complex content. + + + **Returns:** + - a Boolean value indicating whether this XML object contains complex content. + + +--- + +### hasOwnProperty(String) +- hasOwnProperty(prop: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether this object has the + property specified by _prop_. + + + **Parameters:** + - prop - the property to locate. + + **Returns:** + - true if the property exists, false otherwise. + + +--- + +### hasSimpleContent() +- hasSimpleContent(): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether this XML object contains + simple content. An XML object is considered to contain simple + content if it represents a text node, represents an attribute node + or if it represents an XML element that has no child elements. XML + objects representing comments and processing instructions do not + have simple content. The existence of attributes, comments, + processing instructions and text nodes within an XML object is not + significant in determining if it has simple content. + + + **Returns:** + - a Boolean value indicating whether this XML object contains + simple content. + + + +--- + +### inScopeNamespaces() +- inScopeNamespaces(): [Array](TopLevel.Array.md) + - : Returns an Array of Namespace objects representing the namespaces + in scope for this XML object in the context of its parent. If the + parent of this XML object is modified, the associated namespace + declarations may change. The set of namespaces returned by this + method may be a super set of the namespaces used by this value + + + **Returns:** + - an Array of Namespace objects representing the namespaces + in scope for this XML object in the context of its parent. + + + +--- + +### insertChildAfter(Object, Object) +- insertChildAfter(child1: [Object](TopLevel.Object.md), child2: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Inserts the specified _child2_ after the specified _child1_ + in this XML object and returns this XML object. If _child1_ is null, + inserts _child2_ before all children of + this XML object. If _child1_ does not exist + in this XML object, it returns without modifying this XML object. + + + **Parameters:** + - child1 - the child after which _child2_ is inserted. + - child2 - the child to insert into this XML object. + + **Returns:** + - the updated XML object. + + +--- + +### insertChildBefore(Object, Object) +- insertChildBefore(child1: [Object](TopLevel.Object.md), child2: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Inserts the specified _child2_ before the specified _child1_ + in this XML object and returns this XML object. If _child1_ is null, + inserts _child2_ after all children of + this XML object. If _child1_ does not exist + in this XML object, it returns without modifying this XML object. + + + **Parameters:** + - child1 - the child before which _child2_ is inserted. + - child2 - the child to insert into this XML object. + + **Returns:** + - the updated XML object. + + +--- + +### length() +- length(): [Number](TopLevel.Number.md) + - : Returns a value of 1 for XML objects. + + **Returns:** + - the value of 1. + + +--- + +### localName() +- localName(): [Object](TopLevel.Object.md) + - : Returns the local name portion of the qualified name of the XML object. + + **Returns:** + - the local name as either a String or null. + + +--- + +### name() +- name(): [Object](TopLevel.Object.md) + - : Returns the qualified name for the XML object. + + **Returns:** + - the qualified name as either a QName or null. + + +--- + +### namespace() +- namespace(): [Object](TopLevel.Object.md) + - : Returns the namespace associated with the qualified name + of this XML object. + + + **Returns:** + - the namespace associated with the qualified name + of this XML object. + + + +--- + +### namespace(String) +- namespace(prefix: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : Returns the namespace that matches the specified prefix and + that is in scope for the XML object. if there is no such + namespace, the method returns undefined. + + + **Parameters:** + - prefix - the prefix to use when attempting to locate a namespace. + + **Returns:** + - the namespace that matches the specified prefix and + that is in scope for the XML object. If specified + namespace does not exist, the method returns undefined. + + + +--- + +### namespaceDeclarations() +- namespaceDeclarations(): [Array](TopLevel.Array.md) + - : Returns an Array of namespace declarations associated + with the XML Obnject in the context of its parent. + + + **Returns:** + - an Array of namespace declarations associated + with the XML Obnject in the context of its parent. + + + +--- + +### nodeKind() +- nodeKind(): [String](TopLevel.String.md) + - : Returns the type of the XML object, such + as _text_, _comment_, _processing-instruction_, + or _attribute_. + + + **Returns:** + - the type of the XML object. + + +--- + +### normalize() +- normalize(): [XML](TopLevel.XML.md) + - : Merges adjacent text nodes and eliminates and eliminates + empty text nodes for this XML object and all its + descendents. + + + **Returns:** + - the normalized XML object. + + +--- + +### parent() +- parent(): [Object](TopLevel.Object.md) + - : Returns the parent of the XML object + or null if the XML object does not have + a parent. + + + **Returns:** + - the parent of the XML object + of null if the XML object does not have + a parent. + + + +--- + +### prependChild(Object) +- prependChild(value: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Inserts the specified child into this XML object + prior to its existing XML properties and then returns + this XML object. + + + **Parameters:** + - value - the child to prepend to this XML object. + + **Returns:** + - the XML object updated with the prepended child. + + +--- + +### processingInstructions() +- processingInstructions(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMLList containing all the children of this XML object + that are processing-instructions. + + + **Returns:** + - an XMLList containing all the children of this XML object + that are processing-instructions. + + + +--- + +### processingInstructions(String) +- processingInstructions(name: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Returns an XMLList containing all the children of this XML object + that are processing-instructions with the specified _name_. If you + use \* for the name, all processing-instructions are returned. + + + **Parameters:** + - name - the name representing the processing-instructions you want to retreive. + + **Returns:** + - an XMLList containing all the children of this XML object + that are processing-instructions with the specified _name_. + + + +--- + +### propertyIsEnumerable(String) +- propertyIsEnumerable(property: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean indicating whether the specified + _property_ will be included in the set of properties iterated + over when this XML object is used in a _for..in_ statement. + + + **Parameters:** + - property - the property to test. + + **Returns:** + - true when the property can be iterated in a _for..in_ + statement, false otherwise. + + + +--- + +### removeNamespace(Namespace) +- removeNamespace(ns: [Namespace](TopLevel.Namespace.md)): [XML](TopLevel.XML.md) + - : Removes the specified namespace from the in scope namespaces + of this object and all its descendents, then returns a copy of + this XML object. This method will not remove a namespace from + an object when it is referenced by that object's QName or + the ONames of that object's attributes. + + + **Parameters:** + - ns - the namespace to remove. + + **Returns:** + - a copy of this XML object with the namespace removed. + + +--- + +### replace(String, Object) +- replace(propertyName: [String](TopLevel.String.md), value: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Replaces the XML properties of this XML object specified by + _propertyName_ with _value_ and returns this + updated XML object. If this XML object contains no properties + that match _propertyName_, the replace method returns without + modifying this XML object. + + The _propertyName_ parameter may be a numeric property name, + an unqualified name for a set of XML elements, a qualified + name for a set of XML elements or the properties wildcard \*. + + When the _propertyName_ parameter is an unqualified name, + it identifies XML elements in the default namespace. The _value_ + parameter may be an XML object, XMLList object or any value + that may be converted to a String. + + + **Parameters:** + - propertyName - a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard \*. + - value - an XML object, XMLList object or any value that may be converted to a String. + + **Returns:** + - the updated XML object. + + +--- + +### setChildren(Object) +- setChildren(value: [Object](TopLevel.Object.md)): [XML](TopLevel.XML.md) + - : Replaces the XML properties of this XML object + with a new set of XML properties from _value_. + + + **Parameters:** + - value - a single XML object or an XMLList. + + **Returns:** + - the updated XML object. + + +--- + +### setLocalName(String) +- setLocalName(name: [String](TopLevel.String.md)): void + - : Replaces the local name of this XML object with + a string constructed from the specified _name_. + + + **Parameters:** + - name - the new local name. + + +--- + +### setName(String) +- setName(name: [String](TopLevel.String.md)): void + - : Replaces the name of this XML object with a + QName or AttributeName constructed from the specified + _name_. + + + **Parameters:** + - name - the new name of this XML object. + + +--- + +### setNamespace(Namespace) +- setNamespace(ns: [Namespace](TopLevel.Namespace.md)): void + - : Replaces the namespace associated with the name of + this XML object with the specified _namespace_. + + + **Parameters:** + - ns - the namespace to associated with the name of thix XML object. + + +--- + +### setSettings() +- static setSettings(): void + - : Restores the default settings for the following XML + properties: + + - XML.ignoreComments = true + - XML.ignoreProcessingInstructions = true + - XML.ignoreWhitespace = true + - XML.prettyIndent = 2 + - XML.prettyPrinting = true + + + +--- + +### setSettings(Object) +- static setSettings(settings: [Object](TopLevel.Object.md)): void + - : Updates the collection of global XML properties: + ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, + prettyPrinting, prettyIndent, and prettyPrinting. + + + **Parameters:** + - settings - an object with each of the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. + + +--- + +### settings() +- static settings(): [Object](TopLevel.Object.md) + - : Returns the collection of global XML properties: + ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, + prettyPrinting, prettyIndent, and prettyPrinting. + + + **Returns:** + - an object with each of the following properties: + ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, + prettyIndent, and prettyPrinting. + + + +--- + +### text() +- text(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMLList containing all XML properties of + this XML object that represent XML text nodes. + + + **Returns:** + - an XMLList containing all XML properties of + this XML object that represent XML text nodes. + + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns the String representation of the XML object. If the object contains + simple content, this method returns a String with tag, attributes, and + namespace declarations removed. However, if the object contains complex + content, this method returns an XML encoded String representing the entire + XML object. If you want to return the entire XML object regardless of + content complexity, use the _toXMLString()_ method. + + + **Returns:** + - the String representation of the XML object. + + +--- + +### toXMLString() +- toXMLString(): [String](TopLevel.String.md) + - : Returns a XML-encoded String representation of the XML object, including tag and + attributed delimiters. + + + **Returns:** + - the string representation of the XML object. + + +--- + +### valueOf() +- valueOf(): [XML](TopLevel.XML.md) + - : Returns this XML object. + + **Returns:** + - this XML object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLList.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLList.md new file mode 100644 index 00000000..36189c53 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLList.md @@ -0,0 +1,418 @@ + +# Class XMLList + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.XMLList](TopLevel.XMLList.md) + +An XMLList object is an ordered collection of properties. +A XMLList object represents a XML document, an XML fragment, +or an arbitrary collection of XML objects. +An individual XML object is the same thing as an XMLList +containing only that XML object. All operations available +for the XML object are also available for an XMLList object +that contains exactly one XML object. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLList](#xmllistobject)([Object](TopLevel.Object.md)) | Creates a new XMLList object using the specified _value_. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [attribute](TopLevel.XMLList.md#attributestring)([String](TopLevel.String.md)) | Returns the attribute associated with this XMLList object that is identified by the specified name. | +| [attributes](TopLevel.XMLList.md#attributes)() | Returns an XMList of the attributes in this XMLList Object. | +| [child](TopLevel.XMLList.md#childobject)([Object](TopLevel.Object.md)) | Returns the children of the XMLList object based on the specified property name. | +| [children](TopLevel.XMLList.md#children)() | Returns an XMLList containing the children of this XMLList object, maintaing the sequence in which they appear. | +| [comments](TopLevel.XMLList.md#comments)() | Returns the properties of the XMLList object that contain comments. | +| [contains](TopLevel.XMLList.md#containsxml)([XML](TopLevel.XML.md)) | Returns true if this XMLList object contains the specified XML object, false otherwise. | +| [copy](TopLevel.XMLList.md#copy)() | Returns a deep copy of the this XMLList object. | +| [descendants](TopLevel.XMLList.md#descendants)() | Calls the _descendants()_ method of each XML object in this XMLList object and returns an XMLList containing the results concatenated in order. | +| [descendants](TopLevel.XMLList.md#descendantsstring)([String](TopLevel.String.md)) | Calls the _descendants(name)_ method of each XML object in this XMLList object and returns an XMLList containing the results concatenated in order. | +| [elements](TopLevel.XMLList.md#elements)() | Calls the _elements()_ method in each XML object in this XMLList object and returns an XMLList containing the results concatenated in order. | +| [elements](TopLevel.XMLList.md#elementsobject)([Object](TopLevel.Object.md)) | Calls the _elements(name)_ method in each of the XML objects in this XMLList object and returns an XMLList containing the results concatenated in order. | +| [hasComplexContent](TopLevel.XMLList.md#hascomplexcontent)() | Returns a Boolean value indicating whether this XMLList object contains complex content. | +| [hasOwnProperty](TopLevel.XMLList.md#hasownpropertystring)([String](TopLevel.String.md)) | Returns a Boolean value indicating whether this object has the property specified by _prop_. | +| [hasSimpleContent](TopLevel.XMLList.md#hassimplecontent)() | Returns a Boolean value indicating whether this XML object contains simple content. | +| [length](TopLevel.XMLList.md#length)() | Returns the number of children in this XMLList object. | +| [normalize](TopLevel.XMLList.md#normalize)() | Puts all text nodes in this XMLList, all the XML objects it contains and the descendents of all the XML objects it contains into a normal form by merging adjacent text nodes and eliminating empty text nodes. | +| [parent](TopLevel.XMLList.md#parent)() | Returns the parent of the XMLList object or null if the XMLList object does not have a parent. | +| [processingInstructions](TopLevel.XMLList.md#processinginstructions)() | Calls the _processingInstructions()_ method of each XML object in this XMLList object and returns an XMList containing the results in order. | +| [processingInstructions](TopLevel.XMLList.md#processinginstructionsstring)([String](TopLevel.String.md)) | Calls the _processingInstructions(name)_ method of each XML object in this XMLList object and returns an XMList containing the results in order. | +| [propertyIsEnumerable](TopLevel.XMLList.md#propertyisenumerablestring)([String](TopLevel.String.md)) | Returns a Boolean indicating whether the specified _property_ will be included in the set of properties iterated over when this XML object is used in a _for..in_ statement. | +| [text](TopLevel.XMLList.md#text)() | Calls the _text()_ method of each XML object contained in this XMLList object and returns an XMLList containing the results concatenated in order. | +| [toString](TopLevel.XMLList.md#tostring)() | Returns the String representation of this XMLList object. | +| [toXMLString](TopLevel.XMLList.md#toxmlstring)() | Returns an XML-encoded String representation of the XMLList object by calling the _toXMLString_ method on each property contained within this XMLList object. | +| [valueOf](TopLevel.XMLList.md#valueof)() | Returns this XMLList object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### XMLList(Object) +- XMLList(value: [Object](TopLevel.Object.md)) + - : Creates a new XMLList object using the + specified _value_. + + + **Parameters:** + - value - the value to use. + + +--- + +## Method Details + +### attribute(String) +- attribute(attributeName: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Returns the attribute associated with this XMLList object that + is identified by the specified name. + + + **Parameters:** + - attributeName - the name of the attribute. + + **Returns:** + - the value of the attribute as either an XMLList or an empty XMLList + + +--- + +### attributes() +- attributes(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMList of the attributes in this XMLList Object. + + **Returns:** + - an XMList of the attributes in this XMLList Object. + + +--- + +### child(Object) +- child(propertyName: [Object](TopLevel.Object.md)): [XMLList](TopLevel.XMLList.md) + - : Returns the children of the XMLList object based on the specified + property name. + + + **Parameters:** + - propertyName - the property name representing the children of this XMLList object. + + **Returns:** + - an XMLList of children that match the property name + parameter. + + + +--- + +### children() +- children(): [XMLList](TopLevel.XMLList.md) + - : Returns an XMLList containing the children of this XMLList object, maintaing + the sequence in which they appear. + + + **Returns:** + - an XMLList containing the children of this XMLList object. + + +--- + +### comments() +- comments(): [XMLList](TopLevel.XMLList.md) + - : Returns the properties of the XMLList object that contain comments. + + **Returns:** + - properties of the XMLList object that contain comments. + + +--- + +### contains(XML) +- contains(value: [XML](TopLevel.XML.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this XMLList object contains the specified + XML object, false otherwise. + + + **Parameters:** + - value - the object to locate in this XMLList object. + + **Returns:** + - true if this XMLList object contains the specified + XML object, false otherwise. + + + +--- + +### copy() +- copy(): [XMLList](TopLevel.XMLList.md) + - : Returns a deep copy of the this XMLList object. + + **Returns:** + - the deep copy of the object. + + +--- + +### descendants() +- descendants(): [XMLList](TopLevel.XMLList.md) + - : Calls the _descendants()_ method of each XML object in this XMLList + object and returns an XMLList containing the + results concatenated in order. + + + **Returns:** + - a list of all descendents of the XML objects in this XMLList object. + + +--- + +### descendants(String) +- descendants(name: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Calls the _descendants(name)_ method of each XML object in this XMLList + object and returns an XMLList containing the + results concatenated in order. + + + **Parameters:** + - name - the name of the element to match. To return all descendents, use \* as the _name_ parameter. + + **Returns:** + - a list of all descendents of the XML objects in this XMLList + constrained by the _name_ parameter. + + + +--- + +### elements() +- elements(): [XMLList](TopLevel.XMLList.md) + - : Calls the _elements()_ method in each XML object in this XMLList + object and returns an XMLList containing the results concatenated in order. + + + +--- + +### elements(Object) +- elements(name: [Object](TopLevel.Object.md)): [XMLList](TopLevel.XMLList.md) + - : Calls the _elements(name)_ method in each of the XML objects in + this XMLList object and returns an XMLList containing the results + concatenated in order. _name_ can be a + QName, String, or any other data type that will be converted + to a string prior to performing the search for elements of that + name. + + To list all objects use \* for the value of _name_. + + + **Parameters:** + - name - the name of the elements to return. + + **Returns:** + - a list of all elements of the XML objects in this XMLList + constrained by the _name_ parameter. + + + +--- + +### hasComplexContent() +- hasComplexContent(): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether + this XMLList object contains complex content. An XMLList object is considered + to contain complex content if it is not empty, contains a single XML item + with complex content or contains elements. + + + **Returns:** + - a Boolean value indicating whether this XMLList object contains complex content. + + +--- + +### hasOwnProperty(String) +- hasOwnProperty(prop: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether this object has the + property specified by _prop_. + + + **Parameters:** + - prop - the property to locate. + + **Returns:** + - true if the property exists, false otherwise. + + +--- + +### hasSimpleContent() +- hasSimpleContent(): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean value indicating whether this XML object contains + simple content. An XMLList object is considered to contain simple + content if it is empty, contains a single XML item with simple + content or contains no elements. + + + **Returns:** + - a Boolean value indicating whether this XML object contains + simple content. + + + +--- + +### length() +- length(): [Number](TopLevel.Number.md) + - : Returns the number of children in this XMLList + object. + + + **Returns:** + - the number of children in this XMLList + object. + + + +--- + +### normalize() +- normalize(): [XMLList](TopLevel.XMLList.md) + - : Puts all text nodes in this XMLList, all the XML objects it + contains and the descendents of all the XML objects it + contains into a normal form by merging adjacent text nodes + and eliminating empty text nodes. + + + **Returns:** + - the XMLList object containing normailzed objects. + + +--- + +### parent() +- parent(): [Object](TopLevel.Object.md) + - : Returns the parent of the XMLList object + or null if the XMLList object does not have + a parent. + + + **Returns:** + - the parent of the XMLList object + or null if the XMLList object does not have + a parent. + + + +--- + +### processingInstructions() +- processingInstructions(): [XMLList](TopLevel.XMLList.md) + - : Calls the _processingInstructions()_ method of each XML object + in this XMLList object and returns an XMList containing the results + in order. + + + **Returns:** + - an XMLList contaiing the result of calling the + _processingInstructions()_ method of each XML object + in this XMLList object. + + + +--- + +### processingInstructions(String) +- processingInstructions(name: [String](TopLevel.String.md)): [XMLList](TopLevel.XMLList.md) + - : Calls the _processingInstructions(name)_ method of each XML object + in this XMLList object and returns an XMList containing the results + in order. + + + **Parameters:** + - name - the name representing the processing-instructions you want to retreive. + + **Returns:** + - an XMLList containing the result of calling the + _processingInstructions(name)_ method of each XML object + in this XMLList object. + + + +--- + +### propertyIsEnumerable(String) +- propertyIsEnumerable(property: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns a Boolean indicating whether the specified + _property_ will be included in the set of properties iterated + over when this XML object is used in a _for..in_ statement. + + + **Parameters:** + - property - the property to test. + + **Returns:** + - true when the property can be iterated in a _for..in_ + statement, false otherwise. + + + +--- + +### text() +- text(): [XMLList](TopLevel.XMLList.md) + - : Calls the _text()_ method of each XML object contained + in this XMLList object and returns an XMLList containing + the results concatenated in order. + + + **Returns:** + - the concatenated results of calling the _text()_ + method of every XML object contained in this XMLList. + + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns the String representation of this XMLList object. + + **Returns:** + - the String representation of this XMLList object. + + +--- + +### toXMLString() +- toXMLString(): [String](TopLevel.String.md) + - : Returns an XML-encoded String representation of the XMLList object + by calling the _toXMLString_ method on each property contained + within this XMLList object. + + + **Returns:** + - an XML-encoded String representation of the XMLList object + by calling the _toXMLString_ method on each property contained + within this XMLList object. + + + +--- + +### valueOf() +- valueOf(): [XMLList](TopLevel.XMLList.md) + - : Returns this XMLList object. + + **Returns:** + - this XMLList object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLStreamError.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLStreamError.md new file mode 100644 index 00000000..c52e649f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.XMLStreamError.md @@ -0,0 +1,115 @@ + +# Class XMLStreamError + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.Error](TopLevel.Error.md) + - [TopLevel.XMLStreamError](TopLevel.XMLStreamError.md) + +This error indicates an XML streaming related error in the system. The IOError +is always related to a systems internal Java exception. The class provides +access to some more details about this internal Java exception. In particular +the class informs about the location of the error. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [causeFullName](#causefullname): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the full name of the associated Java exception. | +| [causeMessage](#causemessage): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the message of the associated Java exception. | +| [causeName](#causename): [String](TopLevel.String.md) | If the exception is associated with a root cause, the property contains the simplified name of the associated Java exception. | +| [javaFullName](#javafullname): [String](TopLevel.String.md) | The full name of the underlying Java exception. | +| [javaMessage](#javamessage): [String](TopLevel.String.md) | The message of the underlying Java exception. | +| [javaName](#javaname): [String](TopLevel.String.md) | The simplified name of the underlying Java exception. | +| [xmlColumnNumber](#xmlcolumnnumber): [Number](TopLevel.Number.md) | The column number where the error occured. | +| [xmlLineNumber](#xmllinenumber): [Number](TopLevel.Number.md) | The line where the error occured. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLStreamError](#xmlstreamerror)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### causeFullName +- causeFullName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the full name of the associated Java exception. + + + +--- + +### causeMessage +- causeMessage: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the message of the associated Java exception. + + + +--- + +### causeName +- causeName: [String](TopLevel.String.md) + - : If the exception is associated with a root cause, the property + contains the simplified name of the associated Java exception. + + + +--- + +### javaFullName +- javaFullName: [String](TopLevel.String.md) + - : The full name of the underlying Java exception. + + +--- + +### javaMessage +- javaMessage: [String](TopLevel.String.md) + - : The message of the underlying Java exception. + + +--- + +### javaName +- javaName: [String](TopLevel.String.md) + - : The simplified name of the underlying Java exception. + + +--- + +### xmlColumnNumber +- xmlColumnNumber: [Number](TopLevel.Number.md) + - : The column number where the error occured. + + +--- + +### xmlLineNumber +- xmlLineNumber: [Number](TopLevel.Number.md) + - : The line where the error occured. + + +--- + +## Constructor Details + +### XMLStreamError() +- XMLStreamError() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.arguments.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.arguments.md new file mode 100644 index 00000000..68afd31c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.arguments.md @@ -0,0 +1,56 @@ + +# Class arguments + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.arguments](TopLevel.arguments.md) + +The arguments of a function. + +**See Also:** +- [Function](TopLevel.Function.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [callee](#callee): [Object](TopLevel.Object.md) | A reference to the function that is currently executing. | +| [length](#length): [Number](TopLevel.Number.md) | The number of arguments passed to the function. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [arguments](#arguments)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### callee +- callee: [Object](TopLevel.Object.md) + - : A reference to the function that is currently executing. + + +--- + +### length +- length: [Number](TopLevel.Number.md) + - : The number of arguments passed to the function. + + +--- + +## Constructor Details + +### arguments() +- arguments() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.global.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.global.md new file mode 100644 index 00000000..f4e83d6a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.global.md @@ -0,0 +1,539 @@ + +# Class global + +- [TopLevel.Object](TopLevel.Object.md) + - [TopLevel.global](TopLevel.global.md) + +The global object is a pre-defined object that serves as a placeholder for the global +properties and functions of JavaScript. All other predefined objects, functions, and +properties are accessible through the global object. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [Infinity](#infinity): [Number](TopLevel.Number.md) | representation for Infinity as an Integer | +| [NaN](#nan): [Number](TopLevel.Number.md) | representation for Not a Number as an Integer | +| [PIPELET_ERROR](#pipelet_error): [Number](TopLevel.Number.md) | represents an error during pipelet execution | +| [PIPELET_NEXT](#pipelet_next): [Number](TopLevel.Number.md) | represents the next pipelet to fire | +| [slotcontent](#slotcontent): [Object](TopLevel.Object.md) | Provides access to the SlotContent object. | +| [undefined](#undefined): [Object](TopLevel.Object.md) | representation for undefined | +| [webreferences2](#webreferences2): [Object](TopLevel.Object.md) | Provides access to WSDL definition files in a Cartridge's webreferences2 folder. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [customer](#customer): [Customer](dw.customer.Customer.md) | The current customer or null if this request is not associated with any customer. | +| [exports](#exports): [Object](TopLevel.Object.md) | References the [module.exports](TopLevel.Module.md#exports) property of the current module. | +| [globalThis](#globalthis): [Object](TopLevel.Object.md) | Provides access to the global scope object containing all built-in functions and classes. | +| [module](#module): [Module](TopLevel.Module.md) | An object representing the current module. | +| [request](#request): [Request](dw.system.Request.md) | The current request. | +| [response](#response): [Response](dw.system.Response.md) | The current response. | +| [session](#session): [Session](dw.system.Session.md) | The current session. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [decodeURI](TopLevel.global.md#decodeuristring)([String](TopLevel.String.md)) | Unescapes characters in a URI component. | +| static [decodeURIComponent](TopLevel.global.md#decodeuricomponentstring)([String](TopLevel.String.md)) | Unescapes characters in a URI component. | +| static [empty](TopLevel.global.md#emptyobject)([Object](TopLevel.Object.md)) | The method tests, whether the given object is empty. | +| static [encodeURI](TopLevel.global.md#encodeuristring)([String](TopLevel.String.md)) | Escapes characters in a URI. | +| static [encodeURIComponent](TopLevel.global.md#encodeuricomponentstring)([String](TopLevel.String.md)) | Escapes characters in a URI component. | +| static [escape](TopLevel.global.md#escapestring)([String](TopLevel.String.md)) | Encodes a String. | +| ~~static [eval](TopLevel.global.md#evalstring)([String](TopLevel.String.md))~~ | Execute JavaScript code from a String. | +| static [importClass](TopLevel.global.md#importclassobject)([Object](TopLevel.Object.md)) | Import the specified class and make it available at the top level. | +| static [importPackage](TopLevel.global.md#importpackageobject)([Object](TopLevel.Object.md)) | Import all the classes in the specified package available at the top level. | +| static [importScript](TopLevel.global.md#importscriptstring)([String](TopLevel.String.md)) | Imports all functions from the specified script. | +| static [isFinite](TopLevel.global.md#isfinitenumber)([Number](TopLevel.Number.md)) | Returns true if the specified Number is finite. | +| static [isNaN](TopLevel.global.md#isnanobject)([Object](TopLevel.Object.md)) | Test the specified value to determine if it is not a Number. | +| static [isXMLName](TopLevel.global.md#isxmlnamestring)([String](TopLevel.String.md)) | Determines whether the specified string is a valid name for an XML element or attribute. | +| static [parseFloat](TopLevel.global.md#parsefloatstring)([String](TopLevel.String.md)) | Parses a String into an float Number. | +| static [parseInt](TopLevel.global.md#parseintstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Parses a String into an integer Number using the specified radix. | +| static [parseInt](TopLevel.global.md#parseintstring---variant-1)([String](TopLevel.String.md)) | Parses a String into an integer Number. This function is a short form for the call to [parseInt(String, Number)](TopLevel.global.md#parseintstring-number) with automatic determination of the radix. | +| static [parseInt](TopLevel.global.md#parseintstring---variant-2)([String](TopLevel.String.md)) | Parses a String into an integer Number. | +| static [require](TopLevel.global.md#requirestring)([String](TopLevel.String.md)) | The require() function supports loading of modules in JavaScript. | +| static [trace](TopLevel.global.md#tracestring-object)([String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Formats and prints the message using the specified params and returns the formatted message. | +| static [unescape](TopLevel.global.md#unescapestring)([String](TopLevel.String.md)) | Decode an escaped String. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### Infinity + +- Infinity: [Number](TopLevel.Number.md) + - : representation for Infinity as an Integer + + +--- + +### NaN + +- NaN: [Number](TopLevel.Number.md) + - : representation for Not a Number as an Integer + + +--- + +### PIPELET_ERROR + +- PIPELET_ERROR: [Number](TopLevel.Number.md) + - : represents an error during pipelet execution + + +--- + +### PIPELET_NEXT + +- PIPELET_NEXT: [Number](TopLevel.Number.md) + - : represents the next pipelet to fire + + +--- + +### slotcontent + +- slotcontent: [Object](TopLevel.Object.md) + - : Provides access to the SlotContent object. Available only in ISML + templates that are defined as the Slot's template. For example, + will print out the callout message + of the active Slot. + + + **See Also:** + - [SlotContent](dw.campaign.SlotContent.md) + + +--- + +### undefined + +- undefined: [Object](TopLevel.Object.md) + - : representation for undefined + + +--- + +### webreferences2 + +- webreferences2: [Object](TopLevel.Object.md) + - : Provides access to WSDL definition files in a Cartridge's webreferences2 + folder. For example, webreferences2.mywebservice loads the + mywebservice.wsdl file and returns an instance of dw.ws.WebReference2. + The WebReference2 instance enables you to access the actual web service + via the WebReference2.getDefaultService() method. + + + **See Also:** + - [WebReference2](dw.ws.WebReference2.md) + + +--- + +## Property Details + +### customer +- customer: [Customer](dw.customer.Customer.md) + - : The current customer or null if this request is not associated with any customer. + + +--- + +### exports +- exports: [Object](TopLevel.Object.md) + - : References the [module.exports](TopLevel.Module.md#exports) property of the current module. Available only in scripts that were loaded + as CommonJS module using the [require(String)](TopLevel.global.md#requirestring) function. + + + **See Also:** + - [Module.exports](TopLevel.Module.md#exports) + + +--- + +### globalThis +- globalThis: [Object](TopLevel.Object.md) + - : Provides access to the global scope object containing all built-in functions and classes. + + +--- + +### module +- module: [Module](TopLevel.Module.md) + - : An object representing the current module. Available only in scripts that were loaded + as CommonJS module using the [require(String)](TopLevel.global.md#requirestring) function. + + + **See Also:** + - [Module](TopLevel.Module.md) + + +--- + +### request +- request: [Request](dw.system.Request.md) + - : The current request. + + +--- + +### response +- response: [Response](dw.system.Response.md) + - : The current response. + + +--- + +### session +- session: [Session](dw.system.Session.md) + - : The current session. + + +--- + +## Method Details + +### decodeURI(String) +- static decodeURI(uri: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Unescapes characters in a URI component. + + **Parameters:** + - uri - a string that contains an encoded URI or other text to be decoded. + + **Returns:** + - A copy of _uri_ with any hexadecimal escape sequences replaced with the + characters they represent + + + +--- + +### decodeURIComponent(String) +- static decodeURIComponent(uriComponent: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Unescapes characters in a URI component. + + **Parameters:** + - uriComponent - a string that contains an encoded URI component or other text to be decoded. + + **Returns:** + - A copy of _uriComponent_ with any hexadecimal escape sequences replaced with the + characters they represent + + + +--- + +### empty(Object) +- static empty(obj: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : The method tests, whether the given object is empty. The interpretation + of empty is the following. + - null is always empty + - undefined is always empty + - a string with zero length is empty + - an array with no elements is empty + - a collection with no elements is empty + + + **Parameters:** + - obj - the object to be thested + + **Returns:** + - true if the object is interpreted as being empty + + +--- + +### encodeURI(String) +- static encodeURI(uri: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Escapes characters in a URI. + + **Parameters:** + - uri - a String that contains the URI or other text to be encoded. + + **Returns:** + - a copy of _uri_ with certain characters replaced by + hexadecimal escape sequences. + + + +--- + +### encodeURIComponent(String) +- static encodeURIComponent(uriComponent: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Escapes characters in a URI component. + + **Parameters:** + - uriComponent - a String that contains a portion of a URI or other text to be encoded. + + **Returns:** + - a copy of _uriComponent_ with certain characters replaced by + hexadecimal escape sequences. + + + +--- + +### escape(String) +- static escape(s: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Encodes a String. + + **Parameters:** + - s - the String to be encoded. + + **Returns:** + - a copy of _s_ where characters have been replace by + hexadecimal escape sequences. + + + +--- + +### eval(String) +- ~~static eval(code: [String](TopLevel.String.md)): [Object](TopLevel.Object.md)~~ + - : Execute JavaScript code from a String. + + **Parameters:** + - code - a String that contains the JavaScript expression to be evaluated or the statements to be executed. + + **Returns:** + - the value of the executed call or null. + + **Deprecated:** +:::warning +The eval() function is deprecated, because it's potential security risk for server side code injection. +::: + +--- + +### importClass(Object) +- static importClass(classPath: [Object](TopLevel.Object.md)): void + - : Import the specified class and make it + available at the top level. It's equivalent in effect to the + Java import declaration. + + + **Parameters:** + - classPath - the fully qualified class path. + + +--- + +### importPackage(Object) +- static importPackage(packagePath: [Object](TopLevel.Object.md)): void + - : Import all the classes in the specified package + available at the top level. It's equivalent in effect to the + Java import declaration. + + + **Parameters:** + - packagePath - the fully qualified package path. + + +--- + +### importScript(String) +- static importScript(scriptPath: [String](TopLevel.String.md)): void + - : Imports all functions from the specified script. Variables are not imported + from the script and must be accessed through helper functions. + + The script path has the following syntax: \[cartridgename:\]scriptname, where + cartridgename identifies a cartridge where the script file is located. If + cartridgename is omitted the script file is loaded from the same cartridge + in which the importing component is located. + + Examples: + importScript( 'example.ds' ) imports the script file example.ds from the same cartridge + importScript( 'abc:example.ds' ) imports the script file example.ds from the cartridge 'abc' + + + **Parameters:** + - scriptPath - the path to the script. + + +--- + +### isFinite(Number) +- static isFinite(number: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the specified Number is finite. + + **Parameters:** + - number - the Number to test. + + **Returns:** + - true if the specified Number is finite, + false otherwise. + + + +--- + +### isNaN(Object) +- static isNaN(object: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Test the specified value to determine if it + is not a Number. + + + **Parameters:** + - object - the Object to be tested as a number + + **Returns:** + - True if the object is not a number + + +--- + +### isXMLName(String) +- static isXMLName(name: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Determines whether the specified string is a valid name for an + XML element or attribute. + + + **Parameters:** + - name - the String specified + + **Returns:** + - True if the string is a valid name + + +--- + +### parseFloat(String) +- static parseFloat(s: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Parses a String into an float Number. + + **Parameters:** + - s - the String to parse. + + **Returns:** + - Returns the float as a Number. + + +--- + +### parseInt(String, Number) +- static parseInt(s: [String](TopLevel.String.md), radix: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Parses a String into an integer Number using the + specified radix. + + + **Parameters:** + - s - the String to parse. + - radix - the radix to use. + + **Returns:** + - Returns the integer as a Number. + + +--- + +### parseInt(String) - Variant 1 +- static parseInt(s: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Parses a String into an integer Number. + + This function is a short form for the call to [parseInt(String, Number)](TopLevel.global.md#parseintstring-number) with automatic determination of the radix. + If the string starts with "0x" or "0X" then the radix is 16. If the string starts with "0" the the radix is 8. In all other cases the radix is 10. + + + **Parameters:** + - s - the String to parse. + + **Returns:** + - Returns the integer as a Number. + + **API Version:** +:::note +No longer available as of version 16.1. +::: + +--- + +### parseInt(String) - Variant 2 +- static parseInt(s: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Parses a String into an integer Number. + This function is a short form for the call to [parseInt(String, Number)](TopLevel.global.md#parseintstring-number) with automatic determination of the radix. + If the string starts with "0x" or "0X" then the radix is 16. In all other cases the radix is 10. + + + **Parameters:** + - s - the String to parse. + + **Returns:** + - Returns the integer as a Number. + + **API Version:** +:::note +Available from version 16.1. +ECMAScript 5 compliance: removed support for octal numbers. +::: + +--- + +### require(String) +- static require(path: [String](TopLevel.String.md)): [Module](TopLevel.Module.md) + - : The require() function supports loading of modules in JavaScript. The function works similar to the require() function + in CommonJS. The general module loading works the same way, but the exact path lookup is slightly different + and better fits into Demandware concepts. Here are the details for the lookup: + + - If the module name starts with "./" or "../" then load it relative to the current module. The module can be a file or a directory. A file extension is acknowledged, but not required. If it's a directory a 'package.json' or a 'main' file is expected. If the 'package.json' does not contain a main entry, then default to main file in the directory. Access to parent files can't go beyond the cartridges directory. Access to other cartridges is explicitly allowed. + - If the module name starts with "~/" it's a path relative to the current cartridge. + - If the module name starts with "*/" try to find the module in all cartridges that are assigned to the current site. + - A module with the name "dw" or which starts with "dw/" references Demandware built-in functions and classes. For example `var u = require( 'dw/util' );`loads the classes in the util package, which can be then used like `var h = new u.HashMap();` + - A module, which doesn't start with "./" or "../" is resolved as top level module. + - The module name is used to find a folder in the top cartridge directory, typically a cartridge itself, but it can also be a simple folder. + - If nothing is found, the module name is used to look into a special folder called "modules" in the top cartridge directory. That folder can be used by a developer to manage different modules. For example a developer could drop a module like "less.js" just into that folder. + + If the require function is used to reference a file then an optional file extension is used to determine the content of the file. Currently + supported are the extensions ordered by priority: + + - js - JavaScript file + - ds - Demandware Script file + - json - JSON file + + + **Parameters:** + - path - the path to the JavaScript module. + + **Returns:** + - an object with the exported functions and properties. + + +--- + +### trace(String, Object...) +- static trace(msg: [String](TopLevel.String.md), params: [Object...](TopLevel.Object.md)): void + - : Formats and prints the message using the specified params and returns + the formatted message. The format message is a Java MessageFormat + expression. Printing happens in the script log output. + + + **Parameters:** + - msg - the message to format. + - params - one, or multiple parameters that are used to format the message. + + +--- + +### unescape(String) +- static unescape(string: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Decode an escaped String. + + **Parameters:** + - string - the String to decode. + + **Returns:** + - a copy of the String where hexadecimal character sequences + are replace by Unicode characters. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/TopLevel.md b/packages/b2c-tooling-sdk/data/script-api/TopLevel.md new file mode 100644 index 00000000..a6e9e32a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/TopLevel.md @@ -0,0 +1,58 @@ +# Package TopLevel + +## Classes +| Class | Description | +| --- | --- | +| [APIException](TopLevel.APIException.md) | This error indicates an exceptional outcome of some business logic. | +| [arguments](TopLevel.arguments.md) | The arguments of a function. | +| [Array](TopLevel.Array.md) | An Array of items. | +| [ArrayBuffer](TopLevel.ArrayBuffer.md) | The ArrayBuffer represents a generic array of bytes with fixed length. | +| [BigInt](TopLevel.BigInt.md) | A BigInt object is a wrapper for a primitive `bigint` value. | +| [Boolean](TopLevel.Boolean.md) | Provides support for boolean values. | +| [ConversionError](TopLevel.ConversionError.md) | Represents a conversion error. | +| [DataView](TopLevel.DataView.md) | The DataView provides low level access to [ArrayBuffer](TopLevel.ArrayBuffer.md). | +| [Date](TopLevel.Date.md) | A Date object contains a number indicating a particular instant in time to within a millisecond. | +| [Error](TopLevel.Error.md) | Error represents a generic exception. | +| [ES6Iterator](TopLevel.ES6Iterator.md) | This isn't a built-in type. | +| [EvalError](TopLevel.EvalError.md) | Represents an evaluation error. | +| [Fault](TopLevel.Fault.md) | This error indicates an RPC related error in the system. | +| [Float32Array](TopLevel.Float32Array.md) | An optimized array to store 32-bit floating point numbers. | +| [Float64Array](TopLevel.Float64Array.md) | An optimized array to store 64-bit floating point numbers. | +| [Function](TopLevel.Function.md) | The Function class represent a JavaScript function. | +| [Generator](TopLevel.Generator.md) | A generator is a special type of function that works as a factory for iterators and it allows you to define an iterative algorithm by writing a single function which can maintain its own state. | +| [global](TopLevel.global.md) | The global object is a pre-defined object that serves as a placeholder for the global properties and functions of JavaScript. | +| [Int16Array](TopLevel.Int16Array.md) | An optimized array to store 16-bit signed integer numbers. | +| [Int32Array](TopLevel.Int32Array.md) | An optimized array to store 32-bit signed integer numbers. | +| [Int8Array](TopLevel.Int8Array.md) | An optimized array to store 8-bit signed integer numbers. | +| [InternalError](TopLevel.InternalError.md) | Represents the an internal error. | +| [IOError](TopLevel.IOError.md) | This error indicates an I/O related error in the system. | +| [Iterable](TopLevel.Iterable.md) | All objects containing the property @@iterator with a function returning an [ES6Iterator](TopLevel.ES6Iterator.md) are said to be an Iterable. | +| [Iterator](TopLevel.Iterator.md) | An Iterator is a special object that lets you access items from a collection one at a time, while keeping track of its current position within that sequence. | +| [JSON](TopLevel.JSON.md) | The JSON object is a single object that contains two functions, parse and stringify, that are used to parse and construct JSON texts. | +| [Map](TopLevel.Map.md) | Map objects are collections of key/value pairs where both the keys and values may be arbitrary ECMAScript language values. | +| [Math](TopLevel.Math.md) | Mathematical functions and constants. | +| [Module](TopLevel.Module.md) | CommonJS modules are JavaScript files that are loaded using the [require(String)](TopLevel.global.md#requirestring) function. | +| [Namespace](TopLevel.Namespace.md) | Namespace objects represent XML namespaces and provide an association between a namespace prefix and a Unique Resource Identifier (URI). | +| [Number](TopLevel.Number.md) | A Number object represents any numerical value, whether it is an integer or floating-point number. | +| [Object](TopLevel.Object.md) | The _Object_ object is the foundation of all native JavaScript objects. | +| [QName](TopLevel.QName.md) | QName objects are used to represent qualified names of XML elements and attributes. | +| [RangeError](TopLevel.RangeError.md) | Represents a range error. | +| [ReferenceError](TopLevel.ReferenceError.md) | Represents a reference error. | +| [RegExp](TopLevel.RegExp.md) | The RegExp object is a static object that generates instances of a regular expression for pattern matching and monitors all regular expressions in the current window or frame. | +| [Set](TopLevel.Set.md) | A Set can store any kind of element and ensures that no duplicates exist. | +| [StopIteration](TopLevel.StopIteration.md) | A special type of exception that is thrown when an Iterator or Generator sequence is exhausted. | +| [String](TopLevel.String.md) | The String object represents any sequence of zero or more characters that are to be treated strictly as text. | +| [Symbol](TopLevel.Symbol.md) | Symbol is a primitive data type that can serve as object properties. | +| [SyntaxError](TopLevel.SyntaxError.md) | Represents a syntax error. | +| [SystemError](TopLevel.SystemError.md) | This error indicates an error in the system, which doesn't fall into any of the other error categories like for example IOError. | +| [TypeError](TopLevel.TypeError.md) | Represents a type error. | +| [Uint16Array](TopLevel.Uint16Array.md) | An optimized array to store 16-bit unsigned integer numbers. | +| [Uint32Array](TopLevel.Uint32Array.md) | An optimized array to store 32-bit unsigned integer numbers. | +| [Uint8Array](TopLevel.Uint8Array.md) | An optimized array to store 8-bit unsigned integer numbers. | +| [Uint8ClampedArray](TopLevel.Uint8ClampedArray.md) | An optimized array to store 8-bit unsigned integer numbers. | +| [URIError](TopLevel.URIError.md) | Represents a URI error. | +| [WeakMap](TopLevel.WeakMap.md) | The WeakMap is map whose entries are subject to garbage collection if there are no more references to the keys. | +| [WeakSet](TopLevel.WeakSet.md) | The WeakSet is set whose elements are subject to garbage collection if there are no more references to the elements. | +| [XML](TopLevel.XML.md) | The XML object contains functions and properties for working with XML instances. | +| [XMLList](TopLevel.XMLList.md) | An XMLList object is an ordered collection of properties. | +| [XMLStreamError](TopLevel.XMLStreamError.md) | This error indicates an XML streaming related error in the system. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alert.md b/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alert.md new file mode 100644 index 00000000..28ff0128 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alert.md @@ -0,0 +1,175 @@ + +# Class Alert + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.alert.Alert](dw.alert.Alert.md) + +This class represents a single system alert to be shown to a Business Manager user. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [PRIORITY_ACTION](#priority_action): [String](TopLevel.String.md) = "ACTION" | String constant to denote the 'action required' priority. | +| [PRIORITY_INFO](#priority_info): [String](TopLevel.String.md) = "INFO" | String constant to denote the 'informational' priority. | +| [PRIORITY_WARN](#priority_warn): [String](TopLevel.String.md) = "WARN" | String constant to denote the 'warning' priority. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [alertDescriptorID](#alertdescriptorid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the referenced alert description. | +| [contextObjectID](#contextobjectid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the referenced context object (or null, if no context object is assigned to this alert). | +| [displayMessage](#displaymessage): [String](TopLevel.String.md) `(read-only)` | Resolves the display message to be shown. | +| [priority](#priority): [String](TopLevel.String.md) `(read-only)` | Returns the priority assigned to the message. | +| [remediationURL](#remediationurl): [String](TopLevel.String.md) `(read-only)` | The URL of the page where the user can resolve the alert, as provided in the 'alerts.json' descriptor file. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAlertDescriptorID](dw.alert.Alert.md#getalertdescriptorid)() | Returns the ID of the referenced alert description. | +| [getContextObjectID](dw.alert.Alert.md#getcontextobjectid)() | Returns the ID of the referenced context object (or null, if no context object is assigned to this alert). | +| [getDisplayMessage](dw.alert.Alert.md#getdisplaymessage)() | Resolves the display message to be shown. | +| [getPriority](dw.alert.Alert.md#getpriority)() | Returns the priority assigned to the message. | +| [getRemediationURL](dw.alert.Alert.md#getremediationurl)() | The URL of the page where the user can resolve the alert, as provided in the 'alerts.json' descriptor file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### PRIORITY_ACTION + +- PRIORITY_ACTION: [String](TopLevel.String.md) = "ACTION" + - : String constant to denote the 'action required' priority. + + +--- + +### PRIORITY_INFO + +- PRIORITY_INFO: [String](TopLevel.String.md) = "INFO" + - : String constant to denote the 'informational' priority. + + +--- + +### PRIORITY_WARN + +- PRIORITY_WARN: [String](TopLevel.String.md) = "WARN" + - : String constant to denote the 'warning' priority. + + +--- + +## Property Details + +### alertDescriptorID +- alertDescriptorID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the referenced alert description. + + +--- + +### contextObjectID +- contextObjectID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the referenced context object (or null, if no context object is assigned to this alert). + + +--- + +### displayMessage +- displayMessage: [String](TopLevel.String.md) `(read-only)` + - : Resolves the display message to be shown. + It refers to the message resource ID specified in the alert descriptor file ("message-resource-id") and the message provided + by the 'alerts.properties' resource bundle. + When the referenced message contains parameter placeholders (such as '{0}' and '{1}') they are replaced by the parameters stored with the alert. + + + +--- + +### priority +- priority: [String](TopLevel.String.md) `(read-only)` + - : Returns the priority assigned to the message. + One of the string constants defined in this class (PRIORITY\_INFO, PRIORITY\_WARN, PRIORITY\_ACTION). + + + +--- + +### remediationURL +- remediationURL: [String](TopLevel.String.md) `(read-only)` + - : The URL of the page where the user can resolve the alert, as provided in the + 'alerts.json' descriptor file. + + + +--- + +## Method Details + +### getAlertDescriptorID() +- getAlertDescriptorID(): [String](TopLevel.String.md) + - : Returns the ID of the referenced alert description. + + **Returns:** + - the ID of the referenced alert description + + +--- + +### getContextObjectID() +- getContextObjectID(): [String](TopLevel.String.md) + - : Returns the ID of the referenced context object (or null, if no context object is assigned to this alert). + + **Returns:** + - the ID of the referenced context object + + +--- + +### getDisplayMessage() +- getDisplayMessage(): [String](TopLevel.String.md) + - : Resolves the display message to be shown. + It refers to the message resource ID specified in the alert descriptor file ("message-resource-id") and the message provided + by the 'alerts.properties' resource bundle. + When the referenced message contains parameter placeholders (such as '{0}' and '{1}') they are replaced by the parameters stored with the alert. + + + **Returns:** + - the display message + + +--- + +### getPriority() +- getPriority(): [String](TopLevel.String.md) + - : Returns the priority assigned to the message. + One of the string constants defined in this class (PRIORITY\_INFO, PRIORITY\_WARN, PRIORITY\_ACTION). + + + **Returns:** + - the priority + + +--- + +### getRemediationURL() +- getRemediationURL(): [String](TopLevel.String.md) + - : The URL of the page where the user can resolve the alert, as provided in the + 'alerts.json' descriptor file. + + + **Returns:** + - the remediation URL + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alerts.md b/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alerts.md new file mode 100644 index 00000000..2c8e5bc8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.alert.Alerts.md @@ -0,0 +1,256 @@ + +# Class Alerts + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.alert.Alerts](dw.alert.Alerts.md) + + +Allow creation, removal, re-validation and retrieval of alerts that might get visible to Business Manager users. + + +The alerts have to be registered by the 'alerts.json' descriptor file in a cartridge assigned to the Business Manager site. +The descriptor file itself has to be defined in 'package.json' of that cartridge using a property 'alerts' and providing its path +that is relative to the 'package.json'. +The 'alert.json' descriptor files contain the 'alert descriptions', which are referenced by their ID throughout the API. + + +For example, the 'alerts.json' file could have the following content: + + +``` +{ + "alerts": [ + { + "alert-id": "missing_org_config", + "menu-action": "global-prefs_custom_prefs", + "message-resource-id": "global.missing_org_config", + "priority": "ACTION", + "remediation": { + "pipeline":"GlobalCustomPreferences", + "start-node":"View" + } + }, + { + "alert-id":"promo_in_past", + "menu-action":"marketing_promotions", + "context-object-type":"Promotion", + "message-resource-id":"promotion.in_the_past", + "priority":"WARN", + "remediation": { + "pipeline":"ViewApplication", + "start-node":"BM", + "parameter":"screen=Promotion" + } + } + ] +} +``` + +The referenced menu actions can be found in the 'bm\_extensions.xml' file of a Business manager extension cartridge +(a sample file containing all current menu entries is provided when creating a new extension cartridge in Studio). + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [addAlert](dw.alert.Alerts.md#addalertstring-persistentobject-string)([String](TopLevel.String.md), [PersistentObject](dw.object.PersistentObject.md), [String\[\]](TopLevel.String.md)) | Creates a new alert for the given ID and context object. | +| static [addAlert](dw.alert.Alerts.md#addalertstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String\[\]](TopLevel.String.md)) | Creates a new alert for the given ID and ID of the context object. | +| static [addAlert](dw.alert.Alerts.md#addalertstring-string)([String](TopLevel.String.md), [String\[\]](TopLevel.String.md)) | Creates a new alert for the given ID. | +| static [getAlerts](dw.alert.Alerts.md#getalertsstring)([String...](TopLevel.String.md)) | Retrieves all alerts for a set of alert descriptor ID. | +| static [getAlertsForContextObject](dw.alert.Alerts.md#getalertsforcontextobjectpersistentobject-string)([PersistentObject](dw.object.PersistentObject.md), [String...](TopLevel.String.md)) | Retrieves all alerts for a set of alert descriptor ID and the given context object. | +| static [getAlertsForContextObject](dw.alert.Alerts.md#getalertsforcontextobjectstring-string)([String](TopLevel.String.md), [String...](TopLevel.String.md)) | Retrieves all alerts for a set of alert descriptor ID and the given context object ID. | +| static [removeAlert](dw.alert.Alerts.md#removealertstring)([String](TopLevel.String.md)) | Removes all alerts for the given alert descriptor ID. | +| static [removeAlert](dw.alert.Alerts.md#removealertstring-persistentobject)([String](TopLevel.String.md), [PersistentObject](dw.object.PersistentObject.md)) | Removes the alert for the given alert description and context object. | +| static [removeAlert](dw.alert.Alerts.md#removealertstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Removes the alert for the given alert description and context object ID. | +| static [revalidateAlert](dw.alert.Alerts.md#revalidatealertstring-function-string)([String](TopLevel.String.md), [Function](TopLevel.Function.md), [String\[\]](TopLevel.String.md)) | Re-evaluates the process function, and creates or removes the respective alert. | +| static [revalidateAlert](dw.alert.Alerts.md#revalidatealertstring-persistentobject-function-string)([String](TopLevel.String.md), [PersistentObject](dw.object.PersistentObject.md), [Function](TopLevel.Function.md), [String\[\]](TopLevel.String.md)) | Re-evaluates the process function, and creates or removes the respective alert. | +| static [revalidateAlert](dw.alert.Alerts.md#revalidatealertstring-object-string-function-string)([String](TopLevel.String.md), [Object](TopLevel.Object.md), [String](TopLevel.String.md), [Function](TopLevel.Function.md), [String\[\]](TopLevel.String.md)) | Re-evaluates the process function, and creates or removes the respective alert. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### addAlert(String, PersistentObject, String[]) +- static addAlert(alertDescriptorID: [String](TopLevel.String.md), contextObject: [PersistentObject](dw.object.PersistentObject.md), params: [String\[\]](TopLevel.String.md)): void + - : Creates a new alert for the given ID and context object. + If such an alert already exists, no new one is created, and the existing one is not modified. + Multiple alerts for the same alert descriptor ID may exist, as long as they reference different objects. + To refer to the same alert afterwards (e.g. to remove the alert) the same object must be provided. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObject - the context object + - params - parameters which may be shown in the alert message + + +--- + +### addAlert(String, String, String[]) +- static addAlert(alertDescriptorID: [String](TopLevel.String.md), contextObjectID: [String](TopLevel.String.md), params: [String\[\]](TopLevel.String.md)): void + - : Creates a new alert for the given ID and ID of the context object. + If such an alert already exists, no new one is created, and the existing one is not modified. + Multiple alerts for the same alert descriptor ID may exist, as long as they reference different objects. + To refer to the same alert afterwards (e.g. to remove it) the same object ID must be provided. + + Use this method when the alerts refers to an object which is not a PersistentObject. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObjectID - the ID of the referenced object + - params - parameters which may be shown in the alert message + + +--- + +### addAlert(String, String[]) +- static addAlert(alertDescriptorID: [String](TopLevel.String.md), params: [String\[\]](TopLevel.String.md)): void + - : Creates a new alert for the given ID. + If such an alert already exists, no new one is created, and the existing one is not modified. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - params - parameters which may be shown in the alert message + + +--- + +### getAlerts(String...) +- static getAlerts(alertDescriptorIDs: [String...](TopLevel.String.md)): [List](dw.util.List.md) + - : Retrieves all alerts for a set of alert descriptor ID. + + **Parameters:** + - alertDescriptorIDs - the IDs of the referenced alert descriptions + + **Returns:** + - the list of alerts (of type Alert) + + +--- + +### getAlertsForContextObject(PersistentObject, String...) +- static getAlertsForContextObject(contextObject: [PersistentObject](dw.object.PersistentObject.md), alertDescriptorIDs: [String...](TopLevel.String.md)): [List](dw.util.List.md) + - : Retrieves all alerts for a set of alert descriptor ID and the given context object. + + **Parameters:** + - contextObject - the context object + - alertDescriptorIDs - the IDs of the referenced alert descriptions + + **Returns:** + - the list of alerts (of type Alert) + + +--- + +### getAlertsForContextObject(String, String...) +- static getAlertsForContextObject(contextObjectID: [String](TopLevel.String.md), alertDescriptorIDs: [String...](TopLevel.String.md)): [List](dw.util.List.md) + - : Retrieves all alerts for a set of alert descriptor ID and the given context object ID. + + **Parameters:** + - contextObjectID - the ID of the referenced object + - alertDescriptorIDs - the IDs of the referenced alert descriptions + + **Returns:** + - the list of alerts (of type Alert) + + +--- + +### removeAlert(String) +- static removeAlert(alertDescriptorID: [String](TopLevel.String.md)): void + - : Removes all alerts for the given alert descriptor ID. This method will remove also alert referencing + context objects, as long as they reference the same alert description. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + + +--- + +### removeAlert(String, PersistentObject) +- static removeAlert(alertDescriptorID: [String](TopLevel.String.md), contextObject: [PersistentObject](dw.object.PersistentObject.md)): void + - : Removes the alert for the given alert description and context object. + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObject - the context object + + +--- + +### removeAlert(String, String) +- static removeAlert(alertDescriptorID: [String](TopLevel.String.md), contextObjectID: [String](TopLevel.String.md)): void + - : Removes the alert for the given alert description and context object ID. + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObjectID - the context object ID + + +--- + +### revalidateAlert(String, Function, String[]) +- static revalidateAlert(alertDescriptorID: [String](TopLevel.String.md), processFunction: [Function](TopLevel.Function.md), params: [String\[\]](TopLevel.String.md)): void + - : Re-evaluates the process function, and creates or removes the respective alert. + The process function must return true when the alert should be created, and false when it should be removed. + When the process function states that the alert should be created, but it already exists, it is not created again. Instead, the existing + alert is updated with the supplied parameters. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - processFunction - the validation function. Must return true when the alert needs to be created. + - params - parameters which may be shown in the alert message + + +--- + +### revalidateAlert(String, PersistentObject, Function, String[]) +- static revalidateAlert(alertDescriptorID: [String](TopLevel.String.md), contextObject: [PersistentObject](dw.object.PersistentObject.md), processFunction: [Function](TopLevel.Function.md), params: [String\[\]](TopLevel.String.md)): void + - : Re-evaluates the process function, and creates or removes the respective alert. The context object is handed as the only parameter to the process function. + The process function must return true when the alert should be created, and false when it should be removed. + When the process function states that the alert should be created, but it already exists, it is not created again. Instead, the existing + alert is updated with the supplied parameters. + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObject - the context object for which the validation is done, might be null + - processFunction - the validation function. Must return true when the alert needs to be created. + - params - parameters which may be shown in the alert message + + +--- + +### revalidateAlert(String, Object, String, Function, String[]) +- static revalidateAlert(alertDescriptorID: [String](TopLevel.String.md), contextObject: [Object](TopLevel.Object.md), contextObjectID: [String](TopLevel.String.md), processFunction: [Function](TopLevel.Function.md), params: [String\[\]](TopLevel.String.md)): void + - : Re-evaluates the process function, and creates or removes the respective alert. When the optional + context object is supplied, it is handed as the only parameter to the process function (if its not supplied, + no parameter is given to the function). + The process function must return true when the alert should be created, and false when it should be removed. + When the process function states that the alert should be created, but it already exists, it is not created again. Instead, the existing + alert is updated with the supplied parameters. + Use this variant of the function when the context object is not a persistent object. In this case the ID to be assigned + to the alert must be supplied as an additional parameter. (Either both the context object and the ID must be provided, or none of them) + + + **Parameters:** + - alertDescriptorID - the ID of the referenced alert description + - contextObject - the context object for which the validation is done + - contextObjectID - the id of the context object for which the validation is done (and which is used to add / remove the alert object) + - processFunction - the validation function. Must return true when the alert needs to be created. + - params - parameters which may be shown in the alert message + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.alert.md b/packages/b2c-tooling-sdk/data/script-api/dw.alert.md new file mode 100644 index 00000000..ae3f146a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.alert.md @@ -0,0 +1,7 @@ +# Package dw.alert + +## Classes +| Class | Description | +| --- | --- | +| [Alert](dw.alert.Alert.md) | This class represents a single system alert to be shown to a Business Manager user. | +| [Alerts](dw.alert.Alerts.md) |

Allow creation, removal, re-validation and retrieval of alerts that might get visible to Business Manager users. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTest.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTest.md new file mode 100644 index 00000000..1626b9b5 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTest.md @@ -0,0 +1,63 @@ + +# Class ABTest + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.campaign.ABTest](dw.campaign.ABTest.md) + +Object representing an AB-test in Commerce Cloud Digital. + + +AB-tests provide the merchant the ability to compare one set of storefront +"experiences" - promotions, sorting rules, and slot configurations in +particular - against another set. The merchant configures different AB-test +segments which define the sets of experiences that the merchant wishes to +test. AB-tests run for a configured period of time, and customers are +randomly assigned by the platform to the test segments according to +allocation percentages defined by the merchant. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Get the test ID for this AB-test. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.campaign.ABTest.md#getid)() | Get the test ID for this AB-test. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Get the test ID for this AB-test. + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : Get the test ID for this AB-test. + + **Returns:** + - the test ID for this AB-test. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestMgr.md new file mode 100644 index 00000000..4f2805ca --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestMgr.md @@ -0,0 +1,76 @@ + +# Class ABTestMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.ABTestMgr](dw.campaign.ABTestMgr.md) + +Manager class used to access AB-test information in the storefront. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [assignedTestSegments](#assignedtestsegments): [Collection](dw.util.Collection.md) `(read-only)` | Return the AB-test segments to which the current customer is assigned. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getAssignedTestSegments](dw.campaign.ABTestMgr.md#getassignedtestsegments)() | Return the AB-test segments to which the current customer is assigned. | +| static [isParticipant](dw.campaign.ABTestMgr.md#isparticipantstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Test whether the current customer is a member of the specified AB-test segment. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### assignedTestSegments +- assignedTestSegments: [Collection](dw.util.Collection.md) `(read-only)` + - : Return the AB-test segments to which the current customer is assigned. + AB-test segments deleted in the meantime will not be returned. + + + +--- + +## Method Details + +### getAssignedTestSegments() +- static getAssignedTestSegments(): [Collection](dw.util.Collection.md) + - : Return the AB-test segments to which the current customer is assigned. + AB-test segments deleted in the meantime will not be returned. + + + **Returns:** + - unordered collection of ABTestSegment instances representing the + AB-test segments to which the current customer is assigned. + + + +--- + +### isParticipant(String, String) +- static isParticipant(testID: [String](TopLevel.String.md), segmentID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : 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. + + + **Parameters:** + - testID - The ID of the AB-test, must not be null. + - segmentID - The ID of the segment within the AB-test, must not be null. + + **Returns:** + - true if the current customer is a member of the specified AB-test + segment, false otherwise. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestSegment.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestSegment.md new file mode 100644 index 00000000..7df1df59 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ABTestSegment.md @@ -0,0 +1,107 @@ + +# Class ABTestSegment + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.campaign.ABTestSegment](dw.campaign.ABTestSegment.md) + +Object representing an AB-test segment in the Commerce Cloud Digital. + + +Each AB-test defines 1 or more segments to which customers are randomly +assigned by the platform when they qualify for the AB-test. Customers are +assigned to segments according to allocation percentages controlled by the +merchant. Each AB-test segment defines a set of "experiences" that the +merchant is testing and which which apply only to the customers in that +segment. There is always one "control" segment which contains only the +default set of experiences for that site. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ABTest](#abtest): [ABTest](dw.campaign.ABTest.md) `(read-only)` | Get the AB-test to which this segment belongs. | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Get the ID of the AB-test segment. | +| [controlSegment](#controlsegment): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if this is the "control segment" for the AB-test, meaning the segment that has no experiences associated with it. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getABTest](dw.campaign.ABTestSegment.md#getabtest)() | Get the AB-test to which this segment belongs. | +| [getID](dw.campaign.ABTestSegment.md#getid)() | Get the ID of the AB-test segment. | +| [isControlSegment](dw.campaign.ABTestSegment.md#iscontrolsegment)() | Returns true if this is the "control segment" for the AB-test, meaning the segment that has no experiences associated with it. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ABTest +- ABTest: [ABTest](dw.campaign.ABTest.md) `(read-only)` + - : Get the AB-test to which this segment belongs. + + +--- + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Get the ID of the AB-test segment. + + +--- + +### controlSegment +- controlSegment: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if this is the "control segment" for the AB-test, meaning + the segment that has no experiences associated with it. + + + +--- + +## Method Details + +### getABTest() +- getABTest(): [ABTest](dw.campaign.ABTest.md) + - : Get the AB-test to which this segment belongs. + + **Returns:** + - the AB-test to which this segment belongs. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Get the ID of the AB-test segment. + + **Returns:** + - the ID of the AB-test segment. + + +--- + +### isControlSegment() +- isControlSegment(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this is the "control segment" for the AB-test, meaning + the segment that has no experiences associated with it. + + + **Returns:** + - true if this segment is the "control segment" for the AB-test, or + false otherwise. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.AmountDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.AmountDiscount.md new file mode 100644 index 00000000..4e7c860d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.AmountDiscount.md @@ -0,0 +1,70 @@ + +# Class AmountDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.AmountDiscount](dw.campaign.AmountDiscount.md) + +Represents an _amount-off_ discount in the discount plan, for example +"$10 off all orders $100 or more". + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [amount](#amount): [Number](TopLevel.Number.md) `(read-only)` | Returns the discount amount, for example 10.00 for a "$10 off" discount. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [AmountDiscount](#amountdiscountnumber)([Number](TopLevel.Number.md)) | Create an amount-discount on the fly. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAmount](dw.campaign.AmountDiscount.md#getamount)() | Returns the discount amount, for example 10.00 for a "$10 off" discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### amount +- amount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the discount amount, for example 10.00 for a "$10 off" discount. + + +--- + +## Constructor Details + +### AmountDiscount(Number) +- AmountDiscount(amount: [Number](TopLevel.Number.md)) + - : Create an amount-discount on the fly. Can be used to create a custom price adjustment. + + **Parameters:** + - amount - amount off, e.g. 15.00 for a "15$ off" discount + + +--- + +## Method Details + +### getAmount() +- getAmount(): [Number](TopLevel.Number.md) + - : Returns the discount amount, for example 10.00 for a "$10 off" discount. + + **Returns:** + - Discount amount + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ApproachingDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ApproachingDiscount.md new file mode 100644 index 00000000..903ec192 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.ApproachingDiscount.md @@ -0,0 +1,157 @@ + +# Class ApproachingDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.ApproachingDiscount](dw.campaign.ApproachingDiscount.md) + +Transient class representing a discount that a [LineItemCtnr](dw.order.LineItemCtnr.md) +"almost" qualifies for based on the amount of merchandise in it. Storefronts +can display information about approaching discounts to customers in order to +entice them to buy more merchandise. + + +Approaching discounts are calculated on the basis of a +[DiscountPlan](dw.campaign.DiscountPlan.md) instead of a LineItemCtnr itself. When one +of [PromotionMgr.getDiscounts(LineItemCtnr)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr) or +[PromotionMgr.getDiscounts(LineItemCtnr, PromotionPlan)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr-promotionplan) is +called, the promotions engine calculates the discounts the LineItemCtnr +receives based on the promotions in context, and also tries to determine the +discounts the LineItemCtnr would receive if additional merchandise were +added. DiscountPlan provides different methods to retrieve this approaching +discount info. Merchants can use these fine-grained methods to display +information about approaching order discounts on the cart page, and +approaching shipping discounts on the shipping method page during checkout, +for example. + + +The merchant may include or exclude individual promotions from being included +in this list, and define distance thresholds when configuring their +promotions. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [conditionThreshold](#conditionthreshold): [Money](dw.value.Money.md) `(read-only)` | The amount of merchandise required in the cart in order to receive the discount. | +| [discount](#discount): [Discount](dw.campaign.Discount.md) `(read-only)` | The discount that the customer will receive if he adds more merchandise to the cart. | +| [distanceFromConditionThreshold](#distancefromconditionthreshold): [Money](dw.value.Money.md) `(read-only)` | Convenience method that returns `getConditionThreshold().subtract(getMerchandiseValue())` | +| [merchandiseTotal](#merchandisetotal): [Money](dw.value.Money.md) `(read-only)` | The amount of merchandise in the cart contributing towards the condition threshold. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getConditionThreshold](dw.campaign.ApproachingDiscount.md#getconditionthreshold)() | The amount of merchandise required in the cart in order to receive the discount. | +| [getDiscount](dw.campaign.ApproachingDiscount.md#getdiscount)() | The discount that the customer will receive if he adds more merchandise to the cart. | +| [getDistanceFromConditionThreshold](dw.campaign.ApproachingDiscount.md#getdistancefromconditionthreshold)() | Convenience method that returns `getConditionThreshold().subtract(getMerchandiseValue())` | +| [getMerchandiseTotal](dw.campaign.ApproachingDiscount.md#getmerchandisetotal)() | The amount of merchandise in the cart contributing towards the condition threshold. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### conditionThreshold +- conditionThreshold: [Money](dw.value.Money.md) `(read-only)` + - : The amount of merchandise required in the cart in order to receive the + discount. For an order promotion "Get 15% off orders of $100 or more", + the condition threshold is $100.00. + + + +--- + +### discount +- discount: [Discount](dw.campaign.Discount.md) `(read-only)` + - : The discount that the customer will receive if he adds more merchandise + to the cart. For an order promotion "Get 15% off orders of $100 or more", + the discount is a PercentageDiscount object. + + + +--- + +### distanceFromConditionThreshold +- distanceFromConditionThreshold: [Money](dw.value.Money.md) `(read-only)` + - : Convenience method that returns + `getConditionThreshold().subtract(getMerchandiseValue())` + + + +--- + +### merchandiseTotal +- merchandiseTotal: [Money](dw.value.Money.md) `(read-only)` + - : The amount of merchandise in the cart contributing towards the condition + threshold. This will always be less than the condition threshold. + + + +--- + +## Method Details + +### getConditionThreshold() +- getConditionThreshold(): [Money](dw.value.Money.md) + - : The amount of merchandise required in the cart in order to receive the + discount. For an order promotion "Get 15% off orders of $100 or more", + the condition threshold is $100.00. + + + **Returns:** + - The amount of merchandise required in the cart in order to + receive the discount. + + + +--- + +### getDiscount() +- getDiscount(): [Discount](dw.campaign.Discount.md) + - : The discount that the customer will receive if he adds more merchandise + to the cart. For an order promotion "Get 15% off orders of $100 or more", + the discount is a PercentageDiscount object. + + + **Returns:** + - The discount that the customer will receive if he adds more + merchandise to the cart. + + + +--- + +### getDistanceFromConditionThreshold() +- getDistanceFromConditionThreshold(): [Money](dw.value.Money.md) + - : Convenience method that returns + `getConditionThreshold().subtract(getMerchandiseValue())` + + + **Returns:** + - The amount of money needed to add to the order or shipment in + order to receive the discount. + + + +--- + +### getMerchandiseTotal() +- getMerchandiseTotal(): [Money](dw.value.Money.md) + - : The amount of merchandise in the cart contributing towards the condition + threshold. This will always be less than the condition threshold. + + + **Returns:** + - The amount of merchandise in the cart contributing towards the + condition threshold. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusChoiceDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusChoiceDiscount.md new file mode 100644 index 00000000..1956093b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusChoiceDiscount.md @@ -0,0 +1,190 @@ + +# Class BonusChoiceDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.BonusChoiceDiscount](dw.campaign.BonusChoiceDiscount.md) + +Represents a _choice of bonus products_ discount in the discount plan, +for example "Choose 3 DVDs from a list of 20 options with your purchase of +any DVD player." + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bonusProducts](#bonusproducts): [List](dw.util.List.md) `(read-only)` | Get the list of bonus products which the customer is allowed to choose from for this discount. | +| [maxBonusItems](#maxbonusitems): [Number](TopLevel.Number.md) `(read-only)` | Returns the maximum number of bonus items that a customer is entitled to select for this discount. | +| [ruleBased](#rulebased): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if this is a "rule based" bonus choice discount. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBonusProductPrice](dw.campaign.BonusChoiceDiscount.md#getbonusproductpriceproduct)([Product](dw.catalog.Product.md)) | Get the effective price for the passed bonus product. | +| [getBonusProducts](dw.campaign.BonusChoiceDiscount.md#getbonusproducts)() | Get the list of bonus products which the customer is allowed to choose from for this discount. | +| [getMaxBonusItems](dw.campaign.BonusChoiceDiscount.md#getmaxbonusitems)() | Returns the maximum number of bonus items that a customer is entitled to select for this discount. | +| [isRuleBased](dw.campaign.BonusChoiceDiscount.md#isrulebased)() | Returns true if this is a "rule based" bonus choice discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bonusProducts +- bonusProducts: [List](dw.util.List.md) `(read-only)` + - : Get the list of bonus products which the customer is allowed to choose + from for this discount. This list is configured by a merchant entering a + list of SKUs for the discount. Products which do not exist in the system, + or are offline, or are not assigned to a category in the site catalog are + filtered out. Unavailable (i.e. out-of-stock) products are NOT filtered + out. This allows merchants to display out-of-stock bonus products with + appropriate messaging. + + + If a returned product is a master product, the customer is entitled to + choose from any variant. If the product is an option product, the + customer is entitled to choose any value for each option. Since the + promotions engine does not touch the value of the product option line + items, it is the responsibility of custom code to set option prices. + + + If the promotion is rule based, then this method will return an empty list. + A ProductSearchModel should be used to return the bonus products the + customer may choose from instead. See + [ProductSearchModel.PROMOTION_PRODUCT_TYPE_BONUS](dw.catalog.ProductSearchModel.md#promotion_product_type_bonus) and + [ProductSearchModel.setPromotionID(String)](dw.catalog.ProductSearchModel.md#setpromotionidstring) + + + +--- + +### maxBonusItems +- maxBonusItems: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the maximum number of bonus items that a customer is entitled to + select for this discount. + + + +--- + +### ruleBased +- ruleBased: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if this is a "rule based" bonus choice discount. + For such discounts, there is no static list of bonus products + associated with the discount but rather a discounted product + rule associated with the promotion which defines the bonus + products. To retrieve the list of selectable bonus products for + display in the storefront, it is necessary to search for the + bonus products using the [ProductSearchModel](dw.catalog.ProductSearchModel.md) + API since the method [getBonusProducts()](dw.campaign.BonusChoiceDiscount.md#getbonusproducts) in this class + will always return an empty list. Furthermore, for rule based + bonus-choice discounts, [getBonusProductPrice(Product)](dw.campaign.BonusChoiceDiscount.md#getbonusproductpriceproduct) + will always return a price of 0.00 for bonus products. + + + +--- + +## Method Details + +### getBonusProductPrice(Product) +- getBonusProductPrice(product: [Product](dw.catalog.Product.md)): [Number](TopLevel.Number.md) + - : Get the effective price for the passed bonus product. This is expected to + be one of the products returned by [getBonusProducts()](dw.campaign.BonusChoiceDiscount.md#getbonusproducts) with one + exception: If a master product is configured as a bonus product, this + implies that a customer may choose from any of its variants. In this + case, it is allowed to pass in a variant to this method and a price will + be returned. If the passed product is not a valid bonus product, this + method throws an exception. + + + **Parameters:** + - product - The bonus product to retrieve a price for, must not be null. + + **Returns:** + - The price of the passed bonus product as a Number. + + +--- + +### getBonusProducts() +- getBonusProducts(): [List](dw.util.List.md) + - : Get the list of bonus products which the customer is allowed to choose + from for this discount. This list is configured by a merchant entering a + list of SKUs for the discount. Products which do not exist in the system, + or are offline, or are not assigned to a category in the site catalog are + filtered out. Unavailable (i.e. out-of-stock) products are NOT filtered + out. This allows merchants to display out-of-stock bonus products with + appropriate messaging. + + + If a returned product is a master product, the customer is entitled to + choose from any variant. If the product is an option product, the + customer is entitled to choose any value for each option. Since the + promotions engine does not touch the value of the product option line + items, it is the responsibility of custom code to set option prices. + + + If the promotion is rule based, then this method will return an empty list. + A ProductSearchModel should be used to return the bonus products the + customer may choose from instead. See + [ProductSearchModel.PROMOTION_PRODUCT_TYPE_BONUS](dw.catalog.ProductSearchModel.md#promotion_product_type_bonus) and + [ProductSearchModel.setPromotionID(String)](dw.catalog.ProductSearchModel.md#setpromotionidstring) + + + **Returns:** + - An ordered list of bonus products that the customer may choose + from for this discount. + + + +--- + +### getMaxBonusItems() +- getMaxBonusItems(): [Number](TopLevel.Number.md) + - : Returns the maximum number of bonus items that a customer is entitled to + select for this discount. + + + **Returns:** + - The maximum number of bonus items that this discount permits a + customer to select. + + + +--- + +### isRuleBased() +- isRuleBased(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this is a "rule based" bonus choice discount. + For such discounts, there is no static list of bonus products + associated with the discount but rather a discounted product + rule associated with the promotion which defines the bonus + products. To retrieve the list of selectable bonus products for + display in the storefront, it is necessary to search for the + bonus products using the [ProductSearchModel](dw.catalog.ProductSearchModel.md) + API since the method [getBonusProducts()](dw.campaign.BonusChoiceDiscount.md#getbonusproducts) in this class + will always return an empty list. Furthermore, for rule based + bonus-choice discounts, [getBonusProductPrice(Product)](dw.campaign.BonusChoiceDiscount.md#getbonusproductpriceproduct) + will always return a price of 0.00 for bonus products. + + + **Returns:** + - True if this is a rule-based bonus-choice discount, or + false if this discount defines a simple static list of + bonus products. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusDiscount.md new file mode 100644 index 00000000..c36c5bee --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.BonusDiscount.md @@ -0,0 +1,59 @@ + +# Class BonusDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.BonusDiscount](dw.campaign.BonusDiscount.md) + +Represents a _bonus_ discount in the discount plan, for example +"Get a free DVD with your purchase of any DVD player." + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bonusProducts](#bonusproducts): [Collection](dw.util.Collection.md) `(read-only)` | Returns the bonus products associated with this discount that are in stock, online and assigned to site catalog. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBonusProducts](dw.campaign.BonusDiscount.md#getbonusproducts)() | Returns the bonus products associated with this discount that are in stock, online and assigned to site catalog. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bonusProducts +- bonusProducts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the bonus products associated with this discount that are in + stock, online and assigned to site catalog. + + + +--- + +## Method Details + +### getBonusProducts() +- getBonusProducts(): [Collection](dw.util.Collection.md) + - : Returns the bonus products associated with this discount that are in + stock, online and assigned to site catalog. + + + **Returns:** + - Collection of bonus products + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Campaign.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Campaign.md new file mode 100644 index 00000000..e830242e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Campaign.md @@ -0,0 +1,346 @@ + +# Class Campaign + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.campaign.Campaign](dw.campaign.Campaign.md) + +A Campaign is a set of experiences (or site configurations) which may be +deployed as a single unit for a given time frame. The system currently +supports 3 types of experience that may be assigned to a campaign: + + +- Promotions +- Slot Configurations +- Sorting Rules + + +This list may be extended in the future. + + +A campaign can have a start and end date or be open-ended. It may also have +"qualifiers" which determine which customers the campaign applies to. +The currently supported qualifiers are: + + +- Customer groups (where "Everyone" is a possible customer group) +- Source codes +- Coupons + + +A campaign can have list of stores or store groups where it can be applicable to. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique campaign ID. | +| [active](#active): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the campaign is currently active, otherwise 'false'. | +| [applicableInStore](#applicableinstore): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if campaign is applicable to store, otherwise false. | +| [applicableOnline](#applicableonline): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if campaign is applicable to online site, otherwise false. | +| [coupons](#coupons): [Collection](dw.util.Collection.md) `(read-only)` | Returns the coupons assigned to the campaign. | +| [customerGroups](#customergroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the customer groups assigned to the campaign. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the internal description of the campaign. | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if campaign is enabled, otherwise false. | +| [endDate](#enddate): [Date](TopLevel.Date.md) `(read-only)` | Returns the end date of the campaign. | +| [promotions](#promotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns promotions defined in this campaign in no particular order. | +| [sourceCodeGroups](#sourcecodegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the source codes assigned to the campaign. | +| [startDate](#startdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the start date of the campaign. | +| [storeGroups](#storegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns store groups assigned to the campaign. | +| [stores](#stores): [Collection](dw.util.Collection.md) `(read-only)` | Returns stores assigned to the campaign. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCoupons](dw.campaign.Campaign.md#getcoupons)() | Returns the coupons assigned to the campaign. | +| [getCustomerGroups](dw.campaign.Campaign.md#getcustomergroups)() | Returns the customer groups assigned to the campaign. | +| [getDescription](dw.campaign.Campaign.md#getdescription)() | Returns the internal description of the campaign. | +| [getEndDate](dw.campaign.Campaign.md#getenddate)() | Returns the end date of the campaign. | +| [getID](dw.campaign.Campaign.md#getid)() | Returns the unique campaign ID. | +| [getPromotions](dw.campaign.Campaign.md#getpromotions)() | Returns promotions defined in this campaign in no particular order. | +| [getSourceCodeGroups](dw.campaign.Campaign.md#getsourcecodegroups)() | Returns the source codes assigned to the campaign. | +| [getStartDate](dw.campaign.Campaign.md#getstartdate)() | Returns the start date of the campaign. | +| [getStoreGroups](dw.campaign.Campaign.md#getstoregroups)() | Returns store groups assigned to the campaign. | +| [getStores](dw.campaign.Campaign.md#getstores)() | Returns stores assigned to the campaign. | +| [isActive](dw.campaign.Campaign.md#isactive)() | Returns 'true' if the campaign is currently active, otherwise 'false'. | +| [isApplicableInStore](dw.campaign.Campaign.md#isapplicableinstore)() | Returns true if campaign is applicable to store, otherwise false. | +| [isApplicableOnline](dw.campaign.Campaign.md#isapplicableonline)() | Returns true if campaign is applicable to online site, otherwise false. | +| [isEnabled](dw.campaign.Campaign.md#isenabled)() | Returns true if campaign is enabled, otherwise false. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique campaign ID. + + +--- + +### active +- active: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the campaign is currently active, otherwise + 'false'. + + A campaign is active if it is enabled and scheduled for _now_. + + + +--- + +### applicableInStore +- applicableInStore: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if campaign is applicable to store, otherwise false. + + +--- + +### applicableOnline +- applicableOnline: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if campaign is applicable to online site, otherwise false. + + +--- + +### coupons +- coupons: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the coupons assigned to the campaign. + + +--- + +### customerGroups +- customerGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the customer groups assigned to the campaign. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the internal description of the campaign. + + +--- + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if campaign is enabled, otherwise false. + + +--- + +### endDate +- endDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the end date of the campaign. If no end date is defined for the + campaign, null is returned. A campaign w/o end date will run forever. + + + +--- + +### promotions +- promotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns promotions defined in this campaign in no particular order. + + +--- + +### sourceCodeGroups +- sourceCodeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the source codes assigned to the campaign. + + +--- + +### startDate +- startDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the start date of the campaign. If no start date is defined for the + campaign, null is returned. A campaign w/o start date is immediately + effective. + + + +--- + +### storeGroups +- storeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns store groups assigned to the campaign. + + +--- + +### stores +- stores: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns stores assigned to the campaign. + + +--- + +## Method Details + +### getCoupons() +- getCoupons(): [Collection](dw.util.Collection.md) + - : Returns the coupons assigned to the campaign. + + **Returns:** + - All coupons assigned to the campaign. + + +--- + +### getCustomerGroups() +- getCustomerGroups(): [Collection](dw.util.Collection.md) + - : Returns the customer groups assigned to the campaign. + + **Returns:** + - Customer groups assigned to campaign. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the internal description of the campaign. + + **Returns:** + - Internal description of campaign. + + +--- + +### getEndDate() +- getEndDate(): [Date](TopLevel.Date.md) + - : Returns the end date of the campaign. If no end date is defined for the + campaign, null is returned. A campaign w/o end date will run forever. + + + **Returns:** + - End date of campaign. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique campaign ID. + + **Returns:** + - ID of the campaign. + + +--- + +### getPromotions() +- getPromotions(): [Collection](dw.util.Collection.md) + - : Returns promotions defined in this campaign in no particular order. + + **Returns:** + - All promotions defined in campaign. + + +--- + +### getSourceCodeGroups() +- getSourceCodeGroups(): [Collection](dw.util.Collection.md) + - : Returns the source codes assigned to the campaign. + + **Returns:** + - All source code groups assigned to campaign. + + +--- + +### getStartDate() +- getStartDate(): [Date](TopLevel.Date.md) + - : Returns the start date of the campaign. If no start date is defined for the + campaign, null is returned. A campaign w/o start date is immediately + effective. + + + **Returns:** + - Start date of campaign. + + +--- + +### getStoreGroups() +- getStoreGroups(): [Collection](dw.util.Collection.md) + - : Returns store groups assigned to the campaign. + + **Returns:** + - All store groups assigned to the campaign. + + +--- + +### getStores() +- getStores(): [Collection](dw.util.Collection.md) + - : Returns stores assigned to the campaign. + + **Returns:** + - All stores assigned to the campaign. + + +--- + +### isActive() +- isActive(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the campaign is currently active, otherwise + 'false'. + + A campaign is active if it is enabled and scheduled for _now_. + + + **Returns:** + - true of campaign is active, otherwise false. + + +--- + +### isApplicableInStore() +- isApplicableInStore(): [Boolean](TopLevel.Boolean.md) + - : Returns true if campaign is applicable to store, otherwise false. + + **Returns:** + - true if campaign is applicable to store, otherwise false. + + +--- + +### isApplicableOnline() +- isApplicableOnline(): [Boolean](TopLevel.Boolean.md) + - : Returns true if campaign is applicable to online site, otherwise false. + + **Returns:** + - true if campaign is applicable to online site, otherwise false. + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if campaign is enabled, otherwise false. + + **Returns:** + - true if campaign is enabled, otherwise false. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignMgr.md new file mode 100644 index 00000000..8cb29542 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignMgr.md @@ -0,0 +1,436 @@ + +# Class CampaignMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.CampaignMgr](dw.campaign.CampaignMgr.md) + +CampaignMgr provides static methods for managing campaign-specific operations +such as accessing promotions or updating promotion line items. + + +**Deprecated:** +:::warning +Use [PromotionMgr](dw.campaign.PromotionMgr.md) instead. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[applicablePromotions](#applicablepromotions): [Collection](dw.util.Collection.md)~~ `(read-only)` | Returns the enabled promotions of active campaigns applicable for the current customer and source code. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| ~~static [applyBonusPromotions](dw.campaign.CampaignMgr.md#applybonuspromotionslineitemctnr-collection)([LineItemCtnr](dw.order.LineItemCtnr.md), [Collection](dw.util.Collection.md))~~ | This method has been deprecated and should not be used anymore. | +| ~~static [applyOrderPromotions](dw.campaign.CampaignMgr.md#applyorderpromotionslineitemctnr-collection)([LineItemCtnr](dw.order.LineItemCtnr.md), [Collection](dw.util.Collection.md))~~ | Applies the applicable order promotions in the specified collection to the specified line item container. | +| ~~static [applyProductPromotions](dw.campaign.CampaignMgr.md#applyproductpromotionslineitemctnr-collection)([LineItemCtnr](dw.order.LineItemCtnr.md), [Collection](dw.util.Collection.md))~~ | Applies all applicable product promotions in the specified collection to the specified line item container. | +| ~~static [applyShippingPromotions](dw.campaign.CampaignMgr.md#applyshippingpromotionslineitemctnr-collection)([LineItemCtnr](dw.order.LineItemCtnr.md), [Collection](dw.util.Collection.md))~~ | Applies all applicable shipping promotions in the specified collection to the specified line item container. | +| ~~static [getApplicableConditionalPromotions](dw.campaign.CampaignMgr.md#getapplicableconditionalpromotionsproduct)([Product](dw.catalog.Product.md))~~ | Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a qualifiying product. | +| ~~static [getApplicablePromotions](dw.campaign.CampaignMgr.md#getapplicablepromotions)()~~ | Returns the enabled promotions of active campaigns applicable for the current customer and source code. | +| ~~static [getApplicablePromotions](dw.campaign.CampaignMgr.md#getapplicablepromotionsproduct)([Product](dw.catalog.Product.md))~~ | Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a discounted product. | +| ~~static [getApplicablePromotions](dw.campaign.CampaignMgr.md#getapplicablepromotionslineitemctnr)([LineItemCtnr](dw.order.LineItemCtnr.md))~~ | Returns the enabled promotions of active campaigns applicable for the current customer, source code and any coupon contained in the specified line item container. | +| ~~static [getCampaignByID](dw.campaign.CampaignMgr.md#getcampaignbyidstring)([String](TopLevel.String.md))~~ | Returns the campaign identified by the specified ID. | +| ~~static [getConditionalPromotions](dw.campaign.CampaignMgr.md#getconditionalpromotionsproduct)([Product](dw.catalog.Product.md))~~ | Returns the enabled promotions of active campaigns for which the specified product is a qualifiying product. | +| ~~static [getPromotion](dw.campaign.CampaignMgr.md#getpromotionstring)([String](TopLevel.String.md))~~ | Returns the promotion associated with the specified coupon code. | +| ~~static [getPromotionByCouponCode](dw.campaign.CampaignMgr.md#getpromotionbycouponcodestring)([String](TopLevel.String.md))~~ | Returns the promotion associated with the specified coupon code. | +| ~~static [getPromotionByID](dw.campaign.CampaignMgr.md#getpromotionbyidstring)([String](TopLevel.String.md))~~ | Returns the promotion identified by the specified ID. | +| ~~static [getPromotions](dw.campaign.CampaignMgr.md#getpromotionsproduct)([Product](dw.catalog.Product.md))~~ | Returns the enabled promotions of active campaigns for which the specified product is a discounted product. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### applicablePromotions +- ~~applicablePromotions: [Collection](dw.util.Collection.md)~~ `(read-only)` + - : Returns the enabled promotions of active campaigns applicable for the + current customer and source code. + + + Note that this method does not return any coupon-based promotions. + + + **Deprecated:** +:::warning +Use [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getPromotions()](dw.campaign.PromotionPlan.md#getpromotions) + +::: + +--- + +## Method Details + +### applyBonusPromotions(LineItemCtnr, Collection) +- ~~static applyBonusPromotions(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md), promotions: [Collection](dw.util.Collection.md)): [Boolean](TopLevel.Boolean.md)~~ + - : This method has been deprecated and should not be used anymore. + Instead, use [PromotionMgr](dw.campaign.PromotionMgr.md) to apply promotions to + line item containers. + + + The method does nothing, since bonus promotions are applied as product + or order promotions using methods + [applyProductPromotions(LineItemCtnr, Collection)](dw.campaign.CampaignMgr.md#applyproductpromotionslineitemctnr-collection) and + [applyOrderPromotions(LineItemCtnr, Collection)](dw.campaign.CampaignMgr.md#applyorderpromotionslineitemctnr-collection). + + + The method returns 'true' if any the line item container contains + any bonus product line items, and otherwise false. + + + **Parameters:** + - lineItemCtnr - Basket or order + - promotions - Parameter not used, can be null + + **Returns:** + - True if line item container contains bonus product line items, else false + + **Deprecated:** +:::warning +Use [PromotionMgr](dw.campaign.PromotionMgr.md) instead. +::: + +--- + +### applyOrderPromotions(LineItemCtnr, Collection) +- ~~static applyOrderPromotions(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md), promotions: [Collection](dw.util.Collection.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Applies the applicable order promotions in the specified collection to the + specified line item container. + + + This method has been deprecated and should not be used anymore. + Instead, use [PromotionMgr](dw.campaign.PromotionMgr.md) to apply promotions to + line item containers. + + + Note that the method does also apply any bonus discounts defined + as order promotions (see also [applyBonusPromotions(LineItemCtnr, Collection)](dw.campaign.CampaignMgr.md#applybonuspromotionslineitemctnr-collection)). + + + **Parameters:** + - lineItemCtnr - basket or order + - promotions - list of all promotions to be applied + + **Returns:** + - true if changes were made to the line item container, false otherwise. + + **Deprecated:** +:::warning +Use [PromotionMgr](dw.campaign.PromotionMgr.md) +::: + +--- + +### applyProductPromotions(LineItemCtnr, Collection) +- ~~static applyProductPromotions(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md), promotions: [Collection](dw.util.Collection.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Applies all applicable product promotions in the specified collection to the + specified line item container. + + + This method has been deprecated and should not be used anymore. + Instead, use [PromotionMgr](dw.campaign.PromotionMgr.md) to apply promotions to + line item containers. + + + Note that the method does also apply any bonus discounts defined + as product promotions (see also [applyBonusPromotions(LineItemCtnr, Collection)](dw.campaign.CampaignMgr.md#applybonuspromotionslineitemctnr-collection)). + + + **Parameters:** + - lineItemCtnr - basket or order + - promotions - list of all promotions to be applied + + **Returns:** + - true if changes were made to the line item container, false otherwise. + + **Deprecated:** +:::warning +Use [PromotionMgr](dw.campaign.PromotionMgr.md) +::: + +--- + +### applyShippingPromotions(LineItemCtnr, Collection) +- ~~static applyShippingPromotions(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md), promotions: [Collection](dw.util.Collection.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Applies all applicable shipping promotions in the specified collection to + the specified line item container. + + + This method has been deprecated and should not be used anymore. + Instead, use [PromotionMgr](dw.campaign.PromotionMgr.md) to apply promotions to + line item containers. + + + **Parameters:** + - lineItemCtnr - basket or order + - promotions - list of all promotions to be applied + + **Returns:** + - true if changes were made to the line item container, false otherwise. + + **Deprecated:** +:::warning +Use [PromotionMgr](dw.campaign.PromotionMgr.md) +::: + +--- + +### getApplicableConditionalPromotions(Product) +- ~~static getApplicableConditionalPromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns applicable for the + current customer and source code for which the specified product + is a qualifiying product. + + + As a replacement of this deprecated method, use + [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct). + Unlike [getApplicableConditionalPromotions(Product)](dw.campaign.CampaignMgr.md#getapplicableconditionalpromotionsproduct), + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + returns all promotions related to the specified product, regardless + of whether the product is qualifying, discounted, or both, and + also returns promotions where the product is a bonus product. + + + **Parameters:** + - product - Qualifying product + + **Returns:** + - List of active promotions + + **Deprecated:** +:::warning +Use [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + +::: + +--- + +### getApplicablePromotions() +- ~~static getApplicablePromotions(): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns applicable for the + current customer and source code. + + + Note that this method does not return any coupon-based promotions. + + + **Returns:** + - List of active promotions + + **Deprecated:** +:::warning +Use [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getPromotions()](dw.campaign.PromotionPlan.md#getpromotions) + +::: + +--- + +### getApplicablePromotions(Product) +- ~~static getApplicablePromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns applicable for the + current customer and source code for which the specified product is + a discounted product. + + + Note that this method does not return any coupon-based promotions. + + + As a replacement of this deprecated method, use + [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct). + Unlike [getApplicablePromotions(Product)](dw.campaign.CampaignMgr.md#getapplicablepromotionsproduct), + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + returns all promotions related to the specified product, regardless + of whether the product is qualifying, discounted, or both, and + also returns promotions where the product is a bonus product. + + + **Parameters:** + - product - The product whose promotions are returned. + + **Returns:** + - A list of promotions + + **Deprecated:** +:::warning +Use [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + +::: + +--- + +### getApplicablePromotions(LineItemCtnr) +- ~~static getApplicablePromotions(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns applicable for the + current customer, source code and any coupon contained in the specified + line item container. + + + Note that although the method has been deprecated, no replacement + method is provided. + + + **Parameters:** + - lineItemCtnr - the basket or order + + **Returns:** + - list of all applicable promotion for the given basket or order + + **Deprecated:** +:::warning +There is no replacement for this method. +::: + +--- + +### getCampaignByID(String) +- ~~static getCampaignByID(id: [String](TopLevel.String.md)): [Campaign](dw.campaign.Campaign.md)~~ + - : Returns the campaign identified by the specified ID. + + **Parameters:** + - id - Campaign ID + + **Returns:** + - Campaign or null if not found + + **Deprecated:** +:::warning +Use [PromotionMgr.getCampaign(String)](dw.campaign.PromotionMgr.md#getcampaignstring) +::: + +--- + +### getConditionalPromotions(Product) +- ~~static getConditionalPromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns for which the + specified product is a qualifiying product. + + Note that the method also returns coupon-based promotions. + + + As a replacement of this deprecated method, use + [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct). + Unlike [getConditionalPromotions(Product)](dw.campaign.CampaignMgr.md#getconditionalpromotionsproduct), + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + returns all promotions related to the specified product, regardless + of whether the product is qualifying, discounted, or both, and + also returns promotions where the product is a bonus product. + + + **Parameters:** + - product - The product whose conditional promotions are returned. + + **Returns:** + - A list of promotions + + **Deprecated:** +:::warning +Use [PromotionMgr.getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + +::: + +--- + +### getPromotion(String) +- ~~static getPromotion(couponCode: [String](TopLevel.String.md)): [Promotion](dw.campaign.Promotion.md)~~ + - : Returns the promotion associated with the specified coupon code. + + **Parameters:** + - couponCode - The coupon code used to lookup the promotion + + **Returns:** + - The resolved promotion object or null if none was found + + **Deprecated:** +:::warning +Coupons are now related to multiple promotions. Method + returns the first promotion associated with the coupon + code in case of multiple assigned promotions. + +::: + +--- + +### getPromotionByCouponCode(String) +- ~~static getPromotionByCouponCode(couponCode: [String](TopLevel.String.md)): [Promotion](dw.campaign.Promotion.md)~~ + - : Returns the promotion associated with the specified coupon code. + + **Parameters:** + - couponCode - Coupon code + + **Returns:** + - The associated promotion or null + + **Deprecated:** +:::warning +Coupons are now related to multiple promotions. Method + returns the first promotion associated with the coupon + in case of multiple assigned promotions + +::: + +--- + +### getPromotionByID(String) +- ~~static getPromotionByID(id: [String](TopLevel.String.md)): [Promotion](dw.campaign.Promotion.md)~~ + - : Returns the promotion identified by the specified ID. + + **Parameters:** + - id - Promotion ID + + **Returns:** + - Promotion or null if not found + + **Deprecated:** +:::warning +Use [PromotionMgr.getPromotion(String)](dw.campaign.PromotionMgr.md#getpromotionstring) +::: + +--- + +### getPromotions(Product) +- ~~static getPromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the enabled promotions of active campaigns for which the + specified product is a discounted product. + + Note that method does only return promotions based on customer groups + or source codes. + + + As a replacement of this deprecated method, use + [PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct). + Unlike [getPromotions(Product)](dw.campaign.CampaignMgr.md#getpromotionsproduct), + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + returns all promotions related to the specified product, regardless + of whether the product is qualifying, discounted, or both, and + also returns promotions where the product is a bonus product. + + + **Parameters:** + - product - Discounted product + + **Returns:** + - List of promotions + + **Deprecated:** +:::warning +Use [PromotionMgr.getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) and + [PromotionPlan.getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) + +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignStatusCodes.md new file mode 100644 index 00000000..0628097f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CampaignStatusCodes.md @@ -0,0 +1,103 @@ + +# Class CampaignStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.CampaignStatusCodes](dw.campaign.CampaignStatusCodes.md) + +Deprecated. Formerly used to contain the various statuses that a coupon may +be in. + + +**Deprecated:** +:::warning +Use [CouponStatusCodes](dw.campaign.CouponStatusCodes.md) instead. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[COUPON_ALREADY_APPLIED](#coupon_already_applied): [String](TopLevel.String.md) = "COUPON_ALREADY_APPLIED"~~ | Indicates that the coupon has already been applied to the basket. | +| ~~[COUPON_ALREADY_REDEEMED](#coupon_already_redeemed): [String](TopLevel.String.md) = "COUPON_ALREADY_REDEEMED"~~ | Indicates that the coupon has already been redeemed. | +| ~~[COUPON_NOT_REDEEMABLE](#coupon_not_redeemable): [String](TopLevel.String.md) = "COUPON_NOT_REDEEMABLE"~~ | Indicates that the coupon is not currently redeemable. | +| ~~[COUPON_UNKNOWN](#coupon_unknown): [String](TopLevel.String.md) = "COUPON_UNKNOWN"~~ | Indicates that the coupon code is not valid. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CampaignStatusCodes](#campaignstatuscodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### COUPON_ALREADY_APPLIED + +- ~~COUPON_ALREADY_APPLIED: [String](TopLevel.String.md) = "COUPON_ALREADY_APPLIED"~~ + - : Indicates that the coupon has already been applied to the basket. + + **Deprecated:** +:::warning +Use [CouponStatusCodes.COUPON_CODE_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#coupon_code_already_in_basket), +[CouponStatusCodes.COUPON_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#coupon_already_in_basket) instead. + +::: + +--- + +### COUPON_ALREADY_REDEEMED + +- ~~COUPON_ALREADY_REDEEMED: [String](TopLevel.String.md) = "COUPON_ALREADY_REDEEMED"~~ + - : Indicates that the coupon has already been redeemed. + + **Deprecated:** +:::warning +Use [CouponStatusCodes.COUPON_CODE_ALREADY_REDEEMED](dw.campaign.CouponStatusCodes.md#coupon_code_already_redeemed) instead. +::: + +--- + +### COUPON_NOT_REDEEMABLE + +- ~~COUPON_NOT_REDEEMABLE: [String](TopLevel.String.md) = "COUPON_NOT_REDEEMABLE"~~ + - : Indicates that the coupon is not currently redeemable. + + **Deprecated:** +:::warning +Use [CouponStatusCodes.COUPON_DISABLED](dw.campaign.CouponStatusCodes.md#coupon_disabled), +[CouponStatusCodes.COUPON_CODE_UNKNOWN](dw.campaign.CouponStatusCodes.md#coupon_code_unknown), +[CouponStatusCodes.REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#redemption_limit_exceeded), +[CouponStatusCodes.CUSTOMER_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#customer_redemption_limit_exceeded), +[CouponStatusCodes.TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#timeframe_redemption_limit_exceeded) or +[CouponStatusCodes.NO_APPLICABLE_PROMOTION](dw.campaign.CouponStatusCodes.md#no_applicable_promotion) + +::: + +--- + +### COUPON_UNKNOWN + +- ~~COUPON_UNKNOWN: [String](TopLevel.String.md) = "COUPON_UNKNOWN"~~ + - : Indicates that the coupon code is not valid. + + **Deprecated:** +:::warning +Use [CouponStatusCodes.COUPON_CODE_UNKNOWN](dw.campaign.CouponStatusCodes.md#coupon_code_unknown) instead +::: + +--- + +## Constructor Details + +### CampaignStatusCodes() +- CampaignStatusCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Coupon.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Coupon.md new file mode 100644 index 00000000..be457b4f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Coupon.md @@ -0,0 +1,324 @@ + +# Class Coupon + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.campaign.Coupon](dw.campaign.Coupon.md) + +Represents a coupon in Commerce Cloud Digital. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [TYPE_MULTIPLE_CODES](#type_multiple_codes): [String](TopLevel.String.md) = "MULTIPLE_CODES" | Constant representing coupon type _multiple-codes_. | +| [TYPE_SINGLE_CODE](#type_single_code): [String](TopLevel.String.md) = "SINGLE_CODE" | Constant representing coupon type _single-code_. | +| [TYPE_SYSTEM_CODES](#type_system_codes): [String](TopLevel.String.md) = "SYSTEM_CODES" | Constant representing coupon type _system-codes_. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the coupon. | +| [codePrefix](#codeprefix): [String](TopLevel.String.md) `(read-only)` | Returns the prefix defined for coupons of type [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes) If no prefix is defined, or coupon is of type [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code) or [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes), null is returned. | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if coupon is enabled, else false. | +| [nextCouponCode](#nextcouponcode): [String](TopLevel.String.md) `(read-only)` | Returns the next unissued code of this coupon. | +| [promotions](#promotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns the coupon-based promotions directly or indirectly (through campaigns) assigned to this coupon. | +| [redemptionLimitPerCode](#redemptionlimitpercode): [Number](TopLevel.Number.md) `(read-only)` | Returns the defined limit on redemption per coupon code. | +| [redemptionLimitPerCustomer](#redemptionlimitpercustomer): [Number](TopLevel.Number.md) `(read-only)` | Returns the defined limit on redemption of this coupon per customer. | +| [redemptionLimitPerTimeFrame](#redemptionlimitpertimeframe): [Number](TopLevel.Number.md) `(read-only)` | Returns the defined limit on redemption per customer per time-frame (see [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe). | +| [redemptionLimitTimeFrame](#redemptionlimittimeframe): [Number](TopLevel.Number.md) `(read-only)` | Returns the time-frame (in days) of the defined limit on redemption per customer per time-frame. | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the coupon type. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCodePrefix](dw.campaign.Coupon.md#getcodeprefix)() | Returns the prefix defined for coupons of type [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes) If no prefix is defined, or coupon is of type [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code) or [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes), null is returned. | +| [getID](dw.campaign.Coupon.md#getid)() | Returns the ID of the coupon. | +| [getNextCouponCode](dw.campaign.Coupon.md#getnextcouponcode)() | Returns the next unissued code of this coupon. | +| [getPromotions](dw.campaign.Coupon.md#getpromotions)() | Returns the coupon-based promotions directly or indirectly (through campaigns) assigned to this coupon. | +| [getRedemptionLimitPerCode](dw.campaign.Coupon.md#getredemptionlimitpercode)() | Returns the defined limit on redemption per coupon code. | +| [getRedemptionLimitPerCustomer](dw.campaign.Coupon.md#getredemptionlimitpercustomer)() | Returns the defined limit on redemption of this coupon per customer. | +| [getRedemptionLimitPerTimeFrame](dw.campaign.Coupon.md#getredemptionlimitpertimeframe)() | Returns the defined limit on redemption per customer per time-frame (see [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe). | +| [getRedemptionLimitTimeFrame](dw.campaign.Coupon.md#getredemptionlimittimeframe)() | Returns the time-frame (in days) of the defined limit on redemption per customer per time-frame. | +| [getType](dw.campaign.Coupon.md#gettype)() | Returns the coupon type. | +| [isEnabled](dw.campaign.Coupon.md#isenabled)() | Returns true if coupon is enabled, else false. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### TYPE_MULTIPLE_CODES + +- TYPE_MULTIPLE_CODES: [String](TopLevel.String.md) = "MULTIPLE_CODES" + - : Constant representing coupon type _multiple-codes_. + + +--- + +### TYPE_SINGLE_CODE + +- TYPE_SINGLE_CODE: [String](TopLevel.String.md) = "SINGLE_CODE" + - : Constant representing coupon type _single-code_. + + +--- + +### TYPE_SYSTEM_CODES + +- TYPE_SYSTEM_CODES: [String](TopLevel.String.md) = "SYSTEM_CODES" + - : Constant representing coupon type _system-codes_. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the coupon. + + +--- + +### codePrefix +- codePrefix: [String](TopLevel.String.md) `(read-only)` + - : Returns the prefix defined for coupons of type [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes) + If no prefix is defined, or coupon is of type [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code) + or [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes), null is returned. + + + +--- + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if coupon is enabled, else false. + + +--- + +### nextCouponCode +- nextCouponCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the next unissued code of this coupon. + For single-code coupons, the single fixed coupon code is returned. + For all multi-code coupons, the next available, unissued coupon code is returned. + If all codes of the coupon have been issued, then there is no next code, and null is returned. + + A transaction is required when calling this method. This needs to be ensured by the calling script. + + + +--- + +### promotions +- promotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the coupon-based promotions directly or indirectly (through + campaigns) assigned to this coupon. + + + +--- + +### redemptionLimitPerCode +- redemptionLimitPerCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the defined limit on redemption per coupon code. Null is + returned if no limit is defined, which means that each code can be + redeemed an unlimited number of times. + + + +--- + +### redemptionLimitPerCustomer +- redemptionLimitPerCustomer: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the defined limit on redemption of this coupon per customer. + Null is returned if no limit is defined, which means that customers can + redeem this coupon an unlimited number of times. + + + +--- + +### redemptionLimitPerTimeFrame +- redemptionLimitPerTimeFrame: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the defined limit on redemption per customer per time-frame (see + [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe). Null is returned if no limit is + defined, which means that there is no time-specific redemption limit for + customers. + + + **See Also:** + - [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe) + + +--- + +### redemptionLimitTimeFrame +- redemptionLimitTimeFrame: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the time-frame (in days) of the defined limit on redemption per + customer per time-frame. Null is returned if no limit is defined, which + means that there is no time-specific redemption limit for customers. + + + **See Also:** + - [getRedemptionLimitPerTimeFrame()](dw.campaign.Coupon.md#getredemptionlimitpertimeframe) + + +--- + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the coupon type. + Possible values are [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code), [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes) + and [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes). + + + +--- + +## Method Details + +### getCodePrefix() +- getCodePrefix(): [String](TopLevel.String.md) + - : Returns the prefix defined for coupons of type [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes) + If no prefix is defined, or coupon is of type [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code) + or [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes), null is returned. + + + **Returns:** + - Coupon code prefix or null + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the coupon. + + **Returns:** + - Coupon ID + + +--- + +### getNextCouponCode() +- getNextCouponCode(): [String](TopLevel.String.md) + - : Returns the next unissued code of this coupon. + For single-code coupons, the single fixed coupon code is returned. + For all multi-code coupons, the next available, unissued coupon code is returned. + If all codes of the coupon have been issued, then there is no next code, and null is returned. + + A transaction is required when calling this method. This needs to be ensured by the calling script. + + + **Returns:** + - Next available code of this coupon, or null if there are no available codes. + + +--- + +### getPromotions() +- getPromotions(): [Collection](dw.util.Collection.md) + - : Returns the coupon-based promotions directly or indirectly (through + campaigns) assigned to this coupon. + + + **Returns:** + - Promotions assigned to the coupon in no particular order. + + +--- + +### getRedemptionLimitPerCode() +- getRedemptionLimitPerCode(): [Number](TopLevel.Number.md) + - : Returns the defined limit on redemption per coupon code. Null is + returned if no limit is defined, which means that each code can be + redeemed an unlimited number of times. + + + **Returns:** + - The maximum number of redemption per coupon code + + +--- + +### getRedemptionLimitPerCustomer() +- getRedemptionLimitPerCustomer(): [Number](TopLevel.Number.md) + - : Returns the defined limit on redemption of this coupon per customer. + Null is returned if no limit is defined, which means that customers can + redeem this coupon an unlimited number of times. + + + **Returns:** + - The maximum number of redemption per customer + + +--- + +### getRedemptionLimitPerTimeFrame() +- getRedemptionLimitPerTimeFrame(): [Number](TopLevel.Number.md) + - : Returns the defined limit on redemption per customer per time-frame (see + [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe). Null is returned if no limit is + defined, which means that there is no time-specific redemption limit for + customers. + + + **Returns:** + - The maximum number of redemption per customer within time-frame + + **See Also:** + - [getRedemptionLimitTimeFrame()](dw.campaign.Coupon.md#getredemptionlimittimeframe) + + +--- + +### getRedemptionLimitTimeFrame() +- getRedemptionLimitTimeFrame(): [Number](TopLevel.Number.md) + - : Returns the time-frame (in days) of the defined limit on redemption per + customer per time-frame. Null is returned if no limit is defined, which + means that there is no time-specific redemption limit for customers. + + + **Returns:** + - Timeframe (days) of redemption per time + + **See Also:** + - [getRedemptionLimitPerTimeFrame()](dw.campaign.Coupon.md#getredemptionlimitpertimeframe) + + +--- + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the coupon type. + Possible values are [TYPE_SINGLE_CODE](dw.campaign.Coupon.md#type_single_code), [TYPE_MULTIPLE_CODES](dw.campaign.Coupon.md#type_multiple_codes) + and [TYPE_SYSTEM_CODES](dw.campaign.Coupon.md#type_system_codes). + + + **Returns:** + - Coupon type + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if coupon is enabled, else false. + + **Returns:** + - true if coupon is enabled. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponMgr.md new file mode 100644 index 00000000..f8e7a9f6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponMgr.md @@ -0,0 +1,137 @@ + +# Class CouponMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.CouponMgr](dw.campaign.CouponMgr.md) + +Manager to access coupons. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [MR_ERROR_INVALID_SITE_ID](#mr_error_invalid_site_id): [String](TopLevel.String.md) = "MASKREDEMPTIONS_SITE_NOT_FOUND" | Indicates that an error occurred because a valid data domain cannot be found for given siteID. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [coupons](#coupons): [Collection](dw.util.Collection.md) `(read-only)` | Returns all coupons in the current site in no specific order. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getCoupon](dw.campaign.CouponMgr.md#getcouponstring)([String](TopLevel.String.md)) | Returns the coupon with the specified ID. | +| static [getCouponByCode](dw.campaign.CouponMgr.md#getcouponbycodestring)([String](TopLevel.String.md)) | Tries to find a coupon for the given coupon code. | +| static [getCoupons](dw.campaign.CouponMgr.md#getcoupons)() | Returns all coupons in the current site in no specific order. | +| static [getRedemptions](dw.campaign.CouponMgr.md#getredemptionsstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns list of CouponRedemptions for the specified coupon and coupon code, sorted by redemption date descending (i.e. | +| static [maskRedemptions](dw.campaign.CouponMgr.md#maskredemptionsstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Mask customer email address in coupon redemptions for the given siteID and email address | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### MR_ERROR_INVALID_SITE_ID + +- MR_ERROR_INVALID_SITE_ID: [String](TopLevel.String.md) = "MASKREDEMPTIONS_SITE_NOT_FOUND" + - : Indicates that an error occurred because a valid data domain cannot be found for given siteID. + + +--- + +## Property Details + +### coupons +- coupons: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all coupons in the current site in no specific order. + + +--- + +## Method Details + +### getCoupon(String) +- static getCoupon(couponID: [String](TopLevel.String.md)): [Coupon](dw.campaign.Coupon.md) + - : Returns the coupon with the specified ID. + + **Parameters:** + - couponID - the coupon identifier. + + **Returns:** + - Coupon with specified ID or null + + +--- + +### getCouponByCode(String) +- static getCouponByCode(couponCode: [String](TopLevel.String.md)): [Coupon](dw.campaign.Coupon.md) + - : Tries to find a coupon for the given coupon code. The method first + searches for a coupon with a fixed code matching the passed value. If no + such fixed coupon is found, it searches for a coupon with a + system-generated code matching the passed value. If found, the coupon is + returned. Otherwise, the method returns null. + + + **Parameters:** + - couponCode - The coupon code to get the coupon for. + + **Returns:** + - The coupon with the matching coupon code or null if no coupon was + found. + + + +--- + +### getCoupons() +- static getCoupons(): [Collection](dw.util.Collection.md) + - : Returns all coupons in the current site in no specific order. + + **Returns:** + - Coupons in current site + + +--- + +### getRedemptions(String, String) +- static getRedemptions(couponID: [String](TopLevel.String.md), couponCode: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns list of CouponRedemptions for the specified coupon and coupon code, + sorted by redemption date descending (i.e. last redemption first). + Usually, there should only either be 0 or 1 redemption. But if a coupon and code + is removed and recreated and re-issued later, there might be multiple such redemption records. + Returns an empty list if no redemption record exists in system for the specified coupon and code. + + + **Parameters:** + - couponID - The coupon id to find redemption for. + - couponCode - The coupon code to find redemption for. + + **Returns:** + - A sorted list of CouponRedemptions for the specified coupon and coupon code or + an empty list if no redemption record exists. + + + +--- + +### maskRedemptions(String, String) +- static maskRedemptions(siteID: [String](TopLevel.String.md), email: [String](TopLevel.String.md)): [Status](dw.system.Status.md) + - : Mask customer email address in coupon redemptions for the given siteID and email address + + **Parameters:** + - siteID - the site ID + - email - the customer email address + + **Returns:** + - The status of the masking result + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponRedemption.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponRedemption.md new file mode 100644 index 00000000..7d722010 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponRedemption.md @@ -0,0 +1,87 @@ + +# Class CouponRedemption + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.CouponRedemption](dw.campaign.CouponRedemption.md) + +Represents a redeemed coupon. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [customerEmail](#customeremail): [String](TopLevel.String.md) `(read-only)` | Returns email of redeeming customer. | +| [orderNo](#orderno): [String](TopLevel.String.md) `(read-only)` | Returns number of the order the code was redeemed with. | +| [redemptionDate](#redemptiondate): [Date](TopLevel.Date.md) `(read-only)` | Returns date of redemption. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCustomerEmail](dw.campaign.CouponRedemption.md#getcustomeremail)() | Returns email of redeeming customer. | +| [getOrderNo](dw.campaign.CouponRedemption.md#getorderno)() | Returns number of the order the code was redeemed with. | +| [getRedemptionDate](dw.campaign.CouponRedemption.md#getredemptiondate)() | Returns date of redemption. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### customerEmail +- customerEmail: [String](TopLevel.String.md) `(read-only)` + - : Returns email of redeeming customer. + + +--- + +### orderNo +- orderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns number of the order the code was redeemed with. + + +--- + +### redemptionDate +- redemptionDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns date of redemption. + + +--- + +## Method Details + +### getCustomerEmail() +- getCustomerEmail(): [String](TopLevel.String.md) + - : Returns email of redeeming customer. + + **Returns:** + - email of redeeming customer. + + +--- + +### getOrderNo() +- getOrderNo(): [String](TopLevel.String.md) + - : Returns number of the order the code was redeemed with. + + **Returns:** + - number of the order the code was redeemed with. + + +--- + +### getRedemptionDate() +- getRedemptionDate(): [Date](TopLevel.Date.md) + - : Returns date of redemption. + + **Returns:** + - date of redemption. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponStatusCodes.md new file mode 100644 index 00000000..6043a3b5 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.CouponStatusCodes.md @@ -0,0 +1,130 @@ + +# Class CouponStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.CouponStatusCodes](dw.campaign.CouponStatusCodes.md) + +Helper class containing status codes for why a coupon code cannot be added +to cart or why a coupon code already in cart is not longer valid for redemption. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [APPLIED](#applied): [String](TopLevel.String.md) = "APPLIED" | Coupon is currently applied in basket = Coupon code is valid for redemption and Coupon is assigned to one or multiple applicable promotions. | +| [COUPON_ALREADY_IN_BASKET](#coupon_already_in_basket): [String](TopLevel.String.md) = "COUPON_ALREADY_IN_BASKET" | Indicates that another code of the same MultiCode/System coupon has already been added to basket. | +| [COUPON_CODE_ALREADY_IN_BASKET](#coupon_code_already_in_basket): [String](TopLevel.String.md) = "COUPON_CODE_ALREADY_IN_BASKET" | Indicates that coupon code has already been added to basket. | +| [COUPON_CODE_ALREADY_REDEEMED](#coupon_code_already_redeemed): [String](TopLevel.String.md) = "COUPON_CODE_ALREADY_REDEEMED" | Indicates that code of MultiCode/System coupon has already been redeemed. | +| [COUPON_CODE_UNKNOWN](#coupon_code_unknown): [String](TopLevel.String.md) = "COUPON_CODE_UNKNOWN" | Indicates that coupon not found for given coupon code or that the code itself was not found. | +| [COUPON_DISABLED](#coupon_disabled): [String](TopLevel.String.md) = "COUPON_DISABLED" | Indicates that coupon is not enabled. | +| [CUSTOMER_REDEMPTION_LIMIT_EXCEEDED](#customer_redemption_limit_exceeded): [String](TopLevel.String.md) = "CUSTOMER_REDEMPTION_LIMIT_EXCEEDED" | Indicates that No. | +| [NO_ACTIVE_PROMOTION](#no_active_promotion): [String](TopLevel.String.md) = "NO_ACTIVE_PROMOTION" | Indicates that coupon is not assigned to an active promotion. | +| [NO_APPLICABLE_PROMOTION](#no_applicable_promotion): [String](TopLevel.String.md) = "NO_APPLICABLE_PROMOTION" | Coupon is assigned to one or multiple active promotions, but none of these promotions is currently applicable. | +| [REDEMPTION_LIMIT_EXCEEDED](#redemption_limit_exceeded): [String](TopLevel.String.md) = "REDEMPTION_LIMIT_EXCEEDED" | Indicates that no. | +| [TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED](#timeframe_redemption_limit_exceeded): [String](TopLevel.String.md) = "TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED" | Indicates that No. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### APPLIED + +- APPLIED: [String](TopLevel.String.md) = "APPLIED" + - : Coupon is currently applied in basket = Coupon code is valid for redemption and + Coupon is assigned to one or multiple applicable promotions. + + + +--- + +### COUPON_ALREADY_IN_BASKET + +- COUPON_ALREADY_IN_BASKET: [String](TopLevel.String.md) = "COUPON_ALREADY_IN_BASKET" + - : Indicates that another code of the same MultiCode/System coupon has already been added to basket. + + +--- + +### COUPON_CODE_ALREADY_IN_BASKET + +- COUPON_CODE_ALREADY_IN_BASKET: [String](TopLevel.String.md) = "COUPON_CODE_ALREADY_IN_BASKET" + - : Indicates that coupon code has already been added to basket. + + +--- + +### COUPON_CODE_ALREADY_REDEEMED + +- COUPON_CODE_ALREADY_REDEEMED: [String](TopLevel.String.md) = "COUPON_CODE_ALREADY_REDEEMED" + - : Indicates that code of MultiCode/System coupon has already been redeemed. + + +--- + +### COUPON_CODE_UNKNOWN + +- COUPON_CODE_UNKNOWN: [String](TopLevel.String.md) = "COUPON_CODE_UNKNOWN" + - : Indicates that coupon not found for given coupon code or that the code itself was not found. + + +--- + +### COUPON_DISABLED + +- COUPON_DISABLED: [String](TopLevel.String.md) = "COUPON_DISABLED" + - : Indicates that coupon is not enabled. + + +--- + +### CUSTOMER_REDEMPTION_LIMIT_EXCEEDED + +- CUSTOMER_REDEMPTION_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "CUSTOMER_REDEMPTION_LIMIT_EXCEEDED" + - : Indicates that No. of redemptions per code & customer exceeded. + + +--- + +### NO_ACTIVE_PROMOTION + +- NO_ACTIVE_PROMOTION: [String](TopLevel.String.md) = "NO_ACTIVE_PROMOTION" + - : Indicates that coupon is not assigned to an active promotion. + + +--- + +### NO_APPLICABLE_PROMOTION + +- NO_APPLICABLE_PROMOTION: [String](TopLevel.String.md) = "NO_APPLICABLE_PROMOTION" + - : Coupon is assigned to one or multiple active promotions, but none of these promotions is currently applicable. + + +--- + +### REDEMPTION_LIMIT_EXCEEDED + +- REDEMPTION_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "REDEMPTION_LIMIT_EXCEEDED" + - : Indicates that no. of redemptions per code exceeded. + Usually happens for single code coupons + + + +--- + +### TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED + +- TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED" + - : Indicates that No. of redemptions per code,customer & time exceeded. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Discount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Discount.md new file mode 100644 index 00000000..4fa7d6b4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Discount.md @@ -0,0 +1,271 @@ + +# Class Discount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + +Superclass of all specific discount classes. + + +## All Known Subclasses +[AmountDiscount](dw.campaign.AmountDiscount.md), [BonusChoiceDiscount](dw.campaign.BonusChoiceDiscount.md), [BonusDiscount](dw.campaign.BonusDiscount.md), [FixedPriceDiscount](dw.campaign.FixedPriceDiscount.md), [FixedPriceShippingDiscount](dw.campaign.FixedPriceShippingDiscount.md), [FreeDiscount](dw.campaign.FreeDiscount.md), [FreeShippingDiscount](dw.campaign.FreeShippingDiscount.md), [PercentageDiscount](dw.campaign.PercentageDiscount.md), [PercentageOptionDiscount](dw.campaign.PercentageOptionDiscount.md), [PriceBookPriceDiscount](dw.campaign.PriceBookPriceDiscount.md), [TotalFixedPriceDiscount](dw.campaign.TotalFixedPriceDiscount.md) +## Constant Summary + +| Constant | Description | +| --- | --- | +| [TYPE_AMOUNT](#type_amount): [String](TopLevel.String.md) = "AMOUNT" | Constant representing discounts of type _amount_. | +| [TYPE_BONUS](#type_bonus): [String](TopLevel.String.md) = "BONUS" | Constant representing discounts of type _bonus_. | +| [TYPE_BONUS_CHOICE](#type_bonus_choice): [String](TopLevel.String.md) = "BONUS_CHOICE" | Constant representing discounts of type _bonus choice_. | +| [TYPE_FIXED_PRICE](#type_fixed_price): [String](TopLevel.String.md) = "FIXED_PRICE" | Constant representing discounts of type _fixed-price_. | +| [TYPE_FIXED_PRICE_SHIPPING](#type_fixed_price_shipping): [String](TopLevel.String.md) = "FIXED_PRICE_SHIPPING" | Constant representing discounts of type _fixed price shipping_. | +| [TYPE_FREE](#type_free): [String](TopLevel.String.md) = "FREE" | Constant representing discounts of type _free_. | +| [TYPE_FREE_SHIPPING](#type_free_shipping): [String](TopLevel.String.md) = "FREE_SHIPPING" | Constant representing discounts of type _free shipping_. | +| [TYPE_PERCENTAGE](#type_percentage): [String](TopLevel.String.md) = "PERCENTAGE" | Constant representing discounts of type _percentage_. | +| [TYPE_PERCENTAGE_OFF_OPTIONS](#type_percentage_off_options): [String](TopLevel.String.md) = "PERCENTAGE_OFF_OPTIONS" | Constant representing discounts of type _percent off options_. | +| [TYPE_PRICEBOOK_PRICE](#type_pricebook_price): [String](TopLevel.String.md) = "PRICE_BOOK_PRICE" | Constant representing discounts of type _price book price_. | +| [TYPE_TOTAL_FIXED_PRICE](#type_total_fixed_price): [String](TopLevel.String.md) = "TOTAL_FIXED_PRICE" | Constant representing discounts of type _total fixed price_. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [itemPromotionTiers](#itempromotiontiers): [Map](dw.util.Map.md) `(read-only)` | Returns the tier index by quantity Id of Product promotion. | +| [promotion](#promotion): [Promotion](dw.campaign.Promotion.md) `(read-only)` | Returns the promotion this discount is based on. | +| [promotionTier](#promotiontier): [Number](TopLevel.Number.md) `(read-only)` | Returns the tier index for promotion at order level or bonus product. | +| [quantity](#quantity): [Number](TopLevel.Number.md) `(read-only)` | Returns the quantity of the discount. | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the type of the discount. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers)() | Returns the tier index by quantity Id of Product promotion. | +| [getPromotion](dw.campaign.Discount.md#getpromotion)() | Returns the promotion this discount is based on. | +| [getPromotionTier](dw.campaign.Discount.md#getpromotiontier)() | Returns the tier index for promotion at order level or bonus product. | +| [getQuantity](dw.campaign.Discount.md#getquantity)() | Returns the quantity of the discount. | +| [getType](dw.campaign.Discount.md#gettype)() | Returns the type of the discount. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### TYPE_AMOUNT + +- TYPE_AMOUNT: [String](TopLevel.String.md) = "AMOUNT" + - : Constant representing discounts of type _amount_. + + +--- + +### TYPE_BONUS + +- TYPE_BONUS: [String](TopLevel.String.md) = "BONUS" + - : Constant representing discounts of type _bonus_. + + +--- + +### TYPE_BONUS_CHOICE + +- TYPE_BONUS_CHOICE: [String](TopLevel.String.md) = "BONUS_CHOICE" + - : Constant representing discounts of type _bonus choice_. + + +--- + +### TYPE_FIXED_PRICE + +- TYPE_FIXED_PRICE: [String](TopLevel.String.md) = "FIXED_PRICE" + - : Constant representing discounts of type _fixed-price_. + + +--- + +### TYPE_FIXED_PRICE_SHIPPING + +- TYPE_FIXED_PRICE_SHIPPING: [String](TopLevel.String.md) = "FIXED_PRICE_SHIPPING" + - : Constant representing discounts of type _fixed price shipping_. + + +--- + +### TYPE_FREE + +- TYPE_FREE: [String](TopLevel.String.md) = "FREE" + - : Constant representing discounts of type _free_. + + +--- + +### TYPE_FREE_SHIPPING + +- TYPE_FREE_SHIPPING: [String](TopLevel.String.md) = "FREE_SHIPPING" + - : Constant representing discounts of type _free shipping_. + + +--- + +### TYPE_PERCENTAGE + +- TYPE_PERCENTAGE: [String](TopLevel.String.md) = "PERCENTAGE" + - : Constant representing discounts of type _percentage_. + + +--- + +### TYPE_PERCENTAGE_OFF_OPTIONS + +- TYPE_PERCENTAGE_OFF_OPTIONS: [String](TopLevel.String.md) = "PERCENTAGE_OFF_OPTIONS" + - : Constant representing discounts of type _percent off options_. + + +--- + +### TYPE_PRICEBOOK_PRICE + +- TYPE_PRICEBOOK_PRICE: [String](TopLevel.String.md) = "PRICE_BOOK_PRICE" + - : Constant representing discounts of type _price book price_. + + +--- + +### TYPE_TOTAL_FIXED_PRICE + +- TYPE_TOTAL_FIXED_PRICE: [String](TopLevel.String.md) = "TOTAL_FIXED_PRICE" + - : Constant representing discounts of type _total fixed price_. + + +--- + +## Property Details + +### itemPromotionTiers +- itemPromotionTiers: [Map](dw.util.Map.md) `(read-only)` + - : Returns the tier index by quantity Id of Product promotion. ProductLineItems may have more than one quantity, but + not all items of that SKU may have received the same tier of promotion. Each quantity of the ProductLineItem is + indexed from 1 to n, where n is the quantity of the ProductLineItem, and this method returns a mapping from that + quantity index to the index of tier of the promotion that item received. For more information about tier indexes, + see [getPromotionTier()](dw.campaign.Discount.md#getpromotiontier) method. + + + **See Also:** + - [getPromotionTier()](dw.campaign.Discount.md#getpromotiontier) + + +--- + +### promotion +- promotion: [Promotion](dw.campaign.Promotion.md) `(read-only)` + - : Returns the promotion this discount is based on. + + +--- + +### promotionTier +- promotionTier: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the tier index for promotion at order level or bonus product. + Promotion tiers are always evaluated in the order of the highest threshold (e.g. quantity, or amount) + to the lowest threshold. The tier that is evaluated first (i.e. the highest quantity or amount) is indexed as 0, + the next tier 1, etc. The lowest tier will have index n - 1, where n is the total number of tiers. + + + +--- + +### quantity +- quantity: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the quantity of the discount. This quantity specifies how often + this discount applies to its target object. For example, a 10% off + discount with quantity 2 associated to a product line item with + quantity 3 is applied to two items of the product line item. + + Discounts of order and shipping promotions, and bonus discounts + have a fix quantity of 1. + + + +--- + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of the discount. + + +--- + +## Method Details + +### getItemPromotionTiers() +- getItemPromotionTiers(): [Map](dw.util.Map.md) + - : Returns the tier index by quantity Id of Product promotion. ProductLineItems may have more than one quantity, but + not all items of that SKU may have received the same tier of promotion. Each quantity of the ProductLineItem is + indexed from 1 to n, where n is the quantity of the ProductLineItem, and this method returns a mapping from that + quantity index to the index of tier of the promotion that item received. For more information about tier indexes, + see [getPromotionTier()](dw.campaign.Discount.md#getpromotiontier) method. + + + **Returns:** + - Map of Tier index by quantity Id or `empty map` + + **See Also:** + - [getPromotionTier()](dw.campaign.Discount.md#getpromotiontier) + + +--- + +### getPromotion() +- getPromotion(): [Promotion](dw.campaign.Promotion.md) + - : Returns the promotion this discount is based on. + + **Returns:** + - Promotion related to this discount + + +--- + +### getPromotionTier() +- getPromotionTier(): [Number](TopLevel.Number.md) + - : Returns the tier index for promotion at order level or bonus product. + Promotion tiers are always evaluated in the order of the highest threshold (e.g. quantity, or amount) + to the lowest threshold. The tier that is evaluated first (i.e. the highest quantity or amount) is indexed as 0, + the next tier 1, etc. The lowest tier will have index n - 1, where n is the total number of tiers. + + + **Returns:** + - Tier index or `null` + + +--- + +### getQuantity() +- getQuantity(): [Number](TopLevel.Number.md) + - : Returns the quantity of the discount. This quantity specifies how often + this discount applies to its target object. For example, a 10% off + discount with quantity 2 associated to a product line item with + quantity 3 is applied to two items of the product line item. + + Discounts of order and shipping promotions, and bonus discounts + have a fix quantity of 1. + + + **Returns:** + - Discount quantity + + +--- + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the type of the discount. + + **Returns:** + - Discount type + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.DiscountPlan.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.DiscountPlan.md new file mode 100644 index 00000000..a0f0f839 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.DiscountPlan.md @@ -0,0 +1,322 @@ + +# Class DiscountPlan + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.DiscountPlan](dw.campaign.DiscountPlan.md) + +DiscountPlan represents a set of [Discount](dw.campaign.Discount.md)s. Instances of the class are +returned by the [PromotionMgr](dw.campaign.PromotionMgr.md) when requesting applicable discounts +for a specified set of promotions and a line item container +(see [PromotionMgr.getDiscounts(LineItemCtnr, PromotionPlan)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr-promotionplan)). + + +DiscountPlan provides methods to access the discounts contained in the plan, +add additional discounts to the plan (future) or remove discounts from the plan. + + +**See Also:** +- [PromotionMgr](dw.campaign.PromotionMgr.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [approachingOrderDiscounts](#approachingorderdiscounts): [Collection](dw.util.Collection.md) `(read-only)` | Get the collection of order discounts that the LineItemCtnr "almost" qualifies for based on the merchandise total in the cart. | +| [bonusDiscounts](#bonusdiscounts): [Collection](dw.util.Collection.md) `(read-only)` | Returns all bonus discounts contained in the discount plan. | +| [lineItemCtnr](#lineitemctnr): [LineItemCtnr](dw.order.LineItemCtnr.md) `(read-only)` | Returns line item container associated with discount plan. | +| [orderDiscounts](#orderdiscounts): [Collection](dw.util.Collection.md) `(read-only)` | Returns the percentage and amount order discounts contained in the discount plan. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getApproachingOrderDiscounts](dw.campaign.DiscountPlan.md#getapproachingorderdiscounts)() | Get the collection of order discounts that the LineItemCtnr "almost" qualifies for based on the merchandise total in the cart. | +| [getApproachingShippingDiscounts](dw.campaign.DiscountPlan.md#getapproachingshippingdiscountsshipment)([Shipment](dw.order.Shipment.md)) | Get the collection of shipping discounts that the passed shipment "almost" qualifies for based on the merchandise total in the shipment. | +| [getApproachingShippingDiscounts](dw.campaign.DiscountPlan.md#getapproachingshippingdiscountsshipment-shippingmethod)([Shipment](dw.order.Shipment.md), [ShippingMethod](dw.order.ShippingMethod.md)) | Get the collection of shipping discounts that the passed shipment "almost" qualifies for based on the merchandise total in the shipment. | +| [getApproachingShippingDiscounts](dw.campaign.DiscountPlan.md#getapproachingshippingdiscountsshipment-collection)([Shipment](dw.order.Shipment.md), [Collection](dw.util.Collection.md)) | Get the collection of shipping discounts that the passed shipment "almost" qualifies for based on the merchandise total in the shipment. | +| [getBonusDiscounts](dw.campaign.DiscountPlan.md#getbonusdiscounts)() | Returns all bonus discounts contained in the discount plan. | +| [getLineItemCtnr](dw.campaign.DiscountPlan.md#getlineitemctnr)() | Returns line item container associated with discount plan. | +| [getOrderDiscounts](dw.campaign.DiscountPlan.md#getorderdiscounts)() | Returns the percentage and amount order discounts contained in the discount plan. | +| [getProductDiscounts](dw.campaign.DiscountPlan.md#getproductdiscountsproductlineitem)([ProductLineItem](dw.order.ProductLineItem.md)) | Returns the percentage, amount and fix price discounts associated with the specified product line item. | +| [getProductShippingDiscounts](dw.campaign.DiscountPlan.md#getproductshippingdiscountsproductlineitem)([ProductLineItem](dw.order.ProductLineItem.md)) | Returns the product-shipping discounts associated with the specified product line item. | +| [getShippingDiscounts](dw.campaign.DiscountPlan.md#getshippingdiscountsshipment)([Shipment](dw.order.Shipment.md)) | Returns the percentage, amount and fix price discounts associated with the specified shipment. | +| [removeDiscount](dw.campaign.DiscountPlan.md#removediscountdiscount)([Discount](dw.campaign.Discount.md)) | Removes the specified discount from the discount plan. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### approachingOrderDiscounts +- approachingOrderDiscounts: [Collection](dw.util.Collection.md) `(read-only)` + - : Get the collection of order discounts that the LineItemCtnr "almost" + qualifies for based on the merchandise total in the cart. Nearness is + controlled by thresholds configured at the promotion level. + + + The collection of returned approaching discounts is ordered by the + condition threshold of the promotion (e.g. "spend $100 and get 10% off" + discount is returned before "spend $150 and get 15% off" discount.) A + discount is not returned if it would be prevented from applying (because + of compatibility rules) by an order discount already in the DiscountPlan + or an approaching order discount with a lower condition threshold. + + + +--- + +### bonusDiscounts +- bonusDiscounts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all bonus discounts contained in the discount plan. + + +--- + +### lineItemCtnr +- lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md) `(read-only)` + - : Returns line item container associated with discount plan. + + A discount plan is created from and associated with a line item container. + This method returns the line item container associated with this discount plan. + + + +--- + +### orderDiscounts +- orderDiscounts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the percentage and amount order discounts contained in the + discount plan. + + + +--- + +## Method Details + +### getApproachingOrderDiscounts() +- getApproachingOrderDiscounts(): [Collection](dw.util.Collection.md) + - : Get the collection of order discounts that the LineItemCtnr "almost" + qualifies for based on the merchandise total in the cart. Nearness is + controlled by thresholds configured at the promotion level. + + + The collection of returned approaching discounts is ordered by the + condition threshold of the promotion (e.g. "spend $100 and get 10% off" + discount is returned before "spend $150 and get 15% off" discount.) A + discount is not returned if it would be prevented from applying (because + of compatibility rules) by an order discount already in the DiscountPlan + or an approaching order discount with a lower condition threshold. + + + **Returns:** + - Collection of approaching order discounts ordered by the + condition threshold of the promotion ascending. + + + +--- + +### getApproachingShippingDiscounts(Shipment) +- getApproachingShippingDiscounts(shipment: [Shipment](dw.order.Shipment.md)): [Collection](dw.util.Collection.md) + - : Get the collection of shipping discounts that the passed shipment + "almost" qualifies for based on the merchandise total in the shipment. + Nearness is controlled by thresholds configured at the promotion level. + + + The collection of returned approaching discounts is ordered by the + condition threshold of the promotion (e.g. + "spend $100 and get free standard shipping" discount is returned before + "spend $150 and get free standard shipping" discount.) A discount is not + returned if it would be prevented from applying (because of compatibility + rules) by a shipping discount already in the DiscountPlan or an + approaching shipping discount with a lower condition threshold. + + + **Parameters:** + - shipment - The shipment to calculate approaching discounts for. + + **Returns:** + - Collection of approaching shipping discounts ordered by the + condition threshold of the promotion ascending. + + + +--- + +### getApproachingShippingDiscounts(Shipment, ShippingMethod) +- getApproachingShippingDiscounts(shipment: [Shipment](dw.order.Shipment.md), shippingMethod: [ShippingMethod](dw.order.ShippingMethod.md)): [Collection](dw.util.Collection.md) + - : Get the collection of shipping discounts that the passed shipment + "almost" qualifies for based on the merchandise total in the shipment. + Here "almost" is controlled by thresholds configured at the promotion + level. + + + This method only returns discounts for shipping promotions which apply to + the passed shipping method. + + + The collection of returned approaching discounts is ordered by the + condition threshold of the promotion (e.g. + "spend $100 and get free standard shipping" discount is returned before + "spend $150 and get free standard shipping" discount.) A discount is not + returned if it would be prevented from applying (because of compatibility + rules) by a shipping discount already in the DiscountPlan or an + approaching shipping discount with a lower condition threshold. + + + **Parameters:** + - shipment - The shipment to calculate approaching discounts for. + - shippingMethod - The shipping method to filter by. + + **Returns:** + - Collection of approaching shipping discounts ordered by the + condition threshold of the promotion, ascending. + + + +--- + +### getApproachingShippingDiscounts(Shipment, Collection) +- getApproachingShippingDiscounts(shipment: [Shipment](dw.order.Shipment.md), shippingMethods: [Collection](dw.util.Collection.md)): [Collection](dw.util.Collection.md) + - : Get the collection of shipping discounts that the passed shipment + "almost" qualifies for based on the merchandise total in the shipment. + Here "almost" is controlled by thresholds configured at the promotion + level. + + + This method only returns discounts for shipping promotions which apply to + one of the passed shipping methods. + + + The collection of returned approaching discounts is ordered by the + condition threshold of the promotion (e.g. + "spend $100 and get free standard shipping" discount is returned before + "spend $150 and get free standard shipping" discount.) A discount is not + returned if it would be prevented from applying (because of compatibility + rules) by a shipping discount already in the DiscountPlan or an + approaching shipping discount with a lower condition threshold. + + + **Parameters:** + - shipment - The shipment to calculate approaching discounts for. + - shippingMethods - The shipping methods to filter by. + + **Returns:** + - Collection of approaching shipping discounts ordered by the + condition threshold of the promotion ascending. + + + +--- + +### getBonusDiscounts() +- getBonusDiscounts(): [Collection](dw.util.Collection.md) + - : Returns all bonus discounts contained in the discount plan. + + **Returns:** + - All bonus discounts contained in discount plan + + +--- + +### getLineItemCtnr() +- getLineItemCtnr(): [LineItemCtnr](dw.order.LineItemCtnr.md) + - : Returns line item container associated with discount plan. + + A discount plan is created from and associated with a line item container. + This method returns the line item container associated with this discount plan. + + + **Returns:** + - Line item container associated with plan + + +--- + +### getOrderDiscounts() +- getOrderDiscounts(): [Collection](dw.util.Collection.md) + - : Returns the percentage and amount order discounts contained in the + discount plan. + + + **Returns:** + - Order discounts contained in the discount plan + + +--- + +### getProductDiscounts(ProductLineItem) +- getProductDiscounts(productLineItem: [ProductLineItem](dw.order.ProductLineItem.md)): [Collection](dw.util.Collection.md) + - : Returns the percentage, amount and fix price discounts associated + with the specified product line item. If the specified product line + item is not contained in the discount plan, an empty collection is + returned. + + + **Parameters:** + - productLineItem - Product line item + + **Returns:** + - Discounts associated with specified product line item + + +--- + +### getProductShippingDiscounts(ProductLineItem) +- getProductShippingDiscounts(productLineItem: [ProductLineItem](dw.order.ProductLineItem.md)): [Collection](dw.util.Collection.md) + - : Returns the product-shipping discounts associated with the specified + product line item. If the specified product line item is not contained in + the discount plan, an empty collection is returned. + + + **Parameters:** + - productLineItem - Product line item + + **Returns:** + - Product-shipping discounts associated with specified product line + item + + + +--- + +### getShippingDiscounts(Shipment) +- getShippingDiscounts(shipment: [Shipment](dw.order.Shipment.md)): [Collection](dw.util.Collection.md) + - : Returns the percentage, amount and fix price discounts associated with + the specified shipment. If the specified shipment is not contained in + the discount plan, an empty collection is returned. + + + **Parameters:** + - shipment - the shipment for which to fetch discounts. + + **Returns:** + - Discounts associated with specified shipment + + +--- + +### removeDiscount(Discount) +- removeDiscount(discount: [Discount](dw.campaign.Discount.md)): void + - : Removes the specified discount from the discount plan. + + + This method should only be used for very simple discount scenarios. It + is not recommended to use the method in case of stacked discounts + (i.e. multiple order or product discounts), or complex discount types + like Buy X Get Y or Total Fixed Price, since correct re-calculation of the + discount plan based on the promotion rules is not guaranteed. + + + **Parameters:** + - discount - Discount to be removed + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceDiscount.md new file mode 100644 index 00000000..ade65d37 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceDiscount.md @@ -0,0 +1,74 @@ + +# Class FixedPriceDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.FixedPriceDiscount](dw.campaign.FixedPriceDiscount.md) + +Represents a _fix price_ discount in the discount plan, for example +"Shipping only 0.99 all orders $25 or more." + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [fixedPrice](#fixedprice): [Number](TopLevel.Number.md) `(read-only)` | Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" discount. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FixedPriceDiscount](#fixedpricediscountnumber)([Number](TopLevel.Number.md)) | Create a fixed-price-discount on the fly. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getFixedPrice](dw.campaign.FixedPriceDiscount.md#getfixedprice)() | Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### fixedPrice +- fixedPrice: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" + discount. + + + +--- + +## Constructor Details + +### FixedPriceDiscount(Number) +- FixedPriceDiscount(amount: [Number](TopLevel.Number.md)) + - : Create a fixed-price-discount on the fly. Can be used to create a custom price adjustment. + + **Parameters:** + - amount - fixed price e.g. 10.00 + + +--- + +## Method Details + +### getFixedPrice() +- getFixedPrice(): [Number](TopLevel.Number.md) + - : Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" + discount. + + + **Returns:** + - Fixed price amount + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceShippingDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceShippingDiscount.md new file mode 100644 index 00000000..a2a17fc3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FixedPriceShippingDiscount.md @@ -0,0 +1,74 @@ + +# Class FixedPriceShippingDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.FixedPriceShippingDiscount](dw.campaign.FixedPriceShippingDiscount.md) + +Represents a _fixed price shipping_ discount in the discount plan, for +example "Shipping only 0.99 for iPods." + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [fixedPrice](#fixedprice): [Number](TopLevel.Number.md) `(read-only)` | Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" discount. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FixedPriceShippingDiscount](#fixedpriceshippingdiscountnumber)([Number](TopLevel.Number.md)) | Create a fixed-price-shipping-discount on the fly. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getFixedPrice](dw.campaign.FixedPriceShippingDiscount.md#getfixedprice)() | Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### fixedPrice +- fixedPrice: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" + discount. + + + +--- + +## Constructor Details + +### FixedPriceShippingDiscount(Number) +- FixedPriceShippingDiscount(amount: [Number](TopLevel.Number.md)) + - : Create a fixed-price-shipping-discount on the fly. Can be used to create a custom price adjustment. + + **Parameters:** + - amount - fixed price for shipping e.g. 10.00 + + +--- + +## Method Details + +### getFixedPrice() +- getFixedPrice(): [Number](TopLevel.Number.md) + - : Returns the fixed price amount, for example 0.99 for a "Shipping only $0.99" + discount. + + + **Returns:** + - Fixed price amount + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeDiscount.md new file mode 100644 index 00000000..54428896 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeDiscount.md @@ -0,0 +1,24 @@ + +# Class FreeDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.FreeDiscount](dw.campaign.FreeDiscount.md) + +Represents a _free_ discount in the discount plan, for example +"Free shipping on all orders $25 or more." + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeShippingDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeShippingDiscount.md new file mode 100644 index 00000000..e477c244 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.FreeShippingDiscount.md @@ -0,0 +1,24 @@ + +# Class FreeShippingDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.FreeShippingDiscount](dw.campaign.FreeShippingDiscount.md) + +Represents a _free shipping_ discount in the discount plan, for example +"Free shipping on all iPods." + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageDiscount.md new file mode 100644 index 00000000..09618281 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageDiscount.md @@ -0,0 +1,74 @@ + +# Class PercentageDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.PercentageDiscount](dw.campaign.PercentageDiscount.md) + +Represents a _percentage-off_ discount in the discount plan, for example +"10% off all T-Shirts". + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [percentage](#percentage): [Number](TopLevel.Number.md) `(read-only)` | Returns the percentage discount value, for example 10.00 for a "10% off" discount. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [PercentageDiscount](#percentagediscountnumber)([Number](TopLevel.Number.md)) | Create a percentage-discount on the fly. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getPercentage](dw.campaign.PercentageDiscount.md#getpercentage)() | Returns the percentage discount value, for example 10.00 for a "10% off" discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### percentage +- percentage: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the percentage discount value, for example 10.00 for a "10% off" + discount. + + + +--- + +## Constructor Details + +### PercentageDiscount(Number) +- PercentageDiscount(percentage: [Number](TopLevel.Number.md)) + - : Create a percentage-discount on the fly. Can be used to create a custom price adjustment. + + **Parameters:** + - percentage - percentage value, e.g. 15.00 for 15% + + +--- + +## Method Details + +### getPercentage() +- getPercentage(): [Number](TopLevel.Number.md) + - : Returns the percentage discount value, for example 10.00 for a "10% off" + discount. + + + **Returns:** + - Discount percentage value + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageOptionDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageOptionDiscount.md new file mode 100644 index 00000000..c5bdc7df --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PercentageOptionDiscount.md @@ -0,0 +1,59 @@ + +# Class PercentageOptionDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.PercentageOptionDiscount](dw.campaign.PercentageOptionDiscount.md) + +Represents a _percentage-off options_ discount in the discount plan, for +example "50% off monogramming on shirts". + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [percentage](#percentage): [Number](TopLevel.Number.md) `(read-only)` | Returns the percentage discount value, for example 10.00 for a "10% off" discount. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getPercentage](dw.campaign.PercentageOptionDiscount.md#getpercentage)() | Returns the percentage discount value, for example 10.00 for a "10% off" discount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### percentage +- percentage: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the percentage discount value, for example 10.00 for a "10% off" + discount. + + + +--- + +## Method Details + +### getPercentage() +- getPercentage(): [Number](TopLevel.Number.md) + - : Returns the percentage discount value, for example 10.00 for a "10% off" + discount. + + + **Returns:** + - Discount percentage value + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PriceBookPriceDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PriceBookPriceDiscount.md new file mode 100644 index 00000000..a567f9eb --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PriceBookPriceDiscount.md @@ -0,0 +1,56 @@ + +# Class PriceBookPriceDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.PriceBookPriceDiscount](dw.campaign.PriceBookPriceDiscount.md) + +Discount representing that a product's price has been calculated from a +separate sales price book other than the standard price book assigned to the +site. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [priceBookID](#pricebookid): [String](TopLevel.String.md) `(read-only)` | Returns the price book identifier. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getPriceBookID](dw.campaign.PriceBookPriceDiscount.md#getpricebookid)() | Returns the price book identifier. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### priceBookID +- priceBookID: [String](TopLevel.String.md) `(read-only)` + - : Returns the price book identifier. + + +--- + +## Method Details + +### getPriceBookID() +- getPriceBookID(): [String](TopLevel.String.md) + - : Returns the price book identifier. + + **Returns:** + - the price book identifier. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Promotion.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Promotion.md new file mode 100644 index 00000000..34e938c6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.Promotion.md @@ -0,0 +1,939 @@ + +# Class Promotion + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.campaign.Promotion](dw.campaign.Promotion.md) + +This class represents a promotion in Commerce Cloud Digital. Examples of +promotions include: + + +- "Get 20% off your order" +- "$15 off a given product" +- "free shipping for all orders over $50" +- Get a bonus product with purchase of another product + + +The Promotion class provides access to the basic attributes of the promotion +such as name, callout message, and description, but the details of the +promotion rules are not available in the API due to their complexity. + + +Commerce Cloud Digital allows merchants to create a single logical "promotion +rule" (e.g. "Get 20% off your order") and then assign it to one or more +"containers" where the supported container types are campaigns or AB-tests. A +Promotion represents a specific instance of a promotion rule assigned to a +container. Promotion rules themselves that are not assigned to any container +are inaccessible through the API. Each instance (i.e. assignment) can have +separate "qualifiers". Qualifiers are the customer groups, source code +groups, or coupons that trigger a given promotion for a customer. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [EXCLUSIVITY_CLASS](#exclusivity_class): [String](TopLevel.String.md) = "CLASS" | Constant representing promotion exclusivity of type _class_. | +| [EXCLUSIVITY_GLOBAL](#exclusivity_global): [String](TopLevel.String.md) = "GLOBAL" | Constant representing promotion exclusivity of type _global_. | +| [EXCLUSIVITY_NO](#exclusivity_no): [String](TopLevel.String.md) = "NO" | Constant representing promotion exclusivity of type _no_. | +| [PROMOTION_CLASS_ORDER](#promotion_class_order): [String](TopLevel.String.md) = "ORDER" | Constant representing promotion class of type _order_. | +| [PROMOTION_CLASS_PRODUCT](#promotion_class_product): [String](TopLevel.String.md) = "PRODUCT" | Constant representing promotion class of type _product_. | +| [PROMOTION_CLASS_SHIPPING](#promotion_class_shipping): [String](TopLevel.String.md) = "SHIPPING" | Constant representing promotion class of type _shipping_. | +| [QUALIFIER_MATCH_MODE_ALL](#qualifier_match_mode_all): [String](TopLevel.String.md) = "all" | Constant indicating that that all qualifier conditions must be met in order for this promotion to apply for a given customer. | +| [QUALIFIER_MATCH_MODE_ANY](#qualifier_match_mode_any): [String](TopLevel.String.md) = "any" | Constant indicating that that at least one qualifier condition must be met in order for this promotion to apply for a given customer. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique ID of the promotion. | +| [active](#active): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if promotion is active, otherwise 'false'. | +| ~~[basedOnCoupon](#basedoncoupon): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Returns 'true' if the promotion is triggered by a coupon, false otherwise. | +| [basedOnCoupons](#basedoncoupons): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the promotion is triggered by coupons, false otherwise. | +| [basedOnCustomerGroups](#basedoncustomergroups): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the promotion is triggered by customer groups, false otherwise. | +| [basedOnSourceCodes](#basedonsourcecodes): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the promotion is triggered by source codes, false otherwise. | +| [calloutMsg](#calloutmsg): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the callout message of the promotion. | +| [campaign](#campaign): [Campaign](dw.campaign.Campaign.md) `(read-only)` | Returns the campaign this particular instance of the promotion is defined in. | +| [combinablePromotions](#combinablepromotions): [String\[\]](TopLevel.String.md) `(read-only)` | Returns the promotion's combinable promotions. | +| ~~[conditionalDescription](#conditionaldescription): [MarkupText](dw.content.MarkupText.md)~~ `(read-only)` | Returns a description of the condition that must be met for this promotion to be applicable. | +| [coupons](#coupons): [Collection](dw.util.Collection.md) `(read-only)` | Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion. | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this extensible object. | +| [customerGroups](#customergroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion. | +| ~~[description](#description): [MarkupText](dw.content.MarkupText.md)~~ `(read-only)` | Returns the description of the promotion. | +| [details](#details): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the detailed description of the promotion. | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if promotion is enabled, otherwise false. | +| [endDate](#enddate): [Date](TopLevel.Date.md) `(read-only)` | Returns the effective end date of this instance of the promotion. | +| [exclusivity](#exclusivity): [String](TopLevel.String.md) `(read-only)` | Returns the promotion's exclusivity specifying how the promotion can be combined with other promotions. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the reference to the promotion image. | +| [lastModified](#lastmodified): [Date](TopLevel.Date.md) `(read-only)` | Returns the date that this object was last modified. | +| [mutuallyExclusivePromotions](#mutuallyexclusivepromotions): [String\[\]](TopLevel.String.md) `(read-only)` | Returns the promotion's mutually exclusive Promotions. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the promotion. | +| [promotionClass](#promotionclass): [String](TopLevel.String.md) `(read-only)` | Returns the promotion class indicating the general type of the promotion. | +| [qualifierMatchMode](#qualifiermatchmode): [String](TopLevel.String.md) `(read-only)` | Returns the qualifier matching mode specified by this promotion. | +| [rank](#rank): [Number](TopLevel.Number.md) `(read-only)` | Returns the promotion's rank. | +| [refinable](#refinable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if promotion is refinable, otherwise false. | +| [sourceCodeGroups](#sourcecodegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion. | +| [startDate](#startdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the effective start date of this instance of the promotion. | +| [tags](#tags): [String\[\]](TopLevel.String.md) `(read-only)` | Returns the promotion's tags. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCalloutMsg](dw.campaign.Promotion.md#getcalloutmsg)() | Returns the callout message of the promotion. | +| [getCampaign](dw.campaign.Promotion.md#getcampaign)() | Returns the campaign this particular instance of the promotion is defined in. | +| [getCombinablePromotions](dw.campaign.Promotion.md#getcombinablepromotions)() | Returns the promotion's combinable promotions. | +| ~~[getConditionalDescription](dw.campaign.Promotion.md#getconditionaldescription)()~~ | Returns a description of the condition that must be met for this promotion to be applicable. | +| [getCoupons](dw.campaign.Promotion.md#getcoupons)() | Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion. | +| [getCustom](dw.campaign.Promotion.md#getcustom)() | Returns the custom attributes for this extensible object. | +| [getCustomerGroups](dw.campaign.Promotion.md#getcustomergroups)() | Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion. | +| ~~[getDescription](dw.campaign.Promotion.md#getdescription)()~~ | Returns the description of the promotion. | +| [getDetails](dw.campaign.Promotion.md#getdetails)() | Returns the detailed description of the promotion. | +| [getEndDate](dw.campaign.Promotion.md#getenddate)() | Returns the effective end date of this instance of the promotion. | +| [getExclusivity](dw.campaign.Promotion.md#getexclusivity)() | Returns the promotion's exclusivity specifying how the promotion can be combined with other promotions. | +| [getID](dw.campaign.Promotion.md#getid)() | Returns the unique ID of the promotion. | +| [getImage](dw.campaign.Promotion.md#getimage)() | Returns the reference to the promotion image. | +| [getLastModified](dw.campaign.Promotion.md#getlastmodified)() | Returns the date that this object was last modified. | +| [getMutuallyExclusivePromotions](dw.campaign.Promotion.md#getmutuallyexclusivepromotions)() | Returns the promotion's mutually exclusive Promotions. | +| [getName](dw.campaign.Promotion.md#getname)() | Returns the name of the promotion. | +| [getPromotionClass](dw.campaign.Promotion.md#getpromotionclass)() | Returns the promotion class indicating the general type of the promotion. | +| [getPromotionalPrice](dw.campaign.Promotion.md#getpromotionalpriceproduct)([Product](dw.catalog.Product.md)) | Returns the promotional price for the specified product. | +| [getPromotionalPrice](dw.campaign.Promotion.md#getpromotionalpriceproduct-productoptionmodel)([Product](dw.catalog.Product.md), [ProductOptionModel](dw.catalog.ProductOptionModel.md)) | This method follows the same logic as [getPromotionalPrice(Product)](dw.campaign.Promotion.md#getpromotionalpriceproduct) but prices are calculated based on the option values selected in the specified option model. | +| [getQualifierMatchMode](dw.campaign.Promotion.md#getqualifiermatchmode)() | Returns the qualifier matching mode specified by this promotion. | +| [getRank](dw.campaign.Promotion.md#getrank)() | Returns the promotion's rank. | +| [getSourceCodeGroups](dw.campaign.Promotion.md#getsourcecodegroups)() | Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion. | +| [getStartDate](dw.campaign.Promotion.md#getstartdate)() | Returns the effective start date of this instance of the promotion. | +| [getTags](dw.campaign.Promotion.md#gettags)() | Returns the promotion's tags. | +| [isActive](dw.campaign.Promotion.md#isactive)() | Returns 'true' if promotion is active, otherwise 'false'. | +| ~~[isBasedOnCoupon](dw.campaign.Promotion.md#isbasedoncoupon)()~~ | Returns 'true' if the promotion is triggered by a coupon, false otherwise. | +| [isBasedOnCoupons](dw.campaign.Promotion.md#isbasedoncoupons)() | Returns 'true' if the promotion is triggered by coupons, false otherwise. | +| [isBasedOnCustomerGroups](dw.campaign.Promotion.md#isbasedoncustomergroups)() | Returns 'true' if the promotion is triggered by customer groups, false otherwise. | +| [isBasedOnSourceCodes](dw.campaign.Promotion.md#isbasedonsourcecodes)() | Returns 'true' if the promotion is triggered by source codes, false otherwise. | +| [isEnabled](dw.campaign.Promotion.md#isenabled)() | Returns true if promotion is enabled, otherwise false. | +| [isRefinable](dw.campaign.Promotion.md#isrefinable)() | Returns true if promotion is refinable, otherwise false. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### EXCLUSIVITY_CLASS + +- EXCLUSIVITY_CLASS: [String](TopLevel.String.md) = "CLASS" + - : Constant representing promotion exclusivity of type _class_. + + +--- + +### EXCLUSIVITY_GLOBAL + +- EXCLUSIVITY_GLOBAL: [String](TopLevel.String.md) = "GLOBAL" + - : Constant representing promotion exclusivity of type _global_. + + +--- + +### EXCLUSIVITY_NO + +- EXCLUSIVITY_NO: [String](TopLevel.String.md) = "NO" + - : Constant representing promotion exclusivity of type _no_. + + +--- + +### PROMOTION_CLASS_ORDER + +- PROMOTION_CLASS_ORDER: [String](TopLevel.String.md) = "ORDER" + - : Constant representing promotion class of type _order_. + + +--- + +### PROMOTION_CLASS_PRODUCT + +- PROMOTION_CLASS_PRODUCT: [String](TopLevel.String.md) = "PRODUCT" + - : Constant representing promotion class of type _product_. + + +--- + +### PROMOTION_CLASS_SHIPPING + +- PROMOTION_CLASS_SHIPPING: [String](TopLevel.String.md) = "SHIPPING" + - : Constant representing promotion class of type _shipping_. + + +--- + +### QUALIFIER_MATCH_MODE_ALL + +- QUALIFIER_MATCH_MODE_ALL: [String](TopLevel.String.md) = "all" + - : Constant indicating that that all qualifier conditions must be met in + order for this promotion to apply for a given customer. + + + +--- + +### QUALIFIER_MATCH_MODE_ANY + +- QUALIFIER_MATCH_MODE_ANY: [String](TopLevel.String.md) = "any" + - : Constant indicating that that at least one qualifier condition must be + met in order for this promotion to apply for a given customer. + + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique ID of the promotion. + + +--- + +### active +- active: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if promotion is active, otherwise 'false'. + + A promotion is active if its campaign is active, and the promotion + is enabled, and it is scheduled for _now_. + + + +--- + +### basedOnCoupon +- ~~basedOnCoupon: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Returns 'true' if the promotion is triggered by a coupon, + false otherwise. + + + **Deprecated:** +:::warning +Use [isBasedOnCoupons()](dw.campaign.Promotion.md#isbasedoncoupons) +::: + +--- + +### basedOnCoupons +- basedOnCoupons: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the promotion is triggered by coupons, + false otherwise. + + + +--- + +### basedOnCustomerGroups +- basedOnCustomerGroups: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the promotion is triggered by customer groups, + false otherwise. + + + +--- + +### basedOnSourceCodes +- basedOnSourceCodes: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the promotion is triggered by source codes, + false otherwise. + + + +--- + +### calloutMsg +- calloutMsg: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the callout message of the promotion. + + +--- + +### campaign +- campaign: [Campaign](dw.campaign.Campaign.md) `(read-only)` + - : Returns the campaign this particular instance of the promotion is defined + in. + + + Note: If this promotion is defined as part of an AB-test, then a Campaign + object will be returned, but it is a mock implementation, and not a true + Campaign. This behavior is required for backwards compatibility and + should not be relied upon as it may change in future releases. + + + +--- + +### combinablePromotions +- combinablePromotions: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns the promotion's combinable promotions. Combinable promotions is a set of promotions or groups this + promotion can be combined with. + + + +--- + +### conditionalDescription +- ~~conditionalDescription: [MarkupText](dw.content.MarkupText.md)~~ `(read-only)` + - : Returns a description of the condition that must be met for this + promotion to be applicable. + + + The method and the related attribute have been deprecated. Use the + [getDetails()](dw.campaign.Promotion.md#getdetails) method instead. + + + **Deprecated:** +:::warning +Use [getDetails()](dw.campaign.Promotion.md#getdetails) +::: + +--- + +### coupons +- coupons: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on coupons (see [isBasedOnCoupons()](dw.campaign.Promotion.md#isbasedoncoupons)), or no coupons is assigned to the + promotion or its campaign, an empty collection is returned. + + + +--- + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this extensible object. + + +--- + +### customerGroups +- customerGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on customer groups (see [isBasedOnCustomerGroups()](dw.campaign.Promotion.md#isbasedoncustomergroups)), or no customer group is assigned to the + promotion or its campaign, an empty collection is returned. + + + +--- + +### description +- ~~description: [MarkupText](dw.content.MarkupText.md)~~ `(read-only)` + - : Returns the description of the promotion. + + + Method is deprecated and returns the same value as [getCalloutMsg()](dw.campaign.Promotion.md#getcalloutmsg). + + + **Deprecated:** +:::warning +Use [getCalloutMsg()](dw.campaign.Promotion.md#getcalloutmsg) +::: + +--- + +### details +- details: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the detailed description of the promotion. + + +--- + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if promotion is enabled, otherwise false. + + +--- + +### endDate +- endDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the effective end date of this instance of the promotion. If no + explicit end date is defined for the promotion, the end date of the + containing Campaign or AB-test is returned. + + + +--- + +### exclusivity +- exclusivity: [String](TopLevel.String.md) `(read-only)` + - : Returns the promotion's exclusivity specifying how the promotion can be + combined with other promotions. + Possible values are [EXCLUSIVITY_NO](dw.campaign.Promotion.md#exclusivity_no), [EXCLUSIVITY_CLASS](dw.campaign.Promotion.md#exclusivity_class) + and [EXCLUSIVITY_GLOBAL](dw.campaign.Promotion.md#exclusivity_global). + + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the reference to the promotion image. + + +--- + +### lastModified +- lastModified: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date that this object was last modified. + + +--- + +### mutuallyExclusivePromotions +- mutuallyExclusivePromotions: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns the promotion's mutually exclusive Promotions. Mutually exclusive Promotions is a set of promotions or + groups this promotion cannot be combined with. + + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the promotion. + + +--- + +### promotionClass +- promotionClass: [String](TopLevel.String.md) `(read-only)` + - : Returns the promotion class indicating the general type of the promotion. + Possible values are [PROMOTION_CLASS_PRODUCT](dw.campaign.Promotion.md#promotion_class_product), + [PROMOTION_CLASS_ORDER](dw.campaign.Promotion.md#promotion_class_order), and [PROMOTION_CLASS_SHIPPING](dw.campaign.Promotion.md#promotion_class_shipping). + + + +--- + +### qualifierMatchMode +- qualifierMatchMode: [String](TopLevel.String.md) `(read-only)` + - : Returns the qualifier matching mode specified by this promotion. A + promotion may have up to 3 qualifier conditions based on whether it is + customer-group based, coupon based, and/or source-code based. A promotion + may require for example that a customer belong to a certain customer + group and also have a certain coupon in the cart in order for the + promotion to apply. This method returns QUALIFIER\_MATCH\_MODE\_ALL if it is + necessary that all the qualifier conditions are satisfied in order for + this promotion to apply for a given customer. Otherwise, this method + returns QUALIFIER\_MATCH\_MODE\_ANY indicating that at least of the + qualifier conditions must be satisfied. + + + Note: currently QUALIFIER\_MATCH\_MODE\_ALL is only supported for promotions + assigned to campaigns, and not those assigned to AB-tests. + + + +--- + +### rank +- rank: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the promotion's rank. Rank is a numeric attribute that you can specify. + Promotions with a defined rank are calculated before promotions without a defined rank. + If two promotions have a rank, the one with the lowest rank is calculated first. + For example, a promotion with rank 10 is calculated before one with rank 30. + + + +--- + +### refinable +- refinable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if promotion is refinable, otherwise false. + + +--- + +### sourceCodeGroups +- sourceCodeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on source code groups (see [isBasedOnSourceCodes()](dw.campaign.Promotion.md#isbasedonsourcecodes)), or no source code group is assigned to the + promotion or its campaign, an empty collection is returned. + + + +--- + +### startDate +- startDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the effective start date of this instance of the promotion. If no + explicit start date is defined for this instance, the start date of the + containing Campaign or AB-test is returned. + + + +--- + +### tags +- tags: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns the promotion's tags. Tags are a way of categorizing and organizing promotions. A promotion can have many + tags. Tags will be returned in alphabetical order. + + + +--- + +## Method Details + +### getCalloutMsg() +- getCalloutMsg(): [MarkupText](dw.content.MarkupText.md) + - : Returns the callout message of the promotion. + + **Returns:** + - Callout message of the promotion. + + +--- + +### getCampaign() +- getCampaign(): [Campaign](dw.campaign.Campaign.md) + - : Returns the campaign this particular instance of the promotion is defined + in. + + + Note: If this promotion is defined as part of an AB-test, then a Campaign + object will be returned, but it is a mock implementation, and not a true + Campaign. This behavior is required for backwards compatibility and + should not be relied upon as it may change in future releases. + + + **Returns:** + - Campaign of the promotion. + + +--- + +### getCombinablePromotions() +- getCombinablePromotions(): [String\[\]](TopLevel.String.md) + - : Returns the promotion's combinable promotions. Combinable promotions is a set of promotions or groups this + promotion can be combined with. + + + **Returns:** + - The promotion's set of combinable promotions. + + +--- + +### getConditionalDescription() +- ~~getConditionalDescription(): [MarkupText](dw.content.MarkupText.md)~~ + - : Returns a description of the condition that must be met for this + promotion to be applicable. + + + The method and the related attribute have been deprecated. Use the + [getDetails()](dw.campaign.Promotion.md#getdetails) method instead. + + + **Returns:** + - Condition promotion description. + + **Deprecated:** +:::warning +Use [getDetails()](dw.campaign.Promotion.md#getdetails) +::: + +--- + +### getCoupons() +- getCoupons(): [Collection](dw.util.Collection.md) + - : Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on coupons (see [isBasedOnCoupons()](dw.campaign.Promotion.md#isbasedoncoupons)), or no coupons is assigned to the + promotion or its campaign, an empty collection is returned. + + + **Returns:** + - Coupons assigned to promotion in no particular order. + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this extensible object. + + +--- + +### getCustomerGroups() +- getCustomerGroups(): [Collection](dw.util.Collection.md) + - : Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on customer groups (see [isBasedOnCustomerGroups()](dw.campaign.Promotion.md#isbasedoncustomergroups)), or no customer group is assigned to the + promotion or its campaign, an empty collection is returned. + + + **Returns:** + - Customer groups assigned to promotion in no particular order. + + +--- + +### getDescription() +- ~~getDescription(): [MarkupText](dw.content.MarkupText.md)~~ + - : Returns the description of the promotion. + + + Method is deprecated and returns the same value as [getCalloutMsg()](dw.campaign.Promotion.md#getcalloutmsg). + + + **Returns:** + - Description of the promotion. + + **Deprecated:** +:::warning +Use [getCalloutMsg()](dw.campaign.Promotion.md#getcalloutmsg) +::: + +--- + +### getDetails() +- getDetails(): [MarkupText](dw.content.MarkupText.md) + - : Returns the detailed description of the promotion. + + **Returns:** + - Detailed promotion description. + + +--- + +### getEndDate() +- getEndDate(): [Date](TopLevel.Date.md) + - : Returns the effective end date of this instance of the promotion. If no + explicit end date is defined for the promotion, the end date of the + containing Campaign or AB-test is returned. + + + **Returns:** + - End date of the promotion, or null if no end date is defined. + + +--- + +### getExclusivity() +- getExclusivity(): [String](TopLevel.String.md) + - : Returns the promotion's exclusivity specifying how the promotion can be + combined with other promotions. + Possible values are [EXCLUSIVITY_NO](dw.campaign.Promotion.md#exclusivity_no), [EXCLUSIVITY_CLASS](dw.campaign.Promotion.md#exclusivity_class) + and [EXCLUSIVITY_GLOBAL](dw.campaign.Promotion.md#exclusivity_global). + + + **Returns:** + - Promotion exclusivity + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique ID of the promotion. + + **Returns:** + - ID of the promotion. + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the reference to the promotion image. + + **Returns:** + - Image of the promotion. + + +--- + +### getLastModified() +- getLastModified(): [Date](TopLevel.Date.md) + - : Returns the date that this object was last modified. + + **Returns:** + - the date that this object was last modified. + + +--- + +### getMutuallyExclusivePromotions() +- getMutuallyExclusivePromotions(): [String\[\]](TopLevel.String.md) + - : Returns the promotion's mutually exclusive Promotions. Mutually exclusive Promotions is a set of promotions or + groups this promotion cannot be combined with. + + + **Returns:** + - The promotion's set of mutually exclusive Promotions. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the promotion. + + **Returns:** + - Name of the promotion. + + +--- + +### getPromotionClass() +- getPromotionClass(): [String](TopLevel.String.md) + - : Returns the promotion class indicating the general type of the promotion. + Possible values are [PROMOTION_CLASS_PRODUCT](dw.campaign.Promotion.md#promotion_class_product), + [PROMOTION_CLASS_ORDER](dw.campaign.Promotion.md#promotion_class_order), and [PROMOTION_CLASS_SHIPPING](dw.campaign.Promotion.md#promotion_class_shipping). + + + **Returns:** + - Promotion class or null if the promotion rule has not been + configured. + + + +--- + +### getPromotionalPrice(Product) +- getPromotionalPrice(product: [Product](dw.catalog.Product.md)): [Money](dw.value.Money.md) + - : Returns the promotional price for the specified product. The promotional + price is only returned if the following conditions are met: + + + - this promotion is a product promotion without purchase conditions, i.e. is of type 'Without qualifying products'. + - this promotion's discount is Discount.TYPE\_AMOUNT, Discount.TYPE\_PERCENTAGE, Discount.TYPE\_FIXED\_PRICE, or Discount.TYPE\_PRICEBOOK\_PRICE. + - specified product is one of the discounted products of the promotion. + - the product has a valid sales price for quantity 1.0. + + + In all other cases, the method will return Money.NOT\_AVAILABLE. It is + not required that this promotion be an active customer + promotion. + + NOTE: the method might be extended in the future to support more + promotion types. + + To calculate the promotional price, the method uses the current sales + price of the product for quantity 1.0, and applies the discount + associated with the promotion to this price. For example, if the product + price is $14.99, and the promotion discount is 10%, the method will + return $13.49. If the discount is $2 off, the method will return $12.99. + If the discount is $10.00 fixed price, the method will return $10.00. + + + **Parameters:** + - product - the product to calculate the discount for + + **Returns:** + - the price of the passed product after promotional discount is + applied, or Money.NOT\_AVAILABLE if any of the restrictions on + product or promotion are not met. + + + +--- + +### getPromotionalPrice(Product, ProductOptionModel) +- getPromotionalPrice(product: [Product](dw.catalog.Product.md), optionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md)): [Money](dw.value.Money.md) + - : This method follows the same logic as + [getPromotionalPrice(Product)](dw.campaign.Promotion.md#getpromotionalpriceproduct) but prices are calculated based + on the option values selected in the specified option model. + + + **Parameters:** + - product - the product to calculate the discount for + - optionModel - the option model to use when calculating + + **Returns:** + - the price of the passed product after promotional discount is + applied, or Money.NOT\_AVAILABLE if any of the restrictions on + product or promotion are not met. + + + +--- + +### getQualifierMatchMode() +- getQualifierMatchMode(): [String](TopLevel.String.md) + - : Returns the qualifier matching mode specified by this promotion. A + promotion may have up to 3 qualifier conditions based on whether it is + customer-group based, coupon based, and/or source-code based. A promotion + may require for example that a customer belong to a certain customer + group and also have a certain coupon in the cart in order for the + promotion to apply. This method returns QUALIFIER\_MATCH\_MODE\_ALL if it is + necessary that all the qualifier conditions are satisfied in order for + this promotion to apply for a given customer. Otherwise, this method + returns QUALIFIER\_MATCH\_MODE\_ANY indicating that at least of the + qualifier conditions must be satisfied. + + + Note: currently QUALIFIER\_MATCH\_MODE\_ALL is only supported for promotions + assigned to campaigns, and not those assigned to AB-tests. + + + **Returns:** + - the qualifier matching mode specified by this promotion, either + QUALIFIER\_MATCH\_MODE\_ALL or QUALIFIER\_MATCH\_MODE\_ANY. + + + +--- + +### getRank() +- getRank(): [Number](TopLevel.Number.md) + - : Returns the promotion's rank. Rank is a numeric attribute that you can specify. + Promotions with a defined rank are calculated before promotions without a defined rank. + If two promotions have a rank, the one with the lowest rank is calculated first. + For example, a promotion with rank 10 is calculated before one with rank 30. + + + **Returns:** + - The promotion's rank. + + +--- + +### getSourceCodeGroups() +- getSourceCodeGroups(): [Collection](dw.util.Collection.md) + - : Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion. + + If the promotion is not based on source code groups (see [isBasedOnSourceCodes()](dw.campaign.Promotion.md#isbasedonsourcecodes)), or no source code group is assigned to the + promotion or its campaign, an empty collection is returned. + + + **Returns:** + - Source code groups assigned to promotion in no particular order. + + +--- + +### getStartDate() +- getStartDate(): [Date](TopLevel.Date.md) + - : Returns the effective start date of this instance of the promotion. If no + explicit start date is defined for this instance, the start date of the + containing Campaign or AB-test is returned. + + + **Returns:** + - Start date of the promotion, or null if no start date is defined. + + +--- + +### getTags() +- getTags(): [String\[\]](TopLevel.String.md) + - : Returns the promotion's tags. Tags are a way of categorizing and organizing promotions. A promotion can have many + tags. Tags will be returned in alphabetical order. + + + **Returns:** + - The promotion's set of tags. + + +--- + +### isActive() +- isActive(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if promotion is active, otherwise 'false'. + + A promotion is active if its campaign is active, and the promotion + is enabled, and it is scheduled for _now_. + + + **Returns:** + - true if promotion is active, otherwise false. + + +--- + +### isBasedOnCoupon() +- ~~isBasedOnCoupon(): [Boolean](TopLevel.Boolean.md)~~ + - : Returns 'true' if the promotion is triggered by a coupon, + false otherwise. + + + **Returns:** + - true if promotion is triggered by coupon, otherwise false. + + **Deprecated:** +:::warning +Use [isBasedOnCoupons()](dw.campaign.Promotion.md#isbasedoncoupons) +::: + +--- + +### isBasedOnCoupons() +- isBasedOnCoupons(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the promotion is triggered by coupons, + false otherwise. + + + **Returns:** + - true if promotion is triggered by coupons, otherwise false. + + +--- + +### isBasedOnCustomerGroups() +- isBasedOnCustomerGroups(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the promotion is triggered by customer groups, + false otherwise. + + + **Returns:** + - true if promotion is triggered by customer groups, otherwise false. + + +--- + +### isBasedOnSourceCodes() +- isBasedOnSourceCodes(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the promotion is triggered by source codes, + false otherwise. + + + **Returns:** + - true if promotion is triggered by source codes, otherwise false. + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if promotion is enabled, otherwise false. + + **Returns:** + - true if promotion is enabled, otherwise false. + + +--- + +### isRefinable() +- isRefinable(): [Boolean](TopLevel.Boolean.md) + - : Returns true if promotion is refinable, otherwise false. + + **Returns:** + - true if promotion is refinable, otherwise false. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionMgr.md new file mode 100644 index 00000000..d02137d2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionMgr.md @@ -0,0 +1,478 @@ + +# Class PromotionMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.PromotionMgr](dw.campaign.PromotionMgr.md) + +[PromotionMgr](dw.campaign.PromotionMgr.md) is used to access campaigns and promotion +definitions, display active or upcoming promotions in a storefront, and to +calculate and apply promotional discounts to line item containers. + + +To access campaign and promotion definitions, use methods +[getCampaigns()](dw.campaign.PromotionMgr.md#getcampaigns), [getCampaign(String)](dw.campaign.PromotionMgr.md#getcampaignstring), +[getPromotions()](dw.campaign.PromotionMgr.md#getpromotions) and [getPromotion(String)](dw.campaign.PromotionMgr.md#getpromotionstring). + + +To display active or upcoming promotions in the storefront, e.g. on product +pages, various methods are provided. [getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) returns +a [PromotionPlan](dw.campaign.PromotionPlan.md) with all enabled promotions scheduled for _now_. +[getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) returns a [PromotionPlan](dw.campaign.PromotionPlan.md) with +all enabled promotions scheduled for _now_ and applicable for the +session currency, current customer and active source code. +[getUpcomingPromotions(Number)](dw.campaign.PromotionMgr.md#getupcomingpromotionsnumber) returns a [PromotionPlan](dw.campaign.PromotionPlan.md) with all +promotions that are enabled, not scheduled for _now_, but scheduled for +any time between _now_ and _now + previewTime(hours)_. + + +Applying promotions to line item containers is a 3-step process, and +[PromotionMgr](dw.campaign.PromotionMgr.md) provides methods supporting each of these steps. +Convenience methods can be used that execute all three steps at once, +or the steps can be executed individually if you need to customize +the output of the steps due to specific business rules. + + +- Step 1 - calculate active customer promotions: Determine the active promotions for the session currency, current customer, source code and redeemed coupons. +- Step 2 - calculate applicable discounts: Based on the active promotions determined in step 1, applicable discounts are calculated. +- Step 3 - apply discounts: applicable discounts are applied to a line item container by creating price adjustment line items. + + + +The simpliest way to execute steps 1-3 is to use method +[applyDiscounts(LineItemCtnr)](dw.campaign.PromotionMgr.md#applydiscountslineitemctnr). The method identifies all active +customer promotions, calculates and applies applicable discounts. + + +Due to specific business rules it might be necessary to manipulate +the set of applicable discounts calculated by the promotion engine +before applying them to the line item container. To implement such a scenario, +you want to use method [getDiscounts(LineItemCtnr)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr), which +identifies all active customer promotions, and calculates and returns +applicable discounts in an instance of [DiscountPlan](dw.campaign.DiscountPlan.md). The discount +plan contains a description for all applicable discounts for the specified line +item container, and you can remove discounts from it if necessary. +The customized discount plan can then be passed on for application by +using method [applyDiscounts(DiscountPlan)](dw.campaign.PromotionMgr.md#applydiscountsdiscountplan). + + +Due to specific business rules it might be necessary to manipulate the +set of active customer promotions before calculating applicable discounts +from it. For example, you might want to add promotions to the +plan or remove promotions from it. +You want to use method [getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and +[getActiveCustomerPromotions(Boolean)](dw.campaign.PromotionMgr.md#getactivecustomerpromotionsboolean), which +identifies all active customer promotions and returns an instance of +[PromotionPlan](dw.campaign.PromotionPlan.md). You can add promotions to the promotion plan +or remove promotions from the plan. The customized promotion plan can then be +passed on to calculate applicable discounts by using method +[getDiscounts(LineItemCtnr, PromotionPlan)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr-promotionplan). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [activeCustomerPromotions](#activecustomerpromotions): [PromotionPlan](dw.campaign.PromotionPlan.md) `(read-only)` | Returns all promotions scheduled for _now_ and applicable for the session currency, current customer, source code, or presented coupons.
The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). | +| [activePromotions](#activepromotions): [PromotionPlan](dw.campaign.PromotionPlan.md) `(read-only)` | Returns all promotions scheduled for _now_, and applicable for the session currency but regardless of current customer or source code.
The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). | +| [campaigns](#campaigns): [Collection](dw.util.Collection.md) `(read-only)` | Returns all campaigns of the current site in no specific order. | +| [promotions](#promotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all promotions of the current site in no specific order. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [applyDiscounts](dw.campaign.PromotionMgr.md#applydiscountsdiscountplan)([DiscountPlan](dw.campaign.DiscountPlan.md)) | Applies the discounts contained in the specified discount plan to the line item container associated with the discount plan. | +| static [applyDiscounts](dw.campaign.PromotionMgr.md#applydiscountslineitemctnr)([LineItemCtnr](dw.order.LineItemCtnr.md)) | Identifies active promotions, calculates the applicable discounts from these promotions and applies these discounts to the specified line item container. | +| static [getActiveCustomerPromotions](dw.campaign.PromotionMgr.md#getactivecustomerpromotions)() | Returns all promotions scheduled for _now_ and applicable for the session currency, current customer, source code, or presented coupons.
The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). | +| static [getActiveCustomerPromotions](dw.campaign.PromotionMgr.md#getactivecustomerpromotionsboolean)([Boolean](TopLevel.Boolean.md)) | Returns all promotions scheduled for _now_ and applicable for the session currency, current customer, source code, or presented coupons. | +| static [getActiveCustomerPromotionsForCampaign](dw.campaign.PromotionMgr.md#getactivecustomerpromotionsforcampaigncampaign-date-date)([Campaign](dw.campaign.Campaign.md), [Date](TopLevel.Date.md), [Date](TopLevel.Date.md)) | Returns all promotions assigned to the passed campaign, which are active at some point within the specified date range, and are applicable for the current customer, source code, or presented coupons. | +| static [getActivePromotions](dw.campaign.PromotionMgr.md#getactivepromotions)() | Returns all promotions scheduled for _now_, and applicable for the session currency but regardless of current customer or source code.
The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). | +| static [getActivePromotionsForCampaign](dw.campaign.PromotionMgr.md#getactivepromotionsforcampaigncampaign-date-date)([Campaign](dw.campaign.Campaign.md), [Date](TopLevel.Date.md), [Date](TopLevel.Date.md)) | Returns all promotions assigned to the passed campaign which are active at some point within the specified date range. | +| static [getCampaign](dw.campaign.PromotionMgr.md#getcampaignstring)([String](TopLevel.String.md)) | Returns the campaign identified by the specified ID. | +| static [getCampaigns](dw.campaign.PromotionMgr.md#getcampaigns)() | Returns all campaigns of the current site in no specific order. | +| static [getDiscounts](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr)([LineItemCtnr](dw.order.LineItemCtnr.md)) | Returns the discounts applicable for the current customer, active source code and specified line item container. | +| static [getDiscounts](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr-promotionplan)([LineItemCtnr](dw.order.LineItemCtnr.md), [PromotionPlan](dw.campaign.PromotionPlan.md)) | Returns the discounts applicable for the current customer, active source code and specified line item container, based on the specified promotion plan. | +| static [getPromotion](dw.campaign.PromotionMgr.md#getpromotionstring)([String](TopLevel.String.md)) | Returns the promotion identified by the specified ID. | +| static [getPromotions](dw.campaign.PromotionMgr.md#getpromotions)() | Returns all promotions of the current site in no specific order. | +| static [getUpcomingCustomerPromotions](dw.campaign.PromotionMgr.md#getupcomingcustomerpromotionsnumber)([Number](TopLevel.Number.md)) | Returns all promotions currently inactive, but scheduled for any time between _now_ and _now + previewTime(hours)_, and which are applicable based on the current customer, source code, and coupons in the current basket.
The parameter _previewTime_ specifies for how many hours promotions should be previewed. | +| static [getUpcomingPromotions](dw.campaign.PromotionMgr.md#getupcomingpromotionsnumber)([Number](TopLevel.Number.md)) | Returns all promotions currently inactive, but scheduled for any time between _now_ and _now + previewTime(hours)_. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### activeCustomerPromotions +- activeCustomerPromotions: [PromotionPlan](dw.campaign.PromotionPlan.md) `(read-only)` + - : Returns all promotions scheduled for _now_ and applicable for the + session currency, current customer, source code, or presented coupons. + + + The active promotions are returned in an instance of + [PromotionPlan](dw.campaign.PromotionPlan.md). The promotion plan contains all + promotions assigned to any customer group of the current customer, the + current source code, or coupons in the current session basket. + + + **See Also:** + - [getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) + + +--- + +### activePromotions +- activePromotions: [PromotionPlan](dw.campaign.PromotionPlan.md) `(read-only)` + - : Returns all promotions scheduled for _now_, and applicable for the + session currency but regardless of current customer or source code. + + The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). + + + **See Also:** + - [getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) + + +--- + +### campaigns +- campaigns: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all campaigns of the current site in no specific order. + + +--- + +### promotions +- promotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all promotions of the current site in no specific order. + + +--- + +## Method Details + +### applyDiscounts(DiscountPlan) +- static applyDiscounts(discountPlan: [DiscountPlan](dw.campaign.DiscountPlan.md)): void + - : Applies the discounts contained in the specified discount plan + to the line item container associated with the discount + plan. + + + + As a result of this method, the specified line item container + contains price adjustments and/or bonus product line items for + all discounts contained in the specified discount plan. + The method also removes price adjustment and/or bonus product line items + from the line item container if the specified discount plan does not + contain the related discount. + + + _Note that the method does not evaluate if the discounts in the specified + discount plan are applicable nor that the promotions related to these + discounts are active._ + + + **Parameters:** + - discountPlan - Discount plan to apply to associated line item container + + **See Also:** + - [getDiscounts(LineItemCtnr)](dw.campaign.PromotionMgr.md#getdiscountslineitemctnr) + - [applyDiscounts(LineItemCtnr)](dw.campaign.PromotionMgr.md#applydiscountslineitemctnr) + + +--- + +### applyDiscounts(LineItemCtnr) +- static applyDiscounts(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md)): void + - : Identifies active promotions, calculates the applicable + discounts from these promotions and applies these discounts to the + specified line item container. + + + As a result of this method, the specified line item container + contains price adjustments and/or bonus product line items for + all applicable discounts. The method also removes price + adjustment and/or bonus product line items from the line item + container if the related to promotions/discounts are no longer + applicable. + + + **Parameters:** + - lineItemCtnr - Line item ctnr to apply promotions on + + +--- + +### getActiveCustomerPromotions() +- static getActiveCustomerPromotions(): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions scheduled for _now_ and applicable for the + session currency, current customer, source code, or presented coupons. + + + The active promotions are returned in an instance of + [PromotionPlan](dw.campaign.PromotionPlan.md). The promotion plan contains all + promotions assigned to any customer group of the current customer, the + current source code, or coupons in the current session basket. + + + **Returns:** + - [PromotionPlan](dw.campaign.PromotionPlan.md) with active customer promotions + + **See Also:** + - [getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) + + +--- + +### getActiveCustomerPromotions(Boolean) +- static getActiveCustomerPromotions(ignoreCouponCondition: [Boolean](TopLevel.Boolean.md)): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions scheduled for _now_ and applicable for the + session currency, current customer, source code, or presented coupons. + + + The active promotions are returned in an instance of + [PromotionPlan](dw.campaign.PromotionPlan.md). The promotion plan contains all + promotions assigned to any customer group of the current customer, the + current source code, or coupons in the current session basket. + + + **Parameters:** + - ignoreCouponCondition - true if coupon condition will be ignored when get active promotions. + + **Returns:** + - [PromotionPlan](dw.campaign.PromotionPlan.md) with active customer promotions + + +--- + +### getActiveCustomerPromotionsForCampaign(Campaign, Date, Date) +- static getActiveCustomerPromotionsForCampaign(campaign: [Campaign](dw.campaign.Campaign.md), from: [Date](TopLevel.Date.md), to: [Date](TopLevel.Date.md)): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions assigned to the passed campaign, which are active + at some point within the specified date range, and are applicable for the + current customer, source code, or presented coupons. A promotion must be + active for an actual time period within the passed date range, and not + just a single point. + + + The passed campaign and dates must not be null or an exception is thrown. + It is valid for the from and to dates to be in the past. If an invalid + time range is specified (i.e. from is after to), the returned + PromotionPlan will be empty. + + + **Parameters:** + - campaign - The campaign, must not be null or an exception is thrown. + - from - The start of the date range to consider. If null, this signifies an open ended time period. + - to - The end of the date range to consider. If null, this signifies an open ended time period. + + **Returns:** + - PromotionPlan with promotions matching all the criteria. + + +--- + +### getActivePromotions() +- static getActivePromotions(): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions scheduled for _now_, and applicable for the + session currency but regardless of current customer or source code. + + The active promotions are returned in an instance of [PromotionPlan](dw.campaign.PromotionPlan.md). + + + **Returns:** + - [PromotionPlan](dw.campaign.PromotionPlan.md) with active promotions + + **See Also:** + - [getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) + + +--- + +### getActivePromotionsForCampaign(Campaign, Date, Date) +- static getActivePromotionsForCampaign(campaign: [Campaign](dw.campaign.Campaign.md), from: [Date](TopLevel.Date.md), to: [Date](TopLevel.Date.md)): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions assigned to the passed campaign which are active + at some point within the specified date range. A promotion must be active + for an actual time period within the passed date range, and not just a + single point. A promotion must be applicable for the session currency. + + + This method considers only the enabled flags and time conditions of the + promotion and campaign. It does not consider whether the current customer + satisfies the qualifiers of the promotion (customer group, source code, + or coupon). + + + The passed campaign and dates must not be null or an exception is thrown. + It is valid for the from and/or to dates to be in the past. If an invalid + time range is specified (i.e. from is after to), the returned + PromotionPlan will be empty. + + + **Parameters:** + - campaign - The campaign. Must not be null. + - from - The start of the date range to consider. Must not be null + - to - The end of the date range to consider. Must not be null. + + **Returns:** + - PromotionPlan with promotions matching all the criteria. + + +--- + +### getCampaign(String) +- static getCampaign(id: [String](TopLevel.String.md)): [Campaign](dw.campaign.Campaign.md) + - : Returns the campaign identified by the specified ID. + + **Parameters:** + - id - Campaign ID + + **Returns:** + - Campaign or null if not found + + +--- + +### getCampaigns() +- static getCampaigns(): [Collection](dw.util.Collection.md) + - : Returns all campaigns of the current site in no specific order. + + **Returns:** + - All campaigns of current site + + +--- + +### getDiscounts(LineItemCtnr) +- static getDiscounts(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md)): [DiscountPlan](dw.campaign.DiscountPlan.md) + - : Returns the discounts applicable for the current customer, active + source code and specified line item container. + + + This method identifies all active promotions assigned to the customer + groups of the current customer, the active source code and any coupon + contained in the specified line item container, and calculates applicable + discounts from these promotions. + + + The applicable discounts are contained in the returned instance of + [DiscountPlan](dw.campaign.DiscountPlan.md). + + + **Parameters:** + - lineItemCtnr - Line item container + + **Returns:** + - Discount plan with applicable discounts + + +--- + +### getDiscounts(LineItemCtnr, PromotionPlan) +- static getDiscounts(lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md), promotionPlan: [PromotionPlan](dw.campaign.PromotionPlan.md)): [DiscountPlan](dw.campaign.DiscountPlan.md) + - : Returns the discounts applicable for the current customer, active + source code and specified line item container, based on the specified + promotion plan. + + + This method calculates applicable discounts from the promotions in the + specified promotion plan. Note that any promotion in the promotion + plan that is inactive, or not applicable for the current customer + or source code, is being ignored. + + + The applicable discounts are contained in the returned instance of + [DiscountPlan](dw.campaign.DiscountPlan.md). + + + **Parameters:** + - lineItemCtnr - Line item container + - promotionPlan - Promotion plan with active promotions + + **Returns:** + - Discount plan with applicable discounts + + +--- + +### getPromotion(String) +- static getPromotion(id: [String](TopLevel.String.md)): [Promotion](dw.campaign.Promotion.md) + - : Returns the promotion identified by the specified ID. The same logical + promotion may be assigned to multiple campaigns or AB-tests. In this + case, the system returns the instance of highest rank. Some attributes of + the returned Promotion may vary based on exactly which instance is + returned. This method returns null if there is no promotion in the system + with the given ID, or if a promotion with the given ID exists but it is + not assigned to any campaign or AB-test. + + + **Parameters:** + - id - Promotion ID + + **Returns:** + - Promotion or null if not found + + +--- + +### getPromotions() +- static getPromotions(): [Collection](dw.util.Collection.md) + - : Returns all promotions of the current site in no specific order. + + **Returns:** + - All promotions of current site + + +--- + +### getUpcomingCustomerPromotions(Number) +- static getUpcomingCustomerPromotions(previewTime: [Number](TopLevel.Number.md)): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions currently inactive, but scheduled + for any time between _now_ and _now + previewTime(hours)_, + and which are applicable based on the current customer, source code, and + coupons in the current basket. + + The parameter _previewTime_ specifies for how many hours promotions + should be previewed. + + + **Parameters:** + - previewTime - Preview time in hours + + **Returns:** + - PromotionPlan with active promotions + + **See Also:** + - [getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) + + +--- + +### getUpcomingPromotions(Number) +- static getUpcomingPromotions(previewTime: [Number](TopLevel.Number.md)): [PromotionPlan](dw.campaign.PromotionPlan.md) + - : Returns all promotions currently inactive, but scheduled + for any time between _now_ and _now + previewTime(hours)_. + + The upcoming promotions are returned in an instance of + [PromotionPlan](dw.campaign.PromotionPlan.md) and might not necessarily be applicable for + the current customer or source code. + + The parameter _previewTime_ specifies for how many hours promotions + should be previewed. + + + **Parameters:** + - previewTime - Preview time in hours + + **Returns:** + - PromotionPlan with active promotions + + **See Also:** + - [getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionPlan.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionPlan.md new file mode 100644 index 00000000..b53aaff7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.PromotionPlan.md @@ -0,0 +1,378 @@ + +# Class PromotionPlan + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.PromotionPlan](dw.campaign.PromotionPlan.md) + +PromotionPlan represents a set of [Promotion](dw.campaign.Promotion.md) instances and +is used to display active or upcoming promotions on storefront pages, or to +pass it to the [PromotionMgr](dw.campaign.PromotionMgr.md) to calculate a +[DiscountPlan](dw.campaign.DiscountPlan.md) and subsequently apply discounts to a line +item container. Instances of the class are returned by the +[PromotionMgr.getActivePromotions()](dw.campaign.PromotionMgr.md#getactivepromotions), +[PromotionMgr.getActiveCustomerPromotions()](dw.campaign.PromotionMgr.md#getactivecustomerpromotions) and +[PromotionMgr.getUpcomingPromotions(Number)](dw.campaign.PromotionMgr.md#getupcomingpromotionsnumber). + + +PromotionPlan provides methods to access the promotions in the plan and to +remove promotions from the plan. All methods which return a collection of +promotions sort them by the following ordered criteria: + + + + +1. Exclusivity: GLOBAL exclusive promotions first, followed by CLASS exclusive promotions, and NO exclusive promotions last. +2. Rank: sorted ascending +3. Promotion Class: PRODUCT promotions first, followed by ORDER promotions, and SHIPPING promotions last. +4. Discount type: Fixed price promotions first, followed by free, amount-off, percentage-off, and bonus product promotions last. +5. Best discount: Sorted descending. For example, 30% off comes before 20% off. +6. ID: alphanumeric ascending. + + +**See Also:** +- [PromotionMgr](dw.campaign.PromotionMgr.md) + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [SORT_BY_EXCLUSIVITY](#sort_by_exclusivity): [Number](TopLevel.Number.md) = 1 | Constant indicating that a collection of promotions should be sorted first by exclusivity, then rank, promotion class, etc. | +| [SORT_BY_START_DATE](#sort_by_start_date): [Number](TopLevel.Number.md) = 2 | Constant indicating that a collection of promotions should be sorted by start date ascending. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [orderPromotions](#orderpromotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all order promotions contained in this plan. | +| [productPromotions](#productpromotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product promotions contained in this plan. | +| [promotions](#promotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all promotions contained in this plan sorted by exclusivity. | +| [shippingPromotions](#shippingpromotions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all shipping promotions contained in this plan. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getOrderPromotions](dw.campaign.PromotionPlan.md#getorderpromotions)() | Returns all order promotions contained in this plan. | +| [getPaymentCardPromotions](dw.campaign.PromotionPlan.md#getpaymentcardpromotionspaymentcard)([PaymentCard](dw.order.PaymentCard.md)) | Returns the order promotions explicitly associated to the specified discounted payment card. | +| [getPaymentMethodPromotions](dw.campaign.PromotionPlan.md#getpaymentmethodpromotionspaymentmethod)([PaymentMethod](dw.order.PaymentMethod.md)) | Returns the order promotions explicitly associated to the specified discounted payment method. | +| [getProductPromotions](dw.campaign.PromotionPlan.md#getproductpromotions)() | Returns all product promotions contained in this plan. | +| [getProductPromotions](dw.campaign.PromotionPlan.md#getproductpromotionsproduct)([Product](dw.catalog.Product.md)) | Returns the promotions related to the specified product. | +| [getProductPromotionsForDiscountedProduct](dw.campaign.PromotionPlan.md#getproductpromotionsfordiscountedproductproduct)([Product](dw.catalog.Product.md)) | Returns the product promotions for which the specified product is a discounted (and possibly also a qualifying) product. | +| [getProductPromotionsForQualifyingProduct](dw.campaign.PromotionPlan.md#getproductpromotionsforqualifyingproductproduct)([Product](dw.catalog.Product.md)) | Returns the product promotions for which the specified product is a qualifying but NOT a discounted product. | +| [getPromotions](dw.campaign.PromotionPlan.md#getpromotions)() | Returns all promotions contained in this plan sorted by exclusivity. | +| ~~[getPromotions](dw.campaign.PromotionPlan.md#getpromotionsproduct)([Product](dw.catalog.Product.md))~~ | Returns the promotions related to the specified product. | +| [getPromotions](dw.campaign.PromotionPlan.md#getpromotionsnumber)([Number](TopLevel.Number.md)) | Returns all promotions contained in this plan sorted according to the specified sort order. | +| [getShippingPromotions](dw.campaign.PromotionPlan.md#getshippingpromotions)() | Returns all shipping promotions contained in this plan. | +| [getShippingPromotions](dw.campaign.PromotionPlan.md#getshippingpromotionsshippingmethod)([ShippingMethod](dw.order.ShippingMethod.md)) | Returns the shipping promotions related to the specified discounted shipping method, i.e. | +| [removePromotion](dw.campaign.PromotionPlan.md#removepromotionpromotion)([Promotion](dw.campaign.Promotion.md)) | Remove promotion from promotion plan. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### SORT_BY_EXCLUSIVITY + +- SORT_BY_EXCLUSIVITY: [Number](TopLevel.Number.md) = 1 + - : Constant indicating that a collection of promotions should be sorted + first by exclusivity, then rank, promotion class, etc. See class-level + javadoc for details. This is the default sort order for methods that + return a collection of promotions. + + + +--- + +### SORT_BY_START_DATE + +- SORT_BY_START_DATE: [Number](TopLevel.Number.md) = 2 + - : Constant indicating that a collection of promotions should be sorted by + start date ascending. If there is no explicit start date for a promotion + the start date of its containing Campaign or AB-test is used instead. + Promotions without a start date are sorted before promotions with a start + date in the future and after promotions with a start date in the past. In + case two promotion assignments have the same start date, they are sorted + by their ID. + + + +--- + +## Property Details + +### orderPromotions +- orderPromotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all order promotions contained in this plan. + + +--- + +### productPromotions +- productPromotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product promotions contained in this plan. + + +--- + +### promotions +- promotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all promotions contained in this plan sorted by exclusivity. + + +--- + +### shippingPromotions +- shippingPromotions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all shipping promotions contained in this plan. + + +--- + +## Method Details + +### getOrderPromotions() +- getOrderPromotions(): [Collection](dw.util.Collection.md) + - : Returns all order promotions contained in this plan. + + **Returns:** + - The sorted collection of order promotions contained in the promotion plan. + + +--- + +### getPaymentCardPromotions(PaymentCard) +- getPaymentCardPromotions(paymentCard: [PaymentCard](dw.order.PaymentCard.md)): [Collection](dw.util.Collection.md) + - : Returns the order promotions explicitly associated to the specified + discounted payment card. + + + This method is usually used to display order promotions along with + payment card choices. + + + **Parameters:** + - paymentCard - Discounted payment card + + **Returns:** + - The sorted collection of order promotions associated with the + specified payment card. + + + +--- + +### getPaymentMethodPromotions(PaymentMethod) +- getPaymentMethodPromotions(paymentMethod: [PaymentMethod](dw.order.PaymentMethod.md)): [Collection](dw.util.Collection.md) + - : Returns the order promotions explicitly associated to the specified + discounted payment method. + + + This method is usually used to display order promotions along with + payment method choices. + + + **Parameters:** + - paymentMethod - Discounted payment method + + **Returns:** + - The sorted collection of order promotions associated with the + specified payment method. + + + +--- + +### getProductPromotions() +- getProductPromotions(): [Collection](dw.util.Collection.md) + - : Returns all product promotions contained in this plan. + + **Returns:** + - The sorted collection of product promotions contained in the promotion plan. + + +--- + +### getProductPromotions(Product) +- getProductPromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md) + - : Returns the promotions related to the specified product. + + The method returns all promotions where the product is either a + qualifying product, or a discounted product, or both. It also returns + promotions where the specified product is a bonus product. + + + This method is usually used to display product promotions on a product + details page. + + + If a master product is passed, then this method will return promotions + which are relevant for the master itself or at least one of its variants. + + + **Parameters:** + - product - Product associated with promotion + + **Returns:** + - The sorted collection of promotions related to specified + discounted product. + + + +--- + +### getProductPromotionsForDiscountedProduct(Product) +- getProductPromotionsForDiscountedProduct(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md) + - : Returns the product promotions for which the specified product is a + discounted (and possibly also a qualifying) product. It also returns + promotions where the specified product is a bonus product. + + + This method is usually used to display product promotions on a product + details page when separate callout messages are defined depending on if + the product is a qualifying or discounted product for the promotion. + + + If a master product is passed, then this method will return promotions + for which the master product itself or at least one of its product's + variants is a discounted product. + + + **Parameters:** + - product - The discounted product. + + **Returns:** + - Product promotions related to the specified discounted product. + + +--- + +### getProductPromotionsForQualifyingProduct(Product) +- getProductPromotionsForQualifyingProduct(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md) + - : Returns the product promotions for which the specified product is a + qualifying but NOT a discounted product. + + + This method is usually used to display product promotions on a product + details page when separate callout messages are defined depending on if + the product is a qualifying or discounted product for the promotion. + + + If a master product is passed, then this method will return promotions + for which the master product itself or at least one of its product's + variants is a qualifying product. + + + **Parameters:** + - product - The qualifying product. + + **Returns:** + - Product promotions related to the specified qualifying product. + + +--- + +### getPromotions() +- getPromotions(): [Collection](dw.util.Collection.md) + - : Returns all promotions contained in this plan sorted by exclusivity. + + **Returns:** + - The sorted collection of promotions contained in the promotion plan. + + +--- + +### getPromotions(Product) +- ~~getPromotions(product: [Product](dw.catalog.Product.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the promotions related to the specified product. + + The method returns all promotions where the product is either + a qualifying product, or a discounted product, or both. It also + returns promotions where the specified product is a bonus product. + + + This method is usually used to display product promotions on a + product details page. + + + **Parameters:** + - product - Product associated with promotion + + **Returns:** + - The sorted collection of promotions related to the specified discounted product. + + **Deprecated:** +:::warning +Use [getProductPromotions(Product)](dw.campaign.PromotionPlan.md#getproductpromotionsproduct) +::: + +--- + +### getPromotions(Number) +- getPromotions(sortOrder: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all promotions contained in this plan sorted according to the + specified sort order. If the passed sort order is invalid, then the + returned promotions will be sorted by exclusivity. + + + **Parameters:** + - sortOrder - the sort order to use. Must be SORT\_BY\_EXCLUSIVITY or SORT\_BY\_START\_DATE. If an invalid value is passed, SORT\_BY\_EXCLUSIVITY is used. + + **Returns:** + - The sorted collection of promotions contained in the promotion + plan. + + + +--- + +### getShippingPromotions() +- getShippingPromotions(): [Collection](dw.util.Collection.md) + - : Returns all shipping promotions contained in this plan. + + **Returns:** + - The sorted collection of shipping promotions contained in promotion plan. + + +--- + +### getShippingPromotions(ShippingMethod) +- getShippingPromotions(shippingMethod: [ShippingMethod](dw.order.ShippingMethod.md)): [Collection](dw.util.Collection.md) + - : Returns the shipping promotions related to the specified discounted + shipping method, i.e. the returned promotions apply a discount on + the specified shipping method. + + + This method is usually used to display shipping promotions along with + shipping methods. + + + **Parameters:** + - shippingMethod - Discounted shipping method + + **Returns:** + - The sorted collection of shipping promotions with specified method as discounted method. + + +--- + +### removePromotion(Promotion) +- removePromotion(promotion: [Promotion](dw.campaign.Promotion.md)): void + - : Remove promotion from promotion plan. + + Please note that this is the only way to remove promotions from the + plan, i.e. removing promotions from the collections returned + by methods such as [getProductPromotions()](dw.campaign.PromotionPlan.md#getproductpromotions) has no effect + on the promotion plan. + + + **Parameters:** + - promotion - Promotion to remove from promotion plan + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SlotContent.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SlotContent.md new file mode 100644 index 00000000..e0981566 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SlotContent.md @@ -0,0 +1,131 @@ + +# Class SlotContent + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.SlotContent](dw.campaign.SlotContent.md) + +Represents content for a slot. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [calloutMsg](#calloutmsg): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the callout message for the slot. | +| [content](#content): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of content based on the content type for the slot. | +| [custom](#custom): [Map](dw.util.Map.md) `(read-only)` | Returns the custom attributes for the slot. | +| [recommenderName](#recommendername): [String](TopLevel.String.md) `(read-only)` | Returns the recommender name for slot configurations of type 'Recommendation' | +| [slotID](#slotid): [String](TopLevel.String.md) `(read-only)` | Returns the unique slot ID. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCalloutMsg](dw.campaign.SlotContent.md#getcalloutmsg)() | Returns the callout message for the slot. | +| [getContent](dw.campaign.SlotContent.md#getcontent)() | Returns a collection of content based on the content type for the slot. | +| [getCustom](dw.campaign.SlotContent.md#getcustom)() | Returns the custom attributes for the slot. | +| [getRecommenderName](dw.campaign.SlotContent.md#getrecommendername)() | Returns the recommender name for slot configurations of type 'Recommendation' | +| [getSlotID](dw.campaign.SlotContent.md#getslotid)() | Returns the unique slot ID. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### calloutMsg +- calloutMsg: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the callout message for the slot. + + +--- + +### content +- content: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of content based on the content type + for the slot. The collection will include one of the following + types: [Product](dw.catalog.Product.md), [Content](dw.content.Content.md), [Category](dw.catalog.Category.md), or [MarkupText](dw.content.MarkupText.md). + + + +--- + +### custom +- custom: [Map](dw.util.Map.md) `(read-only)` + - : Returns the custom attributes for the slot. + + +--- + +### recommenderName +- recommenderName: [String](TopLevel.String.md) `(read-only)` + - : Returns the recommender name for slot configurations of type 'Recommendation' + + +--- + +### slotID +- slotID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique slot ID. + + +--- + +## Method Details + +### getCalloutMsg() +- getCalloutMsg(): [MarkupText](dw.content.MarkupText.md) + - : Returns the callout message for the slot. + + **Returns:** + - Callout message of the slot. + + +--- + +### getContent() +- getContent(): [Collection](dw.util.Collection.md) + - : Returns a collection of content based on the content type + for the slot. The collection will include one of the following + types: [Product](dw.catalog.Product.md), [Content](dw.content.Content.md), [Category](dw.catalog.Category.md), or [MarkupText](dw.content.MarkupText.md). + + + **Returns:** + - All content of the slot. + + +--- + +### getCustom() +- getCustom(): [Map](dw.util.Map.md) + - : Returns the custom attributes for the slot. + + **Returns:** + - Custom attributes of the slot. + + +--- + +### getRecommenderName() +- getRecommenderName(): [String](TopLevel.String.md) + - : Returns the recommender name for slot configurations of type 'Recommendation' + + **Returns:** + - the recommender name for slot configurations of type 'Recommendation' + + +--- + +### getSlotID() +- getSlotID(): [String](TopLevel.String.md) + - : Returns the unique slot ID. + + **Returns:** + - ID of the slot. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeGroup.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeGroup.md new file mode 100644 index 00000000..1d7c1684 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeGroup.md @@ -0,0 +1,83 @@ + +# Class SourceCodeGroup + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.campaign.SourceCodeGroup](dw.campaign.SourceCodeGroup.md) + +A source code group defines a collection of source codes. Source code groups +are generally pattern based and any source code satisfying the pattern +belongs to the group. In this way, merchants may define a large set of source +codes which qualify a customer for site experiences (different prices, for +example), which customers without that source code do not receive. +The class [SourceCodeInfo](dw.campaign.SourceCodeInfo.md) represents an individual source +code. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | The ID of the SourceCodeGroup. | +| [priceBooks](#pricebooks): [Collection](dw.util.Collection.md) `(read-only)` | Returns a Collection of PriceBooks the SourceCodeGroup is assigned to. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.campaign.SourceCodeGroup.md#getid)() | The ID of the SourceCodeGroup. | +| [getPriceBooks](dw.campaign.SourceCodeGroup.md#getpricebooks)() | Returns a Collection of PriceBooks the SourceCodeGroup is assigned to. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : The ID of the SourceCodeGroup. + + +--- + +### priceBooks +- priceBooks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a Collection of PriceBooks the SourceCodeGroup is assigned to. + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : The ID of the SourceCodeGroup. + + **Returns:** + - the ID. + + +--- + +### getPriceBooks() +- getPriceBooks(): [Collection](dw.util.Collection.md) + - : Returns a Collection of PriceBooks the SourceCodeGroup is assigned to. + + **Returns:** + - Collection of PriceBooks the SourceCodeGroup is assigned to. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeInfo.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeInfo.md new file mode 100644 index 00000000..058f5074 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeInfo.md @@ -0,0 +1,167 @@ + +# Class SourceCodeInfo + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.SourceCodeInfo](dw.campaign.SourceCodeInfo.md) + +Class representing a code (i.e. a "source code") that has been applied to a +customer's session. Source codes can qualify customers for different +campaigns, promotions, and other site experiences from those that the typical +customer sees. Codes are organized into source code groups. + + +Typically, a code is applied to a customer's session automatically by +Commerce Cloud Digital when a customer accesses a Digital URL with a well +known request parameter in the querystring. A code may also be explicitly +applied to a customer session using the `SetSourceCode` +pipelet. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [STATUS_ACTIVE](#status_active): [Number](TopLevel.Number.md) = 2 | The literal source-code is found and currently active. | +| [STATUS_INACTIVE](#status_inactive): [Number](TopLevel.Number.md) = 1 | The literal source-code is found but not active. | +| [STATUS_INVALID](#status_invalid): [Number](TopLevel.Number.md) = 0 | The literal source-code is not found in the system. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [code](#code): [String](TopLevel.String.md) `(read-only)` | The literal source-code. | +| [group](#group): [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) `(read-only)` | The associated source-code group. | +| [redirect](#redirect): [URLRedirect](dw.web.URLRedirect.md) `(read-only)` | Retrieves the redirect information from the last processed SourceCodeGroup (active or inactive). | +| [status](#status): [Number](TopLevel.Number.md) `(read-only)` | The status of the source-code. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCode](dw.campaign.SourceCodeInfo.md#getcode)() | The literal source-code. | +| [getGroup](dw.campaign.SourceCodeInfo.md#getgroup)() | The associated source-code group. | +| [getRedirect](dw.campaign.SourceCodeInfo.md#getredirect)() | Retrieves the redirect information from the last processed SourceCodeGroup (active or inactive). | +| [getStatus](dw.campaign.SourceCodeInfo.md#getstatus)() | The status of the source-code. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### STATUS_ACTIVE + +- STATUS_ACTIVE: [Number](TopLevel.Number.md) = 2 + - : The literal source-code is found and currently active. + + +--- + +### STATUS_INACTIVE + +- STATUS_INACTIVE: [Number](TopLevel.Number.md) = 1 + - : The literal source-code is found but not active. + + +--- + +### STATUS_INVALID + +- STATUS_INVALID: [Number](TopLevel.Number.md) = 0 + - : The literal source-code is not found in the system. + + +--- + +## Property Details + +### code +- code: [String](TopLevel.String.md) `(read-only)` + - : The literal source-code. + + +--- + +### group +- group: [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) `(read-only)` + - : The associated source-code group. + + +--- + +### redirect +- redirect: [URLRedirect](dw.web.URLRedirect.md) `(read-only)` + - : Retrieves the redirect information from the last processed SourceCodeGroup (active or inactive). If none exists, + then the redirect information is retrieved from the source-code preferences, based on the active/inactive status + of the SourceCodeGroup. The redirect information is then resolved to the output URL. If the redirect information + cannot be resolved to a URL, or there is an error retrieving the preferences, then null is returned. + + + +--- + +### status +- status: [Number](TopLevel.Number.md) `(read-only)` + - : The status of the source-code. One of the following: + STATUS\_INVALID - The source code is not found in the system. + STATUS\_INACTIVE - The source code is found but not active. + STATUS\_INACTIVE - The source code is found and active. + + + +--- + +## Method Details + +### getCode() +- getCode(): [String](TopLevel.String.md) + - : The literal source-code. + + **Returns:** + - the source-code. + + +--- + +### getGroup() +- getGroup(): [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) + - : The associated source-code group. + + **Returns:** + - the source-code group. + + +--- + +### getRedirect() +- getRedirect(): [URLRedirect](dw.web.URLRedirect.md) + - : Retrieves the redirect information from the last processed SourceCodeGroup (active or inactive). If none exists, + then the redirect information is retrieved from the source-code preferences, based on the active/inactive status + of the SourceCodeGroup. The redirect information is then resolved to the output URL. If the redirect information + cannot be resolved to a URL, or there is an error retrieving the preferences, then null is returned. + + + **Returns:** + - URLRedirect containing the location and status code, null in case of no redirect was found + + +--- + +### getStatus() +- getStatus(): [Number](TopLevel.Number.md) + - : The status of the source-code. One of the following: + STATUS\_INVALID - The source code is not found in the system. + STATUS\_INACTIVE - The source code is found but not active. + STATUS\_INACTIVE - The source code is found and active. + + + **Returns:** + - the status. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeStatusCodes.md new file mode 100644 index 00000000..d0621132 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.SourceCodeStatusCodes.md @@ -0,0 +1,61 @@ + +# Class SourceCodeStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.SourceCodeStatusCodes](dw.campaign.SourceCodeStatusCodes.md) + +Helper class which contains error result codes returned by the SetSourceCode +pipelet. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CODE_INACTIVE](#code_inactive): [String](TopLevel.String.md) = "CODE_INACTIVE" | Indicates that the specified source code was found in one or more source-code groups, none of which are active. | +| [CODE_INVALID](#code_invalid): [String](TopLevel.String.md) = "CODE_INVALID" | Indicates that the specified source code is not contained in any source-code group. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SourceCodeStatusCodes](#sourcecodestatuscodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CODE_INACTIVE + +- CODE_INACTIVE: [String](TopLevel.String.md) = "CODE_INACTIVE" + - : Indicates that the specified source code was found in one or more + source-code groups, none of which are active. + + + +--- + +### CODE_INVALID + +- CODE_INVALID: [String](TopLevel.String.md) = "CODE_INVALID" + - : Indicates that the specified source code is not contained + in any source-code group. + + + +--- + +## Constructor Details + +### SourceCodeStatusCodes() +- SourceCodeStatusCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.TotalFixedPriceDiscount.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.TotalFixedPriceDiscount.md new file mode 100644 index 00000000..b527dffd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.TotalFixedPriceDiscount.md @@ -0,0 +1,56 @@ + +# Class TotalFixedPriceDiscount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.campaign.Discount](dw.campaign.Discount.md) + - [dw.campaign.TotalFixedPriceDiscount](dw.campaign.TotalFixedPriceDiscount.md) + +Represents a _total fix price_ discount on a group of products in the +discount plan. For example: "buy 3 products of type X for a total price +of $29.99". + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [totalFixedPrice](#totalfixedprice): [Number](TopLevel.Number.md) `(read-only)` | Returns the total fixed price amount. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getTotalFixedPrice](dw.campaign.TotalFixedPriceDiscount.md#gettotalfixedprice)() | Returns the total fixed price amount. | + +### Methods inherited from class Discount + +[getItemPromotionTiers](dw.campaign.Discount.md#getitempromotiontiers), [getPromotion](dw.campaign.Discount.md#getpromotion), [getPromotionTier](dw.campaign.Discount.md#getpromotiontier), [getQuantity](dw.campaign.Discount.md#getquantity), [getType](dw.campaign.Discount.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### totalFixedPrice +- totalFixedPrice: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the total fixed price amount. + + +--- + +## Method Details + +### getTotalFixedPrice() +- getTotalFixedPrice(): [Number](TopLevel.Number.md) + - : Returns the total fixed price amount. + + **Returns:** + - Total fixed price amount + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.campaign.md b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.md new file mode 100644 index 00000000..6019fc49 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.campaign.md @@ -0,0 +1,36 @@ +# Package dw.campaign + +## Classes +| Class | Description | +| --- | --- | +| [ABTest](dw.campaign.ABTest.md) | Object representing an AB-test in Commerce Cloud Digital. | +| [ABTestMgr](dw.campaign.ABTestMgr.md) | Manager class used to access AB-test information in the storefront. | +| [ABTestSegment](dw.campaign.ABTestSegment.md) | Object representing an AB-test segment in the Commerce Cloud Digital. | +| [AmountDiscount](dw.campaign.AmountDiscount.md) | Represents an _amount-off_ discount in the discount plan, for example "$10 off all orders $100 or more". | +| [ApproachingDiscount](dw.campaign.ApproachingDiscount.md) | Transient class representing a discount that a [LineItemCtnr](dw.order.LineItemCtnr.md) "almost" qualifies for based on the amount of merchandise in it. | +| [BonusChoiceDiscount](dw.campaign.BonusChoiceDiscount.md) | Represents a _choice of bonus products_ discount in the discount plan, for example "Choose 3 DVDs from a list of 20 options with your purchase of any DVD player." | +| [BonusDiscount](dw.campaign.BonusDiscount.md) | Represents a _bonus_ discount in the discount plan, for example "Get a free DVD with your purchase of any DVD player." | +| [Campaign](dw.campaign.Campaign.md) | A Campaign is a set of experiences (or site configurations) which may be deployed as a single unit for a given time frame. | +| [CampaignMgr](dw.campaign.CampaignMgr.md) | CampaignMgr provides static methods for managing campaign-specific operations such as accessing promotions or updating promotion line items. | +| [CampaignStatusCodes](dw.campaign.CampaignStatusCodes.md) | Deprecated. | +| [Coupon](dw.campaign.Coupon.md) | Represents a coupon in Commerce Cloud Digital. | +| [CouponMgr](dw.campaign.CouponMgr.md) | Manager to access coupons. | +| [CouponRedemption](dw.campaign.CouponRedemption.md) | Represents a redeemed coupon. | +| [CouponStatusCodes](dw.campaign.CouponStatusCodes.md) | Helper class containing status codes for why a coupon code cannot be added to cart or why a coupon code already in cart is not longer valid for redemption. | +| [Discount](dw.campaign.Discount.md) | Superclass of all specific discount classes. | +| [DiscountPlan](dw.campaign.DiscountPlan.md) | DiscountPlan represents a set of [Discount](dw.campaign.Discount.md)s. | +| [FixedPriceDiscount](dw.campaign.FixedPriceDiscount.md) | Represents a _fix price_ discount in the discount plan, for example "Shipping only 0.99 all orders $25 or more." | +| [FixedPriceShippingDiscount](dw.campaign.FixedPriceShippingDiscount.md) | Represents a _fixed price shipping_ discount in the discount plan, for example "Shipping only 0.99 for iPods." | +| [FreeDiscount](dw.campaign.FreeDiscount.md) | Represents a _free_ discount in the discount plan, for example "Free shipping on all orders $25 or more." | +| [FreeShippingDiscount](dw.campaign.FreeShippingDiscount.md) | Represents a _free shipping_ discount in the discount plan, for example "Free shipping on all iPods." | +| [PercentageDiscount](dw.campaign.PercentageDiscount.md) | Represents a _percentage-off_ discount in the discount plan, for example "10% off all T-Shirts". | +| [PercentageOptionDiscount](dw.campaign.PercentageOptionDiscount.md) | Represents a _percentage-off options_ discount in the discount plan, for example "50% off monogramming on shirts". | +| [PriceBookPriceDiscount](dw.campaign.PriceBookPriceDiscount.md) | Discount representing that a product's price has been calculated from a separate sales price book other than the standard price book assigned to the site. | +| [Promotion](dw.campaign.Promotion.md) | This class represents a promotion in Commerce Cloud Digital. | +| [PromotionMgr](dw.campaign.PromotionMgr.md) | [PromotionMgr](dw.campaign.PromotionMgr.md) is used to access campaigns and promotion definitions, display active or upcoming promotions in a storefront, and to calculate and apply promotional discounts to line item containers. | +| [PromotionPlan](dw.campaign.PromotionPlan.md) | PromotionPlan represents a set of [Promotion](dw.campaign.Promotion.md) instances and is used to display active or upcoming promotions on storefront pages, or to pass it to the [PromotionMgr](dw.campaign.PromotionMgr.md) to calculate a [DiscountPlan](dw.campaign.DiscountPlan.md) and subsequently apply discounts to a line item container. | +| [SlotContent](dw.campaign.SlotContent.md) | Represents content for a slot. | +| [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) | A source code group defines a collection of source codes. | +| [SourceCodeInfo](dw.campaign.SourceCodeInfo.md) | Class representing a code (i.e. | +| [SourceCodeStatusCodes](dw.campaign.SourceCodeStatusCodes.md) | Helper class which contains error result codes returned by the SetSourceCode pipelet. | +| [TotalFixedPriceDiscount](dw.campaign.TotalFixedPriceDiscount.md) | Represents a _total fix price_ discount on a group of products in the discount plan. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Catalog.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Catalog.md new file mode 100644 index 00000000..df96207d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Catalog.md @@ -0,0 +1,158 @@ + +# Class Catalog + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Catalog](dw.catalog.Catalog.md) + +Represents a Commerce Cloud Digital Catalog. Catalogs are containers of products +and other product-related information and can be shared between sites. Every +product in the system is contained in (or "owned by") exactly one catalog. +Every site has a single "site catalog" which defines the products that are +available to purchase on that site. The static method +[CatalogMgr.getSiteCatalog()](dw.catalog.CatalogMgr.md#getsitecatalog) returns the site catalog for +the current site. + + +Catalogs are organized into a tree of categories with a single top-level root +category. Products are assigned to categories within catalogs. They can be +assigned to categories in their owning catalog, or other catalogs. They can +be assigned to multiple categories within the same catalog. Products that are +not assigned to any categories are considered "uncategorized." A product has +a single "classification category" in some catalog, and one +"primary category" per catalog. The classification category defines the +attribute set of the product. The primary category is used as standard +presentation context within that catalog in the storefront. + + +While Commerce Cloud Digital does not currently distinguish different +catalog types, it is common practice to have two general types of catalog: + + +- "Product catalogs" typically contain detailed product information and are frequently generated from some backend PIM system. +- "Site Catalogs" define the category structure of the storefront and contain primarily the assignments of these categories to the products defined in the product catalogs. The site catalog is assigned to the site. + + + +In addition to products and categories, catalogs contain recommendations, +shared variation attributes which can be used by multiple master products, +and shared product options which can be used by multiple option products. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the value of attribute 'id'. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the value of the localized extensible object attribute "shortDescription" for the current locale. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the value of the localized extensible object attribute "displayName" for the current locale. | +| [root](#root): [Category](dw.catalog.Category.md) `(read-only)` | Returns the object for the relation 'root'. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDescription](dw.catalog.Catalog.md#getdescription)() | Returns the value of the localized extensible object attribute "shortDescription" for the current locale. | +| [getDisplayName](dw.catalog.Catalog.md#getdisplayname)() | Returns the value of the localized extensible object attribute "displayName" for the current locale. | +| [getID](dw.catalog.Catalog.md#getid)() | Returns the value of attribute 'id'. | +| [getRoot](dw.catalog.Catalog.md#getroot)() | Returns the object for the relation 'root'. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the value of attribute 'id'. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the value of the localized extensible object attribute + "shortDescription" for the current locale. + + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the value of the localized extensible object attribute + "displayName" for the current locale. + + + +--- + +### root +- root: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the object for the relation 'root'. + + +--- + +## Method Details + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the value of the localized extensible object attribute + "shortDescription" for the current locale. + + + **Returns:** + - The value of the attribute for the current locale, + or null if it wasn't found. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the value of the localized extensible object attribute + "displayName" for the current locale. + + + **Returns:** + - The value of the attribute for the current locale, + or null if it wasn't found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the value of attribute 'id'. + + **Returns:** + - the value of the attribute 'id' + + +--- + +### getRoot() +- getRoot(): [Category](dw.catalog.Category.md) + - : Returns the object for the relation 'root'. + + **Returns:** + - the object for the relation 'root'. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CatalogMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CatalogMgr.md new file mode 100644 index 00000000..e588333d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CatalogMgr.md @@ -0,0 +1,155 @@ + +# Class CatalogMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.CatalogMgr](dw.catalog.CatalogMgr.md) + +Provides helper methods for getting categories. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [siteCatalog](#sitecatalog): [Catalog](dw.catalog.Catalog.md) `(read-only)` | Returns the catalog of the current site or null if no catalog is assigned to the site. | +| [sortingOptions](#sortingoptions): [List](dw.util.List.md) `(read-only)` | Returns a list containing the sorting options configured for this site. | +| [sortingRules](#sortingrules): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing all of the sorting rules for this site, including global sorting rules. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getCatalog](dw.catalog.CatalogMgr.md#getcatalogstring)([String](TopLevel.String.md)) | Returns the catalog identified by the specified catalog id. | +| static [getCategory](dw.catalog.CatalogMgr.md#getcategorystring)([String](TopLevel.String.md)) | Returns the category of the site catalog identified by the specified category id. | +| static [getSiteCatalog](dw.catalog.CatalogMgr.md#getsitecatalog)() | Returns the catalog of the current site or null if no catalog is assigned to the site. | +| static [getSortingOption](dw.catalog.CatalogMgr.md#getsortingoptionstring)([String](TopLevel.String.md)) | Returns the sorting option with the given ID for this site, or `null` if there is no such option. | +| static [getSortingOptions](dw.catalog.CatalogMgr.md#getsortingoptions)() | Returns a list containing the sorting options configured for this site. | +| static [getSortingRule](dw.catalog.CatalogMgr.md#getsortingrulestring)([String](TopLevel.String.md)) | Returns the sorting rule with the given ID for this site, or `null` if there is no such rule. | +| static [getSortingRules](dw.catalog.CatalogMgr.md#getsortingrules)() | Returns a collection containing all of the sorting rules for this site, including global sorting rules. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### siteCatalog +- siteCatalog: [Catalog](dw.catalog.Catalog.md) `(read-only)` + - : Returns the catalog of the current site or null if no catalog is assigned to the site. + + +--- + +### sortingOptions +- sortingOptions: [List](dw.util.List.md) `(read-only)` + - : Returns a list containing the sorting options configured for this site. + + +--- + +### sortingRules +- sortingRules: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing all of the sorting rules for this site, including global sorting rules. + + +--- + +## Method Details + +### getCatalog(String) +- static getCatalog(id: [String](TopLevel.String.md)): [Catalog](dw.catalog.Catalog.md) + - : Returns the catalog identified by the specified catalog id. + Returns null if no catalog with the specified id exists in the + current organization context. + + + **Parameters:** + - id - Catalog id + + **Returns:** + - the catalog or null. + + +--- + +### getCategory(String) +- static getCategory(id: [String](TopLevel.String.md)): [Category](dw.catalog.Category.md) + - : Returns the category of the site catalog identified by the specified + category id. Returns null if no site catalog is defined, or no category + with the specified id is found in the site catalog. + + + **Parameters:** + - id - the category identifier. + + **Returns:** + - the category of the site catalog identified by the specified + category id or null if no site catalog is found. + + + +--- + +### getSiteCatalog() +- static getSiteCatalog(): [Catalog](dw.catalog.Catalog.md) + - : Returns the catalog of the current site or null if no catalog is assigned to the site. + + **Returns:** + - the catalog of the current site or null. + + +--- + +### getSortingOption(String) +- static getSortingOption(id: [String](TopLevel.String.md)): [SortingOption](dw.catalog.SortingOption.md) + - : Returns the sorting option with the given ID for this site, or + `null` if there is no such option. + + + **Parameters:** + - id - the ID of the sorting option + + **Returns:** + - a SortingOption or null. + + +--- + +### getSortingOptions() +- static getSortingOptions(): [List](dw.util.List.md) + - : Returns a list containing the sorting options configured for this site. + + **Returns:** + - a list of SortingOption objects + + +--- + +### getSortingRule(String) +- static getSortingRule(id: [String](TopLevel.String.md)): [SortingRule](dw.catalog.SortingRule.md) + - : Returns the sorting rule with the given ID for this site, + or `null` if there is no such rule. + + + **Parameters:** + - id - the ID of the sorting rule + + **Returns:** + - a SortingRule or null. + + +--- + +### getSortingRules() +- static getSortingRules(): [Collection](dw.util.Collection.md) + - : Returns a collection containing all of the sorting rules for this site, including global sorting rules. + + **Returns:** + - a collection of SortingRule objects + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Category.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Category.md new file mode 100644 index 00000000..0e7eeb99 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Category.md @@ -0,0 +1,1212 @@ + +# Class Category + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Category](dw.catalog.Category.md) + +Represents a category in a product catalog. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [DISPLAY_MODE_INDIVIDUAL](#display_mode_individual): [Number](TopLevel.Number.md) = 0 | Constant representing the Variation Group Display Mode individual setting. | +| [DISPLAY_MODE_MERGED](#display_mode_merged): [Number](TopLevel.Number.md) = 1 | Constant representing the Variation Group Display Mode merged setting. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the id of the category. | +| [allRecommendations](#allrecommendations): [Collection](dw.util.Collection.md) `(read-only)` | Returns all outgoing recommendations for this category. | +| [categoryAssignments](#categoryassignments): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of category assignments of the category. | +| [defaultSortingRule](#defaultsortingrule): [SortingRule](dw.catalog.SortingRule.md) `(read-only)` | Returns the default sorting rule configured for this category, or `null` if there is no default rule to be applied for it. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of the catalog category for the current locale. | +| [displayMode](#displaymode): [Number](TopLevel.Number.md) | Returns the Variation Groups Display Mode of the category or null if no display mode is defined. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name of the of the catalog category for the current locale. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the image reference of this catalog category. | +| [incomingCategoryLinks](#incomingcategorylinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the target. | +| [online](#online): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the value indicating whether the catalog category is "currently online". | +| [onlineCategoryAssignments](#onlinecategoryassignments): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of category assignments of the category where the referenced product is currently online. | +| [onlineFlag](#onlineflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status flag of the category. | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the date from which the category is online or valid. | +| [onlineIncomingCategoryLinks](#onlineincomingcategorylinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the target. | +| [onlineOutgoingCategoryLinks](#onlineoutgoingcategorylinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the source. | +| [onlineProducts](#onlineproducts): [Collection](dw.util.Collection.md) `(read-only)` | Returns online products assigned to this category. | +| [onlineSubCategories](#onlinesubcategories): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted collection of currently online subcategories of this catalog category. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the date until which the category is online or valid. | +| [orderableRecommendations](#orderablerecommendations): [Collection](dw.util.Collection.md) `(read-only)` | Returns a list of outgoing recommendations for this category. | +| [outgoingCategoryLinks](#outgoingcategorylinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the source. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the page description of this category for the default locale or null if not defined. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the page keywords of this category for the default locale or null if not defined. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the page title of this category for the default locale or null if not defined. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the page URL property of this category or null if not defined. | +| [parent](#parent): [Category](dw.catalog.Category.md) `(read-only)` | Returns the parent of this category. | +| [productAttributeModel](#productattributemodel): [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) `(read-only)` | Returns this category's ProductAttributeModel, which makes access to the category's attribute information convenient. | +| [products](#products): [Collection](dw.util.Collection.md) `(read-only)` | Returns all products assigned to this category. | +| [recommendations](#recommendations): [Collection](dw.util.Collection.md) `(read-only)` | Returns the outgoing recommendations for this category. | +| [root](#root): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the category is the root category of its catalog. | +| [searchPlacement](#searchplacement): [Number](TopLevel.Number.md) | Returns the search placement of the category or null of no search placement is defined. | +| [searchRank](#searchrank): [Number](TopLevel.Number.md) | Returns the search rank of the category or null of no search rank is defined. | +| [siteMapChangeFrequency](#sitemapchangefrequency): [String](TopLevel.String.md) `(read-only)` | Returns the category's sitemap change frequency. | +| [siteMapIncluded](#sitemapincluded): [Number](TopLevel.Number.md) `(read-only)` | Returns the category's sitemap inclusion. | +| [siteMapPriority](#sitemappriority): [Number](TopLevel.Number.md) `(read-only)` | Returns the category's sitemap priority. | +| [subCategories](#subcategories): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted collection of the subcategories of this catalog category, including both online and offline subcategories. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the template property value , which is the file name of the template used to display the catalog category. | +| [thumbnail](#thumbnail): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the thumbnail image reference of this catalog category. | +| [topLevel](#toplevel): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if the category is a top level category, but not the root category. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllRecommendations](dw.catalog.Category.md#getallrecommendations)() | Returns all outgoing recommendations for this category. | +| [getAllRecommendations](dw.catalog.Category.md#getallrecommendationsnumber)([Number](TopLevel.Number.md)) | Returns all outgoing recommendations for this category which are of the specified type. | +| [getCategoryAssignments](dw.catalog.Category.md#getcategoryassignments)() | Returns a collection of category assignments of the category. | +| [getDefaultSortingRule](dw.catalog.Category.md#getdefaultsortingrule)() | Returns the default sorting rule configured for this category, or `null` if there is no default rule to be applied for it. | +| [getDescription](dw.catalog.Category.md#getdescription)() | Returns the description of the catalog category for the current locale. | +| [getDisplayMode](dw.catalog.Category.md#getdisplaymode)() | Returns the Variation Groups Display Mode of the category or null if no display mode is defined. | +| [getDisplayName](dw.catalog.Category.md#getdisplayname)() | Returns the display name of the of the catalog category for the current locale. | +| [getID](dw.catalog.Category.md#getid)() | Returns the id of the category. | +| [getImage](dw.catalog.Category.md#getimage)() | Returns the image reference of this catalog category. | +| [getIncomingCategoryLinks](dw.catalog.Category.md#getincomingcategorylinks)() | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the target. | +| [getIncomingCategoryLinks](dw.catalog.Category.md#getincomingcategorylinksnumber)([Number](TopLevel.Number.md)) | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the target and which are of the specified type. | +| [getOnlineCategoryAssignments](dw.catalog.Category.md#getonlinecategoryassignments)() | Returns a collection of category assignments of the category where the referenced product is currently online. | +| [getOnlineFlag](dw.catalog.Category.md#getonlineflag)() | Returns the online status flag of the category. | +| [getOnlineFrom](dw.catalog.Category.md#getonlinefrom)() | Returns the date from which the category is online or valid. | +| [getOnlineIncomingCategoryLinks](dw.catalog.Category.md#getonlineincomingcategorylinks)() | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the target. | +| [getOnlineOutgoingCategoryLinks](dw.catalog.Category.md#getonlineoutgoingcategorylinks)() | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the source. | +| [getOnlineProducts](dw.catalog.Category.md#getonlineproducts)() | Returns online products assigned to this category. | +| [getOnlineSubCategories](dw.catalog.Category.md#getonlinesubcategories)() | Returns a sorted collection of currently online subcategories of this catalog category. | +| [getOnlineTo](dw.catalog.Category.md#getonlineto)() | Returns the date until which the category is online or valid. | +| [getOrderableRecommendations](dw.catalog.Category.md#getorderablerecommendations)() | Returns a list of outgoing recommendations for this category. | +| [getOrderableRecommendations](dw.catalog.Category.md#getorderablerecommendationsnumber)([Number](TopLevel.Number.md)) | Returns a list of outgoing recommendations for this category. | +| [getOutgoingCategoryLinks](dw.catalog.Category.md#getoutgoingcategorylinks)() | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the source. | +| [getOutgoingCategoryLinks](dw.catalog.Category.md#getoutgoingcategorylinksnumber)([Number](TopLevel.Number.md)) | Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category is the source and which are of the specified type. | +| [getPageDescription](dw.catalog.Category.md#getpagedescription)() | Returns the page description of this category for the default locale or null if not defined. | +| [getPageKeywords](dw.catalog.Category.md#getpagekeywords)() | Returns the page keywords of this category for the default locale or null if not defined. | +| [getPageTitle](dw.catalog.Category.md#getpagetitle)() | Returns the page title of this category for the default locale or null if not defined. | +| [getPageURL](dw.catalog.Category.md#getpageurl)() | Returns the page URL property of this category or null if not defined. | +| [getParent](dw.catalog.Category.md#getparent)() | Returns the parent of this category. | +| [getProductAttributeModel](dw.catalog.Category.md#getproductattributemodel)() | Returns this category's ProductAttributeModel, which makes access to the category's attribute information convenient. | +| [getProducts](dw.catalog.Category.md#getproducts)() | Returns all products assigned to this category. | +| [getRecommendations](dw.catalog.Category.md#getrecommendations)() | Returns the outgoing recommendations for this category. | +| [getRecommendations](dw.catalog.Category.md#getrecommendationsnumber)([Number](TopLevel.Number.md)) | Returns the outgoing recommendations for this category which are of the specified type. | +| [getSearchPlacement](dw.catalog.Category.md#getsearchplacement)() | Returns the search placement of the category or null of no search placement is defined. | +| [getSearchRank](dw.catalog.Category.md#getsearchrank)() | Returns the search rank of the category or null of no search rank is defined. | +| [getSiteMapChangeFrequency](dw.catalog.Category.md#getsitemapchangefrequency)() | Returns the category's sitemap change frequency. | +| [getSiteMapIncluded](dw.catalog.Category.md#getsitemapincluded)() | Returns the category's sitemap inclusion. | +| [getSiteMapPriority](dw.catalog.Category.md#getsitemappriority)() | Returns the category's sitemap priority. | +| [getSubCategories](dw.catalog.Category.md#getsubcategories)() | Returns a sorted collection of the subcategories of this catalog category, including both online and offline subcategories. | +| [getTemplate](dw.catalog.Category.md#gettemplate)() | Returns the template property value , which is the file name of the template used to display the catalog category. | +| [getThumbnail](dw.catalog.Category.md#getthumbnail)() | Returns the thumbnail image reference of this catalog category. | +| [hasOnlineProducts](dw.catalog.Category.md#hasonlineproducts)() | Returns true if this catalog category has any online products assigned. | +| [hasOnlineSubCategories](dw.catalog.Category.md#hasonlinesubcategories)() | Returns true if this catalog category has any online subcategories. | +| [isDirectSubCategoryOf](dw.catalog.Category.md#isdirectsubcategoryofcategory)([Category](dw.catalog.Category.md)) | Returns true if this category is a direct sub-category of the provided category. | +| [isOnline](dw.catalog.Category.md#isonline)() | Returns the value indicating whether the catalog category is "currently online". | +| [isRoot](dw.catalog.Category.md#isroot)() | Identifies if the category is the root category of its catalog. | +| [isSubCategoryOf](dw.catalog.Category.md#issubcategoryofcategory)([Category](dw.catalog.Category.md)) | Returns true if this category is a sub-category of the provided category. | +| [isTopLevel](dw.catalog.Category.md#istoplevel)() | Returns true if the category is a top level category, but not the root category. | +| [setDisplayMode](dw.catalog.Category.md#setdisplaymodenumber)([Number](TopLevel.Number.md)) | Set the category's Variation Groups Display Mode. | +| [setSearchPlacement](dw.catalog.Category.md#setsearchplacementnumber)([Number](TopLevel.Number.md)) | Set the category's search placement. | +| [setSearchRank](dw.catalog.Category.md#setsearchranknumber)([Number](TopLevel.Number.md)) | Set the category's search rank. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DISPLAY_MODE_INDIVIDUAL + +- DISPLAY_MODE_INDIVIDUAL: [Number](TopLevel.Number.md) = 0 + - : Constant representing the Variation Group Display Mode individual setting. + + +--- + +### DISPLAY_MODE_MERGED + +- DISPLAY_MODE_MERGED: [Number](TopLevel.Number.md) = 1 + - : Constant representing the Variation Group Display Mode merged setting. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the id of the category. + + +--- + +### allRecommendations +- allRecommendations: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all outgoing recommendations for this category. The + recommendations are sorted by their explicitly set order. + + + +--- + +### categoryAssignments +- categoryAssignments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of category assignments of the category. + + +--- + +### defaultSortingRule +- defaultSortingRule: [SortingRule](dw.catalog.SortingRule.md) `(read-only)` + - : Returns the default sorting rule configured for this category, + or `null` if there is no default rule to be applied for it. + + This method returns the default rule for the parent category if this + category inherits one. The parent category may inherit its default + rule from its parent, and so on, up to the root category. + + This method returns `null` if no ancestor category for this + category has a default rule. + + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of the catalog category for the current locale. + + +--- + +### displayMode +- displayMode: [Number](TopLevel.Number.md) + - : Returns the Variation Groups Display Mode of the category or null if no display mode is defined. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name of the of the catalog category for the current locale. + + This value is intended to be used as the + external visible name of the catalog category. + + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the image reference of this catalog category. + + +--- + +### incomingCategoryLinks +- incomingCategoryLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the target. If the source category of a link belongs to a different + catalog than the catalog owning this category, it is not returned. + + + +--- + +### online +- online: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the value indicating whether the catalog category is "currently + online". A category is currently online if its online flag equals true + and the current site date is within the date range defined by the + onlineFrom and onlineTo attributes. + + + +--- + +### onlineCategoryAssignments +- onlineCategoryAssignments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of category assignments of the category where the + referenced product is currently online. When checking the online status + of the product, the online flag and the online from & to dates are taken + into account. Online flag, online from & to dates set for the current site + takes precedence over the default values. + + + +--- + +### onlineFlag +- onlineFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status flag of the category. + + +--- + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date from which the category is online or valid. + + +--- + +### onlineIncomingCategoryLinks +- onlineIncomingCategoryLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for + which this category is the target. If the source category of a link + belongs to a different catalog than the catalog owning this category, it + is not returned. Additionally, this method will only return a link if the + source category is currently online. A category is currently online if + its online flag equals true and the current site date is within the date + range defined by the onlineFrom and onlineTo attributes. + + + +--- + +### onlineOutgoingCategoryLinks +- onlineOutgoingCategoryLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for + which this category is the source. If the target category of a link + belongs to a different catalog than the catalog owning this category, it + is not returned. Additionally, this method will only return a link if the + target category is currently online. A category is currently online if + its online flag equals true and the current site date is within the date + range defined by the onlineFrom and onlineTo attributes. + + + +--- + +### onlineProducts +- onlineProducts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns online products assigned to this category. + Offline products are not included in the returned collection. + When checking the online status of the product, + the online flag and the online from & to dates are taken into account. + Online flag, online from & to dates set for the current site takes precedence + over the default values. + + + The order of products in the returned collection corresponds to the + defined explicit sorting of products in this category. + + + **See Also:** + - [hasOnlineProducts()](dw.catalog.Category.md#hasonlineproducts) + + +--- + +### onlineSubCategories +- onlineSubCategories: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted collection of currently online subcategories of this + catalog category. + + - A category is currently online if its online flag equals true and the current site date is within the date range defined by the onlineFrom and onlineTo attributes. + - The returned collection is sorted by position. Subcategories marked as "unsorted" always appear after those marked as "sorted" but are otherwise not in any guaranteed order. + - The returned collection contains direct subcategories only. + + + **See Also:** + - [hasOnlineSubCategories()](dw.catalog.Category.md#hasonlinesubcategories) + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date until which the category is online or valid. + + +--- + +### orderableRecommendations +- orderableRecommendations: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a list of outgoing recommendations for this category. This method + behaves similarly to [getRecommendations()](dw.catalog.Category.md#getrecommendations) but additionally filters out + recommendations for which the target product is unorderable according to + its product availability model. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### outgoingCategoryLinks +- outgoingCategoryLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the source. If the target category of a link belongs to a different + catalog than the catalog owning this category, it is not returned. + The collection of links is sorted by the explicitly defined order + for this category with unsorted links appearing at the end. + + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the page description of this category for the default locale or null if not defined. + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the page keywords of this category for the default locale or null if not defined. + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the page title of this category for the default locale or null if not defined. + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the page URL property of this category or null if not defined. + + +--- + +### parent +- parent: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the parent of this category. + + +--- + +### productAttributeModel +- productAttributeModel: [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) `(read-only)` + - : Returns this category's ProductAttributeModel, which makes access to the + category's attribute information convenient. The model is calculated + based on the attribute definitions assigned to this category and the + global attribute definitions for the object type 'Product'. + + + +--- + +### products +- products: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all products assigned to this category. + The order of products in the returned collection corresponds to the + defined explicit sorting of products in this category. + + + **See Also:** + - [getOnlineProducts()](dw.catalog.Category.md#getonlineproducts) + + +--- + +### recommendations +- recommendations: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the outgoing recommendations for this category. If this category + is not in the site catalog, or there is no site catalog, an empty + collection is returned. Only recommendations for which the target + product exists and is assigned to the site catalog are returned. The + recommendations are sorted by their explicitly set order. + + + +--- + +### root +- root: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the category is the root category of its catalog. + + +--- + +### searchPlacement +- searchPlacement: [Number](TopLevel.Number.md) + - : Returns the search placement of the category or null of no search placement is defined. + + +--- + +### searchRank +- searchRank: [Number](TopLevel.Number.md) + - : Returns the search rank of the category or null of no search rank is defined. + + +--- + +### siteMapChangeFrequency +- siteMapChangeFrequency: [String](TopLevel.String.md) `(read-only)` + - : Returns the category's sitemap change frequency. + + +--- + +### siteMapIncluded +- siteMapIncluded: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the category's sitemap inclusion. + + +--- + +### siteMapPriority +- siteMapPriority: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the category's sitemap priority. + + +--- + +### subCategories +- subCategories: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted collection of the subcategories of this catalog category, + including both online and offline subcategories. + + - The returned collection is sorted by position. Subcategories marked as "unsorted" always appear after those marked as "sorted" but are otherwise not in any guaranteed order. + - The returned collection contains direct subcategories only. + + + **See Also:** + - [getOnlineSubCategories()](dw.catalog.Category.md#getonlinesubcategories) + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the template property value , which is the file name of the template + used to display the catalog category. + + + +--- + +### thumbnail +- thumbnail: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the thumbnail image reference of this catalog category. + + +--- + +### topLevel +- topLevel: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if the category is a top level category, but not the root + category. + + + +--- + +## Method Details + +### getAllRecommendations() +- getAllRecommendations(): [Collection](dw.util.Collection.md) + - : Returns all outgoing recommendations for this category. The + recommendations are sorted by their explicitly set order. + + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getAllRecommendations(Number) +- getAllRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all outgoing recommendations for this category which are of the + specified type. The recommendations are sorted by their explicitly set + order. + + + **Parameters:** + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getCategoryAssignments() +- getCategoryAssignments(): [Collection](dw.util.Collection.md) + - : Returns a collection of category assignments of the category. + + **Returns:** + - Collection of category assignments of the category. + + +--- + +### getDefaultSortingRule() +- getDefaultSortingRule(): [SortingRule](dw.catalog.SortingRule.md) + - : Returns the default sorting rule configured for this category, + or `null` if there is no default rule to be applied for it. + + This method returns the default rule for the parent category if this + category inherits one. The parent category may inherit its default + rule from its parent, and so on, up to the root category. + + This method returns `null` if no ancestor category for this + category has a default rule. + + + **Returns:** + - the default SortingRule or null. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the catalog category for the current locale. + + **Returns:** + - The value of the property for the current locale, or null if it + wasn't found. + + + +--- + +### getDisplayMode() +- getDisplayMode(): [Number](TopLevel.Number.md) + - : Returns the Variation Groups Display Mode of the category or null if no display mode is defined. + + **Returns:** + - the value of the attribute 'displayMode' which is either [DISPLAY_MODE_MERGED](dw.catalog.Category.md#display_mode_merged) or + [DISPLAY_MODE_INDIVIDUAL](dw.catalog.Category.md#display_mode_individual) or null if category is set to inherit the display mode. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name of the of the catalog category for the current locale. + + This value is intended to be used as the + external visible name of the catalog category. + + + **Returns:** + - The value of the property for the current locale, or null if it + wasn't found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the id of the category. + + **Returns:** + - the id of the category. + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the image reference of this catalog category. + + **Returns:** + - the image reference for this category. + + +--- + +### getIncomingCategoryLinks() +- getIncomingCategoryLinks(): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the target. If the source category of a link belongs to a different + catalog than the catalog owning this category, it is not returned. + + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly empty but not null. + + +--- + +### getIncomingCategoryLinks(Number) +- getIncomingCategoryLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the target and which are of the specified type. If the source + category of a link belongs to a different catalog than the catalog owning + this category, it is not returned. + + + **Parameters:** + - type - the link type type. + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly empty but not null. + + +--- + +### getOnlineCategoryAssignments() +- getOnlineCategoryAssignments(): [Collection](dw.util.Collection.md) + - : Returns a collection of category assignments of the category where the + referenced product is currently online. When checking the online status + of the product, the online flag and the online from & to dates are taken + into account. Online flag, online from & to dates set for the current site + takes precedence over the default values. + + + **Returns:** + - Collection of online category assignments of the category. + + +--- + +### getOnlineFlag() +- getOnlineFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status flag of the category. + + **Returns:** + - the online status flag of the category. + + +--- + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the date from which the category is online or valid. + + **Returns:** + - the date from which the category is online or valid. + + +--- + +### getOnlineIncomingCategoryLinks() +- getOnlineIncomingCategoryLinks(): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for + which this category is the target. If the source category of a link + belongs to a different catalog than the catalog owning this category, it + is not returned. Additionally, this method will only return a link if the + source category is currently online. A category is currently online if + its online flag equals true and the current site date is within the date + range defined by the onlineFrom and onlineTo attributes. + + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly + empty but not null. + + + +--- + +### getOnlineOutgoingCategoryLinks() +- getOnlineOutgoingCategoryLinks(): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for + which this category is the source. If the target category of a link + belongs to a different catalog than the catalog owning this category, it + is not returned. Additionally, this method will only return a link if the + target category is currently online. A category is currently online if + its online flag equals true and the current site date is within the date + range defined by the onlineFrom and onlineTo attributes. + + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly + empty but not null. + + + +--- + +### getOnlineProducts() +- getOnlineProducts(): [Collection](dw.util.Collection.md) + - : Returns online products assigned to this category. + Offline products are not included in the returned collection. + When checking the online status of the product, + the online flag and the online from & to dates are taken into account. + Online flag, online from & to dates set for the current site takes precedence + over the default values. + + + The order of products in the returned collection corresponds to the + defined explicit sorting of products in this category. + + + **Returns:** + - a sorted collection of online products of this category. + + **See Also:** + - [hasOnlineProducts()](dw.catalog.Category.md#hasonlineproducts) + + +--- + +### getOnlineSubCategories() +- getOnlineSubCategories(): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of currently online subcategories of this + catalog category. + + - A category is currently online if its online flag equals true and the current site date is within the date range defined by the onlineFrom and onlineTo attributes. + - The returned collection is sorted by position. Subcategories marked as "unsorted" always appear after those marked as "sorted" but are otherwise not in any guaranteed order. + - The returned collection contains direct subcategories only. + + + **Returns:** + - a sorted collection of currently online subcategories. + + **See Also:** + - [hasOnlineSubCategories()](dw.catalog.Category.md#hasonlinesubcategories) + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the date until which the category is online or valid. + + **Returns:** + - the date until which the category is online or valid. + + +--- + +### getOrderableRecommendations() +- getOrderableRecommendations(): [Collection](dw.util.Collection.md) + - : Returns a list of outgoing recommendations for this category. This method + behaves similarly to [getRecommendations()](dw.catalog.Category.md#getrecommendations) but additionally filters out + recommendations for which the target product is unorderable according to + its product availability model. + + + **Returns:** + - the sorted collection of recommendations, never null but possibly + empty. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### getOrderableRecommendations(Number) +- getOrderableRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns a list of outgoing recommendations for this category. This method + behaves similarly to [getRecommendations(Number)](dw.catalog.Category.md#getrecommendationsnumber) but additionally + filters out recommendations for which the target product is unorderable + according to its product availability model. + + + **Parameters:** + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly + empty. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### getOutgoingCategoryLinks() +- getOutgoingCategoryLinks(): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the source. If the target category of a link belongs to a different + catalog than the catalog owning this category, it is not returned. + The collection of links is sorted by the explicitly defined order + for this category with unsorted links appearing at the end. + + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly empty but not null. + + +--- + +### getOutgoingCategoryLinks(Number) +- getOutgoingCategoryLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the collection of [CategoryLink](dw.catalog.CategoryLink.md) objects for which this category + is the source and which are of the specified type. If the target + category of a link belongs to a different catalog than the catalog owning + this category, it is not returned. The collection of links is sorted by + the explicitly defined order for this category with unsorted links + appearing at the end. + + + **Parameters:** + - type - the link type type. + + **Returns:** + - a collection of [CategoryLink](dw.catalog.CategoryLink.md) objects, possibly empty but not null. + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the page description of this category for the default locale or null if not defined. + + **Returns:** + - the value of the attribute 'pageDescription'. + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the page keywords of this category for the default locale or null if not defined. + + **Returns:** + - the value of the attribute 'pageKeywords'. + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the page title of this category for the default locale or null if not defined. + + **Returns:** + - the value of the attribute 'pageTitle'. + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the page URL property of this category or null if not defined. + + **Returns:** + - the value of the attribute 'pageURL'. + + +--- + +### getParent() +- getParent(): [Category](dw.catalog.Category.md) + - : Returns the parent of this category. + + **Returns:** + - a CatalogCategory instance representing + the parent of this CatalogCategory or null. + + + +--- + +### getProductAttributeModel() +- getProductAttributeModel(): [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) + - : Returns this category's ProductAttributeModel, which makes access to the + category's attribute information convenient. The model is calculated + based on the attribute definitions assigned to this category and the + global attribute definitions for the object type 'Product'. + + + **Returns:** + - the ProductAttributeModel for this category. + + +--- + +### getProducts() +- getProducts(): [Collection](dw.util.Collection.md) + - : Returns all products assigned to this category. + The order of products in the returned collection corresponds to the + defined explicit sorting of products in this category. + + + **Returns:** + - a sorted collection of all products of this category. + + **See Also:** + - [getOnlineProducts()](dw.catalog.Category.md#getonlineproducts) + + +--- + +### getRecommendations() +- getRecommendations(): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this category. If this category + is not in the site catalog, or there is no site catalog, an empty + collection is returned. Only recommendations for which the target + product exists and is assigned to the site catalog are returned. The + recommendations are sorted by their explicitly set order. + + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getRecommendations(Number) +- getRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this category which are of the + specified type. Behaves the same as [getRecommendations()](dw.catalog.Category.md#getrecommendations) but + additionally filters by recommendation type. + + + **Parameters:** + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getSearchPlacement() +- getSearchPlacement(): [Number](TopLevel.Number.md) + - : Returns the search placement of the category or null of no search placement is defined. + + **Returns:** + - the value of the attribute 'searchPlacement'. + + +--- + +### getSearchRank() +- getSearchRank(): [Number](TopLevel.Number.md) + - : Returns the search rank of the category or null of no search rank is defined. + + **Returns:** + - the value of the attribute 'searchRank'. + + +--- + +### getSiteMapChangeFrequency() +- getSiteMapChangeFrequency(): [String](TopLevel.String.md) + - : Returns the category's sitemap change frequency. + + **Returns:** + - the value of the attribute 'siteMapChangeFrequency'. + + +--- + +### getSiteMapIncluded() +- getSiteMapIncluded(): [Number](TopLevel.Number.md) + - : Returns the category's sitemap inclusion. + + **Returns:** + - the value of the attribute 'siteMapIncluded'. + + +--- + +### getSiteMapPriority() +- getSiteMapPriority(): [Number](TopLevel.Number.md) + - : Returns the category's sitemap priority. + + **Returns:** + - the value of the attribute 'siteMapPriority'. + + +--- + +### getSubCategories() +- getSubCategories(): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of the subcategories of this catalog category, + including both online and offline subcategories. + + - The returned collection is sorted by position. Subcategories marked as "unsorted" always appear after those marked as "sorted" but are otherwise not in any guaranteed order. + - The returned collection contains direct subcategories only. + + + **Returns:** + - a sorted collection of the subcategories. + + **See Also:** + - [getOnlineSubCategories()](dw.catalog.Category.md#getonlinesubcategories) + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the template property value , which is the file name of the template + used to display the catalog category. + + + **Returns:** + - the value of the property 'template'. + + +--- + +### getThumbnail() +- getThumbnail(): [MediaFile](dw.content.MediaFile.md) + - : Returns the thumbnail image reference of this catalog category. + + **Returns:** + - the thumbnail image reference for this category. + + +--- + +### hasOnlineProducts() +- hasOnlineProducts(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this catalog category has any online products assigned. + When checking the online status of the product, + the online flag and the online from & to dates are taken into account. + Online flag, online from & to dates set for the current site takes precedence + over the default values. + + + **Returns:** + - true, if this category has at least one online product assigned, + false otherwise. + + + **See Also:** + - [getOnlineProducts()](dw.catalog.Category.md#getonlineproducts) + + +--- + +### hasOnlineSubCategories() +- hasOnlineSubCategories(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this catalog category has any online subcategories. + + - A category is currently online if its online flag equals true and the current site date is within the date range defined by the onlineFrom and onlineTo attributes. + - Only direct subcategories are considered. + + + **Returns:** + - true, if this category has at least one online subcategory, + false otherwise. + + + **See Also:** + - [getOnlineSubCategories()](dw.catalog.Category.md#getonlinesubcategories) + + +--- + +### isDirectSubCategoryOf(Category) +- isDirectSubCategoryOf(parent: [Category](dw.catalog.Category.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this category is a direct sub-category of the provided + category. + + + **Parameters:** + - parent - The parent category, must not be null. + + **Returns:** + - True if this category is a direct sub-category of parent, false + otherwise. + + + +--- + +### isOnline() +- isOnline(): [Boolean](TopLevel.Boolean.md) + - : Returns the value indicating whether the catalog category is "currently + online". A category is currently online if its online flag equals true + and the current site date is within the date range defined by the + onlineFrom and onlineTo attributes. + + + **Returns:** + - true if the category is currently online, false otherwise. + + +--- + +### isRoot() +- isRoot(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the category is the root category of its catalog. + + **Returns:** + - 'true' if the category is the root category of its catalog, + 'false' otherwise. + + + +--- + +### isSubCategoryOf(Category) +- isSubCategoryOf(ancestor: [Category](dw.catalog.Category.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this category is a sub-category of the provided category. + This can be either a direct or an indirect sub-category. + + + **Parameters:** + - ancestor - The ancestor category, must not be null. + + **Returns:** + - true if this category is a sub-category of ancestor, false + otherwise. + + + +--- + +### isTopLevel() +- isTopLevel(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the category is a top level category, but not the root + category. + + + **Returns:** + - True if the category is a direct sub-category of the root + category, false otherwise. + + + +--- + +### setDisplayMode(Number) +- setDisplayMode(displayMode: [Number](TopLevel.Number.md)): void + - : Set the category's Variation Groups Display Mode. + + **Parameters:** + - displayMode - The category's variation groups display mode which is either [DISPLAY_MODE_MERGED](dw.catalog.Category.md#display_mode_merged) or [DISPLAY_MODE_INDIVIDUAL](dw.catalog.Category.md#display_mode_individual) or null if category is set to inherit the display mode. + + +--- + +### setSearchPlacement(Number) +- setSearchPlacement(placement: [Number](TopLevel.Number.md)): void + - : Set the category's search placement. + + **Parameters:** + - placement - The category's search placement. + + +--- + +### setSearchRank(Number) +- setSearchRank(rank: [Number](TopLevel.Number.md)): void + - : Set the category's search rank. + + **Parameters:** + - rank - The category's search rank. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryAssignment.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryAssignment.md new file mode 100644 index 00000000..4627ee95 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryAssignment.md @@ -0,0 +1,179 @@ + +# Class CategoryAssignment + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.CategoryAssignment](dw.catalog.CategoryAssignment.md) + +Represents a category assignment in Commerce Cloud Digital. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [calloutMsg](#calloutmsg): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the category assignment's callout message in the current locale. | +| [category](#category): [Category](dw.catalog.Category.md) `(read-only)` | Returns the category to which this category assignment is bound. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the category assignment's image. | +| [longDescription](#longdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the category assignment's long description in the current locale. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the category assignment in the current locale. | +| [product](#product): [Product](dw.catalog.Product.md) `(read-only)` | Returns the product to which this category assignment is bound. | +| [shortDescription](#shortdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the category assignment's short description in the current locale. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCalloutMsg](dw.catalog.CategoryAssignment.md#getcalloutmsg)() | Returns the category assignment's callout message in the current locale. | +| [getCategory](dw.catalog.CategoryAssignment.md#getcategory)() | Returns the category to which this category assignment is bound. | +| [getImage](dw.catalog.CategoryAssignment.md#getimage)() | Returns the category assignment's image. | +| [getLongDescription](dw.catalog.CategoryAssignment.md#getlongdescription)() | Returns the category assignment's long description in the current locale. | +| [getName](dw.catalog.CategoryAssignment.md#getname)() | Returns the name of the category assignment in the current locale. | +| [getProduct](dw.catalog.CategoryAssignment.md#getproduct)() | Returns the product to which this category assignment is bound. | +| [getShortDescription](dw.catalog.CategoryAssignment.md#getshortdescription)() | Returns the category assignment's short description in the current locale. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### calloutMsg +- calloutMsg: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the category assignment's callout message in the current locale. + + +--- + +### category +- category: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the category to which this category assignment is bound. + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the category assignment's image. + + +--- + +### longDescription +- longDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the category assignment's long description in the current locale. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the category assignment in the current locale. + + +--- + +### product +- product: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the product to which this category assignment is bound. + + +--- + +### shortDescription +- shortDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the category assignment's short description in the current locale. + + +--- + +## Method Details + +### getCalloutMsg() +- getCalloutMsg(): [MarkupText](dw.content.MarkupText.md) + - : Returns the category assignment's callout message in the current locale. + + **Returns:** + - the category assignment's callout message in the current locale, or null if it + wasn't found. + + + +--- + +### getCategory() +- getCategory(): [Category](dw.catalog.Category.md) + - : Returns the category to which this category assignment is bound. + + **Returns:** + - The category to which this category assignment is bound. + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the category assignment's image. + + **Returns:** + - the category assignment's image. + + +--- + +### getLongDescription() +- getLongDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the category assignment's long description in the current locale. + + **Returns:** + - The category assignment's long description in the current locale, or null if it + wasn't found. + + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the category assignment in the current locale. + + **Returns:** + - The name of the category assignment for the current locale, or null if it + wasn't found. + + + +--- + +### getProduct() +- getProduct(): [Product](dw.catalog.Product.md) + - : Returns the product to which this category assignment is bound. + + **Returns:** + - The product to which this category assignment is bound. + + +--- + +### getShortDescription() +- getShortDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the category assignment's short description in the current locale. + + **Returns:** + - the category assignment's short description in the current locale, or null if it + wasn't found. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryLink.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryLink.md new file mode 100644 index 00000000..113f9ee6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.CategoryLink.md @@ -0,0 +1,142 @@ + +# Class CategoryLink + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.CategoryLink](dw.catalog.CategoryLink.md) + +A CategoryLink represents a directed relationship between two catalog +categories. Merchants create category links in order to market similar or +related groups of products. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [LINKTYPE_ACCESSORY](#linktype_accessory): [Number](TopLevel.Number.md) = 2 | Represents an accessory category link. | +| [LINKTYPE_CROSS_SELL](#linktype_cross_sell): [Number](TopLevel.Number.md) = 4 | Represents a cross-sell category link. | +| [LINKTYPE_OTHER](#linktype_other): [Number](TopLevel.Number.md) = 1 | Represents a miscellaneous category link. | +| [LINKTYPE_SPARE_PART](#linktype_spare_part): [Number](TopLevel.Number.md) = 6 | Represents a spare part category link. | +| [LINKTYPE_UP_SELL](#linktype_up_sell): [Number](TopLevel.Number.md) = 5 | Represents an up-sell category link. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [sourceCategory](#sourcecategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the object for the relation 'sourceCategory'. | +| [targetCategory](#targetcategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the object for the relation 'targetCategory'. | +| [typeCode](#typecode): [Number](TopLevel.Number.md) `(read-only)` | Returns the type of this category link (see constants). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getSourceCategory](dw.catalog.CategoryLink.md#getsourcecategory)() | Returns the object for the relation 'sourceCategory'. | +| [getTargetCategory](dw.catalog.CategoryLink.md#gettargetcategory)() | Returns the object for the relation 'targetCategory'. | +| [getTypeCode](dw.catalog.CategoryLink.md#gettypecode)() | Returns the type of this category link (see constants). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### LINKTYPE_ACCESSORY + +- LINKTYPE_ACCESSORY: [Number](TopLevel.Number.md) = 2 + - : Represents an accessory category link. + + +--- + +### LINKTYPE_CROSS_SELL + +- LINKTYPE_CROSS_SELL: [Number](TopLevel.Number.md) = 4 + - : Represents a cross-sell category link. + + +--- + +### LINKTYPE_OTHER + +- LINKTYPE_OTHER: [Number](TopLevel.Number.md) = 1 + - : Represents a miscellaneous category link. + + +--- + +### LINKTYPE_SPARE_PART + +- LINKTYPE_SPARE_PART: [Number](TopLevel.Number.md) = 6 + - : Represents a spare part category link. + + +--- + +### LINKTYPE_UP_SELL + +- LINKTYPE_UP_SELL: [Number](TopLevel.Number.md) = 5 + - : Represents an up-sell category link. + + +--- + +## Property Details + +### sourceCategory +- sourceCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the object for the relation 'sourceCategory'. + + +--- + +### targetCategory +- targetCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the object for the relation 'targetCategory'. + + +--- + +### typeCode +- typeCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the type of this category link (see constants). + + +--- + +## Method Details + +### getSourceCategory() +- getSourceCategory(): [Category](dw.catalog.Category.md) + - : Returns the object for the relation 'sourceCategory'. + + **Returns:** + - the object for the relation 'sourceCategory' + + +--- + +### getTargetCategory() +- getTargetCategory(): [Category](dw.catalog.Category.md) + - : Returns the object for the relation 'targetCategory'. + + **Returns:** + - the object for the relation 'targetCategory' + + +--- + +### getTypeCode() +- getTypeCode(): [Number](TopLevel.Number.md) + - : Returns the type of this category link (see constants). + + **Returns:** + - the type of the link. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBook.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBook.md new file mode 100644 index 00000000..85e316f6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBook.md @@ -0,0 +1,215 @@ + +# Class PriceBook + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.PriceBook](dw.catalog.PriceBook.md) + +Represents a price book. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the price book. | +| [currencyCode](#currencycode): [String](TopLevel.String.md) `(read-only)` | Returns the currency code of the price book. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of the price book. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name of the price book. | +| [online](#online): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status of the price book. | +| [onlineFlag](#onlineflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status flag of the price book. | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the date from which the price book is online or valid. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the date until which the price book is online or valid. | +| [parentPriceBook](#parentpricebook): [PriceBook](dw.catalog.PriceBook.md) `(read-only)` | Returns the parent price book. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCurrencyCode](dw.catalog.PriceBook.md#getcurrencycode)() | Returns the currency code of the price book. | +| [getDescription](dw.catalog.PriceBook.md#getdescription)() | Returns the description of the price book. | +| [getDisplayName](dw.catalog.PriceBook.md#getdisplayname)() | Returns the display name of the price book. | +| [getID](dw.catalog.PriceBook.md#getid)() | Returns the ID of the price book. | +| [getOnlineFlag](dw.catalog.PriceBook.md#getonlineflag)() | Returns the online status flag of the price book. | +| [getOnlineFrom](dw.catalog.PriceBook.md#getonlinefrom)() | Returns the date from which the price book is online or valid. | +| [getOnlineTo](dw.catalog.PriceBook.md#getonlineto)() | Returns the date until which the price book is online or valid. | +| [getParentPriceBook](dw.catalog.PriceBook.md#getparentpricebook)() | Returns the parent price book. | +| [isOnline](dw.catalog.PriceBook.md#isonline)() | Returns the online status of the price book. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the price book. + + +--- + +### currencyCode +- currencyCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the currency code of the price book. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of the price book. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name of the price book. + + +--- + +### online +- online: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status of the price book. The online status + is calculated from the online status flag and the onlineFrom + onlineTo dates defined for the price book. + + + +--- + +### onlineFlag +- onlineFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status flag of the price book. + + +--- + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date from which the price book is online or valid. + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date until which the price book is online or valid. + + +--- + +### parentPriceBook +- parentPriceBook: [PriceBook](dw.catalog.PriceBook.md) `(read-only)` + - : Returns the parent price book. + + +--- + +## Method Details + +### getCurrencyCode() +- getCurrencyCode(): [String](TopLevel.String.md) + - : Returns the currency code of the price book. + + **Returns:** + - Currency code of the price book + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the price book. + + **Returns:** + - Currency code of the price book + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name of the price book. + + **Returns:** + - Display name of the price book + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the price book. + + **Returns:** + - ID of the price book + + +--- + +### getOnlineFlag() +- getOnlineFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status flag of the price book. + + **Returns:** + - the online status flag of the price book. + + +--- + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the date from which the price book is online or valid. + + **Returns:** + - the date from which the price book is online or valid. + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the date until which the price book is online or valid. + + **Returns:** + - the date until which the price book is online or valid. + + +--- + +### getParentPriceBook() +- getParentPriceBook(): [PriceBook](dw.catalog.PriceBook.md) + - : Returns the parent price book. + + **Returns:** + - Parent price book + + +--- + +### isOnline() +- isOnline(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status of the price book. The online status + is calculated from the online status flag and the onlineFrom + onlineTo dates defined for the price book. + + + **Returns:** + - The online status of the price book. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBookMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBookMgr.md new file mode 100644 index 00000000..827cdd71 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.PriceBookMgr.md @@ -0,0 +1,176 @@ + +# Class PriceBookMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.PriceBookMgr](dw.catalog.PriceBookMgr.md) + +Price book manager provides methods to access price books. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [allPriceBooks](#allpricebooks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all price books defined for the organization. | +| [applicablePriceBooks](#applicablepricebooks): [Collection](dw.util.Collection.md) | Returns a collection of price books that are set in the user session. | +| [sitePriceBooks](#sitepricebooks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all price books assigned to the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [assignPriceBookToSite](dw.catalog.PriceBookMgr.md#assignpricebooktositepricebook-string)([PriceBook](dw.catalog.PriceBook.md), [String](TopLevel.String.md)) | Assign a price book to a site. | +| static [getAllPriceBooks](dw.catalog.PriceBookMgr.md#getallpricebooks)() | Returns all price books defined for the organization. | +| static [getApplicablePriceBooks](dw.catalog.PriceBookMgr.md#getapplicablepricebooks)() | Returns a collection of price books that are set in the user session. | +| static [getPriceBook](dw.catalog.PriceBookMgr.md#getpricebookstring)([String](TopLevel.String.md)) | Returns the price book of the current organization matching the specified ID. | +| static [getSitePriceBooks](dw.catalog.PriceBookMgr.md#getsitepricebooks)() | Returns all price books assigned to the current site. | +| static [setApplicablePriceBooks](dw.catalog.PriceBookMgr.md#setapplicablepricebookspricebook)([PriceBook...](dw.catalog.PriceBook.md)) | Sets one or more price books to be considered by the product price lookup. | +| static [unassignPriceBookFromAllSites](dw.catalog.PriceBookMgr.md#unassignpricebookfromallsitespricebook)([PriceBook](dw.catalog.PriceBook.md)) | Unassign a price book from all sites. | +| static [unassignPriceBookFromSite](dw.catalog.PriceBookMgr.md#unassignpricebookfromsitepricebook-string)([PriceBook](dw.catalog.PriceBook.md), [String](TopLevel.String.md)) | Unassign a price book from a site. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### allPriceBooks +- allPriceBooks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all price books defined for the organization. + + +--- + +### applicablePriceBooks +- applicablePriceBooks: [Collection](dw.util.Collection.md) + - : Returns a collection of price books that are set in the user session. + + +--- + +### sitePriceBooks +- sitePriceBooks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all price books assigned to the current site. + + Please note that this doesn't include parent price books not assigned to the site, but considered by the price + lookup. + + + +--- + +## Method Details + +### assignPriceBookToSite(PriceBook, String) +- static assignPriceBookToSite(priceBook: [PriceBook](dw.catalog.PriceBook.md), siteId: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Assign a price book to a site. This requires a transaction, see [Transaction.wrap(Function)](dw.system.Transaction.md#wrapfunction) + + **Parameters:** + - priceBook - price book to be assigned + - siteId - id of the site to be assigned to, such as 'SiteGenesis'. The site has to be a storefront site. + + **Returns:** + - true if price book is assigned to site. Throws an exception if price book doesn't exist or site doesn't + exist or site is not a storefront site. + + + +--- + +### getAllPriceBooks() +- static getAllPriceBooks(): [Collection](dw.util.Collection.md) + - : Returns all price books defined for the organization. + + **Returns:** + - All price books of the organization. + + +--- + +### getApplicablePriceBooks() +- static getApplicablePriceBooks(): [Collection](dw.util.Collection.md) + - : Returns a collection of price books that are set in the user session. + + **Returns:** + - Collection of applicable price books set in the session. + + +--- + +### getPriceBook(String) +- static getPriceBook(priceBookID: [String](TopLevel.String.md)): [PriceBook](dw.catalog.PriceBook.md) + - : Returns the price book of the current organization matching the specified ID. + + **Parameters:** + - priceBookID - The price book id. + + **Returns:** + - Price book or null of not found + + +--- + +### getSitePriceBooks() +- static getSitePriceBooks(): [Collection](dw.util.Collection.md) + - : Returns all price books assigned to the current site. + + Please note that this doesn't include parent price books not assigned to the site, but considered by the price + lookup. + + + **Returns:** + - All price books assigned to the current site. + + +--- + +### setApplicablePriceBooks(PriceBook...) +- static setApplicablePriceBooks(priceBooks: [PriceBook...](dw.catalog.PriceBook.md)): void + - : Sets one or more price books to be considered by the product price lookup. The information is stored in the user + session. If no price book is set in the user session, all active and valid price books assigned to the site are + used for the price lookup. If price books are set, only those price books are considered by the price lookup. + Note that the system does not assure that a price book set by this API is assigned to the current site. + + + **Parameters:** + - priceBooks - The price books that are set in the session as applicable price books. + + +--- + +### unassignPriceBookFromAllSites(PriceBook) +- static unassignPriceBookFromAllSites(priceBook: [PriceBook](dw.catalog.PriceBook.md)): [Boolean](TopLevel.Boolean.md) + - : Unassign a price book from all sites. This requires a transaction, see + [Transaction.wrap(Function)](dw.system.Transaction.md#wrapfunction) + + + **Parameters:** + - priceBook - price book to be unassigned + + **Returns:** + - true if price book is unassigned from all sites. Throws an exception if price book doesn't exist + + +--- + +### unassignPriceBookFromSite(PriceBook, String) +- static unassignPriceBookFromSite(priceBook: [PriceBook](dw.catalog.PriceBook.md), siteId: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Unassign a price book from a site. This requires a transaction, see + [Transaction.wrap(Function)](dw.system.Transaction.md#wrapfunction) + + + **Parameters:** + - priceBook - price book to be unassigned + - siteId - id of the site to be unassigned from, such as 'SiteGenesis'. The site has to be a storefront site. + + **Returns:** + - true if price book is unassigned from site. Throws an exception if price book doesn't exist or site + doesn't exist or site is not a storefront site. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Product.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Product.md new file mode 100644 index 00000000..b5d2e72d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Product.md @@ -0,0 +1,2492 @@ + +# Class Product + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Product](dw.catalog.Product.md) + +Represents a product in Commerce Cloud Digital. Products are identified by +a unique product ID, sometimes called the SKU. There are several different +types of product: + + +- **Simple product** +- **Master products:**This type of product defines a template for a set of related products which differ only by a set of defined "variation attributes", such as size or color. Master products are not orderable themselves. The variation information for a master product is available through its [ProductVariationModel](dw.catalog.ProductVariationModel.md). +- **Variant:**Variants are the actual orderable products that are related to a master product. Each variant of a master product has a unique set of values for the defined variation attributes. Variants are said to be "mastered" by the corresponding master product. +- **Option products:**Option products define additional options, such as a warranty, which can be purchased for a defined price at the time the product is purchased. The option information for an option product is available through its [ProductOptionModel](dw.catalog.ProductOptionModel.md). +- **Product-sets:**A product-set is a set of products which the merchant can sell as a collection in the storefront, for example an outfit of clothes. Product-sets are not orderable and therefore do not define prices. They exist only to group the products together in the storefront UI. Members of the set are called "product-set-products". +- **Products bundles:**A collection of products which can be ordered as a single unit and therefore can define its own price and inventory record. + + + + +Product price and availability information are retrievable through +[getPriceModel()](dw.catalog.Product.md#getpricemodel) and [getAvailabilityModel()](dw.catalog.Product.md#getavailabilitymodel) respectively. +Attribute information is retrievable through [getAttributeModel()](dw.catalog.Product.md#getattributemodel). +Products may reference other products, either as recommendations or product +links. This class provides the methods for retrieving these referenced +products. + + +Products belong to a catalog (the "owning" catalog) and are assigned to +categories in other catalogs. Products assigned to categories in the site +catalog are typically orderable on the site. + + +Any API method which returns products will return an instance of a +[Variant](dw.catalog.Variant.md) for variant products. This subclass contains +methods which are specific to this type of product. + + + +## All Known Subclasses +[Variant](dw.catalog.Variant.md), [VariationGroup](dw.catalog.VariationGroup.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [EAN](#ean): [String](TopLevel.String.md) `(read-only)` | Returns the European Article Number of the product. | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product. | +| [UPC](#upc): [String](TopLevel.String.md) `(read-only)` | Returns the Universal Product Code of the product. | +| [activeData](#activedata): [ProductActiveData](dw.catalog.ProductActiveData.md) `(read-only)` | Returns the active data for this product, for the current site. | +| [allCategories](#allcategories): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all categories to which this product is assigned. | +| [allCategoryAssignments](#allcategoryassignments): [Collection](dw.util.Collection.md) `(read-only)` | Returns all category assignments for this product in any catalog. | +| [allIncomingProductLinks](#allincomingproductlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all incoming ProductLinks. | +| [allProductLinks](#allproductlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all outgoing ProductLinks. | +| [assignedToSiteCatalog](#assignedtositecatalog): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if the product is assigned to the current site (via the site catalog), otherwise `false` is returned. | +| [attributeModel](#attributemodel): [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) `(read-only)` | Returns this product's ProductAttributeModel, which makes access to the product attribute information convenient. | +| [availabilityModel](#availabilitymodel): [ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) `(read-only)` | Returns the availability model, which can be used to determine availability information for a product. | +| ~~[available](#available): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Identifies if the product is available. | +| ~~[availableFlag](#availableflag): [Boolean](TopLevel.Boolean.md)~~ | Identifies if the product is available. | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the Brand of the product. | +| [bundle](#bundle): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product instance is a product bundle. | +| [bundled](#bundled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product instance is bundled within at least one product bundle. | +| [bundledProducts](#bundledproducts): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing all products that participate in the product bundle. | +| [bundles](#bundles): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all bundles in which this product is included. | +| [categories](#categories): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all categories to which this product is assigned and which are also available through the current site. | +| [categorized](#categorized): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product is bound to at least one catalog category. | +| [categoryAssignments](#categoryassignments): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of category assignments for this product in the current site catalog. | +| [classificationCategory](#classificationcategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the classification category associated with this Product. | +| [facebookEnabled](#facebookenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the product is Facebook enabled. | +| ~~[image](#image): [MediaFile](dw.content.MediaFile.md)~~ `(read-only)` | Returns the product's image. | +| [incomingProductLinks](#incomingproductlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns incoming ProductLinks, where the source product is a site product. | +| [longDescription](#longdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the product's long description in the current locale. | +| [manufacturerName](#manufacturername): [String](TopLevel.String.md) `(read-only)` | Returns the name of the product manufacturer. | +| [manufacturerSKU](#manufacturersku): [String](TopLevel.String.md) `(read-only)` | Returns the value of the manufacturer's stock keeping unit. | +| [master](#master): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product instance is a product master. | +| [minOrderQuantity](#minorderquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the minimum order quantity for this product. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the product in the current locale. | +| [online](#online): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status of the product. | +| [onlineCategories](#onlinecategories): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all currently online categories to which this product is assigned and which are also available through the current site. | +| [onlineFlag](#onlineflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status flag of the product. | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the date from which the product is online or valid. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the date until which the product is online or valid. | +| [optionModel](#optionmodel): [ProductOptionModel](dw.catalog.ProductOptionModel.md) `(read-only)` | Returns the product's option model. | +| [optionProduct](#optionproduct): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the product has options. | +| [orderableRecommendations](#orderablerecommendations): [Collection](dw.util.Collection.md) `(read-only)` | Returns a list of outgoing recommendations for this product. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns product's page description in the default locale. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the product's page keywords in the default locale. | +| [pageMetaTags](#pagemetatags): [Array](TopLevel.Array.md) `(read-only)` | Returns all page meta tags, defined for this instance for which content can be generated. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the product's page title in the default locale. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the product's page URL in the default locale. | +| [pinterestEnabled](#pinterestenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the product is Pinterest enabled. | +| [priceModel](#pricemodel): [ProductPriceModel](dw.catalog.ProductPriceModel.md) `(read-only)` | Returns the price model, which can be used to retrieve a price for this product. | +| [primaryCategory](#primarycategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the primary category of the product within the current site catalog. | +| [primaryCategoryAssignment](#primarycategoryassignment): [CategoryAssignment](dw.catalog.CategoryAssignment.md) `(read-only)` | Returns the category assignment to the primary category in the current site catalog or null if no primary category is defined within the current site catalog. | +| [product](#product): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the instance represents a product. | +| [productLinks](#productlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all outgoing ProductLinks, where the target product is also available in the current site. | +| [productSet](#productset): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the instance represents a product set, otherwise 'false'. | +| [productSetProduct](#productsetproduct): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if this product is part of any product set, otherwise false. | +| [productSetProducts](#productsetproducts): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all products which are assigned to this product and which are also available through the current site. | +| [productSets](#productsets): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all product sets in which this product is included. | +| [recommendations](#recommendations): [Collection](dw.util.Collection.md) `(read-only)` | Returns the outgoing recommendations for this product which belong to the site catalog. | +| ~~[retailSet](#retailset): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Identifies if this product instance is part of a retail set. | +| [searchPlacement](#searchplacement): [Number](TopLevel.Number.md) `(read-only)` | Returns the product's search placement classification. | +| [searchRank](#searchrank): [Number](TopLevel.Number.md) `(read-only)` | Returns the product's search rank. | +| [searchable](#searchable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the product is searchable. | +| [searchableFlag](#searchableflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns, whether the product is currently searchable. | +| [searchableIfUnavailableFlag](#searchableifunavailableflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the searchable status of the [Product](dw.catalog.Product.md) if unavailable. | +| [shortDescription](#shortdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the product's short description in the current locale. | +| [siteMapChangeFrequency](#sitemapchangefrequency): [String](TopLevel.String.md) `(read-only)` | Returns the product's change frequency needed for the sitemap creation. | +| [siteMapIncluded](#sitemapincluded): [Number](TopLevel.Number.md) `(read-only)` | Returns the status if the product is included into the sitemap. | +| [siteMapPriority](#sitemappriority): [Number](TopLevel.Number.md) `(read-only)` | Returns the product's priority needed for the sitemap creation. | +| ~~[siteProduct](#siteproduct): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Returns 'true' if the product is assigned to the current site (via the site catalog), otherwise 'false' is returned. | +| [stepQuantity](#stepquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the steps in which the order amount of the product can be increased. | +| [storeReceiptName](#storereceiptname): [String](TopLevel.String.md) `(read-only)` | Returns the store receipt name of the product in the current locale. | +| [storeTaxClass](#storetaxclass): [String](TopLevel.String.md) `(read-only)` | Returns the store tax class ID. | +| [taxClassID](#taxclassid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product's tax class, by resolving the Global Preference setting selected. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the name of the product's rendering template. | +| ~~[thumbnail](#thumbnail): [MediaFile](dw.content.MediaFile.md)~~ `(read-only)` | Returns the product's thumbnail image. | +| [unit](#unit): [String](TopLevel.String.md) `(read-only)` | Returns the product's sales unit. | +| [unitQuantity](#unitquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the product's unit quantity. | +| [variant](#variant): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product instance is mastered by a product master. | +| [variants](#variants): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all variants assigned to this variation master or variation group product. | +| [variationGroup](#variationgroup): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this product instance is a variation group product. | +| [variationGroups](#variationgroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all variation groups assigned to this variation master product. | +| [variationModel](#variationmodel): [ProductVariationModel](dw.catalog.ProductVariationModel.md) `(read-only)` | Returns the variation model of this product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| ~~[assignedToCategory](dw.catalog.Product.md#assignedtocategorycategory)([Category](dw.catalog.Category.md))~~ | Identifies if this product is bound to the specified catalog category. | +| [getActiveData](dw.catalog.Product.md#getactivedata)() | Returns the active data for this product, for the current site. | +| [getAllCategories](dw.catalog.Product.md#getallcategories)() | Returns a collection of all categories to which this product is assigned. | +| [getAllCategoryAssignments](dw.catalog.Product.md#getallcategoryassignments)() | Returns all category assignments for this product in any catalog. | +| [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinks)() | Returns all incoming ProductLinks. | +| [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all incoming ProductLinks of a specific type. | +| [getAllProductLinks](dw.catalog.Product.md#getallproductlinks)() | Returns all outgoing ProductLinks. | +| [getAllProductLinks](dw.catalog.Product.md#getallproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all outgoing ProductLinks of a specific type. | +| [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog)([Catalog](dw.catalog.Catalog.md)) | Returns the outgoing recommendations for this product which belong to the specified catalog. | +| [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog-number)([Catalog](dw.catalog.Catalog.md), [Number](TopLevel.Number.md)) | Returns the outgoing recommendations for this product which are of the specified type and which belong to the specified catalog. | +| [getAttributeModel](dw.catalog.Product.md#getattributemodel)() | Returns this product's ProductAttributeModel, which makes access to the product attribute information convenient. | +| [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodel)() | Returns the availability model, which can be used to determine availability information for a product. | +| [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodelproductinventorylist)([ProductInventoryList](dw.catalog.ProductInventoryList.md)) | Returns the availability model of the given inventory list, which can be used to determine availability information for a product. | +| ~~[getAvailableFlag](dw.catalog.Product.md#getavailableflag)()~~ | Identifies if the product is available. | +| [getBrand](dw.catalog.Product.md#getbrand)() | Returns the Brand of the product. | +| [getBundledProductQuantity](dw.catalog.Product.md#getbundledproductquantityproduct)([Product](dw.catalog.Product.md)) | Returns the quantity of the specified product within the bundle. | +| [getBundledProducts](dw.catalog.Product.md#getbundledproducts)() | Returns a collection containing all products that participate in the product bundle. | +| [getBundles](dw.catalog.Product.md#getbundles)() | Returns a collection of all bundles in which this product is included. | +| [getCategories](dw.catalog.Product.md#getcategories)() | Returns a collection of all categories to which this product is assigned and which are also available through the current site. | +| [getCategoryAssignment](dw.catalog.Product.md#getcategoryassignmentcategory)([Category](dw.catalog.Category.md)) | Returns the category assignment for a specific category. | +| [getCategoryAssignments](dw.catalog.Product.md#getcategoryassignments)() | Returns a collection of category assignments for this product in the current site catalog. | +| [getClassificationCategory](dw.catalog.Product.md#getclassificationcategory)() | Returns the classification category associated with this Product. | +| [getEAN](dw.catalog.Product.md#getean)() | Returns the European Article Number of the product. | +| [getID](dw.catalog.Product.md#getid)() | Returns the ID of the product. | +| ~~[getImage](dw.catalog.Product.md#getimage)()~~ | Returns the product's image. | +| [getImage](dw.catalog.Product.md#getimagestring)([String](TopLevel.String.md)) | The method calls [getImages(String)](dw.catalog.Product.md#getimagesstring) and returns the first image. | +| [getImage](dw.catalog.Product.md#getimagestring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | The method calls [getImages(String)](dw.catalog.Product.md#getimagesstring) and returns the image at the specific index. | +| [getImages](dw.catalog.Product.md#getimagesstring)([String](TopLevel.String.md)) | Returns all images assigned to this product for a specific view type, e.g. | +| [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinks)() | Returns incoming ProductLinks, where the source product is a site product. | +| [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinksnumber)([Number](TopLevel.Number.md)) | Returns incoming ProductLinks, where the source product is a site product of a specific type. | +| [getLongDescription](dw.catalog.Product.md#getlongdescription)() | Returns the product's long description in the current locale. | +| [getManufacturerName](dw.catalog.Product.md#getmanufacturername)() | Returns the name of the product manufacturer. | +| [getManufacturerSKU](dw.catalog.Product.md#getmanufacturersku)() | Returns the value of the manufacturer's stock keeping unit. | +| [getMinOrderQuantity](dw.catalog.Product.md#getminorderquantity)() | Returns the minimum order quantity for this product. | +| [getName](dw.catalog.Product.md#getname)() | Returns the name of the product in the current locale. | +| [getOnlineCategories](dw.catalog.Product.md#getonlinecategories)() | Returns a collection of all currently online categories to which this product is assigned and which are also available through the current site. | +| [getOnlineFlag](dw.catalog.Product.md#getonlineflag)() | Returns the online status flag of the product. | +| [getOnlineFrom](dw.catalog.Product.md#getonlinefrom)() | Returns the date from which the product is online or valid. | +| [getOnlineTo](dw.catalog.Product.md#getonlineto)() | Returns the date until which the product is online or valid. | +| [getOptionModel](dw.catalog.Product.md#getoptionmodel)() | Returns the product's option model. | +| [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendations)() | Returns a list of outgoing recommendations for this product. | +| [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendationsnumber)([Number](TopLevel.Number.md)) | Returns a list of outgoing recommendations for this product. | +| [getPageDescription](dw.catalog.Product.md#getpagedescription)() | Returns product's page description in the default locale. | +| [getPageKeywords](dw.catalog.Product.md#getpagekeywords)() | Returns the product's page keywords in the default locale. | +| [getPageMetaTag](dw.catalog.Product.md#getpagemetatagstring)([String](TopLevel.String.md)) | Returns the page meta tag for the specified id. | +| [getPageMetaTags](dw.catalog.Product.md#getpagemetatags)() | Returns all page meta tags, defined for this instance for which content can be generated. | +| [getPageTitle](dw.catalog.Product.md#getpagetitle)() | Returns the product's page title in the default locale. | +| [getPageURL](dw.catalog.Product.md#getpageurl)() | Returns the product's page URL in the default locale. | +| [getPriceModel](dw.catalog.Product.md#getpricemodel)() | Returns the price model, which can be used to retrieve a price for this product. | +| [getPriceModel](dw.catalog.Product.md#getpricemodelproductoptionmodel)([ProductOptionModel](dw.catalog.ProductOptionModel.md)) | Returns the price model based on the specified optionModel. | +| [getPrimaryCategory](dw.catalog.Product.md#getprimarycategory)() | Returns the primary category of the product within the current site catalog. | +| [getPrimaryCategoryAssignment](dw.catalog.Product.md#getprimarycategoryassignment)() | Returns the category assignment to the primary category in the current site catalog or null if no primary category is defined within the current site catalog. | +| [getProductLinks](dw.catalog.Product.md#getproductlinks)() | Returns all outgoing ProductLinks, where the target product is also available in the current site. | +| [getProductLinks](dw.catalog.Product.md#getproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all outgoing ProductLinks of a specific type, where the target product is also available in the current site. | +| [getProductSetProducts](dw.catalog.Product.md#getproductsetproducts)() | Returns a collection of all products which are assigned to this product and which are also available through the current site. | +| [getProductSets](dw.catalog.Product.md#getproductsets)() | Returns a collection of all product sets in which this product is included. | +| [getRecommendations](dw.catalog.Product.md#getrecommendations)() | Returns the outgoing recommendations for this product which belong to the site catalog. | +| [getRecommendations](dw.catalog.Product.md#getrecommendationsnumber)([Number](TopLevel.Number.md)) | Returns the outgoing recommendations for this product which are of the specified type and which belong to the site catalog. | +| [getSearchPlacement](dw.catalog.Product.md#getsearchplacement)() | Returns the product's search placement classification. | +| [getSearchRank](dw.catalog.Product.md#getsearchrank)() | Returns the product's search rank. | +| [getSearchableFlag](dw.catalog.Product.md#getsearchableflag)() | Returns, whether the product is currently searchable. | +| [getSearchableIfUnavailableFlag](dw.catalog.Product.md#getsearchableifunavailableflag)() | Returns the searchable status of the [Product](dw.catalog.Product.md) if unavailable. | +| [getShortDescription](dw.catalog.Product.md#getshortdescription)() | Returns the product's short description in the current locale. | +| [getSiteMapChangeFrequency](dw.catalog.Product.md#getsitemapchangefrequency)() | Returns the product's change frequency needed for the sitemap creation. | +| [getSiteMapIncluded](dw.catalog.Product.md#getsitemapincluded)() | Returns the status if the product is included into the sitemap. | +| [getSiteMapPriority](dw.catalog.Product.md#getsitemappriority)() | Returns the product's priority needed for the sitemap creation. | +| [getStepQuantity](dw.catalog.Product.md#getstepquantity)() | Returns the steps in which the order amount of the product can be increased. | +| [getStoreReceiptName](dw.catalog.Product.md#getstorereceiptname)() | Returns the store receipt name of the product in the current locale. | +| [getStoreTaxClass](dw.catalog.Product.md#getstoretaxclass)() | Returns the store tax class ID. | +| [getTaxClassID](dw.catalog.Product.md#gettaxclassid)() | Returns the ID of the product's tax class, by resolving the Global Preference setting selected. | +| [getTemplate](dw.catalog.Product.md#gettemplate)() | Returns the name of the product's rendering template. | +| ~~[getThumbnail](dw.catalog.Product.md#getthumbnail)()~~ | Returns the product's thumbnail image. | +| [getUPC](dw.catalog.Product.md#getupc)() | Returns the Universal Product Code of the product. | +| [getUnit](dw.catalog.Product.md#getunit)() | Returns the product's sales unit. | +| [getUnitQuantity](dw.catalog.Product.md#getunitquantity)() | Returns the product's unit quantity. | +| [getVariants](dw.catalog.Product.md#getvariants)() | Returns a collection of all variants assigned to this variation master or variation group product. | +| [getVariationGroups](dw.catalog.Product.md#getvariationgroups)() | Returns a collection of all variation groups assigned to this variation master product. | +| [getVariationModel](dw.catalog.Product.md#getvariationmodel)() | Returns the variation model of this product. | +| [includedInBundle](dw.catalog.Product.md#includedinbundleproduct)([Product](dw.catalog.Product.md)) | Identifies if the specified product participates in this product bundle. | +| [isAssignedToCategory](dw.catalog.Product.md#isassignedtocategorycategory)([Category](dw.catalog.Category.md)) | Returns 'true' if item is assigned to the specified category. | +| [isAssignedToSiteCatalog](dw.catalog.Product.md#isassignedtositecatalog)() | Returns `true` if the product is assigned to the current site (via the site catalog), otherwise `false` is returned. | +| ~~[isAvailable](dw.catalog.Product.md#isavailable)()~~ | Identifies if the product is available. | +| [isBundle](dw.catalog.Product.md#isbundle)() | Identifies if this product instance is a product bundle. | +| [isBundled](dw.catalog.Product.md#isbundled)() | Identifies if this product instance is bundled within at least one product bundle. | +| [isCategorized](dw.catalog.Product.md#iscategorized)() | Identifies if this product is bound to at least one catalog category. | +| [isFacebookEnabled](dw.catalog.Product.md#isfacebookenabled)() | Identifies if the product is Facebook enabled. | +| [isMaster](dw.catalog.Product.md#ismaster)() | Identifies if this product instance is a product master. | +| [isOnline](dw.catalog.Product.md#isonline)() | Returns the online status of the product. | +| [isOptionProduct](dw.catalog.Product.md#isoptionproduct)() | Identifies if the product has options. | +| [isPinterestEnabled](dw.catalog.Product.md#ispinterestenabled)() | Identifies if the product is Pinterest enabled. | +| [isProduct](dw.catalog.Product.md#isproduct)() | Returns 'true' if the instance represents a product. | +| [isProductSet](dw.catalog.Product.md#isproductset)() | Returns 'true' if the instance represents a product set, otherwise 'false'. | +| [isProductSetProduct](dw.catalog.Product.md#isproductsetproduct)() | Returns true if this product is part of any product set, otherwise false. | +| ~~[isRetailSet](dw.catalog.Product.md#isretailset)()~~ | Identifies if this product instance is part of a retail set. | +| [isSearchable](dw.catalog.Product.md#issearchable)() | Identifies if the product is searchable. | +| ~~[isSiteProduct](dw.catalog.Product.md#issiteproduct)()~~ | Returns 'true' if the product is assigned to the current site (via the site catalog), otherwise 'false' is returned. | +| [isVariant](dw.catalog.Product.md#isvariant)() | Identifies if this product instance is mastered by a product master. | +| [isVariationGroup](dw.catalog.Product.md#isvariationgroup)() | Identifies if this product instance is a variation group product. | +| ~~[setAvailableFlag](dw.catalog.Product.md#setavailableflagboolean)([Boolean](TopLevel.Boolean.md))~~ | Set the availability status flag of the product. | +| [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-1)([Boolean](TopLevel.Boolean.md)) | Set the online status flag of the product. | +| [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-2)([Boolean](TopLevel.Boolean.md)) | Set the online status flag of the product for the current site. | +| [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-1)([Number](TopLevel.Number.md)) | Set the product's search placement. | +| [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-2)([Number](TopLevel.Number.md)) | Set the product's search placement classification in context of the current site. | +| [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-1)([Number](TopLevel.Number.md)) | Set the product's search rank. | +| [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-2)([Number](TopLevel.Number.md)) | Set the product's search rank in context of the current site. | +| [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-1)([Boolean](TopLevel.Boolean.md)) | Set the flag indicating whether the product is searchable or not. | +| [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-2)([Boolean](TopLevel.Boolean.md)) | Set the flag indicating whether the product is searchable or not in context of the current site. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### EAN +- EAN: [String](TopLevel.String.md) `(read-only)` + - : Returns the European Article Number of the product. + + +--- + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product. + + +--- + +### UPC +- UPC: [String](TopLevel.String.md) `(read-only)` + - : Returns the Universal Product Code of the product. + + +--- + +### activeData +- activeData: [ProductActiveData](dw.catalog.ProductActiveData.md) `(read-only)` + - : Returns the active data for this product, for the current site. + + +--- + +### allCategories +- allCategories: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all categories to which this product is assigned. + + +--- + +### allCategoryAssignments +- allCategoryAssignments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all category assignments for this product in any catalog. + + +--- + +### allIncomingProductLinks +- allIncomingProductLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all incoming ProductLinks. + + +--- + +### allProductLinks +- allProductLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all outgoing ProductLinks. + + +--- + +### assignedToSiteCatalog +- assignedToSiteCatalog: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if the product is assigned to the current site (via the site catalog), otherwise + `false` is returned. + + + In case of the product being a variant, the variant will be considered as assigned if its master, one of the + variation groups it is in or itself is assigned to the site catalog. In case this is triggered for a variation + group the variation group is considered as assigned if its master or itself is assigned. + + + +--- + +### attributeModel +- attributeModel: [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) `(read-only)` + - : Returns this product's ProductAttributeModel, which makes access to the + product attribute information convenient. The model is calculated based + on the product attributes assigned to this product's classification + category (or any of it's ancestors) and the global attribute definitions + for the system object type 'Product'. If this product has no + classification category, the attribute model is calculated on the global + attribute definitions only. If this product is a variant, then the + attribute model is calculated based on the classification category of its + corresponding master product. + + + +--- + +### availabilityModel +- availabilityModel: [ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) `(read-only)` + - : Returns the availability model, which can be used to determine availability + information for a product. + + + +--- + +### available +- ~~available: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Identifies if the product is available. + + **Deprecated:** +:::warning +Use [getAvailabilityModel()](dw.catalog.Product.md#getavailabilitymodel).isInStock() instead +::: + +--- + +### availableFlag +- ~~availableFlag: [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if the product is available. + + **Deprecated:** +:::warning +Use [getAvailabilityModel()](dw.catalog.Product.md#getavailabilitymodel) instead. +::: + +--- + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the Brand of the product. + + +--- + +### bundle +- bundle: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product instance is a product bundle. + + +--- + +### bundled +- bundled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product instance is bundled within at least one + product bundle. + + + +--- + +### bundledProducts +- bundledProducts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing all products that participate in the + product bundle. + + + +--- + +### bundles +- bundles: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all bundles in which this product is included. + The method only returns bundles assigned to the current site. + + + +--- + +### categories +- categories: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all categories to which this product is assigned + and which are also available through the current site. + + + +--- + +### categorized +- categorized: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product is bound to at least one catalog category. + + +--- + +### categoryAssignments +- categoryAssignments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of category assignments for this product in + the current site catalog. + + + +--- + +### classificationCategory +- classificationCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the classification category associated with this Product. A + product has a single classification category which may or may not be in + the site catalog. The classification category defines the attribute set + of the product. See [getAttributeModel()](dw.catalog.Product.md#getattributemodel) for + how the classification category is used. + + + +--- + +### facebookEnabled +- facebookEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the product is Facebook enabled. + + +--- + +### image +- ~~image: [MediaFile](dw.content.MediaFile.md)~~ `(read-only)` + - : Returns the product's image. + + **Deprecated:** +:::warning + +Commerce Cloud Digital introduces a new more powerful product +image management. It allows to group product images by self-defined view types +(e.g. 'large', 'thumbnail', 'swatch') and variation values (e.g. for attribute +color 'red', 'blue'). Images can be annotated with pattern based title and +alt. Product images can be accessed from Digital locations or external storage +locations. + + +Please use the new product image management. Therefore you have to set +up the common product image settings like view types, image location, +default image alt and title for your catalogs first. After that you can +group your product images by the previously defined view types in context +of a product. Finally use [getImages(String)](dw.catalog.Product.md#getimagesstring) and +[getImage(String, Number)](dw.catalog.Product.md#getimagestring-number) to access your images. + +::: + +--- + +### incomingProductLinks +- incomingProductLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns incoming ProductLinks, where the source product is a site product. + + +--- + +### longDescription +- longDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the product's long description in the current locale. + + +--- + +### manufacturerName +- manufacturerName: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the product manufacturer. + + +--- + +### manufacturerSKU +- manufacturerSKU: [String](TopLevel.String.md) `(read-only)` + - : Returns the value of the manufacturer's stock keeping unit. + + +--- + +### master +- master: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product instance is a product master. + + +--- + +### minOrderQuantity +- minOrderQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the minimum order quantity for this product. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the product in the current locale. + + +--- + +### online +- online: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status of the product. The online status + is calculated from the online status flag and the onlineFrom + onlineTo dates defined for the product. + + + +--- + +### onlineCategories +- onlineCategories: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all currently online categories to which this + product is assigned and which are also available through the current + site. A category is currently online if its online flag equals true and + the current site date is within the date range defined by the onlineFrom + and onlineTo attributes. + + + +--- + +### onlineFlag +- onlineFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status flag of the product. + + +--- + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date from which the product is online or valid. + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date until which the product is online or valid. + + +--- + +### optionModel +- optionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md) `(read-only)` + - : Returns the product's option model. The option values selections are + initialized with the values defined for the product, or the default values + defined for the option. + + + +--- + +### optionProduct +- optionProduct: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the product has options. + + +--- + +### orderableRecommendations +- orderableRecommendations: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a list of outgoing recommendations for this product. This method + behaves similarly to [getRecommendations()](dw.catalog.Product.md#getrecommendations) but additionally filters out + recommendations for which the target product is unorderable according to + its product availability model. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns product's page description in the default locale. + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the product's page keywords in the default locale. + + +--- + +### pageMetaTags +- pageMetaTags: [Array](TopLevel.Array.md) `(read-only)` + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the product detail page meta tag context and rules. The rules are + obtained from the current product context or inherited from variation groups, master product, the primary + category, up to the root category. + + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the product's page title in the default locale. + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the product's page URL in the default locale. + + +--- + +### pinterestEnabled +- pinterestEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the product is Pinterest enabled. + + +--- + +### priceModel +- priceModel: [ProductPriceModel](dw.catalog.ProductPriceModel.md) `(read-only)` + - : Returns the price model, which can be used to retrieve a price + for this product. + + + +--- + +### primaryCategory +- primaryCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the primary category of the product within the current site catalog. + + +--- + +### primaryCategoryAssignment +- primaryCategoryAssignment: [CategoryAssignment](dw.catalog.CategoryAssignment.md) `(read-only)` + - : Returns the category assignment to the primary category in the current site + catalog or null if no primary category is defined within the current site + catalog. + + + +--- + +### product +- product: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the instance represents a product. Returns 'false' if + the instance represents a product set. + + + **See Also:** + - [isProductSet()](dw.catalog.Product.md#isproductset) + + +--- + +### productLinks +- productLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all outgoing ProductLinks, where the target product is also + available in the current site. The ProductLinks are unsorted. + + + +--- + +### productSet +- productSet: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the instance represents a product set, otherwise 'false'. + + **See Also:** + - [isProduct()](dw.catalog.Product.md#isproduct) + + +--- + +### productSetProduct +- productSetProduct: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if this product is part of any product set, otherwise false. + + +--- + +### productSetProducts +- productSetProducts: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all products which are assigned to this product + and which are also available through the current site. If this product + does not represent a product set then an empty collection will be + returned. + + + +--- + +### productSets +- productSets: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all product sets in which this product is included. + The method only returns product sets assigned to the current site. + + + +--- + +### recommendations +- recommendations: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the outgoing recommendations for this product which + belong to the site catalog. If this product is not assigned to the site + catalog, or there is no site catalog, an empty collection is returned. + Only recommendations for which the target product exists and is assigned + to the site catalog are returned. The recommendations are sorted by + their explicitly set order. + + + +--- + +### retailSet +- ~~retailSet: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Identifies if this product instance is part of a retail set. + + **Deprecated:** +:::warning +Use [isProductSet()](dw.catalog.Product.md#isproductset) instead +::: + +--- + +### searchPlacement +- searchPlacement: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the product's search placement classification. The higher the + numeric product placement value, the more relevant is the product when + sorting search results. The range of numeric placement values is + defined in the meta data of object type 'Product' and can therefore be + customized. + + + +--- + +### searchRank +- searchRank: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the product's search rank. The higher the numeric product rank, + the more relevant is the product when sorting search results. The range of + numeric rank values is defined in the meta data of object type 'Product' + and can therefore be customized. + + + +--- + +### searchable +- searchable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the product is searchable. + + +--- + +### searchableFlag +- searchableFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns, whether the product is currently searchable. + + +--- + +### searchableIfUnavailableFlag +- searchableIfUnavailableFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the searchable status of the [Product](dw.catalog.Product.md) if unavailable. + + Besides `true` or `false`, the return value `null` indicates that the value is not set. + + + +--- + +### shortDescription +- shortDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the product's short description in the current locale. + + +--- + +### siteMapChangeFrequency +- siteMapChangeFrequency: [String](TopLevel.String.md) `(read-only)` + - : Returns the product's change frequency needed for the sitemap creation. + + +--- + +### siteMapIncluded +- siteMapIncluded: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the status if the product is included into the sitemap. + + +--- + +### siteMapPriority +- siteMapPriority: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the product's priority needed for the sitemap creation. + + +--- + +### siteProduct +- ~~siteProduct: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Returns 'true' if the product is assigned to the current site (via the + site catalog), otherwise 'false' is returned. + + + **Deprecated:** +:::warning +Use [isAssignedToSiteCatalog()](dw.catalog.Product.md#isassignedtositecatalog) instead +::: + +--- + +### stepQuantity +- stepQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the steps in which the order amount of the product can be + increased. + + + +--- + +### storeReceiptName +- storeReceiptName: [String](TopLevel.String.md) `(read-only)` + - : Returns the store receipt name of the product in the current locale. + + +--- + +### storeTaxClass +- storeTaxClass: [String](TopLevel.String.md) `(read-only)` + - : Returns the store tax class ID. + + This is an optional override for in-store tax calculation. + + + +--- + +### taxClassID +- taxClassID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product's tax class, by resolving + the Global Preference setting selected. If the Localized + Tax Class setting under Global Preferences -> Products is + selected, the localizedTaxClassID attribute value will be + returned, else the legacy taxClassID attribute value will + be returned. + + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the product's rendering template. + + +--- + +### thumbnail +- ~~thumbnail: [MediaFile](dw.content.MediaFile.md)~~ `(read-only)` + - : Returns the product's thumbnail image. + + **Deprecated:** +:::warning + +Commerce Cloud Digital introduces a new more powerful product +image management. It allows to group product images by self-defined view types +(e.g. 'large', 'thumbnail', 'swatch') and variation values (e.g. for attribute +color 'red', 'blue'). Images can be annotated with pattern based title and +alt. Product images can be accessed from Digital locations or external storage +locations. + + +Please use the new product image management. Therefore you have to set +up the common product image settings like view types, image location, +default image alt and title for your catalogs first. After that you can +group your product images by the previously defined view types in context +of a product. Finally use [getImages(String)](dw.catalog.Product.md#getimagesstring) and +[getImage(String, Number)](dw.catalog.Product.md#getimagestring-number) to access your images. + +::: + +--- + +### unit +- unit: [String](TopLevel.String.md) `(read-only)` + - : Returns the product's sales unit. + + +--- + +### unitQuantity +- unitQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the product's unit quantity. + + +--- + +### variant +- variant: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product instance is mastered by a product master. + + +--- + +### variants +- variants: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all variants assigned to this variation master + or variation group product. All variants are returned regardless of whether + they are online or offline. + + If this product does not represent a variation master or variation group + product then an empty collection is returned. + + + +--- + +### variationGroup +- variationGroup: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this product instance is a variation group product. + + +--- + +### variationGroups +- variationGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all variation groups assigned to this variation + master product. All variation groups are returned regardless of whether + they are online or offline. + + If this product does not represent a variation master product then an + empty collection is returned. + + + +--- + +### variationModel +- variationModel: [ProductVariationModel](dw.catalog.ProductVariationModel.md) `(read-only)` + - : Returns the variation model of this product. If this product is a master + product, then the returned model will encapsulate all the information + about its variation attributes and variants. If this product is a variant + product, then the returned model will encapsulate all the same + information, but additionally pre-select all the variation attribute + values of this variant. (See [ProductVariationModel](dw.catalog.ProductVariationModel.md) for + details on what "selected" means.) If this product is neither a master + product or a variation product, then a model will be returned but will be + essentially empty and not useful for any particular purpose. + + + +--- + +## Method Details + +### assignedToCategory(Category) +- ~~assignedToCategory(category: [Category](dw.catalog.Category.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if this product is bound to the specified catalog category. + + **Parameters:** + - category - the CatalogCategory to check. + + **Returns:** + - true if the product is bound to the CatalogCategory, false + otherwise. + + + **Deprecated:** +:::warning +Use [isAssignedToCategory(Category)](dw.catalog.Product.md#isassignedtocategorycategory) +::: + +--- + +### getActiveData() +- getActiveData(): [ProductActiveData](dw.catalog.ProductActiveData.md) + - : Returns the active data for this product, for the current site. + + **Returns:** + - the active data for this product for the current site. + + +--- + +### getAllCategories() +- getAllCategories(): [Collection](dw.util.Collection.md) + - : Returns a collection of all categories to which this product is assigned. + + **Returns:** + - Collection of categories. + + +--- + +### getAllCategoryAssignments() +- getAllCategoryAssignments(): [Collection](dw.util.Collection.md) + - : Returns all category assignments for this product in any catalog. + + **Returns:** + - Collection of category assignments of the product in any catalog. + + +--- + +### getAllIncomingProductLinks() +- getAllIncomingProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all incoming ProductLinks. + + **Returns:** + - a collection of all incoming ProductLinks. + + +--- + +### getAllIncomingProductLinks(Number) +- getAllIncomingProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all incoming ProductLinks of a specific type. + + **Parameters:** + - type - the type of ProductLinks to use. + + **Returns:** + - a collection of all incoming ProductLinks of a specific type. + + +--- + +### getAllProductLinks() +- getAllProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all outgoing ProductLinks. + + **Returns:** + - a collection of all outgoing ProductLinks. + + +--- + +### getAllProductLinks(Number) +- getAllProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all outgoing ProductLinks of a specific type. + + **Parameters:** + - type - the type of ProductLinks to fetch. + + **Returns:** + - a collection of all outgoing ProductLinks of a specific type. + + +--- + +### getAllRecommendations(Catalog) +- getAllRecommendations(catalog: [Catalog](dw.catalog.Catalog.md)): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this product which belong to the + specified catalog. The recommendations are sorted by their explicitly set + order. + + + **Parameters:** + - catalog - the catalog containing the recommendations. + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getAllRecommendations(Catalog, Number) +- getAllRecommendations(catalog: [Catalog](dw.catalog.Catalog.md), type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this product which are of the + specified type and which belong to the specified catalog. + The recommendations are sorted by their explicitly set order. + + + **Parameters:** + - catalog - the catalog containing the recommendations. + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getAttributeModel() +- getAttributeModel(): [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) + - : Returns this product's ProductAttributeModel, which makes access to the + product attribute information convenient. The model is calculated based + on the product attributes assigned to this product's classification + category (or any of it's ancestors) and the global attribute definitions + for the system object type 'Product'. If this product has no + classification category, the attribute model is calculated on the global + attribute definitions only. If this product is a variant, then the + attribute model is calculated based on the classification category of its + corresponding master product. + + + **Returns:** + - the ProductAttributeModel for this product. + + +--- + +### getAvailabilityModel() +- getAvailabilityModel(): [ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) + - : Returns the availability model, which can be used to determine availability + information for a product. + + + **Returns:** + - the availability model for a product. + + +--- + +### getAvailabilityModel(ProductInventoryList) +- getAvailabilityModel(list: [ProductInventoryList](dw.catalog.ProductInventoryList.md)): [ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) + - : Returns the availability model of the given inventory list, which can be + used to determine availability information for a product. + + + **Parameters:** + - list - The inventory list to get the availability model for. Must not be null or an exception will be raised. + + **Returns:** + - the availability model of the given inventory list for a product. + + +--- + +### getAvailableFlag() +- ~~getAvailableFlag(): [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if the product is available. + + **Returns:** + - the availability status flag of the product. + + **Deprecated:** +:::warning +Use [getAvailabilityModel()](dw.catalog.Product.md#getavailabilitymodel) instead. +::: + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the Brand of the product. + + **Returns:** + - the Brand of the product. + + +--- + +### getBundledProductQuantity(Product) +- getBundledProductQuantity(aProduct: [Product](dw.catalog.Product.md)): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of the specified product within the bundle. If the + specified product is not part of the bundle, a 0 quantity is returned. + + + **Parameters:** + - aProduct - The product to determine the quantity for. + + **Returns:** + - The quantity of the product within the bundle or 0 if the product + is not part of the bundle. + + + +--- + +### getBundledProducts() +- getBundledProducts(): [Collection](dw.util.Collection.md) + - : Returns a collection containing all products that participate in the + product bundle. + + + **Returns:** + - A collection containing all products of the product bundle. + + +--- + +### getBundles() +- getBundles(): [Collection](dw.util.Collection.md) + - : Returns a collection of all bundles in which this product is included. + The method only returns bundles assigned to the current site. + + + **Returns:** + - Collection of bundles in which this product is included, possibly empty. + + +--- + +### getCategories() +- getCategories(): [Collection](dw.util.Collection.md) + - : Returns a collection of all categories to which this product is assigned + and which are also available through the current site. + + + **Returns:** + - Collection of categories to which this product is assigned + and which are also available through the current site. + + + +--- + +### getCategoryAssignment(Category) +- getCategoryAssignment(category: [Category](dw.catalog.Category.md)): [CategoryAssignment](dw.catalog.CategoryAssignment.md) + - : Returns the category assignment for a specific category. + + **Parameters:** + - category - the category to use when fetching assignments. + + **Returns:** + - The category assignment for a specific category. + + +--- + +### getCategoryAssignments() +- getCategoryAssignments(): [Collection](dw.util.Collection.md) + - : Returns a collection of category assignments for this product in + the current site catalog. + + + **Returns:** + - Collection of category assignments. + + +--- + +### getClassificationCategory() +- getClassificationCategory(): [Category](dw.catalog.Category.md) + - : Returns the classification category associated with this Product. A + product has a single classification category which may or may not be in + the site catalog. The classification category defines the attribute set + of the product. See [getAttributeModel()](dw.catalog.Product.md#getattributemodel) for + how the classification category is used. + + + **Returns:** + - the associated classification Category, or null if none is + associated. + + + +--- + +### getEAN() +- getEAN(): [String](TopLevel.String.md) + - : Returns the European Article Number of the product. + + **Returns:** + - the European Article Number of the product. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the product. + + **Returns:** + - ID of the product. + + +--- + +### getImage() +- ~~getImage(): [MediaFile](dw.content.MediaFile.md)~~ + - : Returns the product's image. + + **Returns:** + - the product's image. + + **Deprecated:** +:::warning + +Commerce Cloud Digital introduces a new more powerful product +image management. It allows to group product images by self-defined view types +(e.g. 'large', 'thumbnail', 'swatch') and variation values (e.g. for attribute +color 'red', 'blue'). Images can be annotated with pattern based title and +alt. Product images can be accessed from Digital locations or external storage +locations. + + +Please use the new product image management. Therefore you have to set +up the common product image settings like view types, image location, +default image alt and title for your catalogs first. After that you can +group your product images by the previously defined view types in context +of a product. Finally use [getImages(String)](dw.catalog.Product.md#getimagesstring) and +[getImage(String, Number)](dw.catalog.Product.md#getimagestring-number) to access your images. + +::: + +--- + +### getImage(String) +- getImage(viewtype: [String](TopLevel.String.md)): [MediaFile](dw.content.MediaFile.md) + - : The method calls [getImages(String)](dw.catalog.Product.md#getimagesstring) and returns the first image. + If no image is available the method returns null. + + When called for a variant with defined images for specified view type the + method returns the first image. + + When called for a variant without defined images for specified view type + the method returns the first master product image. If no master product + images are defined, the method returns null. + + + **Parameters:** + - viewtype - the view type annotated to image + + **Returns:** + - the MediaFile or null + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getImage(String, Number) +- getImage(viewtype: [String](TopLevel.String.md), index: [Number](TopLevel.Number.md)): [MediaFile](dw.content.MediaFile.md) + - : The method calls [getImages(String)](dw.catalog.Product.md#getimagesstring) and returns the image at + the specific index. If no image for specified index is available the + method returns null. + + + **Parameters:** + - viewtype - the view type annotated to image + - index - the index number of the image within image list + + **Returns:** + - the MediaFile or null + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getImages(String) +- getImages(viewtype: [String](TopLevel.String.md)): [List](dw.util.List.md) + - : Returns all images assigned to this product for a specific view type, + e.g. all 'thumbnail' images. The images are returned in the order of + their index number ascending. + + When called for a master the method returns the images specific to the + master, which are typically the fall back images. + + + **Parameters:** + - viewtype - the view type annotated to images + + **Returns:** + - a list of MediaFile objects, possibly empty + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getIncomingProductLinks() +- getIncomingProductLinks(): [Collection](dw.util.Collection.md) + - : Returns incoming ProductLinks, where the source product is a site product. + + **Returns:** + - a collection of incoming ProductLinks, where the source product is + a site product. + + + +--- + +### getIncomingProductLinks(Number) +- getIncomingProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns incoming ProductLinks, where the source product is a site product + of a specific type. + + + **Parameters:** + - type - the type of ProductLinks to fetch. + + **Returns:** + - a collection of incoming ProductLinks, where the source product is + a site product of a specific type. + + + +--- + +### getLongDescription() +- getLongDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the product's long description in the current locale. + + **Returns:** + - The product's long description in the current locale, or null if it + wasn't found. + + + +--- + +### getManufacturerName() +- getManufacturerName(): [String](TopLevel.String.md) + - : Returns the name of the product manufacturer. + + **Returns:** + - the name of the product manufacturer. + + +--- + +### getManufacturerSKU() +- getManufacturerSKU(): [String](TopLevel.String.md) + - : Returns the value of the manufacturer's stock keeping unit. + + **Returns:** + - the value of the manufacturer's stock keeping unit. + + +--- + +### getMinOrderQuantity() +- getMinOrderQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the minimum order quantity for this product. + + **Returns:** + - the minimum order quantity of the product. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the product in the current locale. + + **Returns:** + - The name of the product for the current locale, or null if it + wasn't found. + + + +--- + +### getOnlineCategories() +- getOnlineCategories(): [Collection](dw.util.Collection.md) + - : Returns a collection of all currently online categories to which this + product is assigned and which are also available through the current + site. A category is currently online if its online flag equals true and + the current site date is within the date range defined by the onlineFrom + and onlineTo attributes. + + + **Returns:** + - Collection of currently online categories to which this product + is assigned and which are also available through the current + site. + + + +--- + +### getOnlineFlag() +- getOnlineFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status flag of the product. + + **Returns:** + - the online status flag of the product. + + +--- + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the date from which the product is online or valid. + + **Returns:** + - the date from which the product is online or valid. + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the date until which the product is online or valid. + + **Returns:** + - the date until which the product is online or valid. + + +--- + +### getOptionModel() +- getOptionModel(): [ProductOptionModel](dw.catalog.ProductOptionModel.md) + - : Returns the product's option model. The option values selections are + initialized with the values defined for the product, or the default values + defined for the option. + + + **Returns:** + - the products option model. + + +--- + +### getOrderableRecommendations() +- getOrderableRecommendations(): [Collection](dw.util.Collection.md) + - : Returns a list of outgoing recommendations for this product. This method + behaves similarly to [getRecommendations()](dw.catalog.Product.md#getrecommendations) but additionally filters out + recommendations for which the target product is unorderable according to + its product availability model. + + + **Returns:** + - the sorted collection of recommendations, never null but possibly + empty. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### getOrderableRecommendations(Number) +- getOrderableRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns a list of outgoing recommendations for this product. This method + behaves similarly to [getRecommendations(Number)](dw.catalog.Product.md#getrecommendationsnumber) but additionally + filters out recommendations for which the target product is unorderable + according to its product availability model. + + + **Parameters:** + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly + empty. + + + **See Also:** + - [ProductAvailabilityModel.isOrderable()](dw.catalog.ProductAvailabilityModel.md#isorderable) + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns product's page description in the default locale. + + **Returns:** + - The product's page description in the default locale, + or null if it wasn't found. + + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the product's page keywords in the default locale. + + **Returns:** + - The product's page keywords in the default locale, + or null if it wasn't found. + + + +--- + +### getPageMetaTag(String) +- getPageMetaTag(id: [String](TopLevel.String.md)): [PageMetaTag](dw.web.PageMetaTag.md) + - : Returns the page meta tag for the specified id. + + + The meta tag content is generated based on the product detail page meta tag context and rule. The rule is + obtained from the current product context or inherited from variation groups, master product, the primary + category, up to the root category. + + + Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the + current context, or if the rule resolves to an empty string. + + + **Parameters:** + - id - the ID to get the page meta tag for + + **Returns:** + - page meta tag containing content generated based on rules + + +--- + +### getPageMetaTags() +- getPageMetaTags(): [Array](TopLevel.Array.md) + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the product detail page meta tag context and rules. The rules are + obtained from the current product context or inherited from variation groups, master product, the primary + category, up to the root category. + + + **Returns:** + - page meta tags defined for this instance, containing content generated based on rules + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the product's page title in the default locale. + + **Returns:** + - The product's page title in the default locale, + or null if it wasn't found. + + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the product's page URL in the default locale. + + **Returns:** + - The product's page URL in the default locale, + or null if it wasn't found. + + + +--- + +### getPriceModel() +- getPriceModel(): [ProductPriceModel](dw.catalog.ProductPriceModel.md) + - : Returns the price model, which can be used to retrieve a price + for this product. + + + **Returns:** + - the price model, which can be used to retrieve a price + for this product. + + + +--- + +### getPriceModel(ProductOptionModel) +- getPriceModel(optionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md)): [ProductPriceModel](dw.catalog.ProductPriceModel.md) + - : Returns the price model based on the specified optionModel. The + price model can be used to retrieve a price + for this product. Prices are calculated based on the option values + selected in the specified option model. + + + **Parameters:** + - optionModel - the option model to use when fetching the price model. + + **Returns:** + - the price model based on the specified optionModel. + + +--- + +### getPrimaryCategory() +- getPrimaryCategory(): [Category](dw.catalog.Category.md) + - : Returns the primary category of the product within the current site catalog. + + **Returns:** + - The product's primary category or null. + + +--- + +### getPrimaryCategoryAssignment() +- getPrimaryCategoryAssignment(): [CategoryAssignment](dw.catalog.CategoryAssignment.md) + - : Returns the category assignment to the primary category in the current site + catalog or null if no primary category is defined within the current site + catalog. + + + **Returns:** + - The category assignment to the primary category or null. + + +--- + +### getProductLinks() +- getProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all outgoing ProductLinks, where the target product is also + available in the current site. The ProductLinks are unsorted. + + + **Returns:** + - a collection of outgoing ProductLinks where the target product is also + available in the current site. + + + +--- + +### getProductLinks(Number) +- getProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all outgoing ProductLinks of a specific type, where the target + product is also available in the current site. The ProductLinks are + sorted. + + + **Parameters:** + - type - the type of ProductLinks to fetch. + + **Returns:** + - a collection of outgoing ProductLinks where the target product is also + available in the current site. + + + +--- + +### getProductSetProducts() +- getProductSetProducts(): [Collection](dw.util.Collection.md) + - : Returns a collection of all products which are assigned to this product + and which are also available through the current site. If this product + does not represent a product set then an empty collection will be + returned. + + + **Returns:** + - Collection of products which are assigned to this product + and which are also available through the current site. + + + +--- + +### getProductSets() +- getProductSets(): [Collection](dw.util.Collection.md) + - : Returns a collection of all product sets in which this product is included. + The method only returns product sets assigned to the current site. + + + **Returns:** + - Collection of product sets in which this product is included, possibly empty. + + +--- + +### getRecommendations() +- getRecommendations(): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this product which + belong to the site catalog. If this product is not assigned to the site + catalog, or there is no site catalog, an empty collection is returned. + Only recommendations for which the target product exists and is assigned + to the site catalog are returned. The recommendations are sorted by + their explicitly set order. + + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getRecommendations(Number) +- getRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the outgoing recommendations for this product which are of the + specified type and which belong to the site catalog. Behaves the same as + [getRecommendations()](dw.catalog.Product.md#getrecommendations) but additionally filters by recommendation + type. + + + **Parameters:** + - type - the recommendation type. + + **Returns:** + - the sorted collection of recommendations, never null but possibly empty. + + +--- + +### getSearchPlacement() +- getSearchPlacement(): [Number](TopLevel.Number.md) + - : Returns the product's search placement classification. The higher the + numeric product placement value, the more relevant is the product when + sorting search results. The range of numeric placement values is + defined in the meta data of object type 'Product' and can therefore be + customized. + + + **Returns:** + - The product's search placement classification. + + +--- + +### getSearchRank() +- getSearchRank(): [Number](TopLevel.Number.md) + - : Returns the product's search rank. The higher the numeric product rank, + the more relevant is the product when sorting search results. The range of + numeric rank values is defined in the meta data of object type 'Product' + and can therefore be customized. + + + **Returns:** + - The product's search rank. + + +--- + +### getSearchableFlag() +- getSearchableFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns, whether the product is currently searchable. + + **Returns:** + - the searchable status flag of the product. + + +--- + +### getSearchableIfUnavailableFlag() +- getSearchableIfUnavailableFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the searchable status of the [Product](dw.catalog.Product.md) if unavailable. + + Besides `true` or `false`, the return value `null` indicates that the value is not set. + + + **Returns:** + - The searchable status of the product if unavailable or `null` if not set. + + +--- + +### getShortDescription() +- getShortDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the product's short description in the current locale. + + **Returns:** + - the product's short description in the current locale, or null if it + wasn't found. + + + +--- + +### getSiteMapChangeFrequency() +- getSiteMapChangeFrequency(): [String](TopLevel.String.md) + - : Returns the product's change frequency needed for the sitemap creation. + + **Returns:** + - The product's sitemap change frequency. + + +--- + +### getSiteMapIncluded() +- getSiteMapIncluded(): [Number](TopLevel.Number.md) + - : Returns the status if the product is included into the sitemap. + + **Returns:** + - the value of the attribute 'siteMapIncluded'. + + +--- + +### getSiteMapPriority() +- getSiteMapPriority(): [Number](TopLevel.Number.md) + - : Returns the product's priority needed for the sitemap creation. + + **Returns:** + - The product's sitemap priority. + + +--- + +### getStepQuantity() +- getStepQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the steps in which the order amount of the product can be + increased. + + + **Returns:** + - the order amount by which the product can be increased. + + +--- + +### getStoreReceiptName() +- getStoreReceiptName(): [String](TopLevel.String.md) + - : Returns the store receipt name of the product in the current locale. + + **Returns:** + - The store receipt name of the product for the current locale, or null if it + wasn't found. + + + +--- + +### getStoreTaxClass() +- getStoreTaxClass(): [String](TopLevel.String.md) + - : Returns the store tax class ID. + + This is an optional override for in-store tax calculation. + + + **Returns:** + - the store tax class id. + + +--- + +### getTaxClassID() +- getTaxClassID(): [String](TopLevel.String.md) + - : Returns the ID of the product's tax class, by resolving + the Global Preference setting selected. If the Localized + Tax Class setting under Global Preferences -> Products is + selected, the localizedTaxClassID attribute value will be + returned, else the legacy taxClassID attribute value will + be returned. + + + **Returns:** + - the ID of the product's tax class depending on the Global Preference setting selected for Products. + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the name of the product's rendering template. + + **Returns:** + - the name of the product's rendering template. + + +--- + +### getThumbnail() +- ~~getThumbnail(): [MediaFile](dw.content.MediaFile.md)~~ + - : Returns the product's thumbnail image. + + **Returns:** + - the product's thumbnail image. + + **Deprecated:** +:::warning + +Commerce Cloud Digital introduces a new more powerful product +image management. It allows to group product images by self-defined view types +(e.g. 'large', 'thumbnail', 'swatch') and variation values (e.g. for attribute +color 'red', 'blue'). Images can be annotated with pattern based title and +alt. Product images can be accessed from Digital locations or external storage +locations. + + +Please use the new product image management. Therefore you have to set +up the common product image settings like view types, image location, +default image alt and title for your catalogs first. After that you can +group your product images by the previously defined view types in context +of a product. Finally use [getImages(String)](dw.catalog.Product.md#getimagesstring) and +[getImage(String, Number)](dw.catalog.Product.md#getimagestring-number) to access your images. + +::: + +--- + +### getUPC() +- getUPC(): [String](TopLevel.String.md) + - : Returns the Universal Product Code of the product. + + **Returns:** + - the Universal Product Code of the product. + + +--- + +### getUnit() +- getUnit(): [String](TopLevel.String.md) + - : Returns the product's sales unit. + + **Returns:** + - the products sales unit. + + +--- + +### getUnitQuantity() +- getUnitQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the product's unit quantity. + + **Returns:** + - the products unit quantity. + + +--- + +### getVariants() +- getVariants(): [Collection](dw.util.Collection.md) + - : Returns a collection of all variants assigned to this variation master + or variation group product. All variants are returned regardless of whether + they are online or offline. + + If this product does not represent a variation master or variation group + product then an empty collection is returned. + + + **Returns:** + - Collection of variants associated with this variation master or + variation group product. + + + +--- + +### getVariationGroups() +- getVariationGroups(): [Collection](dw.util.Collection.md) + - : Returns a collection of all variation groups assigned to this variation + master product. All variation groups are returned regardless of whether + they are online or offline. + + If this product does not represent a variation master product then an + empty collection is returned. + + + **Returns:** + - Collection of variation groups associated with this variation + master product. + + + +--- + +### getVariationModel() +- getVariationModel(): [ProductVariationModel](dw.catalog.ProductVariationModel.md) + - : Returns the variation model of this product. If this product is a master + product, then the returned model will encapsulate all the information + about its variation attributes and variants. If this product is a variant + product, then the returned model will encapsulate all the same + information, but additionally pre-select all the variation attribute + values of this variant. (See [ProductVariationModel](dw.catalog.ProductVariationModel.md) for + details on what "selected" means.) If this product is neither a master + product or a variation product, then a model will be returned but will be + essentially empty and not useful for any particular purpose. + + + **Returns:** + - the variation model of the product. + + +--- + +### includedInBundle(Product) +- includedInBundle(product: [Product](dw.catalog.Product.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if the specified product participates in this product bundle. + If this product does not represent a bundle at all, then false will + always be returned. + + + **Parameters:** + - product - the product to check for participation. + + **Returns:** + - true if the product participates in the bundle, false otherwise. + + +--- + +### isAssignedToCategory(Category) +- isAssignedToCategory(category: [Category](dw.catalog.Category.md)): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if item is assigned to the specified + category. + + + **Parameters:** + - category - the category to check. + + **Returns:** + - true if item is assigned to category. + + +--- + +### isAssignedToSiteCatalog() +- isAssignedToSiteCatalog(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the product is assigned to the current site (via the site catalog), otherwise + `false` is returned. + + + In case of the product being a variant, the variant will be considered as assigned if its master, one of the + variation groups it is in or itself is assigned to the site catalog. In case this is triggered for a variation + group the variation group is considered as assigned if its master or itself is assigned. + + + **Returns:** + - 'true' if product assigned to the site catalog + + +--- + +### isAvailable() +- ~~isAvailable(): [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if the product is available. + + **Returns:** + - the value of the attribute 'available'. + + **Deprecated:** +:::warning +Use [getAvailabilityModel()](dw.catalog.Product.md#getavailabilitymodel).isInStock() instead +::: + +--- + +### isBundle() +- isBundle(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product instance is a product bundle. + + **Returns:** + - true if the product is a bundle, false otherwise. + + +--- + +### isBundled() +- isBundled(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product instance is bundled within at least one + product bundle. + + + **Returns:** + - true if the product is bundled, false otherwise. + + +--- + +### isCategorized() +- isCategorized(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product is bound to at least one catalog category. + + **Returns:** + - true if the product is bound to at least one catalog category, + false otherwise. + + + +--- + +### isFacebookEnabled() +- isFacebookEnabled(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the product is Facebook enabled. + + **Returns:** + - the value of the attribute 'facebookEnabled'. + + +--- + +### isMaster() +- isMaster(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product instance is a product master. + + **Returns:** + - true if the product is a master, false otherwise. + + +--- + +### isOnline() +- isOnline(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status of the product. The online status + is calculated from the online status flag and the onlineFrom + onlineTo dates defined for the product. + + + **Returns:** + - the online status of the product. + + +--- + +### isOptionProduct() +- isOptionProduct(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the product has options. + + **Returns:** + - true if product has options, false otherwise. + + +--- + +### isPinterestEnabled() +- isPinterestEnabled(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the product is Pinterest enabled. + + **Returns:** + - the value of the attribute 'pinterestEnabled'. + + +--- + +### isProduct() +- isProduct(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the instance represents a product. Returns 'false' if + the instance represents a product set. + + + **Returns:** + - true if the instance is a product, false otherwise. + + **See Also:** + - [isProductSet()](dw.catalog.Product.md#isproductset) + + +--- + +### isProductSet() +- isProductSet(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the instance represents a product set, otherwise 'false'. + + **Returns:** + - true if the instance is a product set, false otherwise. + + **See Also:** + - [isProduct()](dw.catalog.Product.md#isproduct) + + +--- + +### isProductSetProduct() +- isProductSetProduct(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this product is part of any product set, otherwise false. + + **Returns:** + - true if the product is part of any product set, false otherwise. + + +--- + +### isRetailSet() +- ~~isRetailSet(): [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if this product instance is part of a retail set. + + **Returns:** + - true if the product is part of a retail set, false otherwise. + + **Deprecated:** +:::warning +Use [isProductSet()](dw.catalog.Product.md#isproductset) instead +::: + +--- + +### isSearchable() +- isSearchable(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the product is searchable. + + **Returns:** + - the value of the attribute 'searchable'. + + +--- + +### isSiteProduct() +- ~~isSiteProduct(): [Boolean](TopLevel.Boolean.md)~~ + - : Returns 'true' if the product is assigned to the current site (via the + site catalog), otherwise 'false' is returned. + + + **Returns:** + - 'true' if product assigned to site. + + **Deprecated:** +:::warning +Use [isAssignedToSiteCatalog()](dw.catalog.Product.md#isassignedtositecatalog) instead +::: + +--- + +### isVariant() +- isVariant(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product instance is mastered by a product master. + + **Returns:** + - true if the product is mastered, false otherwise. + + +--- + +### isVariationGroup() +- isVariationGroup(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this product instance is a variation group product. + + **Returns:** + - true if the product is a variation group, false otherwise. + + +--- + +### setAvailableFlag(Boolean) +- ~~setAvailableFlag(available: [Boolean](TopLevel.Boolean.md)): void~~ + - : Set the availability status flag of the product. + + **Parameters:** + - available - Availability status flag. + + **Deprecated:** +:::warning +Don't use this method anymore. +::: + +--- + +### setOnlineFlag(Boolean) - Variant 1 +- setOnlineFlag(online: [Boolean](TopLevel.Boolean.md)): void + - : Set the online status flag of the product. + + **Parameters:** + - online - Online status flag. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### setOnlineFlag(Boolean) - Variant 2 +- setOnlineFlag(online: [Boolean](TopLevel.Boolean.md)): void + - : Set the online status flag of the product for the current site. If current site is not available (i.e. + in case this method is called by a job that runs on organization level) the online status flag is set global, + which can affect all sites. + + In previous versions this method set the online status flag global, instead of site specific. + + + **Parameters:** + - online - Online status flag. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method set the online status flag global, instead of site specific. +::: + +--- + +### setSearchPlacement(Number) - Variant 1 +- setSearchPlacement(placement: [Number](TopLevel.Number.md)): void + - : Set the product's search placement. + + **Parameters:** + - placement - The product's search placement classification. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### setSearchPlacement(Number) - Variant 2 +- setSearchPlacement(placement: [Number](TopLevel.Number.md)): void + - : Set the product's search placement classification in context of the current site. If current site is not + available (i.e. in case this method is called by a job that runs on organization level) the search placement is + set global, which can affect all sites. + + In previous versions this method set the search placement classification global, instead of site specific. + + + **Parameters:** + - placement - The product's search placement classification. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method set the search placement classification global, instead of site specific. +::: + +--- + +### setSearchRank(Number) - Variant 1 +- setSearchRank(rank: [Number](TopLevel.Number.md)): void + - : Set the product's search rank. + + **Parameters:** + - rank - The product's search rank. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### setSearchRank(Number) - Variant 2 +- setSearchRank(rank: [Number](TopLevel.Number.md)): void + - : Set the product's search rank in context of the current site. If current site is not available (i.e. in case this + method is called by a job that runs on organization level) the search rank is set global, which can affect all + sites. + + In previous versions this method set the search rank global, instead of site specific. + + + **Parameters:** + - rank - The product's search rank. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method set the search rank global, instead of site specific. +::: + +--- + +### setSearchableFlag(Boolean) - Variant 1 +- setSearchableFlag(searchable: [Boolean](TopLevel.Boolean.md)): void + - : Set the flag indicating whether the product is searchable or not. + + **Parameters:** + - searchable - The value of the attribute 'searchable'. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### setSearchableFlag(Boolean) - Variant 2 +- setSearchableFlag(searchable: [Boolean](TopLevel.Boolean.md)): void + - : Set the flag indicating whether the product is searchable or not in context of the current site. If current site + is not available (i.e. in case this method is called by a job that runs on organization level) the searchable + flag is set global, which can affect all sites. + + In previous versions this method set the searchable flag global, instead of site specific. + + + **Parameters:** + - searchable - The value of the attribute 'searchable'. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method set the searchable flag global, instead of site specific. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductActiveData.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductActiveData.md new file mode 100644 index 00000000..41407d54 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductActiveData.md @@ -0,0 +1,1244 @@ + +# Class ProductActiveData + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.object.ActiveData](dw.object.ActiveData.md) + - [dw.catalog.ProductActiveData](dw.catalog.ProductActiveData.md) + +Represents the active data for a [Product](dw.catalog.Product.md) in Commerce Cloud Digital. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [availableDate](#availabledate): [Date](TopLevel.Date.md) `(read-only)` | Returns the date the product became available on the site, or `null` if none has been set. | +| [avgGrossMarginPercentDay](#avggrossmarginpercentday): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin percentage of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginPercentMonth](#avggrossmarginpercentmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin percentage of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginPercentWeek](#avggrossmarginpercentweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin percentage of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginPercentYear](#avggrossmarginpercentyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin percentage of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginValueDay](#avggrossmarginvalueday): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin value of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginValueMonth](#avggrossmarginvaluemonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin value of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginValueWeek](#avggrossmarginvalueweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin value of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgGrossMarginValueYear](#avggrossmarginvalueyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the average gross margin value of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgSalesPriceDay](#avgsalespriceday): [Number](TopLevel.Number.md) `(read-only)` | Returns the average sales price for the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [avgSalesPriceMonth](#avgsalespricemonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the average sales price for the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgSalesPriceWeek](#avgsalespriceweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the average sales price for the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [avgSalesPriceYear](#avgsalespriceyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the average sales price for the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [conversionDay](#conversionday): [Number](TopLevel.Number.md) `(read-only)` | Returns the conversion rate of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [conversionMonth](#conversionmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the conversion rate of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [conversionWeek](#conversionweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the conversion rate of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [conversionYear](#conversionyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the conversion rate of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [costPrice](#costprice): [Number](TopLevel.Number.md) `(read-only)` | Returns the cost price for the product for the site, or `null` if none has been set or the value is no longer valid. | +| [daysAvailable](#daysavailable): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of days the product has been available on the site. | +| [impressionsDay](#impressionsday): [Number](TopLevel.Number.md) `(read-only)` | Returns the impressions of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [impressionsMonth](#impressionsmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the impressions of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [impressionsWeek](#impressionsweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the impressions of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [impressionsYear](#impressionsyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the impressions of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [lookToBookRatioDay](#looktobookratioday): [Number](TopLevel.Number.md) `(read-only)` | Returns the look to book ratio of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [lookToBookRatioMonth](#looktobookratiomonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the look to book ratio of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [lookToBookRatioWeek](#looktobookratioweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the look to book ratio of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [lookToBookRatioYear](#looktobookratioyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the look to book ratio of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [ordersDay](#ordersday): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders containing the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [ordersMonth](#ordersmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders containing the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [ordersWeek](#ordersweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders containing the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [ordersYear](#ordersyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders containing the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [returnRate](#returnrate): [Number](TopLevel.Number.md) `(read-only)` | Returns the return rate for the product for the site, or `null` if none has been set or the value is no longer valid. | +| [revenueDay](#revenueday): [Number](TopLevel.Number.md) `(read-only)` | Returns the revenue of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [revenueMonth](#revenuemonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the revenue of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [revenueWeek](#revenueweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the revenue of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [revenueYear](#revenueyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the revenue of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [salesVelocityDay](#salesvelocityday): [Number](TopLevel.Number.md) `(read-only)` | Returns the sales velocity of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [salesVelocityMonth](#salesvelocitymonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the sales velocity of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [salesVelocityWeek](#salesvelocityweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the sales velocity of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [salesVelocityYear](#salesvelocityyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the sales velocity of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [unitsDay](#unitsday): [Number](TopLevel.Number.md) `(read-only)` | Returns the units of the product ordered over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [unitsMonth](#unitsmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the units of the product ordered over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [unitsWeek](#unitsweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the units of the product ordered over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [unitsYear](#unitsyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the units of the product ordered over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [viewsDay](#viewsday): [Number](TopLevel.Number.md) `(read-only)` | Returns the views of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [viewsMonth](#viewsmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the views of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [viewsWeek](#viewsweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the views of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [viewsYear](#viewsyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the views of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAvailableDate](dw.catalog.ProductActiveData.md#getavailabledate)() | Returns the date the product became available on the site, or `null` if none has been set. | +| [getAvgGrossMarginPercentDay](dw.catalog.ProductActiveData.md#getavggrossmarginpercentday)() | Returns the average gross margin percentage of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginPercentMonth](dw.catalog.ProductActiveData.md#getavggrossmarginpercentmonth)() | Returns the average gross margin percentage of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginPercentWeek](dw.catalog.ProductActiveData.md#getavggrossmarginpercentweek)() | Returns the average gross margin percentage of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginPercentYear](dw.catalog.ProductActiveData.md#getavggrossmarginpercentyear)() | Returns the average gross margin percentage of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginValueDay](dw.catalog.ProductActiveData.md#getavggrossmarginvalueday)() | Returns the average gross margin value of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginValueMonth](dw.catalog.ProductActiveData.md#getavggrossmarginvaluemonth)() | Returns the average gross margin value of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginValueWeek](dw.catalog.ProductActiveData.md#getavggrossmarginvalueweek)() | Returns the average gross margin value of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgGrossMarginValueYear](dw.catalog.ProductActiveData.md#getavggrossmarginvalueyear)() | Returns the average gross margin value of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgSalesPriceDay](dw.catalog.ProductActiveData.md#getavgsalespriceday)() | Returns the average sales price for the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgSalesPriceMonth](dw.catalog.ProductActiveData.md#getavgsalespricemonth)() | Returns the average sales price for the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgSalesPriceWeek](dw.catalog.ProductActiveData.md#getavgsalespriceweek)() | Returns the average sales price for the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getAvgSalesPriceYear](dw.catalog.ProductActiveData.md#getavgsalespriceyear)() | Returns the average sales price for the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getConversionDay](dw.catalog.ProductActiveData.md#getconversionday)() | Returns the conversion rate of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getConversionMonth](dw.catalog.ProductActiveData.md#getconversionmonth)() | Returns the conversion rate of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getConversionWeek](dw.catalog.ProductActiveData.md#getconversionweek)() | Returns the conversion rate of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getConversionYear](dw.catalog.ProductActiveData.md#getconversionyear)() | Returns the conversion rate of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getCostPrice](dw.catalog.ProductActiveData.md#getcostprice)() | Returns the cost price for the product for the site, or `null` if none has been set or the value is no longer valid. | +| [getDaysAvailable](dw.catalog.ProductActiveData.md#getdaysavailable)() | Returns the number of days the product has been available on the site. | +| [getImpressionsDay](dw.catalog.ProductActiveData.md#getimpressionsday)() | Returns the impressions of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getImpressionsMonth](dw.catalog.ProductActiveData.md#getimpressionsmonth)() | Returns the impressions of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getImpressionsWeek](dw.catalog.ProductActiveData.md#getimpressionsweek)() | Returns the impressions of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getImpressionsYear](dw.catalog.ProductActiveData.md#getimpressionsyear)() | Returns the impressions of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getLookToBookRatioDay](dw.catalog.ProductActiveData.md#getlooktobookratioday)() | Returns the look to book ratio of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getLookToBookRatioMonth](dw.catalog.ProductActiveData.md#getlooktobookratiomonth)() | Returns the look to book ratio of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getLookToBookRatioWeek](dw.catalog.ProductActiveData.md#getlooktobookratioweek)() | Returns the look to book ratio of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getLookToBookRatioYear](dw.catalog.ProductActiveData.md#getlooktobookratioyear)() | Returns the look to book ratio of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getOrdersDay](dw.catalog.ProductActiveData.md#getordersday)() | Returns the number of orders containing the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getOrdersMonth](dw.catalog.ProductActiveData.md#getordersmonth)() | Returns the number of orders containing the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getOrdersWeek](dw.catalog.ProductActiveData.md#getordersweek)() | Returns the number of orders containing the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getOrdersYear](dw.catalog.ProductActiveData.md#getordersyear)() | Returns the number of orders containing the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getReturnRate](dw.catalog.ProductActiveData.md#getreturnrate)() | Returns the return rate for the product for the site, or `null` if none has been set or the value is no longer valid. | +| [getRevenueDay](dw.catalog.ProductActiveData.md#getrevenueday)() | Returns the revenue of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getRevenueMonth](dw.catalog.ProductActiveData.md#getrevenuemonth)() | Returns the revenue of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getRevenueWeek](dw.catalog.ProductActiveData.md#getrevenueweek)() | Returns the revenue of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getRevenueYear](dw.catalog.ProductActiveData.md#getrevenueyear)() | Returns the revenue of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getSalesVelocityDay](dw.catalog.ProductActiveData.md#getsalesvelocityday)() | Returns the sales velocity of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getSalesVelocityMonth](dw.catalog.ProductActiveData.md#getsalesvelocitymonth)() | Returns the sales velocity of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getSalesVelocityWeek](dw.catalog.ProductActiveData.md#getsalesvelocityweek)() | Returns the sales velocity of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getSalesVelocityYear](dw.catalog.ProductActiveData.md#getsalesvelocityyear)() | Returns the sales velocity of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getUnitsDay](dw.catalog.ProductActiveData.md#getunitsday)() | Returns the units of the product ordered over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getUnitsMonth](dw.catalog.ProductActiveData.md#getunitsmonth)() | Returns the units of the product ordered over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getUnitsWeek](dw.catalog.ProductActiveData.md#getunitsweek)() | Returns the units of the product ordered over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getUnitsYear](dw.catalog.ProductActiveData.md#getunitsyear)() | Returns the units of the product ordered over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getViewsDay](dw.catalog.ProductActiveData.md#getviewsday)() | Returns the views of the product, over the most recent day for the site, or `null` if none has been set or the value is no longer valid. | +| [getViewsMonth](dw.catalog.ProductActiveData.md#getviewsmonth)() | Returns the views of the product, over the most recent 30 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getViewsWeek](dw.catalog.ProductActiveData.md#getviewsweek)() | Returns the views of the product, over the most recent 7 days for the site, or `null` if none has been set or the value is no longer valid. | +| [getViewsYear](dw.catalog.ProductActiveData.md#getviewsyear)() | Returns the views of the product, over the most recent 365 days for the site, or `null` if none has been set or the value is no longer valid. | + +### Methods inherited from class ActiveData + +[getCustom](dw.object.ActiveData.md#getcustom), [isEmpty](dw.object.ActiveData.md#isempty) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### availableDate +- availableDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date the product became available on the site, or + `null` if none has been set. + + + +--- + +### avgGrossMarginPercentDay +- avgGrossMarginPercentDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin percentage of the product, + over the most recent day for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginPercentMonth +- avgGrossMarginPercentMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin percentage of the product, + over the most recent 30 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginPercentWeek +- avgGrossMarginPercentWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin percentage of the product, + over the most recent 7 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginPercentYear +- avgGrossMarginPercentYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin percentage of the product, + over the most recent 365 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginValueDay +- avgGrossMarginValueDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin value of the product, + over the most recent day for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginValueMonth +- avgGrossMarginValueMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin value of the product, + over the most recent 30 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginValueWeek +- avgGrossMarginValueWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin value of the product, + over the most recent 7 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgGrossMarginValueYear +- avgGrossMarginValueYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average gross margin value of the product, + over the most recent 365 days for the site, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### avgSalesPriceDay +- avgSalesPriceDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average sales price for the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### avgSalesPriceMonth +- avgSalesPriceMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average sales price for the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### avgSalesPriceWeek +- avgSalesPriceWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average sales price for the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### avgSalesPriceYear +- avgSalesPriceYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average sales price for the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### conversionDay +- conversionDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the conversion rate of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### conversionMonth +- conversionMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the conversion rate of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### conversionWeek +- conversionWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the conversion rate of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### conversionYear +- conversionYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the conversion rate of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### costPrice +- costPrice: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the cost price for the product for the site, + or `null` if none has been set or the value is no longer valid. + + + +--- + +### daysAvailable +- daysAvailable: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of days the product has been available on the site. + The number is calculated based on the current date and the date the + product became available on the site, or if that date has not been set, + the date the product was created in the system. + + + **See Also:** + - [getAvailableDate()](dw.catalog.ProductActiveData.md#getavailabledate) + + +--- + +### impressionsDay +- impressionsDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the impressions of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### impressionsMonth +- impressionsMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the impressions of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### impressionsWeek +- impressionsWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the impressions of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### impressionsYear +- impressionsYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the impressions of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### lookToBookRatioDay +- lookToBookRatioDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the look to book ratio of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### lookToBookRatioMonth +- lookToBookRatioMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the look to book ratio of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### lookToBookRatioWeek +- lookToBookRatioWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the look to book ratio of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### lookToBookRatioYear +- lookToBookRatioYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the look to book ratio of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### ordersDay +- ordersDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders containing the product, over the most + recent day for the site, or `null` if none has been set + or the value is no longer valid. + + + +--- + +### ordersMonth +- ordersMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders containing the product, over the most + recent 30 days for the site, or `null` if none has been set + or the value is no longer valid. + + + +--- + +### ordersWeek +- ordersWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders containing the product, over the most + recent 7 days for the site, or `null` if none has been set + or the value is no longer valid. + + + +--- + +### ordersYear +- ordersYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders containing the product, over the most + recent 365 days for the site, or `null` if none has been set + or the value is no longer valid. + + + +--- + +### returnRate +- returnRate: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the return rate for the product for the site, + or `null` if none has been set or the value is no longer valid. + + + +--- + +### revenueDay +- revenueDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the revenue of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### revenueMonth +- revenueMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the revenue of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### revenueWeek +- revenueWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the revenue of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### revenueYear +- revenueYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the revenue of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### salesVelocityDay +- salesVelocityDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the sales velocity of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### salesVelocityMonth +- salesVelocityMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the sales velocity of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### salesVelocityWeek +- salesVelocityWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the sales velocity of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### salesVelocityYear +- salesVelocityYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the sales velocity of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### unitsDay +- unitsDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the units of the product ordered over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### unitsMonth +- unitsMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the units of the product ordered over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### unitsWeek +- unitsWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the units of the product ordered over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### unitsYear +- unitsYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the units of the product ordered over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### viewsDay +- viewsDay: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the views of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### viewsMonth +- viewsMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the views of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### viewsWeek +- viewsWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the views of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### viewsYear +- viewsYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the views of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + +--- + +## Method Details + +### getAvailableDate() +- getAvailableDate(): [Date](TopLevel.Date.md) + - : Returns the date the product became available on the site, or + `null` if none has been set. + + + **Returns:** + - the date the product became available. + + +--- + +### getAvgGrossMarginPercentDay() +- getAvgGrossMarginPercentDay(): [Number](TopLevel.Number.md) + - : Returns the average gross margin percentage of the product, + over the most recent day for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin percentage over the last day. + + +--- + +### getAvgGrossMarginPercentMonth() +- getAvgGrossMarginPercentMonth(): [Number](TopLevel.Number.md) + - : Returns the average gross margin percentage of the product, + over the most recent 30 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin percentage over the last 30 days. + + +--- + +### getAvgGrossMarginPercentWeek() +- getAvgGrossMarginPercentWeek(): [Number](TopLevel.Number.md) + - : Returns the average gross margin percentage of the product, + over the most recent 7 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin percentage over the last 7 days. + + +--- + +### getAvgGrossMarginPercentYear() +- getAvgGrossMarginPercentYear(): [Number](TopLevel.Number.md) + - : Returns the average gross margin percentage of the product, + over the most recent 365 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin percentage over the last 365 days. + + +--- + +### getAvgGrossMarginValueDay() +- getAvgGrossMarginValueDay(): [Number](TopLevel.Number.md) + - : Returns the average gross margin value of the product, + over the most recent day for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin value over the last day. + + +--- + +### getAvgGrossMarginValueMonth() +- getAvgGrossMarginValueMonth(): [Number](TopLevel.Number.md) + - : Returns the average gross margin value of the product, + over the most recent 30 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin value over the last 30 days. + + +--- + +### getAvgGrossMarginValueWeek() +- getAvgGrossMarginValueWeek(): [Number](TopLevel.Number.md) + - : Returns the average gross margin value of the product, + over the most recent 7 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin value over the last 7 days. + + +--- + +### getAvgGrossMarginValueYear() +- getAvgGrossMarginValueYear(): [Number](TopLevel.Number.md) + - : Returns the average gross margin value of the product, + over the most recent 365 days for the site, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average gross margin value over the last 365 days. + + +--- + +### getAvgSalesPriceDay() +- getAvgSalesPriceDay(): [Number](TopLevel.Number.md) + - : Returns the average sales price for the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the average sales price over the last day. + + +--- + +### getAvgSalesPriceMonth() +- getAvgSalesPriceMonth(): [Number](TopLevel.Number.md) + - : Returns the average sales price for the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the average sales price over the last 30 days. + + +--- + +### getAvgSalesPriceWeek() +- getAvgSalesPriceWeek(): [Number](TopLevel.Number.md) + - : Returns the average sales price for the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the average sales price over the last 7 days. + + +--- + +### getAvgSalesPriceYear() +- getAvgSalesPriceYear(): [Number](TopLevel.Number.md) + - : Returns the average sales price for the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the average sales price over the last 365 days. + + +--- + +### getConversionDay() +- getConversionDay(): [Number](TopLevel.Number.md) + - : Returns the conversion rate of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the conversion over the last day. + + +--- + +### getConversionMonth() +- getConversionMonth(): [Number](TopLevel.Number.md) + - : Returns the conversion rate of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the conversion over the last 30 days. + + +--- + +### getConversionWeek() +- getConversionWeek(): [Number](TopLevel.Number.md) + - : Returns the conversion rate of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the conversion over the last 7 days. + + +--- + +### getConversionYear() +- getConversionYear(): [Number](TopLevel.Number.md) + - : Returns the conversion rate of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the conversion over the last 365 days. + + +--- + +### getCostPrice() +- getCostPrice(): [Number](TopLevel.Number.md) + - : Returns the cost price for the product for the site, + or `null` if none has been set or the value is no longer valid. + + + **Returns:** + - the cost price. + + +--- + +### getDaysAvailable() +- getDaysAvailable(): [Number](TopLevel.Number.md) + - : Returns the number of days the product has been available on the site. + The number is calculated based on the current date and the date the + product became available on the site, or if that date has not been set, + the date the product was created in the system. + + + **Returns:** + - the age in days. + + **See Also:** + - [getAvailableDate()](dw.catalog.ProductActiveData.md#getavailabledate) + + +--- + +### getImpressionsDay() +- getImpressionsDay(): [Number](TopLevel.Number.md) + - : Returns the impressions of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the impressions over the last day. + + +--- + +### getImpressionsMonth() +- getImpressionsMonth(): [Number](TopLevel.Number.md) + - : Returns the impressions of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the impressions over the last 30 days. + + +--- + +### getImpressionsWeek() +- getImpressionsWeek(): [Number](TopLevel.Number.md) + - : Returns the impressions of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the impressions over the last 7 days. + + +--- + +### getImpressionsYear() +- getImpressionsYear(): [Number](TopLevel.Number.md) + - : Returns the impressions of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the impressions over the last 365 days. + + +--- + +### getLookToBookRatioDay() +- getLookToBookRatioDay(): [Number](TopLevel.Number.md) + - : Returns the look to book ratio of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the look to book ratio over the last day. + + +--- + +### getLookToBookRatioMonth() +- getLookToBookRatioMonth(): [Number](TopLevel.Number.md) + - : Returns the look to book ratio of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the look to book ratio over the last 30 days. + + +--- + +### getLookToBookRatioWeek() +- getLookToBookRatioWeek(): [Number](TopLevel.Number.md) + - : Returns the look to book ratio of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the look to book ratio over the last 7 days. + + +--- + +### getLookToBookRatioYear() +- getLookToBookRatioYear(): [Number](TopLevel.Number.md) + - : Returns the look to book ratio of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the look to book ratio over the last 365 days. + + +--- + +### getOrdersDay() +- getOrdersDay(): [Number](TopLevel.Number.md) + - : Returns the number of orders containing the product, over the most + recent day for the site, or `null` if none has been set + or the value is no longer valid. + + + **Returns:** + - the orders over the last day. + + +--- + +### getOrdersMonth() +- getOrdersMonth(): [Number](TopLevel.Number.md) + - : Returns the number of orders containing the product, over the most + recent 30 days for the site, or `null` if none has been set + or the value is no longer valid. + + + **Returns:** + - the orders over the last 30 days. + + +--- + +### getOrdersWeek() +- getOrdersWeek(): [Number](TopLevel.Number.md) + - : Returns the number of orders containing the product, over the most + recent 7 days for the site, or `null` if none has been set + or the value is no longer valid. + + + **Returns:** + - the orders over the last 7 days. + + +--- + +### getOrdersYear() +- getOrdersYear(): [Number](TopLevel.Number.md) + - : Returns the number of orders containing the product, over the most + recent 365 days for the site, or `null` if none has been set + or the value is no longer valid. + + + **Returns:** + - the orders over the last 365 days. + + +--- + +### getReturnRate() +- getReturnRate(): [Number](TopLevel.Number.md) + - : Returns the return rate for the product for the site, + or `null` if none has been set or the value is no longer valid. + + + **Returns:** + - the return rate. + + +--- + +### getRevenueDay() +- getRevenueDay(): [Number](TopLevel.Number.md) + - : Returns the revenue of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the revenue over the last day. + + +--- + +### getRevenueMonth() +- getRevenueMonth(): [Number](TopLevel.Number.md) + - : Returns the revenue of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the revenue over the last 30 days. + + +--- + +### getRevenueWeek() +- getRevenueWeek(): [Number](TopLevel.Number.md) + - : Returns the revenue of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the revenue over the last 7 days. + + +--- + +### getRevenueYear() +- getRevenueYear(): [Number](TopLevel.Number.md) + - : Returns the revenue of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the revenue over the last 365 days. + + +--- + +### getSalesVelocityDay() +- getSalesVelocityDay(): [Number](TopLevel.Number.md) + - : Returns the sales velocity of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the sales velocity over the last day. + + +--- + +### getSalesVelocityMonth() +- getSalesVelocityMonth(): [Number](TopLevel.Number.md) + - : Returns the sales velocity of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the sales velocity over the last 30 days. + + +--- + +### getSalesVelocityWeek() +- getSalesVelocityWeek(): [Number](TopLevel.Number.md) + - : Returns the sales velocity of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the sales velocity over the last 7 days. + + +--- + +### getSalesVelocityYear() +- getSalesVelocityYear(): [Number](TopLevel.Number.md) + - : Returns the sales velocity of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the sales velocity over the last 365 days. + + +--- + +### getUnitsDay() +- getUnitsDay(): [Number](TopLevel.Number.md) + - : Returns the units of the product ordered over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the units over the last day. + + +--- + +### getUnitsMonth() +- getUnitsMonth(): [Number](TopLevel.Number.md) + - : Returns the units of the product ordered over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the units over the last 30 days. + + +--- + +### getUnitsWeek() +- getUnitsWeek(): [Number](TopLevel.Number.md) + - : Returns the units of the product ordered over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the units over the last 7 days. + + +--- + +### getUnitsYear() +- getUnitsYear(): [Number](TopLevel.Number.md) + - : Returns the units of the product ordered over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the units over the last 365 days. + + +--- + +### getViewsDay() +- getViewsDay(): [Number](TopLevel.Number.md) + - : Returns the views of the product, over the most recent day + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the views over the last day. + + +--- + +### getViewsMonth() +- getViewsMonth(): [Number](TopLevel.Number.md) + - : Returns the views of the product, over the most recent 30 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the views over the last 30 days. + + +--- + +### getViewsWeek() +- getViewsWeek(): [Number](TopLevel.Number.md) + - : Returns the views of the product, over the most recent 7 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the views over the last 7 days. + + +--- + +### getViewsYear() +- getViewsYear(): [Number](TopLevel.Number.md) + - : Returns the views of the product, over the most recent 365 days + for the site, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the views over the last 365 days. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAttributeModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAttributeModel.md new file mode 100644 index 00000000..eeb03fcd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAttributeModel.md @@ -0,0 +1,409 @@ + +# Class ProductAttributeModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductAttributeModel](dw.catalog.ProductAttributeModel.md) + +Class representing the complete attribute model for products in the system. +An instance of this class provides methods to access the attribute +definitions and groups for the system object type 'Product' and perhaps +additional information depending on how the instance is obtained. +A ProductAttributeModel can be obtained in one of three ways: + + +- **[ProductAttributeModel()](dw.catalog.ProductAttributeModel.md#productattributemodel):**When the no-arg constructor is used the model represents: + - the attribute groups of the system object type 'Product' (i.e. the global product attribute groups) and their bound attributes + +- **[Category.getProductAttributeModel()](dw.catalog.Category.md#getproductattributemodel):**When the attribute model for a Category is retrieved, the model represents: + - the global product attribute groups + - product attribute groups of the calling category + - product attribute groups of any parent categories of the calling category + +- **[Product.getAttributeModel()](dw.catalog.Product.md#getattributemodel):**When the attribute model for a Product is retrieved, the model represents: + - the global product attribute groups + - product attribute groups of the product's classification category + - product attribute groups of any parent categories of the product's classification category +In this case, the model additionally provides access to the attribute values +of the product. If the product lacks a classification category, then only +the global product attribute group is considered by the model. + + +The ProductAttributeModel provides a generic way to display the attribute +values of a product on a product detail page organized into appropriate +visual groups. This is typically done as follows: + + +- On the product detail page, call [Product.getAttributeModel()](dw.catalog.Product.md#getattributemodel)to get the attribute model for the product. +- Call [getVisibleAttributeGroups()](dw.catalog.ProductAttributeModel.md#getvisibleattributegroups)to get the groups that are appropriate for this product and all other products assigned to the same classification category. +- Iterate the groups, and display each as a "group" in the UI. +- Call [getVisibleAttributeDefinitions(ObjectAttributeGroup)](dw.catalog.ProductAttributeModel.md#getvisibleattributedefinitionsobjectattributegroup)for each group. Iterate and display the attribute names using [ObjectAttributeDefinition.getDisplayName()](dw.object.ObjectAttributeDefinition.md#getdisplayname). +- For each attribute, get the product's display value(s) for that attribute, using `getDisplayValue()`. This might require custom display logic based on the type of attribute (strings, dates, multi-value attributes, etc). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [attributeGroups](#attributegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted collection of attribute groups of this model. | +| [orderRequiredAttributeDefinitions](#orderrequiredattributedefinitions): [Collection](dw.util.Collection.md) `(read-only)` | Returns an unsorted collection of attribute definitions marked as order-required. | +| [visibleAttributeGroups](#visibleattributegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted collection of visible attribute groups of this model. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ProductAttributeModel](#productattributemodel)() | Constructs a product attribute model that is not based on a product nor a category. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeDefinition](dw.catalog.ProductAttributeModel.md#getattributedefinitionstring)([String](TopLevel.String.md)) | Returns the attribute definition with the given id from the product attribute model. | +| [getAttributeDefinitions](dw.catalog.ProductAttributeModel.md#getattributedefinitionsobjectattributegroup)([ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md)) | Returns a sorted collection of attribute definitions for the given attribute group. | +| [getAttributeGroup](dw.catalog.ProductAttributeModel.md#getattributegroupstring)([String](TopLevel.String.md)) | Returns the attribute group with the given id from the product attribute model. | +| [getAttributeGroups](dw.catalog.ProductAttributeModel.md#getattributegroups)() | Returns a sorted collection of attribute groups of this model. | +| [getDisplayValue](dw.catalog.ProductAttributeModel.md#getdisplayvalueobjectattributedefinition---variant-1)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)) | Returns the value that the underlying product defines for the given attribute definition in the current locale. | +| [getDisplayValue](dw.catalog.ProductAttributeModel.md#getdisplayvalueobjectattributedefinition---variant-2)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)) | Returns the value that the underlying product defines for the given attribute definition in the current locale. | +| [getOrderRequiredAttributeDefinitions](dw.catalog.ProductAttributeModel.md#getorderrequiredattributedefinitions)() | Returns an unsorted collection of attribute definitions marked as order-required. | +| [getValue](dw.catalog.ProductAttributeModel.md#getvalueobjectattributedefinition---variant-1)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)) | Returns the attribute value for the specified attribute definition. | +| [getValue](dw.catalog.ProductAttributeModel.md#getvalueobjectattributedefinition---variant-2)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)) | Returns the attribute value for the specified attribute definition. | +| [getVisibleAttributeDefinitions](dw.catalog.ProductAttributeModel.md#getvisibleattributedefinitionsobjectattributegroup)([ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md)) | Returns a sorted collection of all visible attribute definitions for the given attribute group. | +| [getVisibleAttributeGroups](dw.catalog.ProductAttributeModel.md#getvisibleattributegroups)() | Returns a sorted collection of visible attribute groups of this model. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### attributeGroups +- attributeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted collection of attribute groups of this model. The groups + returned depends on how this model is constructed and what it represents. + (See class-level documentation for details). + + + The collection of returned groups is sorted first by scope and secondly + by explicit sort order. Global groups always appear before + category-specific groups in the list. Groups of parent categories always + appear before groups belonging to subcategories. At each scope, groups + have an explicit sort order which can be managed within the Business + Manager. + + + When there are multiple attribute groups with the same ID, the following + rules apply: + + + - If this model represents the global product attribute group only (e.g. the no-arg constructor was used), duplicates cannot occur since only one group can be defined with a given ID at that scope. + - If this model is associated with specific categories (e.g. it is constructed from a product with a classification category), then a category product attribute group might have the same ID as a global product attribute group. In this case, the category group overrides the global one. + - If a category and one of its ancestor categories both define a product attribute group with the same ID, the sub-category group overrides the parent group. + + + As a result of these rules, this method will never return two attribute + groups with the same ID. + + + +--- + +### orderRequiredAttributeDefinitions +- orderRequiredAttributeDefinitions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns an unsorted collection of attribute definitions marked as + order-required. Order-required attributes are usually copied into order + line items. + + + The returned attribute definitions are sorted according to the explicit + sort order defined for the attributes in the group. This is managed by + merchant in the Business Manager. + + + +--- + +### visibleAttributeGroups +- visibleAttributeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted collection of visible attribute groups of this model. + This method is similar to [getAttributeGroups()](dw.catalog.ProductAttributeModel.md#getattributegroups) but only includes + attribute groups containing at least one attribute definition that is + visible. See + [getVisibleAttributeDefinitions(ObjectAttributeGroup)](dw.catalog.ProductAttributeModel.md#getvisibleattributedefinitionsobjectattributegroup). + + + +--- + +## Constructor Details + +### ProductAttributeModel() +- ProductAttributeModel() + - : Constructs a product attribute model that is not based on a product nor + a category. Therefore, the model only describes the product attributes + globally defined for the system object type 'Product'. + + + +--- + +## Method Details + +### getAttributeDefinition(String) +- getAttributeDefinition(id: [String](TopLevel.String.md)): [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) + - : Returns the attribute definition with the given id from the product attribute + model. If attribute definition does not exist, null is returned. + + + **Parameters:** + - id - the identifier of the attribute definition. + + **Returns:** + - attribute definition or null if not exist + + +--- + +### getAttributeDefinitions(ObjectAttributeGroup) +- getAttributeDefinitions(group: [ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of attribute definitions for the given attribute + group. If no attribute definition exist for the group, an empty collection + is returned. + + + The returned attribute definitions are sorted according to the explicit + sort order defined for the attributes in the group. This is managed + by merchant in the Business Manager. + + + **Parameters:** + - group - the group whose attribute definitions are returned. + + **Returns:** + - a sorted collection of ObjectAttributeDefinition instances. + + +--- + +### getAttributeGroup(String) +- getAttributeGroup(id: [String](TopLevel.String.md)): [ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md) + - : Returns the attribute group with the given id from the product attribute + model. If attribute group does not exist, null is returned. + + + **Parameters:** + - id - the attribute group identifier. + + **Returns:** + - the attribute group or null if not exist + + +--- + +### getAttributeGroups() +- getAttributeGroups(): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of attribute groups of this model. The groups + returned depends on how this model is constructed and what it represents. + (See class-level documentation for details). + + + The collection of returned groups is sorted first by scope and secondly + by explicit sort order. Global groups always appear before + category-specific groups in the list. Groups of parent categories always + appear before groups belonging to subcategories. At each scope, groups + have an explicit sort order which can be managed within the Business + Manager. + + + When there are multiple attribute groups with the same ID, the following + rules apply: + + + - If this model represents the global product attribute group only (e.g. the no-arg constructor was used), duplicates cannot occur since only one group can be defined with a given ID at that scope. + - If this model is associated with specific categories (e.g. it is constructed from a product with a classification category), then a category product attribute group might have the same ID as a global product attribute group. In this case, the category group overrides the global one. + - If a category and one of its ancestor categories both define a product attribute group with the same ID, the sub-category group overrides the parent group. + + + As a result of these rules, this method will never return two attribute + groups with the same ID. + + + **Returns:** + - collection of all attribute groups. + + +--- + +### getDisplayValue(ObjectAttributeDefinition) - Variant 1 +- getDisplayValue(definition: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Object](TopLevel.Object.md) + - : Returns the value that the underlying product defines for the given + attribute definition in the current locale. In case the attribute + definition defines localized attribute values, the product's value is + used as an id to find the localized display value. + + + **Parameters:** + - definition - the definition to use. + + **Returns:** + - The localized product attribute display value. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### getDisplayValue(ObjectAttributeDefinition) - Variant 2 +- getDisplayValue(definition: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Object](TopLevel.Object.md) + - : Returns the value that the underlying product defines for the given + attribute definition in the current locale. In case the attribute definition + defines localized attribute values, the product's value is used as an id + to find the localized display value. + + In case of an Image attribute this method returns a MediaFile instance. + In previous versions this method returned a String with the image path. + In case of an HTML attribute this method returns a MarkupText instance. + In previous versions this method returned a String with the HTML source. + + + **Parameters:** + - definition - the definition to use. + + **Returns:** + - The localized product attribute display value. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method returned a String with the image path or a String with the HTML source +::: + +--- + +### getOrderRequiredAttributeDefinitions() +- getOrderRequiredAttributeDefinitions(): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection of attribute definitions marked as + order-required. Order-required attributes are usually copied into order + line items. + + + The returned attribute definitions are sorted according to the explicit + sort order defined for the attributes in the group. This is managed by + merchant in the Business Manager. + + + **Returns:** + - a collection of order-required ObjectAttributeDefinition + instances. + + + +--- + +### getValue(ObjectAttributeDefinition) - Variant 1 +- getValue(definition: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Object](TopLevel.Object.md) + - : Returns the attribute value for the specified attribute + definition. If the product does not define a value, null is returned. + + + Note: this method may only be used where the attribute model was created for + a specific product; otherwise it will always return null. + + + If the attribute is localized, the value for the current session locale + is returned. + + + **Parameters:** + - definition - the attribute definition to use when locating and returning the value. + + **Returns:** + - value the value associated with the object attribute definition. + + **API Version:** +:::note +No longer available as of version 10.6. +::: + +--- + +### getValue(ObjectAttributeDefinition) - Variant 2 +- getValue(definition: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Object](TopLevel.Object.md) + - : Returns the attribute value for the specified attribute definition. If + the product does not define a value, null is returned. + + + Note: this method may only be used where the attribute model was created + for a specific product; otherwise it will always return null. + + + If the attribute is localized, the value for the current session locale + is returned. + + + In case of an Image attribute this method returns a MediaFile instance. + In previous versions this method returned a String with the image path. + In case of an HTML attribute this method returns a MarkupText instance. + In previous versions this method returned a String with the HTML source. + + + **Parameters:** + - definition - the attribute definition to use when locating and returning the value. + + **Returns:** + - value the value associated with the object attribute definition. + + **API Version:** +:::note +Available from version 10.6. +In prior versions this method returned a String with the image path or a String with the HTML source. +::: + +--- + +### getVisibleAttributeDefinitions(ObjectAttributeGroup) +- getVisibleAttributeDefinitions(group: [ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of all visible attribute definitions for the + given attribute group. If no visible attribute definition exist for the + group, an empty collection is returned. + + + An attribute definition is considered visible if is marked as visible. If + the product attribute model is created for a specific product, the + product must also define a value for the attribute definition; else the + attribute definition is considered as invisible. + + + The returned attribute definitions are sorted according to the explicit + sort order defined for the attributes in the group. This is managed by + merchant in the Business Manager. + + + **Parameters:** + - group - the group whose visible attribute definitions are returned. + + **Returns:** + - a sorted collection of visible ObjectAttributeDefinition + instances. + + + +--- + +### getVisibleAttributeGroups() +- getVisibleAttributeGroups(): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of visible attribute groups of this model. + This method is similar to [getAttributeGroups()](dw.catalog.ProductAttributeModel.md#getattributegroups) but only includes + attribute groups containing at least one attribute definition that is + visible. See + [getVisibleAttributeDefinitions(ObjectAttributeGroup)](dw.catalog.ProductAttributeModel.md#getvisibleattributedefinitionsobjectattributegroup). + + + **Returns:** + - sorted collection of visible ObjectAttributeGroup instances. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityLevels.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityLevels.md new file mode 100644 index 00000000..17c68573 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityLevels.md @@ -0,0 +1,125 @@ + +# Class ProductAvailabilityLevels + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md) + +Encapsulates the quantity of items available for each availability status. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [backorder](#backorder): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the backorder quantity. | +| [count](#count): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of attributes that contain non-zero quantities. | +| [inStock](#instock): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity in stock. | +| [notAvailable](#notavailable): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity that is not available. | +| [preorder](#preorder): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the pre-order quantity. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBackorder](dw.catalog.ProductAvailabilityLevels.md#getbackorder)() | Returns the backorder quantity. | +| [getCount](dw.catalog.ProductAvailabilityLevels.md#getcount)() | Returns the number of attributes that contain non-zero quantities. | +| [getInStock](dw.catalog.ProductAvailabilityLevels.md#getinstock)() | Returns the quantity in stock. | +| [getNotAvailable](dw.catalog.ProductAvailabilityLevels.md#getnotavailable)() | Returns the quantity that is not available. | +| [getPreorder](dw.catalog.ProductAvailabilityLevels.md#getpreorder)() | Returns the pre-order quantity. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### backorder +- backorder: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the backorder quantity. + + +--- + +### count +- count: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of attributes that contain non-zero quantities. + + +--- + +### inStock +- inStock: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity in stock. + + +--- + +### notAvailable +- notAvailable: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity that is not available. + + +--- + +### preorder +- preorder: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the pre-order quantity. + + +--- + +## Method Details + +### getBackorder() +- getBackorder(): [Quantity](dw.value.Quantity.md) + - : Returns the backorder quantity. + + **Returns:** + - the backorder quantity. + + +--- + +### getCount() +- getCount(): [Number](TopLevel.Number.md) + - : Returns the number of attributes that contain non-zero quantities. + + **Returns:** + - the number of attributes that contain non-zero quantities. + + +--- + +### getInStock() +- getInStock(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity in stock. + + **Returns:** + - the quantity in stock. + + +--- + +### getNotAvailable() +- getNotAvailable(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity that is not available. + + **Returns:** + - the quantity that is not available. + + +--- + +### getPreorder() +- getPreorder(): [Quantity](dw.value.Quantity.md) + - : Returns the pre-order quantity. + + **Returns:** + - the pre-order quantity. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityModel.md new file mode 100644 index 00000000..a371d9ec --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductAvailabilityModel.md @@ -0,0 +1,516 @@ + +# Class ProductAvailabilityModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) + +The ProductAvailabilityModel provides methods for retrieving all information +on availability of a single product. + + + +When using Omnichannel Inventory (OCI): + +- OCI supports backorders, but does not support preorders or perpetual availability. OCI refers to expected restocks as Future inventory. +- OCI uses an eventual consistency model with asynchronous inventory data updates. Your code must not assume that inventory-affecting actions, such as placing orders, will immediately change inventory levels. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [AVAILABILITY_STATUS_BACKORDER](#availability_status_backorder): [String](TopLevel.String.md) = "BACKORDER" | Indicates that the product stock has run out, but will be replenished, and is therefore available for ordering. | +| [AVAILABILITY_STATUS_IN_STOCK](#availability_status_in_stock): [String](TopLevel.String.md) = "IN_STOCK" | Indicates that the product is in stock and available for ordering. | +| [AVAILABILITY_STATUS_NOT_AVAILABLE](#availability_status_not_available): [String](TopLevel.String.md) = "NOT_AVAILABLE" | Indicates that the product is not currently available for ordering. | +| [AVAILABILITY_STATUS_PREORDER](#availability_status_preorder): [String](TopLevel.String.md) = "PREORDER" | Indicates that the product is not yet in stock but is available for ordering. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [SKUCoverage](#skucoverage): [Number](TopLevel.Number.md) `(read-only)` | Returns the SKU coverage of the product. | +| [availability](#availability): [Number](TopLevel.Number.md) `(read-only)` | Returns the availability of the product, which roughly defined is the ratio of the original stock that is still available to sell. | +| [availabilityStatus](#availabilitystatus): [String](TopLevel.String.md) `(read-only)` | Returns the availability-status for the minimum-orderable-quantity (MOQ) of the product. | +| [inStock](#instock): [Boolean](TopLevel.Boolean.md) `(read-only)` | Convenience method for [isInStock(Number)](dw.catalog.ProductAvailabilityModel.md#isinstocknumber). | +| [inventoryRecord](#inventoryrecord): [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) `(read-only)` | Returns the ProductInventoryRecord for the Product associated with this model. | +| [orderable](#orderable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Convenience method for [isOrderable(Number)](dw.catalog.ProductAvailabilityModel.md#isorderablenumber). | +| [timeToOutOfStock](#timetooutofstock): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of hours before the product is expected to go out of stock. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAvailability](dw.catalog.ProductAvailabilityModel.md#getavailability)() | Returns the availability of the product, which roughly defined is the ratio of the original stock that is still available to sell. | +| [getAvailabilityLevels](dw.catalog.ProductAvailabilityModel.md#getavailabilitylevelsnumber)([Number](TopLevel.Number.md)) |

Returns an instance of [ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md), where each available quantity represents a part of the input quantity. | +| [getAvailabilityStatus](dw.catalog.ProductAvailabilityModel.md#getavailabilitystatus)() | Returns the availability-status for the minimum-orderable-quantity (MOQ) of the product. | +| [getInventoryRecord](dw.catalog.ProductAvailabilityModel.md#getinventoryrecord)() | Returns the ProductInventoryRecord for the Product associated with this model. | +| [getSKUCoverage](dw.catalog.ProductAvailabilityModel.md#getskucoverage)() | Returns the SKU coverage of the product. | +| [getTimeToOutOfStock](dw.catalog.ProductAvailabilityModel.md#gettimetooutofstock)() | Returns the number of hours before the product is expected to go out of stock. | +| [isInStock](dw.catalog.ProductAvailabilityModel.md#isinstock)() | Convenience method for [isInStock(Number)](dw.catalog.ProductAvailabilityModel.md#isinstocknumber). | +| [isInStock](dw.catalog.ProductAvailabilityModel.md#isinstocknumber)([Number](TopLevel.Number.md)) | Returns true if the Product is in-stock in the given quantity. | +| [isOrderable](dw.catalog.ProductAvailabilityModel.md#isorderable)() | Convenience method for [isOrderable(Number)](dw.catalog.ProductAvailabilityModel.md#isorderablenumber). | +| [isOrderable](dw.catalog.ProductAvailabilityModel.md#isorderablenumber)([Number](TopLevel.Number.md)) | Returns true if the Product is currently online (based on its online flag and online dates) and the specified quantity does not exceed the quantity available for sale, and returns false otherwise. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### AVAILABILITY_STATUS_BACKORDER + +- AVAILABILITY_STATUS_BACKORDER: [String](TopLevel.String.md) = "BACKORDER" + - : Indicates that the product stock has run out, but will be replenished, and is therefore available for ordering. + + +--- + +### AVAILABILITY_STATUS_IN_STOCK + +- AVAILABILITY_STATUS_IN_STOCK: [String](TopLevel.String.md) = "IN_STOCK" + - : Indicates that the product is in stock and available for ordering. + + +--- + +### AVAILABILITY_STATUS_NOT_AVAILABLE + +- AVAILABILITY_STATUS_NOT_AVAILABLE: [String](TopLevel.String.md) = "NOT_AVAILABLE" + - : Indicates that the product is not currently available for ordering. + + +--- + +### AVAILABILITY_STATUS_PREORDER + +- AVAILABILITY_STATUS_PREORDER: [String](TopLevel.String.md) = "PREORDER" + - : Indicates that the product is not yet in stock but is available for ordering. + + +--- + +## Property Details + +### SKUCoverage +- SKUCoverage: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the SKU coverage of the product. The basic formula for a + master product is the ratio of online variations that are in stock + to the total number of online variations. The following specific rules + apply for standard products: + + - If the product is in stock this method returns the availability of the product. + - If the product is out of stock this method returns 0. + + The following rules apply for special product types: + + - For a master product this method returns the average SKU coverage of its online variations. + - For a master product with no online variations this method returns 0. + - For a product set this method returns the ratio of orderable SKUs in the product set over the total number of online SKUs in the product set. + - For a product set with no online products this method returns 0. + - For a product bundle this method returns 1 if all of the bundled products are online, and 0 otherwise. + - For a product bundle with no online bundled products this method returns 0. + + + +--- + +### availability +- availability: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the availability of the product, which roughly defined is the + ratio of the original stock that is still available to sell. The basic + formula, if the current site uses an + inventory list, is the ATS quantity divided by allocation + amount. If the product is not orderable at all this method returns 0. + The following specific rules apply for standard products: + + - If inventory lists are in use: + - If no inventory record exists and the inventory list default-in-stock flag is true this method returns 1. + - If no inventory record exists the inventory list default-in-stock flag is false this method returns 0. + - If the product is not available this method returns 0. + - If the product is perpetually available this method returns 1. + - Otherwise, this method returns ATS / (allocation + preorderBackorderAllocation). (Values from [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md).) + + + If inventory lists are not in use the method returns 0. + + The following rules apply for special product types: + + - For a master product this method returns the average availability of its online variations. + - For a master product with no online variations this method returns 0. + - For a master product with own inventory record the rules of the standard products apply. Note: In this case the availability of the variations is not considered. + - For a product set this method returns the greatest availability of the online products in the set. + - For a product set with no online products this method returns 0. + - For a product set with an inventory record the rules of the standard products apply. Note: In this case the availability of the set products is not considered. + - For a bundle, this method returns the least availability of the bundled products according to their bundled quantity and if it exist also from the bundle inventory record. + + + +--- + +### availabilityStatus +- availabilityStatus: [String](TopLevel.String.md) `(read-only)` + - : Returns the availability-status for the minimum-orderable-quantity (MOQ) of + the product. The MOQ essentially represents a single orderable unit, and + therefore can be represented by a single availability-status. This + method is essentially a convenience method. The same information + can be retrieved by calling [getAvailabilityLevels(Number)](dw.catalog.ProductAvailabilityModel.md#getavailabilitylevelsnumber) + with the MOQ of the product as the parameter and then retrieving the + single status from the returned map. + + This method is typically used to display a product's availability in + the catalog when the order quantity is not known. + + + +--- + +### inStock +- inStock: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Convenience method for [isInStock(Number)](dw.catalog.ProductAvailabilityModel.md#isinstocknumber). Returns true, if the + Product is available in the minimum-order-quantity. If the product does + not have a minimum-order-quantity defined, in-stock is checked for a + quantity value 1. + + + +--- + +### inventoryRecord +- inventoryRecord: [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) `(read-only)` + - : Returns the ProductInventoryRecord for the Product associated + with this model. + + + +--- + +### orderable +- orderable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Convenience method for [isOrderable(Number)](dw.catalog.ProductAvailabilityModel.md#isorderablenumber). Returns true if the + Product is currently online (based on its online flag and online dates) + and is orderable in its minimum-order-quantity. If the product does not + have a minimum-order-quantity specified, then 1 is used. The method + returns false otherwise. + + + Note: Orderable status is more general than in-stock status. A product + may be out-of-stock but orderable because it is back-orderable or + pre-orderable. + + + +--- + +### timeToOutOfStock +- timeToOutOfStock: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of hours before the product is expected to go out + of stock. The basic formula is the ATS quantity divided by the + sales velocity for the most recent day. The following specific rules + apply for standard products: + + - If the product is out of stock this method returns 0. + - If the product is perpetually available this method returns 1. + - If the sales velocity or ATS is not available this method returns 0. + - Otherwise this method returns ATS / sales velocity. + + The following rules apply for special product types: + + - For a master product this method returns the greatest time to out of stock of its online variations. + - For a master product with no online variations this method returns 0. + - For a product set this method returns the greatest time to out of stock of the online products in the set. + - For a product set with no online products this method returns 0. + - For a bundle with no product inventory record, this method returns the least time to out of stock of the online bundled products. + - For a bundle with no product inventory record, and no online bundled products, this method returns 0. + + + +--- + +## Method Details + +### getAvailability() +- getAvailability(): [Number](TopLevel.Number.md) + - : Returns the availability of the product, which roughly defined is the + ratio of the original stock that is still available to sell. The basic + formula, if the current site uses an + inventory list, is the ATS quantity divided by allocation + amount. If the product is not orderable at all this method returns 0. + The following specific rules apply for standard products: + + - If inventory lists are in use: + - If no inventory record exists and the inventory list default-in-stock flag is true this method returns 1. + - If no inventory record exists the inventory list default-in-stock flag is false this method returns 0. + - If the product is not available this method returns 0. + - If the product is perpetually available this method returns 1. + - Otherwise, this method returns ATS / (allocation + preorderBackorderAllocation). (Values from [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md).) + + + If inventory lists are not in use the method returns 0. + + The following rules apply for special product types: + + - For a master product this method returns the average availability of its online variations. + - For a master product with no online variations this method returns 0. + - For a master product with own inventory record the rules of the standard products apply. Note: In this case the availability of the variations is not considered. + - For a product set this method returns the greatest availability of the online products in the set. + - For a product set with no online products this method returns 0. + - For a product set with an inventory record the rules of the standard products apply. Note: In this case the availability of the set products is not considered. + - For a bundle, this method returns the least availability of the bundled products according to their bundled quantity and if it exist also from the bundle inventory record. + + + +--- + +### getAvailabilityLevels(Number) +- getAvailabilityLevels(quantity: [Number](TopLevel.Number.md)): [ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md) + - : + Returns an instance of [ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md), + where each available quantity represents a part of the input quantity. + This method is typically used to display availability information in + the context of a known order quantity, e.g. a shopping cart. + + + + For example, if for a given product + there are 3 pieces in stock with no pre/backorder handling specified, + and the order quantity is 10, then the return instance would have the + following state: + + - [ProductAvailabilityLevels.getInStock()](dw.catalog.ProductAvailabilityLevels.md#getinstock)- 3 + - [ProductAvailabilityLevels.getPreorder()](dw.catalog.ProductAvailabilityLevels.md#getpreorder)- 0 + - [ProductAvailabilityLevels.getBackorder()](dw.catalog.ProductAvailabilityLevels.md#getbackorder)- 0 + - [ProductAvailabilityLevels.getNotAvailable()](dw.catalog.ProductAvailabilityLevels.md#getnotavailable)- 7 + + + The following assertions can be made about the state of the returned instance. + + - Between 1 and 3 levels are non-zero. + - The sum of the levels equals the input quantity. + - [ProductAvailabilityLevels.getPreorder()](dw.catalog.ProductAvailabilityLevels.md#getpreorder)or [ProductAvailabilityLevels.getBackorder()](dw.catalog.ProductAvailabilityLevels.md#getbackorder)may be available, but not both. + + + + + + Product bundles are handled specially: The availability of product + bundles is calculated based on the availability of the bundled products. + Therefore, if a bundle contains products that are not in stock, then + the bundle itself is not in stock. If all the products in the bundle + are on backorder, then the bundle itself is backordered. If a product + bundle has its own inventory record, then this record may + further limit the availability. If a bundle has no record, then + only the records of the bundled products are considered. + + + + Product masters and product sets without an own inventory record are + handled specially too: The availability is calculated based on the + availability of the variants or set products. A product master or product + set is in stock as soon as one of its variants or set products is in stock. + Each product master or product set availability level reflects the sum of + the variant or set product availability levels up to the specified quantity. + + + + Product masters or product sets with own inventory record are handled like + standard products. The availability of the variants or set products is not + considered. (Such an inventory scenario should be avoided.) + + + + Offline products are always unavailable and will result in returned + levels that are all unavailable. + + + When using Omnichannel Inventory (OCI), future restocks provided by OCI are mapped to + [AVAILABILITY_STATUS_BACKORDER](dw.catalog.ProductAvailabilityModel.md#availability_status_backorder). For more information, see the comments for + [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md). + + + **Parameters:** + - quantity - The quantity to evaluate. + + **Returns:** + - an instance of ProductAvailabilityLevels, which encapsulates the number + of items for each relevant availability-status. + + + **Throws:** + - IllegalArgumentException - if the specified quantity is less or equal than zero + + **See Also:** + - [ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md) + + +--- + +### getAvailabilityStatus() +- getAvailabilityStatus(): [String](TopLevel.String.md) + - : Returns the availability-status for the minimum-orderable-quantity (MOQ) of + the product. The MOQ essentially represents a single orderable unit, and + therefore can be represented by a single availability-status. This + method is essentially a convenience method. The same information + can be retrieved by calling [getAvailabilityLevels(Number)](dw.catalog.ProductAvailabilityModel.md#getavailabilitylevelsnumber) + with the MOQ of the product as the parameter and then retrieving the + single status from the returned map. + + This method is typically used to display a product's availability in + the catalog when the order quantity is not known. + + + **Returns:** + - the availability-status. + + +--- + +### getInventoryRecord() +- getInventoryRecord(): [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) + - : Returns the ProductInventoryRecord for the Product associated + with this model. + + + **Returns:** + - the ProductInventoryRecord or null if there is none. + + +--- + +### getSKUCoverage() +- getSKUCoverage(): [Number](TopLevel.Number.md) + - : Returns the SKU coverage of the product. The basic formula for a + master product is the ratio of online variations that are in stock + to the total number of online variations. The following specific rules + apply for standard products: + + - If the product is in stock this method returns the availability of the product. + - If the product is out of stock this method returns 0. + + The following rules apply for special product types: + + - For a master product this method returns the average SKU coverage of its online variations. + - For a master product with no online variations this method returns 0. + - For a product set this method returns the ratio of orderable SKUs in the product set over the total number of online SKUs in the product set. + - For a product set with no online products this method returns 0. + - For a product bundle this method returns 1 if all of the bundled products are online, and 0 otherwise. + - For a product bundle with no online bundled products this method returns 0. + + + +--- + +### getTimeToOutOfStock() +- getTimeToOutOfStock(): [Number](TopLevel.Number.md) + - : Returns the number of hours before the product is expected to go out + of stock. The basic formula is the ATS quantity divided by the + sales velocity for the most recent day. The following specific rules + apply for standard products: + + - If the product is out of stock this method returns 0. + - If the product is perpetually available this method returns 1. + - If the sales velocity or ATS is not available this method returns 0. + - Otherwise this method returns ATS / sales velocity. + + The following rules apply for special product types: + + - For a master product this method returns the greatest time to out of stock of its online variations. + - For a master product with no online variations this method returns 0. + - For a product set this method returns the greatest time to out of stock of the online products in the set. + - For a product set with no online products this method returns 0. + - For a bundle with no product inventory record, this method returns the least time to out of stock of the online bundled products. + - For a bundle with no product inventory record, and no online bundled products, this method returns 0. + + + +--- + +### isInStock() +- isInStock(): [Boolean](TopLevel.Boolean.md) + - : Convenience method for [isInStock(Number)](dw.catalog.ProductAvailabilityModel.md#isinstocknumber). Returns true, if the + Product is available in the minimum-order-quantity. If the product does + not have a minimum-order-quantity defined, in-stock is checked for a + quantity value 1. + + + **Returns:** + - true if the Product is in stock, otherwise false. + + +--- + +### isInStock(Number) +- isInStock(quantity: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the Product is in-stock in the given quantity. This is + determined as follows: + + 1. If the product is not currently online (based on its online flag and online dates), then return false. + 2. If there is no inventory-list for the current site, then return false. + 3. If there is no inventory-record for the product, then return the default setting on the inventory-list. + 4. If there is no allocation-amount on the inventory-record, then return the value of the perpetual-flag. + 5. If there is an allocation-amount, but the perpetual-flag is true, then return true. + 6. If the quantity is less than or equal to the stock-level, then return true. + 7. Otherwise return false. + + + **Parameters:** + - quantity - the quantity that is requested + + **Returns:** + - true if the Product is in-stock. + + **Throws:** + - Exception - if the specified quantity is less or equal than zero + + +--- + +### isOrderable() +- isOrderable(): [Boolean](TopLevel.Boolean.md) + - : Convenience method for [isOrderable(Number)](dw.catalog.ProductAvailabilityModel.md#isorderablenumber). Returns true if the + Product is currently online (based on its online flag and online dates) + and is orderable in its minimum-order-quantity. If the product does not + have a minimum-order-quantity specified, then 1 is used. The method + returns false otherwise. + + + Note: Orderable status is more general than in-stock status. A product + may be out-of-stock but orderable because it is back-orderable or + pre-orderable. + + + **Returns:** + - true if the Product is orderable for the minimum-order-quantity + of the product. + + + +--- + +### isOrderable(Number) +- isOrderable(quantity: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the Product is currently online (based on its online flag + and online dates) and the specified quantity does not exceed the quantity + available for sale, and returns false otherwise. + + + Note: Orderable status is more general than in-stock status. A product + may be out-of-stock but orderable because it is back-orderable or + pre-orderable. + + + **Parameters:** + - quantity - the quantity to test against. + + **Returns:** + - true if the item can be ordered in the specified quantity. + + **Throws:** + - Exception - if the specified quantity is less or equal than zero + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryList.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryList.md new file mode 100644 index 00000000..eff44e1f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryList.md @@ -0,0 +1,136 @@ + +# Class ProductInventoryList + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.ProductInventoryList](dw.catalog.ProductInventoryList.md) + +The ProductInventoryList provides access to ID, description and defaultInStockFlag of the list. Furthermore inventory +records can be accessed by product or product ID. + + +When using Omnichannel Inventory (OCI): + +- B2C Commerce uses ProductInventoryLists to reference and expose OCI Locations and Location Groups. They're required for synchronizing availability data and creating reservations. +- Create a ProductInventoryList in B2C Commerce for each OCI Location and Location Group that B2C Commerce will access. The ProductInventoryList ID must match the External Reference field on the corresponding Location or Location Group. +- A ProductInventoryList ID/External Reference must have between 2 and 128 characters (inclusive). It can include only lowercase letters, uppercase letters, digits, hyphens, and underscores. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the inventory list. | +| [defaultInStockFlag](#defaultinstockflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the default in-stock flag of the inventory list. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of the inventory list. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDefaultInStockFlag](dw.catalog.ProductInventoryList.md#getdefaultinstockflag)() | Returns the default in-stock flag of the inventory list. | +| [getDescription](dw.catalog.ProductInventoryList.md#getdescription)() | Returns the description of the inventory list. | +| [getID](dw.catalog.ProductInventoryList.md#getid)() | Returns the ID of the inventory list. | +| [getRecord](dw.catalog.ProductInventoryList.md#getrecordproduct)([Product](dw.catalog.Product.md)) | Returns the inventory record for the specified product or null if there is no record for the product in this list. | +| [getRecord](dw.catalog.ProductInventoryList.md#getrecordstring)([String](TopLevel.String.md)) | Returns the inventory record for the specified product ID or null if there is no record for the product id in this list. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the inventory list. + + +--- + +### defaultInStockFlag +- defaultInStockFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the default in-stock flag of the inventory list. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of the inventory list. + + +--- + +## Method Details + +### getDefaultInStockFlag() +- getDefaultInStockFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the default in-stock flag of the inventory list. + + **Returns:** + - Default in-stock flag of inventory list. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the inventory list. + + **Returns:** + - Description of inventory list. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the inventory list. + + **Returns:** + - ID of inventory list. + + +--- + +### getRecord(Product) +- getRecord(product: [Product](dw.catalog.Product.md)): [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) + - : Returns the inventory record for the specified product or null + if there is no record for the product in this list. + + + **Parameters:** + - product - The product to lookup inventory record. + + **Returns:** + - Inventory record or `null` if not found. + + +--- + +### getRecord(String) +- getRecord(productID: [String](TopLevel.String.md)): [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) + - : Returns the inventory record for the specified product ID or null + if there is no record for the product id in this list. + + + **Parameters:** + - productID - The product ID to lookup inventory record. + + **Returns:** + - Inventory record or `null` if not found. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryMgr.md new file mode 100644 index 00000000..a2c2bac8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryMgr.md @@ -0,0 +1,132 @@ + +# Class ProductInventoryMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductInventoryMgr](dw.catalog.ProductInventoryMgr.md) + +This manager provides access to inventory-related objects. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [INTEGRATIONMODE_B2C](#integrationmode_b2c): [String](TopLevel.String.md) = "B2C" | Integration mode 'B2C' - using B2C inventory, no integration with Omnichannel Inventory | +| [INTEGRATIONMODE_OCI](#integrationmode_oci): [String](TopLevel.String.md) = "OCI" | Integration mode 'OCI' - integration with Omnichannel Inventory enabled | +| [INTEGRATIONMODE_OCI_CACHE](#integrationmode_oci_cache): [String](TopLevel.String.md) = "OCI_CACHE" | Integration mode 'OCI\_CACHE' - using B2C inventory, initializing cache as preparation for integration with Omnichannel Inventory | + +## Property Summary + +| Property | Description | +| --- | --- | +| [inventoryIntegrationMode](#inventoryintegrationmode): [String](TopLevel.String.md) `(read-only)` | Returns the current inventory integration mode as one of

  • [INTEGRATIONMODE_B2C](dw.catalog.ProductInventoryMgr.md#integrationmode_b2c)
  • [INTEGRATIONMODE_OCI_CACHE](dw.catalog.ProductInventoryMgr.md#integrationmode_oci_cache)
  • [INTEGRATIONMODE_OCI](dw.catalog.ProductInventoryMgr.md#integrationmode_oci)
| +| [inventoryList](#inventorylist): [ProductInventoryList](dw.catalog.ProductInventoryList.md) `(read-only)` | Returns the inventory list assigned to the current site or null if no inventory list is assigned to the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getInventoryIntegrationMode](dw.catalog.ProductInventoryMgr.md#getinventoryintegrationmode)() | Returns the current inventory integration mode as one of
  • [INTEGRATIONMODE_B2C](dw.catalog.ProductInventoryMgr.md#integrationmode_b2c)
  • [INTEGRATIONMODE_OCI_CACHE](dw.catalog.ProductInventoryMgr.md#integrationmode_oci_cache)
  • [INTEGRATIONMODE_OCI](dw.catalog.ProductInventoryMgr.md#integrationmode_oci)
| +| static [getInventoryList](dw.catalog.ProductInventoryMgr.md#getinventorylist)() | Returns the inventory list assigned to the current site or null if no inventory list is assigned to the current site. | +| static [getInventoryList](dw.catalog.ProductInventoryMgr.md#getinventoryliststring)([String](TopLevel.String.md)) | Returns the inventory list with the passed ID or null if no inventory list exists with that ID. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### INTEGRATIONMODE_B2C + +- INTEGRATIONMODE_B2C: [String](TopLevel.String.md) = "B2C" + - : Integration mode 'B2C' - using B2C inventory, no integration with Omnichannel Inventory + + +--- + +### INTEGRATIONMODE_OCI + +- INTEGRATIONMODE_OCI: [String](TopLevel.String.md) = "OCI" + - : Integration mode 'OCI' - integration with Omnichannel Inventory enabled + + +--- + +### INTEGRATIONMODE_OCI_CACHE + +- INTEGRATIONMODE_OCI_CACHE: [String](TopLevel.String.md) = "OCI_CACHE" + - : Integration mode 'OCI\_CACHE' - using B2C inventory, initializing cache as preparation for integration with + Omnichannel Inventory + + + +--- + +## Property Details + +### inventoryIntegrationMode +- inventoryIntegrationMode: [String](TopLevel.String.md) `(read-only)` + - : Returns the current inventory integration mode as one of + + - [INTEGRATIONMODE_B2C](dw.catalog.ProductInventoryMgr.md#integrationmode_b2c) + - [INTEGRATIONMODE_OCI_CACHE](dw.catalog.ProductInventoryMgr.md#integrationmode_oci_cache) + - [INTEGRATIONMODE_OCI](dw.catalog.ProductInventoryMgr.md#integrationmode_oci) + + + +--- + +### inventoryList +- inventoryList: [ProductInventoryList](dw.catalog.ProductInventoryList.md) `(read-only)` + - : Returns the inventory list assigned to the current site or null if no inventory list is assigned to the current + site. + + + +--- + +## Method Details + +### getInventoryIntegrationMode() +- static getInventoryIntegrationMode(): [String](TopLevel.String.md) + - : Returns the current inventory integration mode as one of + + - [INTEGRATIONMODE_B2C](dw.catalog.ProductInventoryMgr.md#integrationmode_b2c) + - [INTEGRATIONMODE_OCI_CACHE](dw.catalog.ProductInventoryMgr.md#integrationmode_oci_cache) + - [INTEGRATIONMODE_OCI](dw.catalog.ProductInventoryMgr.md#integrationmode_oci) + + + **Returns:** + - The current inventory integration mode as a constant String. + + +--- + +### getInventoryList() +- static getInventoryList(): [ProductInventoryList](dw.catalog.ProductInventoryList.md) + - : Returns the inventory list assigned to the current site or null if no inventory list is assigned to the current + site. + + + **Returns:** + - The ProductInventoryList assigned to the current site, or null. + + +--- + +### getInventoryList(String) +- static getInventoryList(listID: [String](TopLevel.String.md)): [ProductInventoryList](dw.catalog.ProductInventoryList.md) + - : Returns the inventory list with the passed ID or null if no inventory list exists with that ID. + + **Parameters:** + - listID - The ID of the inventory list to retrieve. + + **Returns:** + - The ProductInventoryList identified by listID, or null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryRecord.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryRecord.md new file mode 100644 index 00000000..e1d88d35 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductInventoryRecord.md @@ -0,0 +1,638 @@ + +# Class ProductInventoryRecord + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) + +The ProductInventoryRecord holds information about a Product's inventory, and availability. + + +When using Omnichannel Inventory (OCI): + +- All ProductInventoryRecord properties are read-only. Calling any setter method throws an IllegalStateException. +- The ProductInventoryRecord class does not support custom properties. +- [isPerpetual()](dw.catalog.ProductInventoryRecord.md#isperpetual)and [isPreorderable()](dw.catalog.ProductInventoryRecord.md#ispreorderable)always return false. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ATS](#ats): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity of items available to sell (ATS). | +| [allocation](#allocation): [Quantity](dw.value.Quantity.md) | Returns the allocation quantity that is currently set. | +| [allocationResetDate](#allocationresetdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the date the allocation quantity was initialized or reset. | +| [backorderable](#backorderable): [Boolean](TopLevel.Boolean.md) | Determines if the product is backorderable. | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this object. | +| [inStockDate](#instockdate): [Date](TopLevel.Date.md) | Returns the date that the item is expected to be in stock. | +| ~~[onHand](#onhand): [Quantity](dw.value.Quantity.md)~~ `(read-only)` | Returns the on-hand quantity, the actual quantity of available (on-hand) items. | +| [onOrder](#onorder): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity that is currently on order. | +| [perpetual](#perpetual): [Boolean](TopLevel.Boolean.md) | Determines if the product is perpetually in stock. | +| [preorderBackorderAllocation](#preorderbackorderallocation): [Quantity](dw.value.Quantity.md) | Returns the quantity of items that are allocated for sale, beyond the initial stock allocation. | +| [preorderable](#preorderable): [Boolean](TopLevel.Boolean.md) | Determines if the product is preorderable. | +| [reserved](#reserved): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity of items that are reserved. | +| [stockLevel](#stocklevel): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the current stock level. | +| [turnover](#turnover): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the sum of all inventory transactions (decrements and increments) recorded after the allocation reset date. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [describe](dw.catalog.ProductInventoryRecord.md#describe)() | Returns the meta data of this object. | +| [getATS](dw.catalog.ProductInventoryRecord.md#getats)() | Returns the quantity of items available to sell (ATS). | +| [getAllocation](dw.catalog.ProductInventoryRecord.md#getallocation)() | Returns the allocation quantity that is currently set. | +| [getAllocationResetDate](dw.catalog.ProductInventoryRecord.md#getallocationresetdate)() | Returns the date the allocation quantity was initialized or reset. | +| [getCustom](dw.catalog.ProductInventoryRecord.md#getcustom)() | Returns the custom attributes for this object. | +| [getInStockDate](dw.catalog.ProductInventoryRecord.md#getinstockdate)() | Returns the date that the item is expected to be in stock. | +| ~~[getOnHand](dw.catalog.ProductInventoryRecord.md#getonhand)()~~ | Returns the on-hand quantity, the actual quantity of available (on-hand) items. | +| [getOnOrder](dw.catalog.ProductInventoryRecord.md#getonorder)() | Returns the quantity that is currently on order. | +| [getPreorderBackorderAllocation](dw.catalog.ProductInventoryRecord.md#getpreorderbackorderallocation)() | Returns the quantity of items that are allocated for sale, beyond the initial stock allocation. | +| [getReserved](dw.catalog.ProductInventoryRecord.md#getreserved)() | Returns the quantity of items that are reserved. | +| [getStockLevel](dw.catalog.ProductInventoryRecord.md#getstocklevel)() | Returns the current stock level. | +| [getTurnover](dw.catalog.ProductInventoryRecord.md#getturnover)() | Returns the sum of all inventory transactions (decrements and increments) recorded after the allocation reset date. | +| [isBackorderable](dw.catalog.ProductInventoryRecord.md#isbackorderable)() | Determines if the product is backorderable. | +| [isPerpetual](dw.catalog.ProductInventoryRecord.md#isperpetual)() | Determines if the product is perpetually in stock. | +| [isPreorderable](dw.catalog.ProductInventoryRecord.md#ispreorderable)() | Determines if the product is preorderable. | +| [setAllocation](dw.catalog.ProductInventoryRecord.md#setallocationnumber)([Number](TopLevel.Number.md)) | Sets the allocation quantity. | +| [setAllocation](dw.catalog.ProductInventoryRecord.md#setallocationnumber-date)([Number](TopLevel.Number.md), [Date](TopLevel.Date.md)) | Sets the allocation quantity. | +| [setBackorderable](dw.catalog.ProductInventoryRecord.md#setbackorderableboolean)([Boolean](TopLevel.Boolean.md)) | The method is used to set whether the product is backorderable. | +| [setInStockDate](dw.catalog.ProductInventoryRecord.md#setinstockdatedate)([Date](TopLevel.Date.md)) | Sets the date that the item is expected to be in stock. | +| [setPerpetual](dw.catalog.ProductInventoryRecord.md#setperpetualboolean)([Boolean](TopLevel.Boolean.md)) | Sets if the product is perpetually in stock. | +| [setPreorderBackorderAllocation](dw.catalog.ProductInventoryRecord.md#setpreorderbackorderallocationnumber)([Number](TopLevel.Number.md)) | Sets the quantity of items that are allocated for sale, beyond the initial stock allocation. | +| [setPreorderable](dw.catalog.ProductInventoryRecord.md#setpreorderableboolean)([Boolean](TopLevel.Boolean.md)) | The method is used to set whether the product is preorderable. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ATS +- ATS: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity of items available to sell (ATS). This is calculated as the allocation + ([getAllocation()](dw.catalog.ProductInventoryRecord.md#getallocation)) plus the preorderBackorderAllocation ([getPreorderBackorderAllocation()](dw.catalog.ProductInventoryRecord.md#getpreorderbackorderallocation)) minus + the turnover ([getTurnover()](dw.catalog.ProductInventoryRecord.md#getturnover)) minus the on order quantity ([getOnOrder()](dw.catalog.ProductInventoryRecord.md#getonorder)). + + + When using OCI, corresponds to the ATO (Available To Order) quantity in OCI. + + + +--- + +### allocation +- allocation: [Quantity](dw.value.Quantity.md) + - : Returns the allocation quantity that is currently set. The quantity unit is the same unit as the product itself. + + + When using OCI, returns the physically available quantity. Corresponds to the On Hand quantity in OCI. + + + +--- + +### allocationResetDate +- allocationResetDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date the allocation quantity was initialized or reset. + + + When using OCI, corresponds to the Effective Date in OCI. The value can be null. + + + +--- + +### backorderable +- backorderable: [Boolean](TopLevel.Boolean.md) + - : Determines if the product is backorderable. + + + When using OCI, returns true if the product has at least one Future quantity in OCI. + + + +--- + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this object. The returned object is used for retrieving and storing attribute + values. See [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for working with custom + attributes. + + + When using Omnichannel Inventory (OCI), this class doesn't support custom attributes. If OCI is enabled, then + attempting to set or modify a custom attribute value throws an UnsupportedOperationException. + + + +--- + +### inStockDate +- inStockDate: [Date](TopLevel.Date.md) + - : Returns the date that the item is expected to be in stock. + + + When using OCI, returns the date of the earliest Future quantity. If the product has no Future quantities, it + returns null. + + + +--- + +### onHand +- ~~onHand: [Quantity](dw.value.Quantity.md)~~ `(read-only)` + - : Returns the on-hand quantity, the actual quantity of available (on-hand) items. + + **Deprecated:** +:::warning +Use [getStockLevel()](dw.catalog.ProductInventoryRecord.md#getstocklevel) instead. +::: + **API Version:** +:::note +No longer available as of version 21.7. +::: + +--- + +### onOrder +- onOrder: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity that is currently on order. + + + This is only relevant when On Order Inventory is turned on for the related inventory list. On Order is a bucket + of inventory used for the time between order creation and order export to external (warehouse) systems. On Order + value is increased when an order is created. It will be decreased and with that turnover will be increased when + the order is exported, see [getTurnover()](dw.catalog.ProductInventoryRecord.md#getturnover). Notice that [Order.setExportStatus(Number)](dw.order.Order.md#setexportstatusnumber) and + [OrderItem.allocateInventory(Boolean)](dw.order.OrderItem.md#allocateinventoryboolean) will decrease the On Order value. On order will be included + in the ATS calculation, see [getATS()](dw.catalog.ProductInventoryRecord.md#getats). + + + + + When using OCI, always returns zero. OCI doesn't support On Order inventory. + + + +--- + +### perpetual +- perpetual: [Boolean](TopLevel.Boolean.md) + - : Determines if the product is perpetually in stock. + + + When using OCI, always returns false. + + + +--- + +### preorderBackorderAllocation +- preorderBackorderAllocation: [Quantity](dw.value.Quantity.md) + - : Returns the quantity of items that are allocated for sale, beyond the initial stock allocation. + + + When using OCI, returns the sum of all Future quantities. If the product has no Future quantities, it returns + zero. + + + +--- + +### preorderable +- preorderable: [Boolean](TopLevel.Boolean.md) + - : Determines if the product is preorderable. + + + When using OCI, always returns false. + + + +--- + +### reserved +- reserved: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity of items that are reserved. + + + Note that for products with high velocity and concurrency, the return value is extremely volatile and the + retrieval will be expensive. + + + When using OCI, always returns zero. + + + +--- + +### stockLevel +- stockLevel: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the current stock level. This is calculated as the allocation minus the turnover. + + + When using OCI, corresponds to the ATF (Available To Fulfill) quantity in OCI. + + + +--- + +### turnover +- turnover: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the sum of all inventory transactions (decrements and increments) recorded after the allocation reset + date. If the total decremented quantity is greater than the total incremented quantity, then this value is + negative. + + + When using OCI, returns the total reserved quantity, including order, basket, and temporary reservations. + + + +--- + +## Method Details + +### describe() +- describe(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : 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. + + + When using Omnichannel Inventory (OCI), this class doesn't support custom attributes. If OCI is enabled, then + attempting to set or modify a custom attribute value throws an UnsupportedOperationException. + + + **Returns:** + - the meta data of this object. If no meta data is available the method returns null. + + +--- + +### getATS() +- getATS(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of items available to sell (ATS). This is calculated as the allocation + ([getAllocation()](dw.catalog.ProductInventoryRecord.md#getallocation)) plus the preorderBackorderAllocation ([getPreorderBackorderAllocation()](dw.catalog.ProductInventoryRecord.md#getpreorderbackorderallocation)) minus + the turnover ([getTurnover()](dw.catalog.ProductInventoryRecord.md#getturnover)) minus the on order quantity ([getOnOrder()](dw.catalog.ProductInventoryRecord.md#getonorder)). + + + When using OCI, corresponds to the ATO (Available To Order) quantity in OCI. + + + **Returns:** + - the quantity or quantity N/A if not available. + + +--- + +### getAllocation() +- getAllocation(): [Quantity](dw.value.Quantity.md) + - : Returns the allocation quantity that is currently set. The quantity unit is the same unit as the product itself. + + + When using OCI, returns the physically available quantity. Corresponds to the On Hand quantity in OCI. + + + **Returns:** + - the allocation quantity or quantity N/A if not available. + + +--- + +### getAllocationResetDate() +- getAllocationResetDate(): [Date](TopLevel.Date.md) + - : Returns the date the allocation quantity was initialized or reset. + + + When using OCI, corresponds to the Effective Date in OCI. The value can be null. + + + **Returns:** + - the allocation reset date. + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this object. The returned object is used for retrieving and storing attribute + values. See [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for working with custom + attributes. + + + When using Omnichannel Inventory (OCI), this class doesn't support custom attributes. If OCI is enabled, then + attempting to set or modify a custom attribute value throws an UnsupportedOperationException. + + + **Returns:** + - the custom attributes for this object. + + +--- + +### getInStockDate() +- getInStockDate(): [Date](TopLevel.Date.md) + - : Returns the date that the item is expected to be in stock. + + + When using OCI, returns the date of the earliest Future quantity. If the product has no Future quantities, it + returns null. + + + **Returns:** + - the date that the item is expected to be in stock. + + +--- + +### getOnHand() +- ~~getOnHand(): [Quantity](dw.value.Quantity.md)~~ + - : Returns the on-hand quantity, the actual quantity of available (on-hand) items. + + **Returns:** + - the on-hand quantity or quantity N/A if not available. + + **Deprecated:** +:::warning +Use [getStockLevel()](dw.catalog.ProductInventoryRecord.md#getstocklevel) instead. +::: + **API Version:** +:::note +No longer available as of version 21.7. +::: + +--- + +### getOnOrder() +- getOnOrder(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity that is currently on order. + + + This is only relevant when On Order Inventory is turned on for the related inventory list. On Order is a bucket + of inventory used for the time between order creation and order export to external (warehouse) systems. On Order + value is increased when an order is created. It will be decreased and with that turnover will be increased when + the order is exported, see [getTurnover()](dw.catalog.ProductInventoryRecord.md#getturnover). Notice that [Order.setExportStatus(Number)](dw.order.Order.md#setexportstatusnumber) and + [OrderItem.allocateInventory(Boolean)](dw.order.OrderItem.md#allocateinventoryboolean) will decrease the On Order value. On order will be included + in the ATS calculation, see [getATS()](dw.catalog.ProductInventoryRecord.md#getats). + + + + + When using OCI, always returns zero. OCI doesn't support On Order inventory. + + + **Returns:** + - the quantity or quantity N/A if not available. + + +--- + +### getPreorderBackorderAllocation() +- getPreorderBackorderAllocation(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of items that are allocated for sale, beyond the initial stock allocation. + + + When using OCI, returns the sum of all Future quantities. If the product has no Future quantities, it returns + zero. + + + **Returns:** + - the quantity or quantity N/A if not available. + + +--- + +### getReserved() +- getReserved(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of items that are reserved. + + + Note that for products with high velocity and concurrency, the return value is extremely volatile and the + retrieval will be expensive. + + + When using OCI, always returns zero. + + + **Returns:** + - the quantity of items reserved for this product. + + +--- + +### getStockLevel() +- getStockLevel(): [Quantity](dw.value.Quantity.md) + - : Returns the current stock level. This is calculated as the allocation minus the turnover. + + + When using OCI, corresponds to the ATF (Available To Fulfill) quantity in OCI. + + + **Returns:** + - the stock level or quantity N/A if not available. + + +--- + +### getTurnover() +- getTurnover(): [Quantity](dw.value.Quantity.md) + - : Returns the sum of all inventory transactions (decrements and increments) recorded after the allocation reset + date. If the total decremented quantity is greater than the total incremented quantity, then this value is + negative. + + + When using OCI, returns the total reserved quantity, including order, basket, and temporary reservations. + + + **Returns:** + - the turnover or quantity N/A if not available. + + +--- + +### isBackorderable() +- isBackorderable(): [Boolean](TopLevel.Boolean.md) + - : Determines if the product is backorderable. + + + When using OCI, returns true if the product has at least one Future quantity in OCI. + + + **Returns:** + - true if the product is backorderable. + + +--- + +### isPerpetual() +- isPerpetual(): [Boolean](TopLevel.Boolean.md) + - : Determines if the product is perpetually in stock. + + + When using OCI, always returns false. + + + **Returns:** + - true if the product is perpetually in stock. + + +--- + +### isPreorderable() +- isPreorderable(): [Boolean](TopLevel.Boolean.md) + - : Determines if the product is preorderable. + + + When using OCI, always returns false. + + + **Returns:** + - true if the product is preorderable. + + +--- + +### setAllocation(Number) +- setAllocation(quantity: [Number](TopLevel.Number.md)): void + - : Sets the allocation quantity. This also updates the allocation reset date. + + All final reservations will be considered as expired and will therefore no longer be considered for ATS. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + + **Parameters:** + - quantity - the allocation quantity to set (must be greater than or equal to zero). + + **API Version:** +:::note +No longer available as of version 21.7. +::: + +--- + +### setAllocation(Number, Date) +- setAllocation(quantity: [Number](TopLevel.Number.md), allocationResetDate: [Date](TopLevel.Date.md)): void + - : Sets the allocation quantity. This also updates the allocation reset date. + + Any final reservations made prior to the allocation reset date will be considered as expired and will therefore + no longer be considered for ATS. + + + When using OCI, throws an IllegalStateException. + + This method must **not** be called within a storefront request. + + + **Parameters:** + - quantity - the allocation quantity to set (must be greater than or equal to zero). + - allocationResetDate - the date allocation quantity was effectively calculated
  • the reset date must not be older than 48 hours
  • the reset date must not be older than the prior reset date. see [getAllocationResetDate()](dw.catalog.ProductInventoryRecord.md#getallocationresetdate)
  • + + +--- + +### setBackorderable(Boolean) +- setBackorderable(backorderableFlag: [Boolean](TopLevel.Boolean.md)): void + - : The method is used to set whether the product is backorderable. Setting the backorderable flag to true will clear + the preorderable flag. If the record's preorderable flag is set to true, calling this method with + backorderableFlag==false will have no effect. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + This method must **not** be called within a storefront request when the API version is 21.7 or later. + + + **Parameters:** + - backorderableFlag - the flag to set backorderable status. + + +--- + +### setInStockDate(Date) +- setInStockDate(inStockDate: [Date](TopLevel.Date.md)): void + - : Sets the date that the item is expected to be in stock. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + This method must **not** be called within a storefront request when the API version is 21.7 or later. + + + **Parameters:** + - inStockDate - the date that the item is expected to be in stock. + + +--- + +### setPerpetual(Boolean) +- setPerpetual(perpetualFlag: [Boolean](TopLevel.Boolean.md)): void + - : Sets if the product is perpetually in stock. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + This method must **not** be called within a storefront request when the API version is 21.7 or later. + + + **Parameters:** + - perpetualFlag - true to set the product perpetually in stock. + + +--- + +### setPreorderBackorderAllocation(Number) +- setPreorderBackorderAllocation(quantity: [Number](TopLevel.Number.md)): void + - : Sets the quantity of items that are allocated for sale, beyond the initial stock allocation. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + This method must **not** be called within a storefront request when the API version is 21.7 or later. + + + **Parameters:** + - quantity - the quantity to set. + + +--- + +### setPreorderable(Boolean) +- setPreorderable(preorderableFlag: [Boolean](TopLevel.Boolean.md)): void + - : The method is used to set whether the product is preorderable. Setting the preorderable flag to true will clear + the backorderable flag. If the record's backorderable flag is set to true, calling this method with + preorderableFlag==false will have no effect. + + + When using OCI, throws an IllegalStateException. + + This method should **not** be called within a storefront request. + + This method must **not** be called within a storefront request when the API version is 21.7 or later. + + + **Parameters:** + - preorderableFlag - the flag to set preorderable status. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductLink.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductLink.md new file mode 100644 index 00000000..a5e84efa --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductLink.md @@ -0,0 +1,166 @@ + +# Class ProductLink + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductLink](dw.catalog.ProductLink.md) + +The class represents a link between two products. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [LINKTYPE_ACCESSORY](#linktype_accessory): [Number](TopLevel.Number.md) = 4 | Represents an accessory product link. | +| [LINKTYPE_ALT_ORDERUNIT](#linktype_alt_orderunit): [Number](TopLevel.Number.md) = 6 | Represents an alternative order unit product link. | +| [LINKTYPE_CROSS_SELL](#linktype_cross_sell): [Number](TopLevel.Number.md) = 1 | Represents a cross-sell product link. | +| [LINKTYPE_NEWER_VERSION](#linktype_newer_version): [Number](TopLevel.Number.md) = 5 | Represents a newer verion link. | +| [LINKTYPE_OTHER](#linktype_other): [Number](TopLevel.Number.md) = 8 | Represents a miscellaneous product link. | +| [LINKTYPE_REPLACEMENT](#linktype_replacement): [Number](TopLevel.Number.md) = 2 | Represents a replacement product link. | +| [LINKTYPE_SPARE_PART](#linktype_spare_part): [Number](TopLevel.Number.md) = 7 | Represents a spare part product link. | +| [LINKTYPE_UP_SELL](#linktype_up_sell): [Number](TopLevel.Number.md) = 3 | Represents an up-sell product link. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [sourceProduct](#sourceproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the source product for this link. | +| [targetProduct](#targetproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the target product for this link. | +| [typeCode](#typecode): [Number](TopLevel.Number.md) `(read-only)` | Returns the type of this link (see constants). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getSourceProduct](dw.catalog.ProductLink.md#getsourceproduct)() | Returns the source product for this link. | +| [getTargetProduct](dw.catalog.ProductLink.md#gettargetproduct)() | Returns the target product for this link. | +| [getTypeCode](dw.catalog.ProductLink.md#gettypecode)() | Returns the type of this link (see constants). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### LINKTYPE_ACCESSORY + +- LINKTYPE_ACCESSORY: [Number](TopLevel.Number.md) = 4 + - : Represents an accessory product link. + + +--- + +### LINKTYPE_ALT_ORDERUNIT + +- LINKTYPE_ALT_ORDERUNIT: [Number](TopLevel.Number.md) = 6 + - : Represents an alternative order unit product link. + + +--- + +### LINKTYPE_CROSS_SELL + +- LINKTYPE_CROSS_SELL: [Number](TopLevel.Number.md) = 1 + - : Represents a cross-sell product link. + + +--- + +### LINKTYPE_NEWER_VERSION + +- LINKTYPE_NEWER_VERSION: [Number](TopLevel.Number.md) = 5 + - : Represents a newer verion link. + + +--- + +### LINKTYPE_OTHER + +- LINKTYPE_OTHER: [Number](TopLevel.Number.md) = 8 + - : Represents a miscellaneous product link. + + +--- + +### LINKTYPE_REPLACEMENT + +- LINKTYPE_REPLACEMENT: [Number](TopLevel.Number.md) = 2 + - : Represents a replacement product link. + + +--- + +### LINKTYPE_SPARE_PART + +- LINKTYPE_SPARE_PART: [Number](TopLevel.Number.md) = 7 + - : Represents a spare part product link. + + +--- + +### LINKTYPE_UP_SELL + +- LINKTYPE_UP_SELL: [Number](TopLevel.Number.md) = 3 + - : Represents an up-sell product link. + + +--- + +## Property Details + +### sourceProduct +- sourceProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the source product for this link. + + +--- + +### targetProduct +- targetProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the target product for this link. + + +--- + +### typeCode +- typeCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the type of this link (see constants). + + +--- + +## Method Details + +### getSourceProduct() +- getSourceProduct(): [Product](dw.catalog.Product.md) + - : Returns the source product for this link. + + **Returns:** + - the source product for this link. + + +--- + +### getTargetProduct() +- getTargetProduct(): [Product](dw.catalog.Product.md) + - : Returns the target product for this link. + + **Returns:** + - the target product for this link. + + +--- + +### getTypeCode() +- getTypeCode(): [Number](TopLevel.Number.md) + - : Returns the type of this link (see constants). + + **Returns:** + - the type of the link. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductMgr.md new file mode 100644 index 00000000..0b64671c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductMgr.md @@ -0,0 +1,136 @@ + +# Class ProductMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductMgr](dw.catalog.ProductMgr.md) + +Provides helper methods for getting products based on Product ID or [Catalog](dw.catalog.Catalog.md). + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getProduct](dw.catalog.ProductMgr.md#getproductstring)([String](TopLevel.String.md)) | Returns the product with the specified id. | +| static [queryAllSiteProducts](dw.catalog.ProductMgr.md#queryallsiteproducts)() | Returns all products assigned to the current site. | +| static [queryAllSiteProductsSorted](dw.catalog.ProductMgr.md#queryallsiteproductssorted)() | Returns all products assigned to the current site. | +| static [queryProductsInCatalog](dw.catalog.ProductMgr.md#queryproductsincatalogcatalog)([Catalog](dw.catalog.Catalog.md)) | Returns all products assigned to the the specified catalog, where assignment has the same meaning as it does for queryAllSiteProducts(). | +| static [queryProductsInCatalogSorted](dw.catalog.ProductMgr.md#queryproductsincatalogsortedcatalog)([Catalog](dw.catalog.Catalog.md)) | Returns all products assigned to the the specified catalog. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### getProduct(String) +- static getProduct(productID: [String](TopLevel.String.md)): [Product](dw.catalog.Product.md) + - : Returns the product with the specified id. + + **Parameters:** + - productID - the product identifier. + + **Returns:** + - Product for specified id or null + + +--- + +### queryAllSiteProducts() +- static queryAllSiteProducts(): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all products assigned to the current site. + + + A product is assigned to a site if + + + - it is assigned to at least one category of the site catalog or + - it is a variant and it's master product is assigned to the current site + + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Returns:** + - Iterator of all site products + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### queryAllSiteProductsSorted() +- static queryAllSiteProductsSorted(): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all products assigned to the current site. + + + Works like queryAllSiteProducts(), but additionally sorts the result set + by product ID. + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Returns:** + - Iterator of all site products sorted by product ID. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### queryProductsInCatalog(Catalog) +- static queryProductsInCatalog(catalog: [Catalog](dw.catalog.Catalog.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all products assigned to the the specified catalog, where + assignment has the same meaning as it does for queryAllSiteProducts(). + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - catalog - The catalog whose assigned products should be returned. + + **Returns:** + - Iterator of all products assigned to specified catalog. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### queryProductsInCatalogSorted(Catalog) +- static queryProductsInCatalogSorted(catalog: [Catalog](dw.catalog.Catalog.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all products assigned to the the specified catalog. + Works like queryProductsInCatalog(), but additionally sorts the result + set by product ID. + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - catalog - The catalog whose assigned products should be returned. + + **Returns:** + - Iterator of all products assigned to specified catalog sorted by + product ID. + + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOption.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOption.md new file mode 100644 index 00000000..41300abf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOption.md @@ -0,0 +1,189 @@ + +# Class ProductOption + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.ProductOption](dw.catalog.ProductOption.md) + +Represents a product option. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the product option ID. | +| [defaultValue](#defaultvalue): [ProductOptionValue](dw.catalog.ProductOptionValue.md) `(read-only)` | Returns the default value for the product option. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the product option's short description in the current locale. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the product option's display name in the current locale. | +| [htmlName](#htmlname): [String](TopLevel.String.md) `(read-only)` | Returns an HTML representation of the option id. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the product option's image. | +| [optionValues](#optionvalues): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing the product option values. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDefaultValue](dw.catalog.ProductOption.md#getdefaultvalue)() | Returns the default value for the product option. | +| [getDescription](dw.catalog.ProductOption.md#getdescription)() | Returns the product option's short description in the current locale. | +| [getDisplayName](dw.catalog.ProductOption.md#getdisplayname)() | Returns the product option's display name in the current locale. | +| [getHtmlName](dw.catalog.ProductOption.md#gethtmlname)() | Returns an HTML representation of the option id. | +| [getHtmlName](dw.catalog.ProductOption.md#gethtmlnamestring)([String](TopLevel.String.md)) | Returns an HTML representation of the option id with the custom prefix. | +| [getID](dw.catalog.ProductOption.md#getid)() | Returns the product option ID. | +| [getImage](dw.catalog.ProductOption.md#getimage)() | Returns the product option's image. | +| [getOptionValues](dw.catalog.ProductOption.md#getoptionvalues)() | Returns a collection containing the product option values. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the product option ID. + + +--- + +### defaultValue +- defaultValue: [ProductOptionValue](dw.catalog.ProductOptionValue.md) `(read-only)` + - : Returns the default value for the product option. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the product option's short description in the current locale. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the product option's display name in the current locale. + + +--- + +### htmlName +- htmlName: [String](TopLevel.String.md) `(read-only)` + - : Returns an HTML representation of the option id. + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the product option's image. + + +--- + +### optionValues +- optionValues: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing the product option values. + + +--- + +## Method Details + +### getDefaultValue() +- getDefaultValue(): [ProductOptionValue](dw.catalog.ProductOptionValue.md) + - : Returns the default value for the product option. + + **Returns:** + - the object for the relation 'defaultValue' + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the product option's short description in the current locale. + + **Returns:** + - The value of the short description in the current locale, + or null if it wasn't found. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the product option's display name in the current locale. + + **Returns:** + - The value of the display name in the current locale, + or null if it wasn't found. + + + +--- + +### getHtmlName() +- getHtmlName(): [String](TopLevel.String.md) + - : Returns an HTML representation of the option id. + + **Returns:** + - an HTML representation of the option id. + + +--- + +### getHtmlName(String) +- getHtmlName(prefix: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns an HTML representation of the option id with the custom prefix. + + **Parameters:** + - prefix - a custom prefix for the html name. + + **Returns:** + - an HTML representation of the option id. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the product option ID. + + **Returns:** + - the product option identifier. + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the product option's image. + + **Returns:** + - the product option's image. + + +--- + +### getOptionValues() +- getOptionValues(): [Collection](dw.util.Collection.md) + - : Returns a collection containing the product option values. + + **Returns:** + - a collection containing the product option values. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionModel.md new file mode 100644 index 00000000..7e19b926 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionModel.md @@ -0,0 +1,209 @@ + +# Class ProductOptionModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductOptionModel](dw.catalog.ProductOptionModel.md) + +This class represents the option model of a specific product and +for a specific currency. It provides accessor methods to the configured +options and the values of those options. It has also methods to set a +specific selection of option values. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [options](#options): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of product options. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getOption](dw.catalog.ProductOptionModel.md#getoptionstring)([String](TopLevel.String.md)) | Returns the product option for the specified ID. | +| [getOptionValue](dw.catalog.ProductOptionModel.md#getoptionvalueproductoption-string)([ProductOption](dw.catalog.ProductOption.md), [String](TopLevel.String.md)) | Returns the product option value object for the passed value id and in the context of the passed option. | +| [getOptionValues](dw.catalog.ProductOptionModel.md#getoptionvaluesproductoption)([ProductOption](dw.catalog.ProductOption.md)) | Returns a collection of product option values for the specified product option. | +| [getOptions](dw.catalog.ProductOptionModel.md#getoptions)() | Returns the collection of product options. | +| [getPrice](dw.catalog.ProductOptionModel.md#getpriceproductoptionvalue)([ProductOptionValue](dw.catalog.ProductOptionValue.md)) | Returns the effective price of the specified option value. | +| [getSelectedOptionValue](dw.catalog.ProductOptionModel.md#getselectedoptionvalueproductoption)([ProductOption](dw.catalog.ProductOption.md)) | Returns the selected value for the specified product option. | +| [isSelectedOptionValue](dw.catalog.ProductOptionModel.md#isselectedoptionvalueproductoption-productoptionvalue)([ProductOption](dw.catalog.ProductOption.md), [ProductOptionValue](dw.catalog.ProductOptionValue.md)) | Returns true if the specified option value is the one currently selected, false otherwise. | +| [setSelectedOptionValue](dw.catalog.ProductOptionModel.md#setselectedoptionvalueproductoption-productoptionvalue)([ProductOption](dw.catalog.ProductOption.md), [ProductOptionValue](dw.catalog.ProductOptionValue.md)) | Updates the selection of the specified option based on the specified value. | +| [url](dw.catalog.ProductOptionModel.md#urlstring-object)([String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Returns a URL that can be used to select one or more option values. | +| [urlSelectOptionValue](dw.catalog.ProductOptionModel.md#urlselectoptionvaluestring-productoption-productoptionvalue)([String](TopLevel.String.md), [ProductOption](dw.catalog.ProductOption.md), [ProductOptionValue](dw.catalog.ProductOptionValue.md)) | Returns an URL that can be used to select a specific value of a specific option. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### options +- options: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of product options. + + +--- + +## Method Details + +### getOption(String) +- getOption(optionID: [String](TopLevel.String.md)): [ProductOption](dw.catalog.ProductOption.md) + - : Returns the product option for the specified ID. + + **Parameters:** + - optionID - the product option identifier. + + **Returns:** + - the product option for the specified ID. + + +--- + +### getOptionValue(ProductOption, String) +- getOptionValue(option: [ProductOption](dw.catalog.ProductOption.md), valueID: [String](TopLevel.String.md)): [ProductOptionValue](dw.catalog.ProductOptionValue.md) + - : Returns the product option value object for the passed value id and in + the context of the passed option. + + + **Parameters:** + - option - The option to get the specified value for. + - valueID - The id of the value to retrieve + + **Returns:** + - a value for the specified product option and value id + + +--- + +### getOptionValues(ProductOption) +- getOptionValues(option: [ProductOption](dw.catalog.ProductOption.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of product option values for the + specified product option. + + + **Parameters:** + - option - the option for which we want to extract the collection of product option values. + + **Returns:** + - a collection of product option values for the + specified product option. + + + +--- + +### getOptions() +- getOptions(): [Collection](dw.util.Collection.md) + - : Returns the collection of product options. + + **Returns:** + - Collection of Product Options. + + +--- + +### getPrice(ProductOptionValue) +- getPrice(optionValue: [ProductOptionValue](dw.catalog.ProductOptionValue.md)): [Money](dw.value.Money.md) + - : Returns the effective price of the specified option value. + + **Parameters:** + - optionValue - the product option value to use. + + **Returns:** + - the effective price of the specified option value. + + +--- + +### getSelectedOptionValue(ProductOption) +- getSelectedOptionValue(option: [ProductOption](dw.catalog.ProductOption.md)): [ProductOptionValue](dw.catalog.ProductOptionValue.md) + - : Returns the selected value for the specified product option. If no + option values was set as selected option explicitly, the method + returns the default option value for this option. + + + **Parameters:** + - option - The option to get the selected value for. + + **Returns:** + - a selected value for the specified product option. + + +--- + +### isSelectedOptionValue(ProductOption, ProductOptionValue) +- isSelectedOptionValue(option: [ProductOption](dw.catalog.ProductOption.md), value: [ProductOptionValue](dw.catalog.ProductOptionValue.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the specified option value is the one currently selected, + false otherwise. + + + **Parameters:** + - option - the product option. + - value - the product option value. + + **Returns:** + - true if the specified option value is the one currently selected, + false otherwise. + + + +--- + +### setSelectedOptionValue(ProductOption, ProductOptionValue) +- setSelectedOptionValue(option: [ProductOption](dw.catalog.ProductOption.md), value: [ProductOptionValue](dw.catalog.ProductOptionValue.md)): void + - : Updates the selection of the specified option based on the specified value. + + **Parameters:** + - option - the option to update. + - value - the value to use when updating the product option. + + +--- + +### url(String, Object...) +- url(action: [String](TopLevel.String.md), varOptionAndValues: [Object...](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Returns a URL that can be used to select one or more option values. The + optional `varOptionAndValues` argument can be empty, or can + contain one or more option / value pairs. This variable list must be even + in length, with options and values alternating. If the list is odd in + length, the last argument will be ignored. Options can be specified as + instances of ProductOption, or String option ID. Values can be specified + as instances of ProductOptionValue or as strings representing the value + ID. If a parameter is invalid, then the parameter pair is not included in + the generated URL. The returned URL will contain options and values + already selected in the product option model, as well as options and + values specified as method parameters. This includes option values + explicitly selected and implicitly selected by default. + + + **Parameters:** + - action - The pipeline action, must not be null. + - varOptionAndValues - Variable length list of options and values. + + **Returns:** + - The constructed URL. + + +--- + +### urlSelectOptionValue(String, ProductOption, ProductOptionValue) +- urlSelectOptionValue(action: [String](TopLevel.String.md), option: [ProductOption](dw.catalog.ProductOption.md), value: [ProductOptionValue](dw.catalog.ProductOptionValue.md)): [String](TopLevel.String.md) + - : Returns an URL that can be used to select a specific value of a specific + option. + + + **Parameters:** + - action - the action to use. + - option - the option to use when constructing the URL. + - value - the value to use when constructing the URL. + + **Returns:** + - The constructed URL as string. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionValue.md new file mode 100644 index 00000000..5dbac303 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductOptionValue.md @@ -0,0 +1,132 @@ + +# Class ProductOptionValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.ProductOptionValue](dw.catalog.ProductOptionValue.md) + +Represents the value of a product option. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the product option value's ID. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the the product option value's description in the current locale. | +| [displayValue](#displayvalue): [String](TopLevel.String.md) `(read-only)` | Returns the the product option value's display name in the current locale. | +| [productIDModifier](#productidmodifier): [String](TopLevel.String.md) `(read-only)` | Returns the product option value's product ID modifier which can be used to build the SKU for the actual product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDescription](dw.catalog.ProductOptionValue.md#getdescription)() | Returns the the product option value's description in the current locale. | +| [getDisplayValue](dw.catalog.ProductOptionValue.md#getdisplayvalue)() | Returns the the product option value's display name in the current locale. | +| [getID](dw.catalog.ProductOptionValue.md#getid)() | Returns the product option value's ID. | +| [getProductIDModifier](dw.catalog.ProductOptionValue.md#getproductidmodifier)() | Returns the product option value's product ID modifier which can be used to build the SKU for the actual product. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the product option value's ID. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the the product option value's description + in the current locale. + + + +--- + +### displayValue +- displayValue: [String](TopLevel.String.md) `(read-only)` + - : Returns the the product option value's display name + in the current locale. + + + +--- + +### productIDModifier +- productIDModifier: [String](TopLevel.String.md) `(read-only)` + - : Returns the product option value's product ID modifier which + can be used to build the SKU for the actual product. + + + +--- + +## Method Details + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the the product option value's description + in the current locale. + + + **Returns:** + - The value of the product option value's description + in the current locale, or null if it wasn't found. + + + +--- + +### getDisplayValue() +- getDisplayValue(): [String](TopLevel.String.md) + - : Returns the the product option value's display name + in the current locale. + + + **Returns:** + - The value of the product option value's display name + in the current locale, or null if it wasn't found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the product option value's ID. + + **Returns:** + - the product option value's ID. + + +--- + +### getProductIDModifier() +- getProductIDModifier(): [String](TopLevel.String.md) + - : Returns the product option value's product ID modifier which + can be used to build the SKU for the actual product. + + + **Returns:** + - the product option value's product ID modifier which + can be used to build the SKU for the actual product. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceInfo.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceInfo.md new file mode 100644 index 00000000..dc64a366 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceInfo.md @@ -0,0 +1,170 @@ + +# Class ProductPriceInfo + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductPriceInfo](dw.catalog.ProductPriceInfo.md) + +Simple class representing a product price point. This class is useful +because it provides additional information beyond just the price. Since the +system calculates sales prices based on applicable price books, it is +sometimes useful to know additional information such as which price book +defined a price point, what percentage discount off the base price +this value represents, and the date range for which this price point is active. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the date from which the associated price point is valid. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the date until which the associated price point is valid. | +| [percentage](#percentage): [Number](TopLevel.Number.md) `(read-only)` | Returns the percentage off value of this price point related to the base price for the product's minimum order quantity. | +| [price](#price): [Money](dw.value.Money.md) `(read-only)` | Returns the monetary price for this price point. | +| [priceBook](#pricebook): [PriceBook](dw.catalog.PriceBook.md) `(read-only)` | Returns the price book which defined this price point. | +| [priceInfo](#priceinfo): [String](TopLevel.String.md) `(read-only)` | Returns the price info associated with this price point. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getOnlineFrom](dw.catalog.ProductPriceInfo.md#getonlinefrom)() | Returns the date from which the associated price point is valid. | +| [getOnlineTo](dw.catalog.ProductPriceInfo.md#getonlineto)() | Returns the date until which the associated price point is valid. | +| [getPercentage](dw.catalog.ProductPriceInfo.md#getpercentage)() | Returns the percentage off value of this price point related to the base price for the product's minimum order quantity. | +| [getPrice](dw.catalog.ProductPriceInfo.md#getprice)() | Returns the monetary price for this price point. | +| [getPriceBook](dw.catalog.ProductPriceInfo.md#getpricebook)() | Returns the price book which defined this price point. | +| [getPriceInfo](dw.catalog.ProductPriceInfo.md#getpriceinfo)() | Returns the price info associated with this price point. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date from which the associated price point is valid. If such a date doesn't exist, e.g. as in the + case of a continuous price point, null will be returned. + + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date until which the associated price point is valid. If such a date doesn't exist, e.g. as in the case + of a continuous price point, null will be returned. + + + +--- + +### percentage +- percentage: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the percentage off value of this price point related to the base + price for the product's minimum order quantity. + + + +--- + +### price +- price: [Money](dw.value.Money.md) `(read-only)` + - : Returns the monetary price for this price point. + + +--- + +### priceBook +- priceBook: [PriceBook](dw.catalog.PriceBook.md) `(read-only)` + - : Returns the price book which defined this price point. + + +--- + +### priceInfo +- priceInfo: [String](TopLevel.String.md) `(read-only)` + - : Returns the price info associated with this price point. This is an + arbitrary string which a merchant can associate with a price entry. This + can be used for example, to track which back-end system the price is + derived from. + + + +--- + +## Method Details + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the date from which the associated price point is valid. If such a date doesn't exist, e.g. as in the + case of a continuous price point, null will be returned. + + + **Returns:** + - the date from which the associated price point is valid + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the date until which the associated price point is valid. If such a date doesn't exist, e.g. as in the case + of a continuous price point, null will be returned. + + + **Returns:** + - the date to which the associated price point is valid + + +--- + +### getPercentage() +- getPercentage(): [Number](TopLevel.Number.md) + - : Returns the percentage off value of this price point related to the base + price for the product's minimum order quantity. + + + **Returns:** + - the percentage off value of this price point + + +--- + +### getPrice() +- getPrice(): [Money](dw.value.Money.md) + - : Returns the monetary price for this price point. + + **Returns:** + - the price amount + + +--- + +### getPriceBook() +- getPriceBook(): [PriceBook](dw.catalog.PriceBook.md) + - : Returns the price book which defined this price point. + + **Returns:** + - the price book defining this price + + +--- + +### getPriceInfo() +- getPriceInfo(): [String](TopLevel.String.md) + - : Returns the price info associated with this price point. This is an + arbitrary string which a merchant can associate with a price entry. This + can be used for example, to track which back-end system the price is + derived from. + + + **Returns:** + - the price info associated with this price point. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceModel.md new file mode 100644 index 00000000..3be16a27 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceModel.md @@ -0,0 +1,988 @@ + +# Class ProductPriceModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductPriceModel](dw.catalog.ProductPriceModel.md) + +ProductPriceModel provides methods to access all the +[PriceBook](dw.catalog.PriceBook.md) information of a product. A ProductPriceModel +instance is retrieved by calling [Product.getPriceModel()](dw.catalog.Product.md#getpricemodel) +or [Product.getPriceModel(ProductOptionModel)](dw.catalog.Product.md#getpricemodelproductoptionmodel) for a +specific product. The latter method will return a model which also includes +the additional option prices of an option product. + + +When the current price of a product is accessed in the storefront via its +price model, a price lookup is performed. The high-level steps of this price +lookup are: + + +- Get all price books applicable in the context of the current site, time, session, customer, source code. +- Identify all prices in the applicable price books and for a requested quantity. +- Calculate the best-price of all identified prices. The best-price is the lowest price. + + +In more detail: + + + +**Identify applicable price books** + + +- If any price books are explicitly registered in the session (see pipelet SetApplicablePriceBooks), use these price books and their direct parents for price lookup. Ignore all inactive price books, price books not valid at the current time, and price books with a currency other than the session currency. + + +**Otherwise:** + + +- If a valid source code is registered with the current session, get all price books assigned to the source code and their parent price books. Ignore all inactive price books, price books not valid at the current time, and price books with a currency other than the session currency. +- Get all price books assigned to site and their parent price books. Ignore all inactive price books, price books not valid at the current time, and price books with a currency other than the session currency. + + +**Identify all prices:** + + +- Get all price definitions for the product from all applicable price books. Ignore price definitions not valid at the current time. +- Convert any percentage price definition into a monetary amount. As the base price for this calculation, the minimum product price for the minimum order quantity of the product, including product options, is used. +- Compare all prices and identify the lowest (= best) price. +- Calculate best price for each defined price cut in the price table and return price table. + + +**Variation Price Fallback:** + + +- If no applicable pricebooks for a variant is found, the price lookup gets the price books from the variant's master product +- A price books is also not applicable of the price definition for the variant in the price book is not valid at the current time. + + + + + +Typically, in order to do a standard price lookup, it is only necessary to +call `Product.getPriceModel().getPrice()`. However, Commerce Cloud +Digital also supports tiered prices, meaning that higher quantities receive +a lower price. In this case, the merchant typically wants to display a table +of price points on product detail pages. Therefore, the ProductPriceModel +provides the method [getPriceTable()](dw.catalog.ProductPriceModel.md#getpricetable) to retrieve a table of these prices. + + + + +If a merchant wants to know not only what the price of a given product is, +but what price book the price was derived from, this class provides the +method [getPriceInfo()](dw.catalog.ProductPriceModel.md#getpriceinfo). This class also provides methods to lookup +product prices in specific price books by name and quantity. See +[getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [basePriceQuantity](#basepricequantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity for which the base price is defined. | +| [maxPrice](#maxprice): [Money](dw.value.Money.md) `(read-only)` | Calculates and returns the maximum price-book price of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [maxPricePerUnit](#maxpriceperunit): [Money](dw.value.Money.md) `(read-only)` | Calculates and returns the maximum price-book price per unit of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [minPrice](#minprice): [Money](dw.value.Money.md) `(read-only)` | Calculates and returns the minimum price-book price of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [minPricePerUnit](#minpriceperunit): [Money](dw.value.Money.md) `(read-only)` | Calculates and returns the minimum price-book price per unit of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [price](#price): [Money](dw.value.Money.md) `(read-only)` | Returns the active price of a product, calculated based on base price quantity 1.00. | +| [priceInfo](#priceinfo): [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) `(read-only)` | Returns the active price info of a product, calculated based on base price quantity 1.00. | +| [priceInfos](#priceinfos): [Collection](dw.util.Collection.md) `(read-only)` | Returns all the eligible `ProductPriceInfo`(s), calculated based on base price quantity 1.00. | +| [pricePerUnit](#priceperunit): [Money](dw.value.Money.md) `(read-only)` | Returns the sales price per unit of a product, calculated based on base price quantity 1.00. | +| [priceRange](#pricerange): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if this product is a master product (or product set) and the collection of online variants (or set products respectively) contains products of different prices. | +| [priceTable](#pricetable): [ProductPriceTable](dw.catalog.ProductPriceTable.md) `(read-only)` | Returns the product price table object. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBasePriceQuantity](dw.catalog.ProductPriceModel.md#getbasepricequantity)() | Returns the quantity for which the base price is defined. | +| [getMaxPrice](dw.catalog.ProductPriceModel.md#getmaxprice)() | Calculates and returns the maximum price-book price of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMaxPriceBookPrice](dw.catalog.ProductPriceModel.md#getmaxpricebookpricestring)([String](TopLevel.String.md)) | Calculates and returns the maximum price in a given price book of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMaxPriceBookPricePerUnit](dw.catalog.ProductPriceModel.md#getmaxpricebookpriceperunitstring)([String](TopLevel.String.md)) | Calculates and returns the maximum price per unit in a given price book of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMaxPricePerUnit](dw.catalog.ProductPriceModel.md#getmaxpriceperunit)() | Calculates and returns the maximum price-book price per unit of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMinPrice](dw.catalog.ProductPriceModel.md#getminprice)() | Calculates and returns the minimum price-book price of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMinPriceBookPrice](dw.catalog.ProductPriceModel.md#getminpricebookpricestring)([String](TopLevel.String.md)) | Calculates and returns the minimum price in a given price book of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMinPriceBookPricePerUnit](dw.catalog.ProductPriceModel.md#getminpricebookpriceperunitstring)([String](TopLevel.String.md)) | Calculates and returns the minimum price per unit in a given price book of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getMinPricePerUnit](dw.catalog.ProductPriceModel.md#getminpriceperunit)() | Calculates and returns the minimum price-book price per unit of all variants (for master products) or set-products (for product sets) for base quantity 1.00. | +| [getPrice](dw.catalog.ProductPriceModel.md#getprice)() | Returns the active price of a product, calculated based on base price quantity 1.00. | +| [getPrice](dw.catalog.ProductPriceModel.md#getpricequantity)([Quantity](dw.value.Quantity.md)) | Returns the active price of a product, calculated based on the passed order quantity. | +| [getPriceBookPrice](dw.catalog.ProductPriceModel.md#getpricebookpricestring)([String](TopLevel.String.md)) | Returns the active price of the product in the specified price book for quantity 1.00. | +| [getPriceBookPrice](dw.catalog.ProductPriceModel.md#getpricebookpricestring-quantity)([String](TopLevel.String.md), [Quantity](dw.value.Quantity.md)) | Returns the active price of the product in the specified price book for the specified quantity. | +| [getPriceBookPriceInfo](dw.catalog.ProductPriceModel.md#getpricebookpriceinfostring)([String](TopLevel.String.md)) | This method acts similarly to [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring) but returns a ProductPriceInfo object wrapping the actual price with additional information. | +| [getPriceBookPriceInfo](dw.catalog.ProductPriceModel.md#getpricebookpriceinfostring-quantity)([String](TopLevel.String.md), [Quantity](dw.value.Quantity.md)) | This method acts similarly to [getPriceBookPrice(String, Quantity)](dw.catalog.ProductPriceModel.md#getpricebookpricestring-quantity) but returns a ProductPriceInfo object wrapping the actual price with additional information. | +| [getPriceBookPricePerUnit](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring)([String](TopLevel.String.md)) | Returns the active price per unit of the product in the specified price book for quantity 1.00. | +| [getPriceBookPricePerUnit](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring-quantity)([String](TopLevel.String.md), [Quantity](dw.value.Quantity.md)) | Returns the active price per unit of the product in the specified price book for the specified quantity. | +| [getPriceInfo](dw.catalog.ProductPriceModel.md#getpriceinfo)() | Returns the active price info of a product, calculated based on base price quantity 1.00. | +| [getPriceInfo](dw.catalog.ProductPriceModel.md#getpriceinfoquantity)([Quantity](dw.value.Quantity.md)) | Returns the active price info of a product, calculated based on the passed order quantity. | +| [getPriceInfos](dw.catalog.ProductPriceModel.md#getpriceinfos)() | Returns all the eligible `ProductPriceInfo`(s), calculated based on base price quantity 1.00. | +| [getPricePerUnit](dw.catalog.ProductPriceModel.md#getpriceperunit)() | Returns the sales price per unit of a product, calculated based on base price quantity 1.00. | +| [getPricePerUnit](dw.catalog.ProductPriceModel.md#getpriceperunitquantity)([Quantity](dw.value.Quantity.md)) | Returns the sales price per unit of a product, calculated based on the passed order quantity. | +| ~~[getPricePercentage](dw.catalog.ProductPriceModel.md#getpricepercentagemoney-money)([Money](dw.value.Money.md), [Money](dw.value.Money.md))~~ | Calculates and returns the percentage off amount of the passed comparePrice to the passed basePrice. | +| [getPriceTable](dw.catalog.ProductPriceModel.md#getpricetable)() | Returns the product price table object. | +| [isPriceRange](dw.catalog.ProductPriceModel.md#ispricerange)() | Returns true if this product is a master product (or product set) and the collection of online variants (or set products respectively) contains products of different prices. | +| [isPriceRange](dw.catalog.ProductPriceModel.md#ispricerangestring)([String](TopLevel.String.md)) | Returns true if this product is a master product (or product set) and the collection of online variants (or set products respectively) contains products of different prices in the specified price book. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### basePriceQuantity +- basePriceQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity for which the base price is defined. This + is typically 1.0. + + + +--- + +### maxPrice +- maxPrice: [Money](dw.value.Money.md) `(read-only)` + - : Calculates and returns the maximum price-book price of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPrice()](dw.catalog.ProductPriceModel.md#getprice). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + +--- + +### maxPricePerUnit +- maxPricePerUnit: [Money](dw.value.Money.md) `(read-only)` + - : Calculates and returns the maximum price-book price per unit of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPricePerUnit()](dw.catalog.ProductPriceModel.md#getpriceperunit). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + e.g. + suppose one master product mp (price = $6, unitQuantity = 2), it has 2 variants: + v1(price = $5, unitQuantity = 5), v2(price = $10, unitQuantity = 20). + The max price per unit of mp will be max($6/2, $5/5, $10/20) = $3 + + + +--- + +### minPrice +- minPrice: [Money](dw.value.Money.md) `(read-only)` + - : Calculates and returns the minimum price-book price of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPrice()](dw.catalog.ProductPriceModel.md#getprice). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + +--- + +### minPricePerUnit +- minPricePerUnit: [Money](dw.value.Money.md) `(read-only)` + - : Calculates and returns the minimum price-book price per unit of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPricePerUnit()](dw.catalog.ProductPriceModel.md#getpriceperunit). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + e.g. + suppose one master product mp (price = $6, unitQuantity = 2), it has 2 variants: + v1(price = $5, unitQuantity = 5), v2(price = $10, unitQuantity = 20). + The min price per unit of mp will be min($6/2, $5/5, $10/20) = $0.5 + + + +--- + +### price +- price: [Money](dw.value.Money.md) `(read-only)` + - : Returns the active price of a product, calculated based on base price quantity + 1.00. The price is returned for the currency of the current session. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitly + set as applicable in the current session. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If no price could be found, MONEY.NOT\_AVAILABLE is returned. + + + +--- + +### priceInfo +- priceInfo: [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) `(read-only)` + - : Returns the active price info of a product, calculated based on base price + quantity 1.00. The price is returned for the currency of the current + session. + + + This method is similar to `getPrice()` but instead of just + returning the price value, it returns a `ProductPriceInfo` + which contains additional information such as the PriceBook which defined + the price and the percentage discount this price point represents. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If no price info could be found, null is returned. + + + **See Also:** + - [getPrice()](dw.catalog.ProductPriceModel.md#getprice) + - [getPriceInfo(Quantity)](dw.catalog.ProductPriceModel.md#getpriceinfoquantity) + + +--- + +### priceInfos +- priceInfos: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all the eligible `ProductPriceInfo`(s), calculated based + on base price quantity 1.00. This will return an empty list if getPriceInfo() would return null, and if there is + only one price info in the collection it will be the same price info as getPriceInfo(). Two or more price infos + indicate that there are that many price books that meet the criteria for returning the price shown in the + storefront. + + + **See Also:** + - [getPriceInfo()](dw.catalog.ProductPriceModel.md#getpriceinfo) + + +--- + +### pricePerUnit +- pricePerUnit: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sales price per unit of a product, calculated based on base price + quantity 1.00. + + + The product sales price per unit is returned for the current session currency. + Hence, the using this method is only useful in storefront processes. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitly + set as applicable in the current session. + + + If no price could be found, MONEY.N\_A is returned. + + + +--- + +### priceRange +- priceRange: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if this product is a master product (or product set) and the + collection of online variants (or set products respectively) contains + products of different prices. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + +--- + +### priceTable +- priceTable: [ProductPriceTable](dw.catalog.ProductPriceTable.md) `(read-only)` + - : Returns the product price table object. The price table represents a map + between order quantities and prices, and also provides % off information + to be shown to storefront customers. The price is returned for the + currency of the current session. + + + Usually, the product price table is printed on product detail pages in + the storefront. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + All other methods of this class are based on the information in the + product price table. + + + +--- + +## Method Details + +### getBasePriceQuantity() +- getBasePriceQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity for which the base price is defined. This + is typically 1.0. + + + **Returns:** + - the quantity for which the base price is defined. + + +--- + +### getMaxPrice() +- getMaxPrice(): [Money](dw.value.Money.md) + - : Calculates and returns the maximum price-book price of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPrice()](dw.catalog.ProductPriceModel.md#getprice). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + **Returns:** + - Maximum price of all online variants or set-products. + + +--- + +### getMaxPriceBookPrice(String) +- getMaxPriceBookPrice(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Calculates and returns the maximum price in a given price book of all + variants (for master products) or set-products (for product sets) for + base quantity 1.00. This value can be used to display a range of prices + in storefront. + + This method follows the same rules as + [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring) in determining the price book + price for each variant or set-product. If the product represented by this + model is not a master product or product set, then this method behaves + the same as [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring). + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - The maximum price across all subproducts in the specified price + book. + + + +--- + +### getMaxPriceBookPricePerUnit(String) +- getMaxPriceBookPricePerUnit(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Calculates and returns the maximum price per unit in a given price book of all + variants (for master products) or set-products (for product sets) for + base quantity 1.00. This value can be used to display a range of price per units + in storefront. + + This method follows the same rules as + [getPriceBookPricePerUnit(String)](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring) in determining the price book + price for each variant or set-product. If the product represented by this + model is not a master product or product set, then this method behaves + the same as [getPriceBookPricePerUnit(String)](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring). + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - The maximum price per unit across all sub-products in the specified price + book. + + + +--- + +### getMaxPricePerUnit() +- getMaxPricePerUnit(): [Money](dw.value.Money.md) + - : Calculates and returns the maximum price-book price per unit of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPricePerUnit()](dw.catalog.ProductPriceModel.md#getpriceperunit). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + e.g. + suppose one master product mp (price = $6, unitQuantity = 2), it has 2 variants: + v1(price = $5, unitQuantity = 5), v2(price = $10, unitQuantity = 20). + The max price per unit of mp will be max($6/2, $5/5, $10/20) = $3 + + + **Returns:** + - Maximum price per unit of all online variants or set-products. + + +--- + +### getMinPrice() +- getMinPrice(): [Money](dw.value.Money.md) + - : Calculates and returns the minimum price-book price of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPrice()](dw.catalog.ProductPriceModel.md#getprice). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + **Returns:** + - Minimum price of all online variants or set-products. + + +--- + +### getMinPriceBookPrice(String) +- getMinPriceBookPrice(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Calculates and returns the minimum price in a given price book of all + variants (for master products) or set-products (for product sets) for + base quantity 1.00. This value can be used to display a range of prices + in storefront. + + This method follows the same rules as + [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring) in determining the price book + price for each variant or set-product. If the product represented by this + model is not a master product or product set, then this method behaves + the same as [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring). + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - The minimum price across all subproducts in the specified price + book. + + + +--- + +### getMinPriceBookPricePerUnit(String) +- getMinPriceBookPricePerUnit(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Calculates and returns the minimum price per unit in a given price book of all + variants (for master products) or set-products (for product sets) for + base quantity 1.00. This value can be used to display a range of price per units + in storefront. + + This method follows the same rules as + [getPriceBookPricePerUnit(String)](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring) in determining the price book + price for each variant or set-product. If the product represented by this + model is not a master product or product set, then this method behaves + the same as [getPriceBookPricePerUnit(String)](dw.catalog.ProductPriceModel.md#getpricebookpriceperunitstring). + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - The minimum price per unit across all sub-products in the specified price + book. + + + +--- + +### getMinPricePerUnit() +- getMinPricePerUnit(): [Money](dw.value.Money.md) + - : Calculates and returns the minimum price-book price per unit of all variants (for + master products) or set-products (for product sets) for base quantity + 1.00. This value can be used to display a range of prices in storefront. + If the product represented by this model is not a master product or + product set, then this method behaves the same as [getPricePerUnit()](dw.catalog.ProductPriceModel.md#getpriceperunit). + Only online products are considered. If the "orderable products only" + search preference is enabled for the current site, then only orderable + products are considered. For master products, only variants with all + variation attributes configured are considered. + + e.g. + suppose one master product mp (price = $6, unitQuantity = 2), it has 2 variants: + v1(price = $5, unitQuantity = 5), v2(price = $10, unitQuantity = 20). + The min price per unit of mp will be min($6/2, $5/5, $10/20) = $0.5 + + + **Returns:** + - Minimum price of all online variants or set-products. + + +--- + +### getPrice() +- getPrice(): [Money](dw.value.Money.md) + - : Returns the active price of a product, calculated based on base price quantity + 1.00. The price is returned for the currency of the current session. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitly + set as applicable in the current session. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If no price could be found, MONEY.NOT\_AVAILABLE is returned. + + + **Returns:** + - the product price. + + +--- + +### getPrice(Quantity) +- getPrice(quantity: [Quantity](dw.value.Quantity.md)): [Money](dw.value.Money.md) + - : Returns the active price of a product, calculated based on the passed order + quantity. The price is returned for the currency of the current session. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitly + set as applicable in the current session. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If passed order quantity < 1 (and greater than zero), price for quantity + 1 is returned. + + + If no price could be found, MONEY.NOT\_AVAILABLE is returned. + + + **Parameters:** + - quantity - Quantity price is requested for + + **Returns:** + - the product price. + + +--- + +### getPriceBookPrice(String) +- getPriceBookPrice(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Returns the active price of the product in the specified price book for + quantity 1.00. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + Money.NOT\_AVAILABLE will be returned in any of the following cases: + + + - priceBookID is null or does not identify a valid price book. + - The price book has no price for the product. + - None of the prices for the product in the price book is currently active. + - The currently active price entry is a percentage. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for. + + **Returns:** + - the price of the product in the specified price book. + + +--- + +### getPriceBookPrice(String, Quantity) +- getPriceBookPrice(priceBookID: [String](TopLevel.String.md), quantity: [Quantity](dw.value.Quantity.md)): [Money](dw.value.Money.md) + - : Returns the active price of the product in the specified price book for + the specified quantity. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + Money.NOT\_AVAILABLE will be returned in any of the following cases: + + + - priceBookID is null or does not identify a valid price book. + - quantity is null. + - The price book has no price for the product. + - None of the prices for the product in the price book is currently active. + - The currently active price entry is a percentage. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for. + - quantity - the specified quantity to find the price for. + + **Returns:** + - the price of the product in the specified price book. + + +--- + +### getPriceBookPriceInfo(String) +- getPriceBookPriceInfo(priceBookID: [String](TopLevel.String.md)): [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) + - : This method acts similarly to [getPriceBookPrice(String)](dw.catalog.ProductPriceModel.md#getpricebookpricestring) but + returns a ProductPriceInfo object wrapping the actual price with + additional information. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - the product price info, or null if not found. + + +--- + +### getPriceBookPriceInfo(String, Quantity) +- getPriceBookPriceInfo(priceBookID: [String](TopLevel.String.md), quantity: [Quantity](dw.value.Quantity.md)): [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) + - : This method acts similarly to + [getPriceBookPrice(String, Quantity)](dw.catalog.ProductPriceModel.md#getpricebookpricestring-quantity) but returns a + ProductPriceInfo object wrapping the actual price with additional + information. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + - quantity - Quantity price is requested for. + + **Returns:** + - the product price info, or null if not found. + + +--- + +### getPriceBookPricePerUnit(String) +- getPriceBookPricePerUnit(priceBookID: [String](TopLevel.String.md)): [Money](dw.value.Money.md) + - : Returns the active price per unit of the product in the specified price book for + quantity 1.00. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + Money.NOT\_AVAILABLE will be returned in any of the following cases: + + + - The priceBookID does not identify a valid price book. + - The price book has no price for the product. + - None of the prices for the product in the price book is currently active. + - The currently active price entry is a percentage. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + + **Returns:** + - the price per unit of the product in the specified price book. + + +--- + +### getPriceBookPricePerUnit(String, Quantity) +- getPriceBookPricePerUnit(priceBookID: [String](TopLevel.String.md), quantity: [Quantity](dw.value.Quantity.md)): [Money](dw.value.Money.md) + - : Returns the active price per unit of the product in the specified price book for + the specified quantity. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + Money.NOT\_AVAILABLE will be returned in any of the following cases: + + + - The priceBookID does not identify a valid price book. + - The price book has no price for the product. + - None of the prices for the product in the price book is currently active. + - The currently active price entry is a percentage. + + + **Parameters:** + - priceBookID - ID of price book the price is requested for, must not be null. + - quantity - the specified quantity to find the price for, must not be null. + + **Returns:** + - the price per unit of the product in the specified price book for the specific quantity. + + +--- + +### getPriceInfo() +- getPriceInfo(): [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) + - : Returns the active price info of a product, calculated based on base price + quantity 1.00. The price is returned for the currency of the current + session. + + + This method is similar to `getPrice()` but instead of just + returning the price value, it returns a `ProductPriceInfo` + which contains additional information such as the PriceBook which defined + the price and the percentage discount this price point represents. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If no price info could be found, null is returned. + + + **Returns:** + - the product price info, or null if not found. + + **See Also:** + - [getPrice()](dw.catalog.ProductPriceModel.md#getprice) + - [getPriceInfo(Quantity)](dw.catalog.ProductPriceModel.md#getpriceinfoquantity) + + +--- + +### getPriceInfo(Quantity) +- getPriceInfo(quantity: [Quantity](dw.value.Quantity.md)): [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) + - : Returns the active price info of a product, calculated based on the passed order + quantity. The price is returned for the currency of the current session. + + + This method is similar to `getPrice(Quantity)` but instead of + just returning the price value, it returns a + `ProductPriceInfo` which contains additional information such + as the PriceBook which defined the price and the percentage discount this + price point represents. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + If no price info could be found, null is returned. + + + **Parameters:** + - quantity - the quantity to use. + + **Returns:** + - the product price info, or null if not found. + + **See Also:** + - [getPrice(Quantity)](dw.catalog.ProductPriceModel.md#getpricequantity) + + +--- + +### getPriceInfos() +- getPriceInfos(): [Collection](dw.util.Collection.md) + - : Returns all the eligible `ProductPriceInfo`(s), calculated based + on base price quantity 1.00. This will return an empty list if getPriceInfo() would return null, and if there is + only one price info in the collection it will be the same price info as getPriceInfo(). Two or more price infos + indicate that there are that many price books that meet the criteria for returning the price shown in the + storefront. + + + **Returns:** + - any product price info that could be responsible for the storefront price, or empty collection if there + were no product price infos this price model. + + + **See Also:** + - [getPriceInfo()](dw.catalog.ProductPriceModel.md#getpriceinfo) + + +--- + +### getPricePerUnit() +- getPricePerUnit(): [Money](dw.value.Money.md) + - : Returns the sales price per unit of a product, calculated based on base price + quantity 1.00. + + + The product sales price per unit is returned for the current session currency. + Hence, the using this method is only useful in storefront processes. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitly + set as applicable in the current session. + + + If no price could be found, MONEY.N\_A is returned. + + + **Returns:** + - product sales price per unit + + +--- + +### getPricePerUnit(Quantity) +- getPricePerUnit(quantity: [Quantity](dw.value.Quantity.md)): [Money](dw.value.Money.md) + - : Returns the sales price per unit of a product, calculated based on the passed + order quantity. + + + The product sales price per unit is returned for the current session currency. + Hence, the using this method is only useful in storefront processes. + + + The price lookup is based on the configuration of price books. It depends + on various settings, such as which price books are active, or explicitely + set as applicable in the current session. + + + If no price could be found, MONEY.N\_A is returned. + + + **Parameters:** + - quantity - Quantity price is requested for + + **Returns:** + - product sales price per unit + + +--- + +### getPricePercentage(Money, Money) +- ~~getPricePercentage(basePrice: [Money](dw.value.Money.md), comparePrice: [Money](dw.value.Money.md)): [Number](TopLevel.Number.md)~~ + - : Calculates and returns the percentage off amount of the passed + comparePrice to the passed basePrice. + + + **Parameters:** + - basePrice - The assumed 100% price amount + - comparePrice - The price to compare to the basePrice + + **Returns:** + - The percentage between comparePrice and basePrice (e.g. 90%). + + **Deprecated:** +:::warning +Use [Money.percentLessThan(Money)](dw.value.Money.md#percentlessthanmoney) +::: + +--- + +### getPriceTable() +- getPriceTable(): [ProductPriceTable](dw.catalog.ProductPriceTable.md) + - : Returns the product price table object. The price table represents a map + between order quantities and prices, and also provides % off information + to be shown to storefront customers. The price is returned for the + currency of the current session. + + + Usually, the product price table is printed on product detail pages in + the storefront. + + + If the product represented by this model is an option product, option + prices will be added to the price book price if the price model was + initialized with an option model. + + + All other methods of this class are based on the information in the + product price table. + + + **Returns:** + - the Product price table. + + +--- + +### isPriceRange() +- isPriceRange(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this product is a master product (or product set) and the + collection of online variants (or set products respectively) contains + products of different prices. + + + **Warning:** If the product represented by this model is a master + product with numerous variants, this method can be very expensive and + should be avoided. + + + **Returns:** + - True if this product has a range of prices, false otherwise. + + +--- + +### isPriceRange(String) +- isPriceRange(priceBookID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if this product is a master product (or product set) and the + collection of online variants (or set products respectively) contains + products of different prices in the specified price book. + + + **Parameters:** + - priceBookID - The ID of the price book. + + **Returns:** + - True if this product has a range of prices, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceTable.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceTable.md new file mode 100644 index 00000000..2f8b6e36 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductPriceTable.md @@ -0,0 +1,121 @@ + +# Class ProductPriceTable + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductPriceTable](dw.catalog.ProductPriceTable.md) + +A ProductPriceTable is a map of quantities to prices representing the +potentially tiered prices of a product in Commerce Cloud Digital. The price +of a product is the price associated with the largest quantity in +the ProductPriceTable which does not exceed the purchase quantity. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [quantities](#quantities): [Collection](dw.util.Collection.md) `(read-only)` | Returns all quantities stored in the price table. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getNextQuantity](dw.catalog.ProductPriceTable.md#getnextquantityquantity)([Quantity](dw.value.Quantity.md)) | Returns the quantity following the passed quantity in the price table. | +| [getPercentage](dw.catalog.ProductPriceTable.md#getpercentagequantity)([Quantity](dw.value.Quantity.md)) | Returns the percentage off value of the price related to the passed quantity, calculated based on the price of the products minimum order quantity. | +| [getPrice](dw.catalog.ProductPriceTable.md#getpricequantity)([Quantity](dw.value.Quantity.md)) | Returns the monetary price for the passed order quantity. | +| [getPriceBook](dw.catalog.ProductPriceTable.md#getpricebookquantity)([Quantity](dw.value.Quantity.md)) | Returns the price book which defined the monetary price for the passed order quantity. | +| [getQuantities](dw.catalog.ProductPriceTable.md#getquantities)() | Returns all quantities stored in the price table. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### quantities +- quantities: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all quantities stored in the price table. + + +--- + +## Method Details + +### getNextQuantity(Quantity) +- getNextQuantity(quantity: [Quantity](dw.value.Quantity.md)): [Quantity](dw.value.Quantity.md) + - : Returns the quantity following the passed quantity in the price table. + If the passed quantity is the last entry in the price table, null is + returned. + + + **Parameters:** + - quantity - the quantity to use to locate the next quantity in the price table. + + **Returns:** + - the next quantity or null. + + +--- + +### getPercentage(Quantity) +- getPercentage(quantity: [Quantity](dw.value.Quantity.md)): [Number](TopLevel.Number.md) + - : Returns the percentage off value of the price related to the passed quantity, + calculated based on the price of the products minimum order quantity. + + + **Parameters:** + - quantity - the price quantity to compute the percentage off. + + **Returns:** + - the percentage off value of the price related to the passed quantity. + + +--- + +### getPrice(Quantity) +- getPrice(quantity: [Quantity](dw.value.Quantity.md)): [Money](dw.value.Money.md) + - : Returns the monetary price for the passed order quantity. If + no price is defined for the passed quantity, null is returned. This + can happen if for example no price is defined for a single item. + + + **Parameters:** + - quantity - the quantity to use to determine price. + + **Returns:** + - price amount for the passed quantity + + +--- + +### getPriceBook(Quantity) +- getPriceBook(quantity: [Quantity](dw.value.Quantity.md)): [PriceBook](dw.catalog.PriceBook.md) + - : Returns the price book which defined the monetary price for the passed + order quantity. If no price is defined for the passed quantity, null is + returned. This can happen if for example no price is defined for a single + item. + + + **Parameters:** + - quantity - the quantity to use to determine price. + + **Returns:** + - the price book defining this price, or null + + +--- + +### getQuantities() +- getQuantities(): [Collection](dw.util.Collection.md) + - : Returns all quantities stored in the price table. + + **Returns:** + - all price table quantities. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchHit.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchHit.md new file mode 100644 index 00000000..6d28e92a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchHit.md @@ -0,0 +1,702 @@ + +# Class ProductSearchHit + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductSearchHit](dw.catalog.ProductSearchHit.md) + +ProductSearchHit is the result of a executed search query and wraps the actual product found by the search. + +The method [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) returns the actual products that is conforming the query and is represented by the search hit. +Depending on the hit typ, [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) returns: + +- [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product +- [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation product +- [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product part of set +- [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product part of a bundle +- [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)-> a variation product + + +The ProductSearchHit type can be retrieved by method [getHitType()](dw.catalog.ProductSearchHit.md#gethittype) and contains the following types: + +- [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple) +- [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master) +- [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set) +- [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle) +- [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group) + + +The method [getProduct()](dw.catalog.ProductSearchHit.md#getproduct) returns the presentation product corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. + +- [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product +- [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation master product +- [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product set +- [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product bundle +- [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation group + + +Example: + +Given a product master P1 called "Sweater" with attributes color and size that has the following variants: + +- V1 - color: red, size: small +- V2 - color: red, size: large +- V3 - color: blue, size: small +- V4 - color: blue, size: large +- V5 - color: yellow, size: small +- V6 - color: yellow, size: large + + +A search for "red sweater" should hit the first two variants, V1 and V2 +that are both red. The ProductSearchHit for this result encompass the master and the red variants but not the other +non-relevant variants. + +The variants hit by the query can be retrieved by [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts), returning a list that contains the two red sweater variants. + +The master product "Sweater" is returned by [getProduct()](dw.catalog.ProductSearchHit.md#getproduct). + +Furthermore, to get the first or last of that list of variants hit by the query we can call +[getFirstRepresentedProduct()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct) or [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct). The product with the highest +sort rank is returned first, and the product with the lowest sort rank is +returned last. The product sort rank depends on the sorting conditions +used for the search query. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [HIT_TYPE_PRODUCT_BUNDLE](#hit_type_product_bundle): [String](TopLevel.String.md) = "bundle" | Constant representing a product search hit type based on the presentation product of a hit. | +| [HIT_TYPE_PRODUCT_MASTER](#hit_type_product_master): [String](TopLevel.String.md) = "master" | Constant representing a product search hit type based on the presentation product of a hit. | +| [HIT_TYPE_PRODUCT_SET](#hit_type_product_set): [String](TopLevel.String.md) = "set" | Constant representing a product search hit type based on the presentation product of a hit. | +| [HIT_TYPE_SIMPLE](#hit_type_simple): [String](TopLevel.String.md) = "product" | Constant representing a product search hit type based on the presentation product of a hit. | +| ~~[HIT_TYPE_SLICING_GROUP](#hit_type_slicing_group): [String](TopLevel.String.md) = "slicing_group"~~ | Constant representing a product search hit type based on the presentation product of a hit. | +| [HIT_TYPE_VARIATION_GROUP](#hit_type_variation_group): [String](TopLevel.String.md) = "variation_group" | Constant representing a product search hit type based on the presentation product of a hit. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [firstRepresentedProduct](#firstrepresentedproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query. | +| [firstRepresentedProductID](#firstrepresentedproductid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query. | +| [hitType](#hittype): [String](TopLevel.String.md) `(read-only)` | Returns the type of the product wrapped by this search hit. | +| [lastRepresentedProduct](#lastrepresentedproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query. | +| [lastRepresentedProductID](#lastrepresentedproductid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query. | +| [maxPrice](#maxprice): [Money](dw.value.Money.md) `(read-only)` | Returns the maximum price of all products represented by the product hit. | +| [maxPricePerUnit](#maxpriceperunit): [Money](dw.value.Money.md) `(read-only)` | Returns the maximum price per unit of all products represented by the product hit. | +| [minPrice](#minprice): [Money](dw.value.Money.md) `(read-only)` | Returns the minimum price of all products represented by the product hit. | +| [minPricePerUnit](#minpriceperunit): [Money](dw.value.Money.md) `(read-only)` | Returns the minimum price per unit of all products represented by the product hit. | +| [priceRange](#pricerange): [Boolean](TopLevel.Boolean.md) `(read-only)` | Convenience method to check whether this ProductSearchHit represents multiple products (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)) that have different prices. | +| [product](#product): [Product](dw.catalog.Product.md) `(read-only)` | Returns the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. | +| [productID](#productid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. | +| [representedProductIDs](#representedproductids): [List](dw.util.List.md) `(read-only)` | The method returns the actual ID of the product that is conforming the query and is represented by the search hit. | +| [representedProducts](#representedproducts): [List](dw.util.List.md) `(read-only)` | The method returns the actual product that is conforming the query and is represented by the search hit. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getFirstRepresentedProduct](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct)() | Returns the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query. | +| [getFirstRepresentedProductID](dw.catalog.ProductSearchHit.md#getfirstrepresentedproductid)() | Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query. | +| [getHitType](dw.catalog.ProductSearchHit.md#gethittype)() | Returns the type of the product wrapped by this search hit. | +| [getLastRepresentedProduct](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct)() | Returns the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query. | +| [getLastRepresentedProductID](dw.catalog.ProductSearchHit.md#getlastrepresentedproductid)() | Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query. | +| [getMaxPrice](dw.catalog.ProductSearchHit.md#getmaxprice)() | Returns the maximum price of all products represented by the product hit. | +| [getMaxPricePerUnit](dw.catalog.ProductSearchHit.md#getmaxpriceperunit)() | Returns the maximum price per unit of all products represented by the product hit. | +| [getMinPrice](dw.catalog.ProductSearchHit.md#getminprice)() | Returns the minimum price of all products represented by the product hit. | +| [getMinPricePerUnit](dw.catalog.ProductSearchHit.md#getminpriceperunit)() | Returns the minimum price per unit of all products represented by the product hit. | +| [getProduct](dw.catalog.ProductSearchHit.md#getproduct)() | Returns the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. | +| [getProductID](dw.catalog.ProductSearchHit.md#getproductid)() | Returns the ID of the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. | +| [getRepresentedProductIDs](dw.catalog.ProductSearchHit.md#getrepresentedproductids)() | The method returns the actual ID of the product that is conforming the query and is represented by the search hit. | +| [getRepresentedProducts](dw.catalog.ProductSearchHit.md#getrepresentedproducts)() | The method returns the actual product that is conforming the query and is represented by the search hit. | +| [getRepresentedVariationValues](dw.catalog.ProductSearchHit.md#getrepresentedvariationvaluesobject)([Object](TopLevel.Object.md)) | This method is only applicable if this ProductSearchHit represents a product variation (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)). | +| [isPriceRange](dw.catalog.ProductSearchHit.md#ispricerange)() | Convenience method to check whether this ProductSearchHit represents multiple products (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)) that have different prices. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### HIT_TYPE_PRODUCT_BUNDLE + +- HIT_TYPE_PRODUCT_BUNDLE: [String](TopLevel.String.md) = "bundle" + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with product bundles. + + +--- + +### HIT_TYPE_PRODUCT_MASTER + +- HIT_TYPE_PRODUCT_MASTER: [String](TopLevel.String.md) = "master" + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with master products. + + +--- + +### HIT_TYPE_PRODUCT_SET + +- HIT_TYPE_PRODUCT_SET: [String](TopLevel.String.md) = "set" + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with product sets. + + +--- + +### HIT_TYPE_SIMPLE + +- HIT_TYPE_SIMPLE: [String](TopLevel.String.md) = "product" + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with single, non-complex products, including product variants that + are assigned to a category and are returned as the presentation product. + + + +--- + +### HIT_TYPE_SLICING_GROUP + +- ~~HIT_TYPE_SLICING_GROUP: [String](TopLevel.String.md) = "slicing_group"~~ + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with slicing groups. + + **Deprecated:** +:::warning +Please use [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group) instead. +::: + +--- + +### HIT_TYPE_VARIATION_GROUP + +- HIT_TYPE_VARIATION_GROUP: [String](TopLevel.String.md) = "variation_group" + - : Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with variation groups. + + +--- + +## Property Details + +### firstRepresentedProduct +- firstRepresentedProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the product that is actually hit by the search and has the highest + sort rank according to the sorting conditions used for the search query. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### firstRepresentedProductID +- firstRepresentedProductID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product that is actually hit by the search and has the highest + sort rank according to the sorting conditions used for the search query. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### hitType +- hitType: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of the product wrapped by this search hit. The product type returned will be one of the hit types: + + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple) - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master) - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle) - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set) - [HIT_TYPE_SLICING_GROUP](dw.catalog.ProductSearchHit.md#hit_type_slicing_group) - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group) + + + +--- + +### lastRepresentedProduct +- lastRepresentedProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the product that is actually hit by the search and has the lowest + sort rank according to the sorting conditions used for the search query. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### lastRepresentedProductID +- lastRepresentedProductID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product that is actually hit by the search and has the lowest + sort rank according to the sorting conditions used for the search query. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### maxPrice +- maxPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the maximum price of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the maximum. The method returns + `N/A` in case no price information can be found. + + + Note: The method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + +--- + +### maxPricePerUnit +- maxPricePerUnit: [Money](dw.value.Money.md) `(read-only)` + - : Returns the maximum price per unit of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the maximum. The method returns + `N/A` in case no price information can be found. + + + Note: The method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + +--- + +### minPrice +- minPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the minimum price of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the minimum. The method returns + `N/A` in case no price information can be found. + + + Note: the method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + +--- + +### minPricePerUnit +- minPricePerUnit: [Money](dw.value.Money.md) `(read-only)` + - : Returns the minimum price per unit of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the minimum. The method returns + `N/A` in case no price information can be found. + + + Note: the method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + +--- + +### priceRange +- priceRange: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Convenience method to check whether this ProductSearchHit represents + multiple products (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)) that have + different prices. + + + +--- + +### product +- product: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation master product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation group + + + To retrieve the product(s) actually hit by the search use [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts). + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + + +--- + +### productID +- productID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation master product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation group + + + To retrieve the ID of the product actually hit by the search use [getFirstRepresentedProductID()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproductid) or [getLastRepresentedProductID()](dw.catalog.ProductSearchHit.md#getlastrepresentedproductid). + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + + +--- + +### representedProductIDs +- representedProductIDs: [List](dw.util.List.md) `(read-only)` + - : The method returns the actual ID of the product that is conforming the query and is represented by the search hit. + Depending on the hit typ, it returns the ID of: + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product part of set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product part of a bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation product + + + If the method returns multiple products, the product with the highest + sort rank is returned first, and the product with the lowest sort rank is + returned last. The product sort rank depends on the sorting conditions + used for the search query. + + + **See Also:** + - [getFirstRepresentedProduct()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### representedProducts +- representedProducts: [List](dw.util.List.md) `(read-only)` + - : The method returns the actual product that is conforming the query and is represented by the search hit. + Depending on the hit typ, [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) returns: + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product part of set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product part of a bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation product + + + If the method returns multiple products, the product with the highest + sort rank is returned first, and the product with the lowest sort rank is + returned last. The product sort rank depends on the sorting conditions + used for the search query. + + + **See Also:** + - [getFirstRepresentedProduct()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +## Method Details + +### getFirstRepresentedProduct() +- getFirstRepresentedProduct(): [Product](dw.catalog.Product.md) + - : Returns the product that is actually hit by the search and has the highest + sort rank according to the sorting conditions used for the search query. + + + **Returns:** + - the first product that is actually hit by the search + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getFirstRepresentedProductID() +- getFirstRepresentedProductID(): [String](TopLevel.String.md) + - : Returns the ID of the product that is actually hit by the search and has the highest + sort rank according to the sorting conditions used for the search query. + + + **Returns:** + - the ID of the first product that is actually hit by the search + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getHitType() +- getHitType(): [String](TopLevel.String.md) + - : Returns the type of the product wrapped by this search hit. The product type returned will be one of the hit types: + + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple) - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master) - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle) - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set) - [HIT_TYPE_SLICING_GROUP](dw.catalog.ProductSearchHit.md#hit_type_slicing_group) - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group) + + + **Returns:** + - search hit type + + +--- + +### getLastRepresentedProduct() +- getLastRepresentedProduct(): [Product](dw.catalog.Product.md) + - : Returns the product that is actually hit by the search and has the lowest + sort rank according to the sorting conditions used for the search query. + + + **Returns:** + - the last product that is actually hit by the search + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getLastRepresentedProductID() +- getLastRepresentedProductID(): [String](TopLevel.String.md) + - : Returns the ID of the product that is actually hit by the search and has the lowest + sort rank according to the sorting conditions used for the search query. + + + **Returns:** + - the ID of the last product that is actually hit by the search + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getMaxPrice() +- getMaxPrice(): [Money](dw.value.Money.md) + - : Returns the maximum price of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the maximum. The method returns + `N/A` in case no price information can be found. + + + Note: The method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + **Returns:** + - the maximum price of all products represented by the product hit. + + +--- + +### getMaxPricePerUnit() +- getMaxPricePerUnit(): [Money](dw.value.Money.md) + - : Returns the maximum price per unit of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the maximum. The method returns + `N/A` in case no price information can be found. + + + Note: The method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + **Returns:** + - the maximum price per unit of all products represented by the product hit. + + +--- + +### getMinPrice() +- getMinPrice(): [Money](dw.value.Money.md) + - : Returns the minimum price of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the minimum. The method returns + `N/A` in case no price information can be found. + + + Note: the method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + **Returns:** + - the minimum price of all products represented by the product hit. + + +--- + +### getMinPricePerUnit() +- getMinPricePerUnit(): [Money](dw.value.Money.md) + - : Returns the minimum price per unit of all products represented by the + product hit. See [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) for details on + the set of products used for finding the minimum. The method returns + `N/A` in case no price information can be found. + + + Note: the method uses price information of the search index and therefore + might return different prices than the ProductPriceModel. + + + **Returns:** + - the minimum price per unit of all products represented by the product hit. + + +--- + +### getProduct() +- getProduct(): [Product](dw.catalog.Product.md) + - : Returns the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation master product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation group + + + To retrieve the product(s) actually hit by the search use [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts). + + + **Returns:** + - the presentation product of this ProductSearchHit, which is possibly a + representative of other related products actually hit by the + search. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + + +--- + +### getProductID() +- getProductID(): [String](TopLevel.String.md) + - : Returns the ID of the presentation product of this ProductSearchHit corresponding to the [ProductSearchHit](dw.catalog.ProductSearchHit.md) type. + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation master product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation group + + + To retrieve the ID of the product actually hit by the search use [getFirstRepresentedProductID()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproductid) or [getLastRepresentedProductID()](dw.catalog.ProductSearchHit.md#getlastrepresentedproductid). + + + **Returns:** + - the ID of the presentation product of this ProductSearchHit, that possibly represents + a set of related products actually hit by the search. + + + **See Also:** + - [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) + + +--- + +### getRepresentedProductIDs() +- getRepresentedProductIDs(): [List](dw.util.List.md) + - : The method returns the actual ID of the product that is conforming the query and is represented by the search hit. + Depending on the hit typ, it returns the ID of: + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product part of set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product part of a bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation product + + + If the method returns multiple products, the product with the highest + sort rank is returned first, and the product with the lowest sort rank is + returned last. The product sort rank depends on the sorting conditions + used for the search query. + + + **Returns:** + - a sorted list of products represented by the wrapped product. + + **See Also:** + - [getFirstRepresentedProduct()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getRepresentedProducts() +- getRepresentedProducts(): [List](dw.util.List.md) + - : The method returns the actual product that is conforming the query and is represented by the search hit. + Depending on the hit typ, [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts) returns: + + - [HIT_TYPE_SIMPLE](dw.catalog.ProductSearchHit.md#hit_type_simple)-> a simple product + - [HIT_TYPE_PRODUCT_MASTER](dw.catalog.ProductSearchHit.md#hit_type_product_master)-> a variation product + - [HIT_TYPE_PRODUCT_SET](dw.catalog.ProductSearchHit.md#hit_type_product_set)-> a product part of set + - [HIT_TYPE_PRODUCT_BUNDLE](dw.catalog.ProductSearchHit.md#hit_type_product_bundle)-> a product part of a bundle + - [HIT_TYPE_VARIATION_GROUP](dw.catalog.ProductSearchHit.md#hit_type_variation_group)->a variation product + + + If the method returns multiple products, the product with the highest + sort rank is returned first, and the product with the lowest sort rank is + returned last. The product sort rank depends on the sorting conditions + used for the search query. + + + **Returns:** + - a sorted list of products represented by the wrapped product. + + **See Also:** + - [getFirstRepresentedProduct()](dw.catalog.ProductSearchHit.md#getfirstrepresentedproduct) + - [getLastRepresentedProduct()](dw.catalog.ProductSearchHit.md#getlastrepresentedproduct) + + +--- + +### getRepresentedVariationValues(Object) +- getRepresentedVariationValues(va: [Object](TopLevel.Object.md)): [List](dw.util.List.md) + - : This method is only applicable if this ProductSearchHit represents a + product variation (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)). It returns the + distinct value set for the specified variation attribute for all variants + represented by this ProductSearchHit. The values are returned in the same + order as they are defined for the variation. + + + This method will accept a ProductVariationAttribute parameter or a String + which is the ID of a variation attribute. If any other object type is + passed, or null is passed, an exception will be thrown. If this + ProductSearchHit does not represent a product variation, or the passed + variation attribute is not associated with this product, the method + returns an empty list. + + + **Parameters:** + - va - the product variation attribute, specified as either a ProductVariationAttribute or a String which is the ID of a variation attribute associated with this product. + + **Returns:** + - a list containing all distinct ProductVariationAttributeValues. + + +--- + +### isPriceRange() +- isPriceRange(): [Boolean](TopLevel.Boolean.md) + - : Convenience method to check whether this ProductSearchHit represents + multiple products (see [getRepresentedProducts()](dw.catalog.ProductSearchHit.md#getrepresentedproducts)) that have + different prices. + + + **Returns:** + - `true` if the represented products form a price range + `false` otherwise. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchModel.md new file mode 100644 index 00000000..a40a161e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchModel.md @@ -0,0 +1,1894 @@ + +# Class ProductSearchModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchModel](dw.catalog.SearchModel.md) + - [dw.catalog.ProductSearchModel](dw.catalog.ProductSearchModel.md) + +The class is the central interface to a product search result and a product +search refinement. It also provides utility methods to generate a search URL. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CATEGORYID_PARAMETER](#categoryid_parameter): [String](TopLevel.String.md) = "cgid" | URL Parameter for the category ID | +| [INVENTORY_LIST_IDS_PARAMETER](#inventory_list_ids_parameter): [String](TopLevel.String.md) = "ilids" | URL Parameter for the inventory list IDs | +| [MAXIMUM_INVENTORY_LIST_IDS](#maximum_inventory_list_ids): [Number](TopLevel.Number.md) = 10 | The maximum number of inventory list IDs that can be passed to [setInventoryListIDs(List)](dw.catalog.ProductSearchModel.md#setinventorylistidslist) | +| [MAXIMUM_PRODUCT_IDS](#maximum_product_ids): [Number](TopLevel.Number.md) = 30 | The maximum number of product IDs that can be passed to [setProductIDs(List)](dw.catalog.ProductSearchModel.md#setproductidslist) | +| [MAXIMUM_STORE_INVENTORY_FILTER_VALUES](#maximum_store_inventory_filter_values): [Number](TopLevel.Number.md) = 10 | The maximum number of store inventory values for a store inventory filter that can be passed to [setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter) | +| [PRICE_MAX_PARAMETER](#price_max_parameter): [String](TopLevel.String.md) = "pmax" | URL Parameter for the maximum price | +| [PRICE_MIN_PARAMETER](#price_min_parameter): [String](TopLevel.String.md) = "pmin" | URL Parameter for the minimum price | +| [PRODUCTID_PARAMETER](#productid_parameter): [String](TopLevel.String.md) = "pid" | URL Parameter for the product ID | +| [PROMOTIONID_PARAMETER](#promotionid_parameter): [String](TopLevel.String.md) = "pmid" | URL Parameter for the promotion ID | +| [PROMOTION_PRODUCT_TYPE_ALL](#promotion_product_type_all): [String](TopLevel.String.md) = "all" | constant indicating that all related products should be returned for the next product search by promotion ID | +| [PROMOTION_PRODUCT_TYPE_BONUS](#promotion_product_type_bonus): [String](TopLevel.String.md) = "bonus" | constant indicating that only bonus products should be returned for the next product search by promotion ID. | +| [PROMOTION_PRODUCT_TYPE_DISCOUNTED](#promotion_product_type_discounted): [String](TopLevel.String.md) = "discounted" | constant indicating that only discounted products should be returned for the next product search by promotion ID | +| [PROMOTION_PRODUCT_TYPE_PARAMETER](#promotion_product_type_parameter): [String](TopLevel.String.md) = "pmpt" | URL Parameter for the promotion product type | +| [PROMOTION_PRODUCT_TYPE_QUALIFYING](#promotion_product_type_qualifying): [String](TopLevel.String.md) = "qualifying" | constant indicating that only qualifying products should be returned for the next product search by promotion ID | +| [REFINE_NAME_PARAMETER_PREFIX](#refine_name_parameter_prefix): [String](TopLevel.String.md) = "prefn" | URL Parameter prefix for a refinement name | +| [REFINE_VALUE_PARAMETER_PREFIX](#refine_value_parameter_prefix): [String](TopLevel.String.md) = "prefv" | URL Parameter prefix for a refinement value | +| [SORTING_OPTION_PARAMETER](#sorting_option_parameter): [String](TopLevel.String.md) = "sopt" | URL Parameter prefix for a sorting option | +| [SORTING_RULE_PARAMETER](#sorting_rule_parameter): [String](TopLevel.String.md) = "srule" | URL Parameter prefix for a sorting rule | +| [SORT_BY_PARAMETER_PREFIX](#sort_by_parameter_prefix): [String](TopLevel.String.md) = "psortb" | URL Parameter prefix for a refinement value | +| [SORT_DIRECTION_PARAMETER_PREFIX](#sort_direction_parameter_prefix): [String](TopLevel.String.md) = "psortd" | URL Parameter prefix for a refinement value | + +## Property Summary + +| Property | Description | +| --- | --- | +| [category](#category): [Category](dw.catalog.Category.md) `(read-only)` | Returns the category object for the category id specified in the query. | +| [categoryID](#categoryid): [String](TopLevel.String.md) | Returns the category id that was specified in the search query. | +| [categorySearch](#categorysearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if this is a pure search for a category. | +| [deepestCommonCategory](#deepestcommoncategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the deepest common category of all products in the search result. | +| [effectiveSortingRule](#effectivesortingrule): [SortingRule](dw.catalog.SortingRule.md) `(read-only)` | Returns the sorting rule used to order the products in the results of this query, or `null` if no search has been executed yet. | +| [inventoryIDs](#inventoryids): [List](dw.util.List.md) `(read-only)` |

    Returns a list of inventory IDs that were specified in the search query or an empty list if no inventory ID set. | +| [orderableProductsOnly](#orderableproductsonly): [Boolean](TopLevel.Boolean.md) | Get the flag indicating whether unorderable products should be excluded when the next call to getProducts() is made. | +| [pageMetaTags](#pagemetatags): [Array](TopLevel.Array.md) `(read-only)` | Returns all page meta tags, defined for this instance for which content can be generated. | +| [personalizedSort](#personalizedsort): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method indicates if the search result is ordered by a personalized sorting rule. | +| [priceMax](#pricemax): [Number](TopLevel.Number.md) | Returns the maximum price by which the search result is refined. | +| [priceMin](#pricemin): [Number](TopLevel.Number.md) | Returns the minimum price by which the search result is refined. | +| ~~[productID](#productid): [String](TopLevel.String.md)~~ | Returns the product id that was specified in the search query. | +| [productIDs](#productids): [List](dw.util.List.md) | Returns a list of product IDs that were specified in the search query or an empty list if no product ID set. | +| [productSearchHits](#productsearchhits): [Iterator](dw.util.Iterator.md) `(read-only)` | Returns the product search hits in the search result. | +| ~~[products](#products): [Iterator](dw.util.Iterator.md)~~ `(read-only)` | Returns all products in the search result. | +| [promotionID](#promotionid): [String](TopLevel.String.md) | Returns the promotion id that was specified in the search query or null if no promotion id set. | +| [promotionIDs](#promotionids): [List](dw.util.List.md) | Returns a list of promotion id's that were specified in the search query or an empty list if no promotion id set. | +| [promotionProductType](#promotionproducttype): [String](TopLevel.String.md) | Returns the promotion product type specified in the search query. | +| [recursiveCategorySearch](#recursivecategorysearch): [Boolean](TopLevel.Boolean.md) | Get the flag that determines if the category search will be recursive. | +| [refinedByCategory](#refinedbycategory): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if the search is refined by a category. | +| [refinedByPrice](#refinedbyprice): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this search has been refined by price. | +| [refinedByPromotion](#refinedbypromotion): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this search has been refined by promotion. | +| [refinedCategorySearch](#refinedcategorysearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a category search and is refined with further criteria, like a brand refinement or an attribute refinement. | +| [refinementCategory](#refinementcategory): [Category](dw.catalog.Category.md) | Returns the category used to determine possible refinements for the search. | +| [refinements](#refinements): [ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) `(read-only)` | Returns the ProductSearchRefinements associated with this search and filtered by session currency. | +| [searchPhraseSuggestions](#searchphrasesuggestions): [SearchPhraseSuggestions](dw.suggest.SearchPhraseSuggestions.md) `(read-only)` | Returns search phrase suggestions for the current search phrase. | +| [searchableImageUploadURL](#searchableimageuploadurl): [String](TopLevel.String.md) `(read-only)` | This method returns the URL of the endpoint where the merchants should upload their image for visual search. | +| [sortingRule](#sortingrule): [SortingRule](dw.catalog.SortingRule.md) | Returns the sorting rule explicitly set on this model to be used to order the products in the results of this query, or `null` if no rule has been explicitly set. | +| [storeInventoryFilter](#storeinventoryfilter): [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) |

    Returns the [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md), which was specified for this search. | +| ~~[suggestedSearchPhrase](#suggestedsearchphrase): [String](TopLevel.String.md)~~ `(read-only)` | Returns the suggested search phrase with the highest accuracy provided for the current search phrase. | +| ~~[suggestedSearchPhrases](#suggestedsearchphrases): [List](dw.util.List.md)~~ `(read-only)` | Returns a list with up to 5 suggested search phrases provided for the current search phrase. | +| [trackingEmptySearchesEnabled](#trackingemptysearchesenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method indicates if no-hits search should be tracked for predictive intelligence use. | +| [visualSearch](#visualsearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if this is a visual search. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ProductSearchModel](#productsearchmodel)() | Constructs a new ProductSearchModel. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addHitTypeRefinement](dw.catalog.ProductSearchModel.md#addhittyperefinementstring)([String...](TopLevel.String.md)) | Set the only search hit types to be included from the search. | +| [excludeHitType](dw.catalog.ProductSearchModel.md#excludehittypestring)([String...](TopLevel.String.md)) | Set the search hit types to be excluded from the search. | +| [getCategory](dw.catalog.ProductSearchModel.md#getcategory)() | Returns the category object for the category id specified in the query. | +| [getCategoryID](dw.catalog.ProductSearchModel.md#getcategoryid)() | Returns the category id that was specified in the search query. | +| [getDeepestCommonCategory](dw.catalog.ProductSearchModel.md#getdeepestcommoncategory)() | Returns the deepest common category of all products in the search result. | +| [getEffectiveSortingRule](dw.catalog.ProductSearchModel.md#geteffectivesortingrule)() | Returns the sorting rule used to order the products in the results of this query, or `null` if no search has been executed yet. | +| [getInventoryIDs](dw.catalog.ProductSearchModel.md#getinventoryids)() |

    Returns a list of inventory IDs that were specified in the search query or an empty list if no inventory ID set. | +| [getOrderableProductsOnly](dw.catalog.ProductSearchModel.md#getorderableproductsonly)() | Get the flag indicating whether unorderable products should be excluded when the next call to getProducts() is made. | +| [getPageMetaTag](dw.catalog.ProductSearchModel.md#getpagemetatagstring)([String](TopLevel.String.md)) | Returns the page meta tag for the specified id. | +| [getPageMetaTags](dw.catalog.ProductSearchModel.md#getpagemetatags)() | Returns all page meta tags, defined for this instance for which content can be generated. | +| [getPriceMax](dw.catalog.ProductSearchModel.md#getpricemax)() | Returns the maximum price by which the search result is refined. | +| [getPriceMin](dw.catalog.ProductSearchModel.md#getpricemin)() | Returns the minimum price by which the search result is refined. | +| ~~[getProductID](dw.catalog.ProductSearchModel.md#getproductid)()~~ | Returns the product id that was specified in the search query. | +| [getProductIDs](dw.catalog.ProductSearchModel.md#getproductids)() | Returns a list of product IDs that were specified in the search query or an empty list if no product ID set. | +| [getProductSearchHit](dw.catalog.ProductSearchModel.md#getproductsearchhitproduct)([Product](dw.catalog.Product.md)) | Returns the underlying ProductSearchHit for a product, or null if no ProductSearchHit found for this product. | +| [getProductSearchHits](dw.catalog.ProductSearchModel.md#getproductsearchhits)() | Returns the product search hits in the search result. | +| ~~[getProducts](dw.catalog.ProductSearchModel.md#getproducts)()~~ | Returns all products in the search result. | +| [getPromotionID](dw.catalog.ProductSearchModel.md#getpromotionid)() | Returns the promotion id that was specified in the search query or null if no promotion id set. | +| [getPromotionIDs](dw.catalog.ProductSearchModel.md#getpromotionids)() | Returns a list of promotion id's that were specified in the search query or an empty list if no promotion id set. | +| [getPromotionProductType](dw.catalog.ProductSearchModel.md#getpromotionproducttype)() | Returns the promotion product type specified in the search query. | +| [getRefinementCategory](dw.catalog.ProductSearchModel.md#getrefinementcategory)() | Returns the category used to determine possible refinements for the search. | +| [getRefinements](dw.catalog.ProductSearchModel.md#getrefinements)() | Returns the ProductSearchRefinements associated with this search and filtered by session currency. | +| [getSearchPhraseSuggestions](dw.catalog.ProductSearchModel.md#getsearchphrasesuggestions)() | Returns search phrase suggestions for the current search phrase. | +| [getSearchableImageUploadURL](dw.catalog.ProductSearchModel.md#getsearchableimageuploadurl)() | This method returns the URL of the endpoint where the merchants should upload their image for visual search. | +| [getSortingRule](dw.catalog.ProductSearchModel.md#getsortingrule)() | Returns the sorting rule explicitly set on this model to be used to order the products in the results of this query, or `null` if no rule has been explicitly set. | +| [getStoreInventoryFilter](dw.catalog.ProductSearchModel.md#getstoreinventoryfilter)() |

    Returns the [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md), which was specified for this search. | +| ~~[getSuggestedSearchPhrase](dw.catalog.ProductSearchModel.md#getsuggestedsearchphrase)()~~ | Returns the suggested search phrase with the highest accuracy provided for the current search phrase. | +| ~~[getSuggestedSearchPhrases](dw.catalog.ProductSearchModel.md#getsuggestedsearchphrases)()~~ | Returns a list with up to 5 suggested search phrases provided for the current search phrase. | +| [isCategorySearch](dw.catalog.ProductSearchModel.md#iscategorysearch)() | The method returns true, if this is a pure search for a category. | +| [isPersonalizedSort](dw.catalog.ProductSearchModel.md#ispersonalizedsort)() | The method indicates if the search result is ordered by a personalized sorting rule. | +| [isRecursiveCategorySearch](dw.catalog.ProductSearchModel.md#isrecursivecategorysearch)() | Get the flag that determines if the category search will be recursive. | +| [isRefinedByCategory](dw.catalog.ProductSearchModel.md#isrefinedbycategory)() | The method returns true, if the search is refined by a category. | +| [isRefinedByPrice](dw.catalog.ProductSearchModel.md#isrefinedbyprice)() | Identifies if this search has been refined by price. | +| [isRefinedByPriceRange](dw.catalog.ProductSearchModel.md#isrefinedbypricerangenumber-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Identifies if this search has been refined by the given price range. | +| [isRefinedByPromotion](dw.catalog.ProductSearchModel.md#isrefinedbypromotion)() | Identifies if this search has been refined by promotion. | +| [isRefinedByPromotion](dw.catalog.ProductSearchModel.md#isrefinedbypromotionstring)([String](TopLevel.String.md)) | Identifies if this search has been refined by a given promotion. | +| [isRefinedCategorySearch](dw.catalog.ProductSearchModel.md#isrefinedcategorysearch)() | Identifies if this is a category search and is refined with further criteria, like a brand refinement or an attribute refinement. | +| [isTrackingEmptySearchesEnabled](dw.catalog.ProductSearchModel.md#istrackingemptysearchesenabled)() | The method indicates if no-hits search should be tracked for predictive intelligence use. | +| [isVisualSearch](dw.catalog.ProductSearchModel.md#isvisualsearch)() | The method returns true, if this is a visual search. | +| [search](dw.catalog.ProductSearchModel.md#search)() | Execute the search based on the configured search term, category and filter conditions (price, attribute, promotion, product type) and return the execution status. | +| [setCategoryID](dw.catalog.ProductSearchModel.md#setcategoryidstring)([String](TopLevel.String.md)) | Specifies the category id used for the search query. | +| [setEnableTrackingEmptySearches](dw.catalog.ProductSearchModel.md#setenabletrackingemptysearchesboolean)([Boolean](TopLevel.Boolean.md)) | Set a flag indicating whether no-hits search should be tracked for predictive intelligence use. | +| [setInventoryListIDs](dw.catalog.ProductSearchModel.md#setinventorylistidslist)([List](dw.util.List.md)) |

    Specifies multiple inventory list IDs used for the search query. | +| [setOrderableProductsOnly](dw.catalog.ProductSearchModel.md#setorderableproductsonlyboolean)([Boolean](TopLevel.Boolean.md)) | Set a flag indicating whether unorderable products should be excluded when the next call to getProducts() is made. | +| [setPriceMax](dw.catalog.ProductSearchModel.md#setpricemaxnumber)([Number](TopLevel.Number.md)) | Sets the maximum price by which the search result is to be refined. | +| [setPriceMin](dw.catalog.ProductSearchModel.md#setpriceminnumber)([Number](TopLevel.Number.md)) | Sets the minimum price by which the search result is to be refined. | +| ~~[setProductID](dw.catalog.ProductSearchModel.md#setproductidstring)([String](TopLevel.String.md))~~ | Specifies the product id used for the search query. | +| [setProductIDs](dw.catalog.ProductSearchModel.md#setproductidslist)([List](dw.util.List.md)) | Specifies multiple product IDs used for the search query. | +| [setPromotionID](dw.catalog.ProductSearchModel.md#setpromotionidstring)([String](TopLevel.String.md)) | Specifies the promotion id used for the search query. | +| [setPromotionIDs](dw.catalog.ProductSearchModel.md#setpromotionidslist)([List](dw.util.List.md)) | Specifies multiple promotion id's used for the search query. | +| [setPromotionProductType](dw.catalog.ProductSearchModel.md#setpromotionproducttypestring)([String](TopLevel.String.md)) | Specifies the promotion product type used for the search query. | +| [setRecursiveCategorySearch](dw.catalog.ProductSearchModel.md#setrecursivecategorysearchboolean)([Boolean](TopLevel.Boolean.md)) | Set a flag to indicate if the search in category should be recursive. | +| [setRefinementCategory](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory)([Category](dw.catalog.Category.md)) | Sets an explicit category to be used when determining refinements. | +| [setSearchableImageID](dw.catalog.ProductSearchModel.md#setsearchableimageidstring)([String](TopLevel.String.md)) | An image ID can be retrieved by uploading an image with a multipart/form-data POST request to 'https://api.cquotient.com/v3/image/search/upload/{siteID}'. | +| ~~[setSortingCondition](dw.catalog.ProductSearchModel.md#setsortingconditionstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md))~~ | Sets or removes a sorting condition for the specified attribute. | +| [setSortingOption](dw.catalog.ProductSearchModel.md#setsortingoptionsortingoption)([SortingOption](dw.catalog.SortingOption.md)) | Sets the sorting option to be used to order the products in the results of this query. | +| [setSortingRule](dw.catalog.ProductSearchModel.md#setsortingrulesortingrule)([SortingRule](dw.catalog.SortingRule.md)) | Sets the sorting rule to be used to order the products in the results of this query. | +| [setStoreInventoryFilter](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter)([StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md)) |

    Filters the search result by one or more inventory list IDs provided by the class [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) which supports a semantic URL parameter like zip, city, store ... | +| static [urlForCategory](dw.catalog.ProductSearchModel.md#urlforcategoryurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific Category. | +| static [urlForCategory](dw.catalog.ProductSearchModel.md#urlforcategorystring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific Category. | +| static [urlForProduct](dw.catalog.ProductSearchModel.md#urlforproducturl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific Product. | +| static [urlForProduct](dw.catalog.ProductSearchModel.md#urlforproductstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific Product. | +| static [urlForRefine](dw.catalog.ProductSearchModel.md#urlforrefineurl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific attribute name-value pair. | +| static [urlForRefine](dw.catalog.ProductSearchModel.md#urlforrefinestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to execute a query for a specific attribute name-value pair. | +| [urlRefineCategory](dw.catalog.ProductSearchModel.md#urlrefinecategoryurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query with a category refinement. | +| [urlRefineCategory](dw.catalog.ProductSearchModel.md#urlrefinecategorystring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query with a category refinement. | +| [urlRefinePrice](dw.catalog.ProductSearchModel.md#urlrefinepriceurl-number-number)([URL](dw.web.URL.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Constructs a URL that you can use to re-execute the query with an additional price filter. | +| [urlRefinePrice](dw.catalog.ProductSearchModel.md#urlrefinepricestring-number-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Constructs a URL that you can use to re-execute the query with an additional price filter. | +| [urlRefinePromotion](dw.catalog.ProductSearchModel.md#urlrefinepromotionurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query with a promotion refinement. | +| [urlRefinePromotion](dw.catalog.ProductSearchModel.md#urlrefinepromotionstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query with a promotion refinement. | +| [urlRelaxCategory](dw.catalog.ProductSearchModel.md#urlrelaxcategoryurl)([URL](dw.web.URL.md)) | Constructs a URL that you can use to re-execute the query without any category refinement. | +| [urlRelaxCategory](dw.catalog.ProductSearchModel.md#urlrelaxcategorystring)([String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query without any category refinement. | +| [urlRelaxPrice](dw.catalog.ProductSearchModel.md#urlrelaxpriceurl)([URL](dw.web.URL.md)) | Constructs a URL that you can use to would re-execute the query with no price filter. | +| [urlRelaxPrice](dw.catalog.ProductSearchModel.md#urlrelaxpricestring)([String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query with no price filter. | +| [urlRelaxPromotion](dw.catalog.ProductSearchModel.md#urlrelaxpromotionurl)([URL](dw.web.URL.md)) | Constructs a URL that you can use to re-execute the query without any promotion refinement. | +| [urlRelaxPromotion](dw.catalog.ProductSearchModel.md#urlrelaxpromotionstring)([String](TopLevel.String.md)) | Constructs a URL that you can use to re-execute the query without any promotion refinement. | +| [urlSortingOption](dw.catalog.ProductSearchModel.md#urlsortingoptionurl-sortingoption)([URL](dw.web.URL.md), [SortingOption](dw.catalog.SortingOption.md)) | Constructs a URL that you can use to re-execute the query but sort the results by the given storefront sorting option. | +| [urlSortingOption](dw.catalog.ProductSearchModel.md#urlsortingoptionstring-sortingoption)([String](TopLevel.String.md), [SortingOption](dw.catalog.SortingOption.md)) | Constructs a URL that you can use to re-execute the query but sort the results by the given storefront sorting option. | +| [urlSortingRule](dw.catalog.ProductSearchModel.md#urlsortingruleurl-sortingrule)([URL](dw.web.URL.md), [SortingRule](dw.catalog.SortingRule.md)) | Constructs a URL that you can use to re-execute the query but sort the results by the given rule. | +| [urlSortingRule](dw.catalog.ProductSearchModel.md#urlsortingrulestring-sortingrule)([String](TopLevel.String.md), [SortingRule](dw.catalog.SortingRule.md)) | Constructs a URL that you can use to re-execute the query but sort the results by the given rule. | + +### Methods inherited from class SearchModel + +[addRefinementValues](dw.catalog.SearchModel.md#addrefinementvaluesstring-string), [canRelax](dw.catalog.SearchModel.md#canrelax), [getCount](dw.catalog.SearchModel.md#getcount), [getRefinementMaxValue](dw.catalog.SearchModel.md#getrefinementmaxvaluestring), [getRefinementMinValue](dw.catalog.SearchModel.md#getrefinementminvaluestring), [getRefinementValue](dw.catalog.SearchModel.md#getrefinementvaluestring), [getRefinementValues](dw.catalog.SearchModel.md#getrefinementvaluesstring), [getSearchPhrase](dw.catalog.SearchModel.md#getsearchphrase), [getSearchRedirect](dw.catalog.SearchModel.md#getsearchredirectstring), [getSortingCondition](dw.catalog.SearchModel.md#getsortingconditionstring), [isEmptyQuery](dw.catalog.SearchModel.md#isemptyquery), [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattribute), [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattributestring), [isRefinedByAttributeValue](dw.catalog.SearchModel.md#isrefinedbyattributevaluestring-string), [isRefinedSearch](dw.catalog.SearchModel.md#isrefinedsearch), [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring), [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring-string-string), [removeRefinementValues](dw.catalog.SearchModel.md#removerefinementvaluesstring-string), [search](dw.catalog.SearchModel.md#search), [setRefinementValueRange](dw.catalog.SearchModel.md#setrefinementvaluerangestring-string-string), [setRefinementValues](dw.catalog.SearchModel.md#setrefinementvaluesstring-string), [setSearchPhrase](dw.catalog.SearchModel.md#setsearchphrasestring), [setSortingCondition](dw.catalog.SearchModel.md#setsortingconditionstring-number), [url](dw.catalog.SearchModel.md#urlurl), [url](dw.catalog.SearchModel.md#urlstring), [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsorturl), [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsortstring), [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributeurl-string-string), [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributestring-string-string), [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevalueurl-string-string), [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevaluestring-string-string), [urlRefineAttributeValueRange](dw.catalog.SearchModel.md#urlrefineattributevaluerangestring-string-string-string), [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributeurl-string), [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributestring-string), [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevalueurl-string-string), [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevaluestring-string-string), [urlSort](dw.catalog.SearchModel.md#urlsorturl-string-number), [urlSort](dw.catalog.SearchModel.md#urlsortstring-string-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CATEGORYID_PARAMETER + +- CATEGORYID_PARAMETER: [String](TopLevel.String.md) = "cgid" + - : URL Parameter for the category ID + + +--- + +### INVENTORY_LIST_IDS_PARAMETER + +- INVENTORY_LIST_IDS_PARAMETER: [String](TopLevel.String.md) = "ilids" + - : URL Parameter for the inventory list IDs + + +--- + +### MAXIMUM_INVENTORY_LIST_IDS + +- MAXIMUM_INVENTORY_LIST_IDS: [Number](TopLevel.Number.md) = 10 + - : The maximum number of inventory list IDs that can be passed to [setInventoryListIDs(List)](dw.catalog.ProductSearchModel.md#setinventorylistidslist) + + +--- + +### MAXIMUM_PRODUCT_IDS + +- MAXIMUM_PRODUCT_IDS: [Number](TopLevel.Number.md) = 30 + - : The maximum number of product IDs that can be passed to [setProductIDs(List)](dw.catalog.ProductSearchModel.md#setproductidslist) + + +--- + +### MAXIMUM_STORE_INVENTORY_FILTER_VALUES + +- MAXIMUM_STORE_INVENTORY_FILTER_VALUES: [Number](TopLevel.Number.md) = 10 + - : The maximum number of store inventory values for a store inventory filter that can be passed to + [setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter) + + + +--- + +### PRICE_MAX_PARAMETER + +- PRICE_MAX_PARAMETER: [String](TopLevel.String.md) = "pmax" + - : URL Parameter for the maximum price + + +--- + +### PRICE_MIN_PARAMETER + +- PRICE_MIN_PARAMETER: [String](TopLevel.String.md) = "pmin" + - : URL Parameter for the minimum price + + +--- + +### PRODUCTID_PARAMETER + +- PRODUCTID_PARAMETER: [String](TopLevel.String.md) = "pid" + - : URL Parameter for the product ID + + +--- + +### PROMOTIONID_PARAMETER + +- PROMOTIONID_PARAMETER: [String](TopLevel.String.md) = "pmid" + - : URL Parameter for the promotion ID + + +--- + +### PROMOTION_PRODUCT_TYPE_ALL + +- PROMOTION_PRODUCT_TYPE_ALL: [String](TopLevel.String.md) = "all" + - : constant indicating that all related products should be returned for the next product search by promotion ID + + +--- + +### PROMOTION_PRODUCT_TYPE_BONUS + +- PROMOTION_PRODUCT_TYPE_BONUS: [String](TopLevel.String.md) = "bonus" + - : constant indicating that only bonus products should be returned for the next product search by promotion ID. This + constant should be set using [setPromotionProductType(String)](dw.catalog.ProductSearchModel.md#setpromotionproducttypestring) when using the search model to find the + available list of bonus products for a Choice of Bonus Product (Rule) promotion, along with + [setPromotionID(String)](dw.catalog.ProductSearchModel.md#setpromotionidstring). + + + +--- + +### PROMOTION_PRODUCT_TYPE_DISCOUNTED + +- PROMOTION_PRODUCT_TYPE_DISCOUNTED: [String](TopLevel.String.md) = "discounted" + - : constant indicating that only discounted products should be returned for the next product search by promotion ID + + +--- + +### PROMOTION_PRODUCT_TYPE_PARAMETER + +- PROMOTION_PRODUCT_TYPE_PARAMETER: [String](TopLevel.String.md) = "pmpt" + - : URL Parameter for the promotion product type + + +--- + +### PROMOTION_PRODUCT_TYPE_QUALIFYING + +- PROMOTION_PRODUCT_TYPE_QUALIFYING: [String](TopLevel.String.md) = "qualifying" + - : constant indicating that only qualifying products should be returned for the next product search by promotion ID + + +--- + +### REFINE_NAME_PARAMETER_PREFIX + +- REFINE_NAME_PARAMETER_PREFIX: [String](TopLevel.String.md) = "prefn" + - : URL Parameter prefix for a refinement name + + +--- + +### REFINE_VALUE_PARAMETER_PREFIX + +- REFINE_VALUE_PARAMETER_PREFIX: [String](TopLevel.String.md) = "prefv" + - : URL Parameter prefix for a refinement value + + +--- + +### SORTING_OPTION_PARAMETER + +- SORTING_OPTION_PARAMETER: [String](TopLevel.String.md) = "sopt" + - : URL Parameter prefix for a sorting option + + +--- + +### SORTING_RULE_PARAMETER + +- SORTING_RULE_PARAMETER: [String](TopLevel.String.md) = "srule" + - : URL Parameter prefix for a sorting rule + + +--- + +### SORT_BY_PARAMETER_PREFIX + +- SORT_BY_PARAMETER_PREFIX: [String](TopLevel.String.md) = "psortb" + - : URL Parameter prefix for a refinement value + + +--- + +### SORT_DIRECTION_PARAMETER_PREFIX + +- SORT_DIRECTION_PARAMETER_PREFIX: [String](TopLevel.String.md) = "psortd" + - : URL Parameter prefix for a refinement value + + +--- + +## Property Details + +### category +- category: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the category object for the category id specified in the query. + If a category with that id doesn't exist or if the category is offline + this method returns null. + + + +--- + +### categoryID +- categoryID: [String](TopLevel.String.md) + - : Returns the category id that was specified in the search query. + + +--- + +### categorySearch +- categorySearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if this is a pure search for a category. The + method checks, that a category ID is specified and no search phrase is + specified. + + + +--- + +### deepestCommonCategory +- deepestCommonCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the deepest common category of all products in the search result. + In case of an empty search result the method returns the root category. + + + +--- + +### effectiveSortingRule +- effectiveSortingRule: [SortingRule](dw.catalog.SortingRule.md) `(read-only)` + - : Returns the sorting rule used to order the products in the results of this query, + or `null` if no search has been executed yet. + + In contrast to [getSortingRule()](dw.catalog.ProductSearchModel.md#getsortingrule), this method respects explicit sorting rules and sorting options and rules determined implicitly + based on the refinement category, keyword sorting rule assignment, etc. + + + +--- + +### inventoryIDs +- inventoryIDs: [List](dw.util.List.md) `(read-only)` + - : + + Returns a list of inventory IDs that were specified in the search query or an empty list if no inventory ID set. + + + +--- + +### orderableProductsOnly +- orderableProductsOnly: [Boolean](TopLevel.Boolean.md) + - : Get the flag indicating whether unorderable products should be excluded + when the next call to getProducts() is made. If this value has not been + previously set, then the value returned will be based on the value of the + search preference. + + + +--- + +### pageMetaTags +- pageMetaTags: [Array](TopLevel.Array.md) `(read-only)` + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the product listing page meta tag context and rules. + The rules are obtained from the current category context or inherited from the parent category, + up to the root category. + + + +--- + +### personalizedSort +- personalizedSort: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method indicates if the search result is ordered by a personalized sorting rule. + + +--- + +### priceMax +- priceMax: [Number](TopLevel.Number.md) + - : Returns the maximum price by which the search result is refined. + + +--- + +### priceMin +- priceMin: [Number](TopLevel.Number.md) + - : Returns the minimum price by which the search result is refined. + + +--- + +### productID +- ~~productID: [String](TopLevel.String.md)~~ + - : Returns the product id that was specified in the search query. + + **Deprecated:** +:::warning +Please use [getProductIDs()](dw.catalog.ProductSearchModel.md#getproductids) instead +::: + +--- + +### productIDs +- productIDs: [List](dw.util.List.md) + - : Returns a list of product IDs that were specified in the search query or an empty list if no product ID set. + + +--- + +### productSearchHits +- productSearchHits: [Iterator](dw.util.Iterator.md) `(read-only)` + - : Returns the product search hits in the search result. + + Note that method does also return search hits representing products that + were removed or went offline since the last index update, i.e. you must + implement appropriate checks before accessing the product related to the + search hit instance (see [ProductSearchHit.getProduct()](dw.catalog.ProductSearchHit.md#getproduct)) + + + **See Also:** + - [getProducts()](dw.catalog.ProductSearchModel.md#getproducts) + + +--- + +### products +- ~~products: [Iterator](dw.util.Iterator.md)~~ `(read-only)` + - : Returns all products in the search result. + + Note that products that were removed or went offline since the last index + update are not included in the returned set. + + + **See Also:** + - [getProductSearchHits()](dw.catalog.ProductSearchModel.md#getproductsearchhits) + + **Deprecated:** +:::warning +This method should not be used because loading Products for each result of a product search is + extremely expensive performance-wise. Please use [getProductSearchHits()](dw.catalog.ProductSearchModel.md#getproductsearchhits) to iterate + ProductSearchHits instead. + +::: + +--- + +### promotionID +- promotionID: [String](TopLevel.String.md) + - : Returns the promotion id that was specified in the search query or null if no promotion id set. If multiple + promotion id's specified the method returns only the first id. See [setPromotionIDs(List)](dw.catalog.ProductSearchModel.md#setpromotionidslist) and + [getPromotionIDs()](dw.catalog.ProductSearchModel.md#getpromotionids). + + + +--- + +### promotionIDs +- promotionIDs: [List](dw.util.List.md) + - : Returns a list of promotion id's that were specified in the search query or an empty list if no promotion id set. + + +--- + +### promotionProductType +- promotionProductType: [String](TopLevel.String.md) + - : Returns the promotion product type specified in the search query. + + +--- + +### recursiveCategorySearch +- recursiveCategorySearch: [Boolean](TopLevel.Boolean.md) + - : Get the flag that determines if the category search will + be recursive. + + + +--- + +### refinedByCategory +- refinedByCategory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if the search is refined by a category. + The method checks, that a category ID is specified. + + + +--- + +### refinedByPrice +- refinedByPrice: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this search has been refined by price. + + +--- + +### refinedByPromotion +- refinedByPromotion: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this search has been refined by promotion. + + +--- + +### refinedCategorySearch +- refinedCategorySearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a category search and is refined with further + criteria, like a brand refinement or an attribute refinement. + + + +--- + +### refinementCategory +- refinementCategory: [Category](dw.catalog.Category.md) + - : Returns the category used to determine possible refinements for the search. + If an explicit category was set for this purpose using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory), it is returned. + Otherwise, the deepest common category of all search results will be returned. + + + +--- + +### refinements +- refinements: [ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) `(read-only)` + - : Returns the ProductSearchRefinements associated with this search and filtered by session currency. + If an explicit category was set for this purpose using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory), it will be used to determine the refinements. + Otherwise, the refinements are determined based on the deepest common category of all products in the search result. + Hint: If you want to use the same refinements for all searches, consider defining them in one category (usually root) and using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory) to avoid unnecessary calculation of the deepest common category. + + + +--- + +### searchPhraseSuggestions +- searchPhraseSuggestions: [SearchPhraseSuggestions](dw.suggest.SearchPhraseSuggestions.md) `(read-only)` + - : Returns search phrase suggestions for the current search phrase. + Search phrase suggestions may contain alternative search phrases as well + as lists of corrected and completed search terms. + + + +--- + +### searchableImageUploadURL +- searchableImageUploadURL: [String](TopLevel.String.md) `(read-only)` + - : This method returns the URL of the endpoint where the merchants should upload their image for visual search. + + +--- + +### sortingRule +- sortingRule: [SortingRule](dw.catalog.SortingRule.md) + - : Returns the sorting rule explicitly set on this model to be used + to order the products in the results of this query, or `null` + if no rule has been explicitly set. + + This method does not return the sorting rule that will be used implicitly + based on the context of the search, such as the refinement category. + + + +--- + +### storeInventoryFilter +- storeInventoryFilter: [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) + - : + + Returns the [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md), which was specified for this search. + + + +--- + +### suggestedSearchPhrase +- ~~suggestedSearchPhrase: [String](TopLevel.String.md)~~ `(read-only)` + - : Returns the suggested search phrase with the highest accuracy provided + for the current search phrase. + + + **Deprecated:** +:::warning +Please use [getSearchPhraseSuggestions()](dw.catalog.ProductSearchModel.md#getsearchphrasesuggestions) instead +::: + +--- + +### suggestedSearchPhrases +- ~~suggestedSearchPhrases: [List](dw.util.List.md)~~ `(read-only)` + - : Returns a list with up to 5 suggested search phrases provided for the + current search phrase. It is possible that less than 5 suggestions + or even no suggestions are returned. + + + **Deprecated:** +:::warning +Please use [getSearchPhraseSuggestions()](dw.catalog.ProductSearchModel.md#getsearchphrasesuggestions) instead +::: + +--- + +### trackingEmptySearchesEnabled +- trackingEmptySearchesEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method indicates if no-hits search should be tracked for predictive intelligence use. + + +--- + +### visualSearch +- visualSearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if this is a visual search. The + method checks that a image UUID is specified. + + + +--- + +## Constructor Details + +### ProductSearchModel() +- ProductSearchModel() + - : Constructs a new ProductSearchModel. + + +--- + +## Method Details + +### addHitTypeRefinement(String...) +- addHitTypeRefinement(types: [String...](TopLevel.String.md)): void + - : Set the only search hit types to be included from the search. Values accepted are the 'hit type' constants + exposed in the [ProductSearchHit](dw.catalog.ProductSearchHit.md) class. Overwrites any hit type refinements set from prior calls to + addHitTypeRefinement(String...) or excludeHitType(String...). + + + **Parameters:** + - types - to be included. + + +--- + +### excludeHitType(String...) +- excludeHitType(types: [String...](TopLevel.String.md)): void + - : Set the search hit types to be excluded from the search. Values accepted are the 'hit type' constants exposed in + the [ProductSearchHit](dw.catalog.ProductSearchHit.md) class. Overwrites any hit type refinements set from prior calls to + addHitTypeRefinement(String...) or excludeHitType(String...). + + + **Parameters:** + - types - to be excluded. + + +--- + +### getCategory() +- getCategory(): [Category](dw.catalog.Category.md) + - : Returns the category object for the category id specified in the query. + If a category with that id doesn't exist or if the category is offline + this method returns null. + + + **Returns:** + - the category object for the category id specified in the query. + + +--- + +### getCategoryID() +- getCategoryID(): [String](TopLevel.String.md) + - : Returns the category id that was specified in the search query. + + **Returns:** + - the category id that was specified in the search query. + + +--- + +### getDeepestCommonCategory() +- getDeepestCommonCategory(): [Category](dw.catalog.Category.md) + - : Returns the deepest common category of all products in the search result. + In case of an empty search result the method returns the root category. + + + **Returns:** + - the deepest common category of all products in the search result of this search model or root for an empty search result. + + +--- + +### getEffectiveSortingRule() +- getEffectiveSortingRule(): [SortingRule](dw.catalog.SortingRule.md) + - : Returns the sorting rule used to order the products in the results of this query, + or `null` if no search has been executed yet. + + In contrast to [getSortingRule()](dw.catalog.ProductSearchModel.md#getsortingrule), this method respects explicit sorting rules and sorting options and rules determined implicitly + based on the refinement category, keyword sorting rule assignment, etc. + + + **Returns:** + - a SortingRule or null. + + +--- + +### getInventoryIDs() +- getInventoryIDs(): [List](dw.util.List.md) + - : + + Returns a list of inventory IDs that were specified in the search query or an empty list if no inventory ID set. + + + **Returns:** + - the list of inventory IDs that were specified in the search query or an empty list if no + inventory ID set. + + + +--- + +### getOrderableProductsOnly() +- getOrderableProductsOnly(): [Boolean](TopLevel.Boolean.md) + - : Get the flag indicating whether unorderable products should be excluded + when the next call to getProducts() is made. If this value has not been + previously set, then the value returned will be based on the value of the + search preference. + + + **Returns:** + - true if unorderable products should be excluded from product + search results, false otherwise. + + + +--- + +### getPageMetaTag(String) +- getPageMetaTag(id: [String](TopLevel.String.md)): [PageMetaTag](dw.web.PageMetaTag.md) + - : Returns the page meta tag for the specified id. + + + The meta tag content is generated based on the product listing page meta tag context and rule. + The rule is obtained from the current category context or inherited from the parent category, + up to the root category. + + + Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the + current context, or if the rule resolves to an empty string. + + + **Parameters:** + - id - the ID to get the page meta tag for + + **Returns:** + - page meta tag containing content generated based on rules + + +--- + +### getPageMetaTags() +- getPageMetaTags(): [Array](TopLevel.Array.md) + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the product listing page meta tag context and rules. + The rules are obtained from the current category context or inherited from the parent category, + up to the root category. + + + **Returns:** + - page meta tags defined for this instance, containing content generated based on rules + + +--- + +### getPriceMax() +- getPriceMax(): [Number](TopLevel.Number.md) + - : Returns the maximum price by which the search result is refined. + + **Returns:** + - the maximum price by which the search result is refined. + + +--- + +### getPriceMin() +- getPriceMin(): [Number](TopLevel.Number.md) + - : Returns the minimum price by which the search result is refined. + + **Returns:** + - the minimum price by which the search result is refined. + + +--- + +### getProductID() +- ~~getProductID(): [String](TopLevel.String.md)~~ + - : Returns the product id that was specified in the search query. + + **Returns:** + - the product id that was specified in the search. + + **Deprecated:** +:::warning +Please use [getProductIDs()](dw.catalog.ProductSearchModel.md#getproductids) instead +::: + +--- + +### getProductIDs() +- getProductIDs(): [List](dw.util.List.md) + - : Returns a list of product IDs that were specified in the search query or an empty list if no product ID set. + + **Returns:** + - the list of product IDs that were specified in the search query or an empty list if no product ID set. + + +--- + +### getProductSearchHit(Product) +- getProductSearchHit(product: [Product](dw.catalog.Product.md)): [ProductSearchHit](dw.catalog.ProductSearchHit.md) + - : Returns the underlying ProductSearchHit for a product, or null if no + ProductSearchHit found for this product. + + + **Parameters:** + - product - the product to find the underlying ProductSearchHit + + **Returns:** + - the underlying ProductSearchHit for a product, or null if no + ProductSearchHit found for this product. + + + +--- + +### getProductSearchHits() +- getProductSearchHits(): [Iterator](dw.util.Iterator.md) + - : Returns the product search hits in the search result. + + Note that method does also return search hits representing products that + were removed or went offline since the last index update, i.e. you must + implement appropriate checks before accessing the product related to the + search hit instance (see [ProductSearchHit.getProduct()](dw.catalog.ProductSearchHit.md#getproduct)) + + + **Returns:** + - Products hits in search result + + **See Also:** + - [getProducts()](dw.catalog.ProductSearchModel.md#getproducts) + + +--- + +### getProducts() +- ~~getProducts(): [Iterator](dw.util.Iterator.md)~~ + - : Returns all products in the search result. + + Note that products that were removed or went offline since the last index + update are not included in the returned set. + + + **Returns:** + - Products in search result + + **See Also:** + - [getProductSearchHits()](dw.catalog.ProductSearchModel.md#getproductsearchhits) + + **Deprecated:** +:::warning +This method should not be used because loading Products for each result of a product search is + extremely expensive performance-wise. Please use [getProductSearchHits()](dw.catalog.ProductSearchModel.md#getproductsearchhits) to iterate + ProductSearchHits instead. + +::: + +--- + +### getPromotionID() +- getPromotionID(): [String](TopLevel.String.md) + - : Returns the promotion id that was specified in the search query or null if no promotion id set. If multiple + promotion id's specified the method returns only the first id. See [setPromotionIDs(List)](dw.catalog.ProductSearchModel.md#setpromotionidslist) and + [getPromotionIDs()](dw.catalog.ProductSearchModel.md#getpromotionids). + + + **Returns:** + - the promotion id that was specified in the search query or null if no promotion id set. + + +--- + +### getPromotionIDs() +- getPromotionIDs(): [List](dw.util.List.md) + - : Returns a list of promotion id's that were specified in the search query or an empty list if no promotion id set. + + **Returns:** + - the list of promotion id's that was specified in the search query or an empty list if no promotion id set. + + +--- + +### getPromotionProductType() +- getPromotionProductType(): [String](TopLevel.String.md) + - : Returns the promotion product type specified in the search query. + + **Returns:** + - the promotion product type that was specified in the search + query. + + + +--- + +### getRefinementCategory() +- getRefinementCategory(): [Category](dw.catalog.Category.md) + - : Returns the category used to determine possible refinements for the search. + If an explicit category was set for this purpose using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory), it is returned. + Otherwise, the deepest common category of all search results will be returned. + + + **Returns:** + - the category used to determine refinements. + + +--- + +### getRefinements() +- getRefinements(): [ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) + - : Returns the ProductSearchRefinements associated with this search and filtered by session currency. + If an explicit category was set for this purpose using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory), it will be used to determine the refinements. + Otherwise, the refinements are determined based on the deepest common category of all products in the search result. + Hint: If you want to use the same refinements for all searches, consider defining them in one category (usually root) and using [setRefinementCategory(Category)](dw.catalog.ProductSearchModel.md#setrefinementcategorycategory) to avoid unnecessary calculation of the deepest common category. + + + **Returns:** + - the ProductSearchRefinements associated with this search. + + +--- + +### getSearchPhraseSuggestions() +- getSearchPhraseSuggestions(): [SearchPhraseSuggestions](dw.suggest.SearchPhraseSuggestions.md) + - : Returns search phrase suggestions for the current search phrase. + Search phrase suggestions may contain alternative search phrases as well + as lists of corrected and completed search terms. + + + **Returns:** + - search phrase suggestions for the current search phrase + + +--- + +### getSearchableImageUploadURL() +- getSearchableImageUploadURL(): [String](TopLevel.String.md) + - : This method returns the URL of the endpoint where the merchants should upload their image for visual search. + + **Returns:** + - returns the URL where the merchants should upload their image. + + **Throws:** + - RuntimeException - + + +--- + +### getSortingRule() +- getSortingRule(): [SortingRule](dw.catalog.SortingRule.md) + - : Returns the sorting rule explicitly set on this model to be used + to order the products in the results of this query, or `null` + if no rule has been explicitly set. + + This method does not return the sorting rule that will be used implicitly + based on the context of the search, such as the refinement category. + + + **Returns:** + - a SortingRule or null. + + +--- + +### getStoreInventoryFilter() +- getStoreInventoryFilter(): [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) + - : + + Returns the [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md), which was specified for this search. + + + **Returns:** + - the [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md), which was specified for this search. + + +--- + +### getSuggestedSearchPhrase() +- ~~getSuggestedSearchPhrase(): [String](TopLevel.String.md)~~ + - : Returns the suggested search phrase with the highest accuracy provided + for the current search phrase. + + + **Returns:** + - the suggested search phrase. + + **Deprecated:** +:::warning +Please use [getSearchPhraseSuggestions()](dw.catalog.ProductSearchModel.md#getsearchphrasesuggestions) instead +::: + +--- + +### getSuggestedSearchPhrases() +- ~~getSuggestedSearchPhrases(): [List](dw.util.List.md)~~ + - : Returns a list with up to 5 suggested search phrases provided for the + current search phrase. It is possible that less than 5 suggestions + or even no suggestions are returned. + + + **Returns:** + - a list containing the suggested search phrases. + + **Deprecated:** +:::warning +Please use [getSearchPhraseSuggestions()](dw.catalog.ProductSearchModel.md#getsearchphrasesuggestions) instead +::: + +--- + +### isCategorySearch() +- isCategorySearch(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if this is a pure search for a category. The + method checks, that a category ID is specified and no search phrase is + specified. + + + **Returns:** + - True if this is a category search + + +--- + +### isPersonalizedSort() +- isPersonalizedSort(): [Boolean](TopLevel.Boolean.md) + - : The method indicates if the search result is ordered by a personalized sorting rule. + + **Returns:** + - true if search result is ordered by a personalized sorting rule, otherwise false. + + +--- + +### isRecursiveCategorySearch() +- isRecursiveCategorySearch(): [Boolean](TopLevel.Boolean.md) + - : Get the flag that determines if the category search will + be recursive. + + + **Returns:** + - true if the category search will be recursive, false otherwise + + +--- + +### isRefinedByCategory() +- isRefinedByCategory(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if the search is refined by a category. + The method checks, that a category ID is specified. + + + **Returns:** + - true, if the search is refined by a category, false otherwise. + + +--- + +### isRefinedByPrice() +- isRefinedByPrice(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined by price. + + **Returns:** + - True if the search is refined by price, false otherwise. + + +--- + +### isRefinedByPriceRange(Number, Number) +- isRefinedByPriceRange(priceMin: [Number](TopLevel.Number.md), priceMax: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined by the given price range. + Either range parameters may be null to represent open ranges. + + + **Parameters:** + - priceMin - The lower bound of the price range. + - priceMax - The upper bound of the price range. + + **Returns:** + - True if the search is refinemd on the given price range, false + otherwise. + + + +--- + +### isRefinedByPromotion() +- isRefinedByPromotion(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined by promotion. + + **Returns:** + - True if the search is refined by promotion, false otherwise. + + +--- + +### isRefinedByPromotion(String) +- isRefinedByPromotion(promotionID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined by a given promotion. + + **Parameters:** + - promotionID - the ID of the promotion to check + + **Returns:** + - True if the search is refined by the given promotionID, false otherwise. + + +--- + +### isRefinedCategorySearch() +- isRefinedCategorySearch(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a category search and is refined with further + criteria, like a brand refinement or an attribute refinement. + + + **Returns:** + - true if this is a category search and is refined with further + criteria, false otherwise. + + + +--- + +### isTrackingEmptySearchesEnabled() +- isTrackingEmptySearchesEnabled(): [Boolean](TopLevel.Boolean.md) + - : The method indicates if no-hits search should be tracked for predictive intelligence use. + + **Returns:** + - true, if no-hits search should be tracked, otherwise false. + + +--- + +### isVisualSearch() +- isVisualSearch(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if this is a visual search. The + method checks that a image UUID is specified. + + + **Returns:** + - True if this is a visual search + + +--- + +### search() +- search(): [SearchStatus](dw.system.SearchStatus.md) + - : Execute the search based on the configured search term, category and filter conditions (price, attribute, + promotion, product type) and return the execution status. The execution of an empty ProductSearchModel without + any search term or filter criteria will not be supported and the search status [SearchStatus.EMPTY_QUERY](dw.system.SearchStatus.md#empty_query) + will be returned. A usage of the internal category id 'root' as category filter is not recommended, could cause + performance issues and will be potentially deprecated in a future release. A successful execution will be + indicated by [SearchStatus.SUCCESSFUL](dw.system.SearchStatus.md#successful) or [SearchStatus.LIMITED](dw.system.SearchStatus.md#limited). For other possible search + statuses see [SearchStatus](dw.system.SearchStatus.md). The sorted and grouped search result of a successful execution can be fetched + via [getProductSearchHits()](dw.catalog.ProductSearchModel.md#getproductsearchhits) and the refinement options based on the search result can be obtained via + [getRefinements()](dw.catalog.ProductSearchModel.md#getrefinements) and [SearchModel.getRefinementValues(String)](dw.catalog.SearchModel.md#getrefinementvaluesstring). + + + **Returns:** + - the searchStatus object with search status code and description of search result. + + +--- + +### setCategoryID(String) +- setCategoryID(categoryID: [String](TopLevel.String.md)): void + - : Specifies the category id used for the search query. + + **Parameters:** + - categoryID - the category id for the search query. + + +--- + +### setEnableTrackingEmptySearches(Boolean) +- setEnableTrackingEmptySearches(trackingEmptySearches: [Boolean](TopLevel.Boolean.md)): void + - : Set a flag indicating whether no-hits search should be tracked for predictive intelligence use. + + **Parameters:** + - trackingEmptySearches - true, no-hits search should be tracked, false, otherwise. + + +--- + +### setInventoryListIDs(List) +- setInventoryListIDs(inventoryListIDs: [List](dw.util.List.md)): void + - : + + Specifies multiple inventory list IDs used for the search query. The method supports up to + [MAXIMUM_INVENTORY_LIST_IDS](dw.catalog.ProductSearchModel.md#maximum_inventory_list_ids) inventory IDs. If more than [MAXIMUM_INVENTORY_LIST_IDS](dw.catalog.ProductSearchModel.md#maximum_inventory_list_ids) inventory IDs + used the method throws an IllegalArgumentException. + + + **Parameters:** + - inventoryListIDs - the inventory IDs for the search query. + + **Throws:** + - IllegalArgumentException - if more than [MAXIMUM_INVENTORY_LIST_IDS](dw.catalog.ProductSearchModel.md#maximum_inventory_list_ids) inventory IDs used + + +--- + +### setOrderableProductsOnly(Boolean) +- setOrderableProductsOnly(orderableOnly: [Boolean](TopLevel.Boolean.md)): void + - : Set a flag indicating whether unorderable products should be excluded + when the next call to getProducts() is made. This method overrides the + default behavior which is controlled by the search preference. + + + **Parameters:** + - orderableOnly - true if unorderable products should be excluded from product search results, false otherwise. + + +--- + +### setPriceMax(Number) +- setPriceMax(priceMax: [Number](TopLevel.Number.md)): void + - : Sets the maximum price by which the search result is to be refined. + + **Parameters:** + - priceMax - sets the maximum price by which the search result is to be refined. + + +--- + +### setPriceMin(Number) +- setPriceMin(priceMin: [Number](TopLevel.Number.md)): void + - : Sets the minimum price by which the search result is to be refined. + + **Parameters:** + - priceMin - the minimum price by which the search result is to be refined. + + +--- + +### setProductID(String) +- ~~setProductID(productID: [String](TopLevel.String.md)): void~~ + - : Specifies the product id used for the search query. + + **Parameters:** + - productID - the product id for the search query. + + **Deprecated:** +:::warning +Please use [setProductIDs(List)](dw.catalog.ProductSearchModel.md#setproductidslist) instead +::: + +--- + +### setProductIDs(List) +- setProductIDs(productIDs: [List](dw.util.List.md)): void + - : Specifies multiple product IDs used for the search query. The specified product IDs include, but not limited to, + variant product IDs, product master IDs, variation group IDs, product set IDs, or product bundle IDs. For + example, this API could be used in high-traffic pages where developers need to be able to filter quickly for only + available child products of a specified master product, instead of looping through all variants of a set products + and checking their availabilities. The method supports up to [MAXIMUM_PRODUCT_IDS](dw.catalog.ProductSearchModel.md#maximum_product_ids) product IDs. If more + than [MAXIMUM_PRODUCT_IDS](dw.catalog.ProductSearchModel.md#maximum_product_ids) products IDs are passed, the method throws an IllegalArgumentException. + + + **Parameters:** + - productIDs - the product IDs for the search query. + + **Throws:** + - IllegalArgumentException - if more than [MAXIMUM_PRODUCT_IDS](dw.catalog.ProductSearchModel.md#maximum_product_ids) product IDs used + + +--- + +### setPromotionID(String) +- setPromotionID(promotionID: [String](TopLevel.String.md)): void + - : Specifies the promotion id used for the search query. + + **Parameters:** + - promotionID - the promotion id for the search query. + + +--- + +### setPromotionIDs(List) +- setPromotionIDs(promotionIDs: [List](dw.util.List.md)): void + - : Specifies multiple promotion id's used for the search query. The method supports up to 30 promotion id's. If more + than 30 promotion id's used the method throws an IllegalArgumentException. + + + **Parameters:** + - promotionIDs - the promotion ids for the search query. + + **Throws:** + - IllegalArgumentException - if more than 30 promotion id's used + + +--- + +### setPromotionProductType(String) +- setPromotionProductType(promotionProductType: [String](TopLevel.String.md)): void + - : Specifies the promotion product type used for the search query. This + value is only relevant for searches by promotion ID. + + + **Parameters:** + - promotionProductType - The type of product to filter by when searching by promotion ID. Allowed values are PROMOTION\_PRODUCT\_TYPE\_ALL, PROMOTION\_PRODUCT\_TYPE\_BONUS, PROMOTION\_PRODUCT\_TYPE\_QUALIFYING, and PROMOTION\_PRODUCT\_TYPE\_DISCOUNTED. If null is passed, or an invalid value is passed, the search will use PROMOTION\_PRODUCT\_TYPE\_ALL. + + +--- + +### setRecursiveCategorySearch(Boolean) +- setRecursiveCategorySearch(recurse: [Boolean](TopLevel.Boolean.md)): void + - : Set a flag to indicate if the search in category should be recursive. + + **Parameters:** + - recurse - recurse the category in the search + + +--- + +### setRefinementCategory(Category) +- setRefinementCategory(refinementCategory: [Category](dw.catalog.Category.md)): void + - : Sets an explicit category to be used when determining refinements. If this is not done, they will be determined based on the deepest common category of all search results. + The explicit category must be in the site's storefront catalog, otherwise the method fails with an IllegalArgumentException. + + + **Parameters:** + - refinementCategory - the category used to determine the applicable refinements. + + **Throws:** + - IllegalArgumentException - if the refinement category does not reside in the storefront catalog + + +--- + +### setSearchableImageID(String) +- setSearchableImageID(imageID: [String](TopLevel.String.md)): void + - : An image ID can be retrieved by uploading an image with a multipart/form-data POST + request to 'https://api.cquotient.com/v3/image/search/upload/{siteID}'. This method sets product IDs retrieved + from the image ID to the ProductSearchModel. If using [setProductIDs(List)](dw.catalog.ProductSearchModel.md#setproductidslist) in addition to this method, + the ProductSearchModel will take the intersection of these sets of product IDs. If the image ID provided is + invalid or expired, product IDs will not be set onto the product search model. + + + **Parameters:** + - imageID - the image ID for the visual search query. + + **Throws:** + - RuntimeException - if product IDs for the provided image could not be set. + + +--- + +### setSortingCondition(String, Number) +- ~~setSortingCondition(attributeID: [String](TopLevel.String.md), direction: [Number](TopLevel.Number.md)): void~~ + - : Sets or removes a sorting condition for the specified attribute. Specify + either SORT\_DIRECTION\_ASCENDING or SORT\_DIRECTION\_DESCENDING to set a + sorting condition. Specify SORT\_DIRECTION\_NONE to remove a sorting + condition from the attribute. + + + **Parameters:** + - attributeID - the attribute ID + - direction - SORT\_DIRECTION\_ASCENDING, SORT\_DIRECTION\_DESCENDING or SORT\_DIRECTION\_NONE + + **Deprecated:** +:::warning +This method is subject to removal. Use [setSortingRule(SortingRule)](dw.catalog.ProductSearchModel.md#setsortingrulesortingrule) instead. +::: + +--- + +### setSortingOption(SortingOption) +- setSortingOption(option: [SortingOption](dw.catalog.SortingOption.md)): void + - : Sets the sorting option to be used to order the products in the results of this query. + If a sorting rule is also set, the sorting option is ignored. + + + **Parameters:** + - option - the SortingOption to use to sort the products + + +--- + +### setSortingRule(SortingRule) +- setSortingRule(rule: [SortingRule](dw.catalog.SortingRule.md)): void + - : Sets the sorting rule to be used to order the products in the + results of this query. Setting the rule in this way overrides the + default behavior of choosing the sorting rule based on the context of the + search, such as the refinement category. + + + **Parameters:** + - rule - the SortingRule to use to sort the products + + +--- + +### setStoreInventoryFilter(StoreInventoryFilter) +- setStoreInventoryFilter(storeInventoryFilter: [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md)): void + - : + + Filters the search result by one or more inventory list IDs provided by the class [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) + which supports a semantic URL parameter like zip, city, store ... and a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) + which maps the semantic inventory list id value like Burlington, Boston, ... to a real inventory list id like + 'Burlington -> inventory1', 'Boston -> inventory2'. The search will filter the result by the real inventory list + id(s) but will use the semantic URL parameter and semantic inventory list id values for URL generation via all + URLRefine and URLRelax methods e.g. for [urlRefineCategory(URL, String)](dw.catalog.ProductSearchModel.md#urlrefinecategoryurl-string), [urlRelaxPrice(URL)](dw.catalog.ProductSearchModel.md#urlrelaxpriceurl), + [SearchModel.urlRefineAttribute(String, String, String)](dw.catalog.SearchModel.md#urlrefineattributestring-string-string). + + + Example custom URL: city=Burlington|Boston + + + + ``` + var storeFilter = new dw.catalog.StoreInventoryFilter("city", + new dw.util.ArrayList( + new dw.catalog.StoreInventoryFilterValue("Burlington","inventory_store_store9"), + new dw.catalog.StoreInventoryFilterValue("Boston","inventory_store_store8") + )); + searchModel.setStoreInventoryFilter(filter) + ``` + + + **Parameters:** + - storeInventoryFilter - The [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) instance to filter the search result by one or more inventory IDs with semantic key and semantic value support. + + **Throws:** + - IllegalArgumentException - if more than [MAXIMUM_STORE_INVENTORY_FILTER_VALUES](dw.catalog.ProductSearchModel.md#maximum_store_inventory_filter_values) filter values used + + +--- + +### urlForCategory(URL, String) +- static urlForCategory(url: [URL](dw.web.URL.md), cgid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + Category. The search specific parameters are appended to the provided + URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - the URL to use to generate the new URL. + - cgid - the category ID. + + **Returns:** + - the new URL. + + +--- + +### urlForCategory(String, String) +- static urlForCategory(action: [String](TopLevel.String.md), cgid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + Category. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - pipeline action, e.g. 'Search-Show'. + - cgid - the category ID. + + **Returns:** + - the new URL. + + +--- + +### urlForProduct(URL, String, String) +- static urlForProduct(url: [URL](dw.web.URL.md), cgid: [String](TopLevel.String.md), pid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + Product. The passed url can be either a full url or just the name for a + pipeline. In the later case a relative URL is created. + + + **Parameters:** + - url - the URL to use to generate the new URL. + - cgid - the category id or null if product is not in category context. + - pid - the product id. + + **Returns:** + - the new URL. + + +--- + +### urlForProduct(String, String, String) +- static urlForProduct(action: [String](TopLevel.String.md), cgid: [String](TopLevel.String.md), pid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + Product. The passed action is used to build an initial url. All search + specific attributes are appended. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - pipeline action, e.g. 'Search-Show'. + - cgid - the category id or null if product is not in category context. + - pid - the product id. + + **Returns:** + - the new URL. + + +--- + +### urlForRefine(URL, String, String) +- static urlForRefine(url: [URL](dw.web.URL.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + attribute name-value pair. The search specific parameters are appended to + the provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - the URL to use to generate the new URL. + - attributeID - the attribute ID for the refinement. + - value - the attribute value for the refinement. + + **Returns:** + - the new URL. + + +--- + +### urlForRefine(String, String, String) +- static urlForRefine(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to execute a query for a specific + attribute name-value pair. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - pipeline action, e.g. 'Search-Show'. + - attributeID - the attribute ID for the refinement. + - value - the attribute value for the refinement. + + **Returns:** + - the new URL. + + +--- + +### urlRefineCategory(URL, String) +- urlRefineCategory(url: [URL](dw.web.URL.md), refineCategoryID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with a + category refinement. The search specific parameters are appended to the + provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + - refineCategoryID - the ID of the category. + + **Returns:** + - the new URL. + + +--- + +### urlRefineCategory(String, String) +- urlRefineCategory(action: [String](TopLevel.String.md), refineCategoryID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with a + category refinement. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show' + - refineCategoryID - the ID of the category. + + **Returns:** + - the new URL. + + +--- + +### urlRefinePrice(URL, Number, Number) +- urlRefinePrice(url: [URL](dw.web.URL.md), min: [Number](TopLevel.Number.md), max: [Number](TopLevel.Number.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with an + additional price filter. The search specific parameters are appended to + the provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - the URL to use to generate the new URL. + - min - the minimum price. + - max - the maximum price. + + **Returns:** + - the new URL. + + +--- + +### urlRefinePrice(String, Number, Number) +- urlRefinePrice(action: [String](TopLevel.String.md), min: [Number](TopLevel.Number.md), max: [Number](TopLevel.Number.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with an + additional price filter. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show'. + - min - the minimum price. + - max - the maximum price. + + **Returns:** + - the new URL. + + +--- + +### urlRefinePromotion(URL, String) +- urlRefinePromotion(url: [URL](dw.web.URL.md), refinePromotionID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with a promotion refinement. The search specific + parameters are appended to the provided URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + - refinePromotionID - the ID of the promotion. + + **Returns:** + - the new URL. + + +--- + +### urlRefinePromotion(String, String) +- urlRefinePromotion(action: [String](TopLevel.String.md), refinePromotionID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with a promotion refinement. The generated URL will be + an absolute URL which uses the protocol of the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show' + - refinePromotionID - the ID of the promotion. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxCategory(URL) +- urlRelaxCategory(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query without any + category refinement. The search specific parameters are appended to the + provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxCategory(String) +- urlRelaxCategory(action: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query without any + category refinement. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show'. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxPrice(URL) +- urlRelaxPrice(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to would re-execute the query with no + price filter. The search specific parameters are appended to the provided + URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxPrice(String) +- urlRelaxPrice(action: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query with no price + filter. + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show' + + **Returns:** + - the new URL. + + +--- + +### urlRelaxPromotion(URL) +- urlRelaxPromotion(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query without any promotion refinement. The search specific + parameters are appended to the provided URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxPromotion(String) +- urlRelaxPromotion(action: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query without any promotion refinement. The generated URL + will be an absolute URL which uses the protocol of the current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show'. + + **Returns:** + - the new URL. + + +--- + +### urlSortingOption(URL, SortingOption) +- urlSortingOption(url: [URL](dw.web.URL.md), option: [SortingOption](dw.catalog.SortingOption.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query but sort + the results by the given storefront sorting option. The search specific parameters are + appended to the provided URL. The URL is typically generated with one of + the URLUtils methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + - option - sorting option + + **Returns:** + - the new URL. + + +--- + +### urlSortingOption(String, SortingOption) +- urlSortingOption(action: [String](TopLevel.String.md), option: [SortingOption](dw.catalog.SortingOption.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query but sort the + results by the given storefront sorting option. + + The generated URL will be an absolute URL which uses the protocol of the + current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show'. + - option - sorting option + + **Returns:** + - the new URL. + + +--- + +### urlSortingRule(URL, SortingRule) +- urlSortingRule(url: [URL](dw.web.URL.md), rule: [SortingRule](dw.catalog.SortingRule.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query but sort + the results by the given rule. The search specific parameters are + appended to the provided URL. The URL is typically generated with one of + the URLUtils methods. + + + **Parameters:** + - url - the existing URL to use to create the new URL. + - rule - sorting rule + + **Returns:** + - the new URL. + + +--- + +### urlSortingRule(String, SortingRule) +- urlSortingRule(action: [String](TopLevel.String.md), rule: [SortingRule](dw.catalog.SortingRule.md)): [URL](dw.web.URL.md) + - : Constructs a URL that you can use to re-execute the query but sort the + results by the given rule. + + The generated URL will be an absolute URL which uses the protocol of the + current request. + + + **Parameters:** + - action - the pipeline action, e.g. 'Search-Show'. + - rule - sorting rule + + **Returns:** + - the new URL. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementDefinition.md new file mode 100644 index 00000000..e14af888 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementDefinition.md @@ -0,0 +1,99 @@ + +# Class ProductSearchRefinementDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md) + - [dw.catalog.ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) + +This class provides an interface to refinement options for the product search. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [categoryRefinement](#categoryrefinement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a category refinement. | +| [priceRefinement](#pricerefinement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a price refinement. | +| [promotionRefinement](#promotionrefinement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a promotion refinement. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [isCategoryRefinement](dw.catalog.ProductSearchRefinementDefinition.md#iscategoryrefinement)() | Identifies if this is a category refinement. | +| [isPriceRefinement](dw.catalog.ProductSearchRefinementDefinition.md#ispricerefinement)() | Identifies if this is a price refinement. | +| [isPromotionRefinement](dw.catalog.ProductSearchRefinementDefinition.md#ispromotionrefinement)() | Identifies if this is a promotion refinement. | + +### Methods inherited from class SearchRefinementDefinition + +[getAttributeID](dw.catalog.SearchRefinementDefinition.md#getattributeid), [getCutoffThreshold](dw.catalog.SearchRefinementDefinition.md#getcutoffthreshold), [getDisplayName](dw.catalog.SearchRefinementDefinition.md#getdisplayname), [getValueTypeCode](dw.catalog.SearchRefinementDefinition.md#getvaluetypecode), [isAttributeRefinement](dw.catalog.SearchRefinementDefinition.md#isattributerefinement) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### categoryRefinement +- categoryRefinement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a category refinement. + + +--- + +### priceRefinement +- priceRefinement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a price refinement. + + +--- + +### promotionRefinement +- promotionRefinement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a promotion refinement. + + +--- + +## Method Details + +### isCategoryRefinement() +- isCategoryRefinement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a category refinement. + + **Returns:** + - true if this is a category refinement, false otherwise. + + +--- + +### isPriceRefinement() +- isPriceRefinement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a price refinement. + + **Returns:** + - true if this is a price refinement, false otherwise. + + +--- + +### isPromotionRefinement() +- isPromotionRefinement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a promotion refinement. + + **Returns:** + - true if this is a promotion refinement, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementValue.md new file mode 100644 index 00000000..4409f8ec --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinementValue.md @@ -0,0 +1,80 @@ + +# Class ProductSearchRefinementValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinementValue](dw.catalog.SearchRefinementValue.md) + - [dw.catalog.ProductSearchRefinementValue](dw.catalog.ProductSearchRefinementValue.md) + +Represents the value of a product search refinement. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [valueFrom](#valuefrom): [Number](TopLevel.Number.md) `(read-only)` | Returns the lower bound for price refinements. | +| [valueTo](#valueto): [Number](TopLevel.Number.md) `(read-only)` | Returns the upper bound for price refinements. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getValueFrom](dw.catalog.ProductSearchRefinementValue.md#getvaluefrom)() | Returns the lower bound for price refinements. | +| [getValueTo](dw.catalog.ProductSearchRefinementValue.md#getvalueto)() | Returns the upper bound for price refinements. | + +### Methods inherited from class SearchRefinementValue + +[getDescription](dw.catalog.SearchRefinementValue.md#getdescription), [getDisplayValue](dw.catalog.SearchRefinementValue.md#getdisplayvalue), [getHitCount](dw.catalog.SearchRefinementValue.md#gethitcount), [getID](dw.catalog.SearchRefinementValue.md#getid), [getPresentationID](dw.catalog.SearchRefinementValue.md#getpresentationid), [getValue](dw.catalog.SearchRefinementValue.md#getvalue) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### valueFrom +- valueFrom: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the lower bound for price refinements. For example, 50.00 + for a range of $50.00 - $99.99. + + + +--- + +### valueTo +- valueTo: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the upper bound for price refinements. For example, 99.99 + for a range of $50.00 - $99.99. + + + +--- + +## Method Details + +### getValueFrom() +- getValueFrom(): [Number](TopLevel.Number.md) + - : Returns the lower bound for price refinements. For example, 50.00 + for a range of $50.00 - $99.99. + + + **Returns:** + - the lower bound for price refinements. + + +--- + +### getValueTo() +- getValueTo(): [Number](TopLevel.Number.md) + - : Returns the upper bound for price refinements. For example, 99.99 + for a range of $50.00 - $99.99. + + + **Returns:** + - the upper bound for price refinements. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinements.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinements.md new file mode 100644 index 00000000..6991160b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductSearchRefinements.md @@ -0,0 +1,265 @@ + +# Class ProductSearchRefinements + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinements](dw.catalog.SearchRefinements.md) + - [dw.catalog.ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) + +This class provides an interface to refinement options for the product +search. In a typical usage, the client application UI displays the search +refinements along with the search results and allows customers to "refine" +the results (i.e. limit the results that are shown) by specifying additional +product criteria, or "relax" (i.e. broaden) the results after previously +refining. The four types of product search refinements are: + + +- **Refine By Category:**Limit the products to those assigned to specific child/ancestor categories of the search category. +- **Refine By Attribute:**Limit the products to those with specific values for a given attribute. Values may be grouped into "buckets" so that a given set of values are represented as a single refinement option. +- **Refine By Price:**Limit the products to those whose prices fall in a specific range. +- **Refine By Promotion:**Limit the products to those which are related to a specific promotion. + + +Rendering a product search refinement UI typically begins with iterating the +refinement definitions for the search result. Call +[SearchRefinements.getRefinementDefinitions()](dw.catalog.SearchRefinements.md#getrefinementdefinitions) or +[SearchRefinements.getAllRefinementDefinitions()](dw.catalog.SearchRefinements.md#getallrefinementdefinitions) to +retrieve the appropriate collection of refinement definitions. For each +definition, display the available refinement values by calling +[getAllRefinementValues(ProductSearchRefinementDefinition)](dw.catalog.ProductSearchRefinements.md#getallrefinementvaluesproductsearchrefinementdefinition). Depending +on the type of the refinement definition, the application must use slightly +different logic to display the refinement widgets. For all 4 types, methods +in [ProductSearchModel](dw.catalog.ProductSearchModel.md) are used to generate URLs to render +hyperlinks in the UI. When clicked, these links trigger a call to the Search +pipelet which in turn applies the appropriate filters to the native search +result. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [categoryRefinementDefinition](#categoryrefinementdefinition): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` | Returns the appropriate category refinement definition based on the search result. | +| [priceRefinementDefinition](#pricerefinementdefinition): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` | Returns the appropriate price refinement definition based on the search result. | +| [promotionRefinementDefinition](#promotionrefinementdefinition): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` | Returns the appropriate promotion refinement definition based on the search result. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllRefinementValues](dw.catalog.ProductSearchRefinements.md#getallrefinementvaluesproductsearchrefinementdefinition)([ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md)) | Returns a sorted collection of refinement values for the passed refinement definition. | +| [getCategoryRefinementDefinition](dw.catalog.ProductSearchRefinements.md#getcategoryrefinementdefinition)() | Returns the appropriate category refinement definition based on the search result. | +| [getNextLevelCategoryRefinementValues](dw.catalog.ProductSearchRefinements.md#getnextlevelcategoryrefinementvaluescategory)([Category](dw.catalog.Category.md)) | Returns category refinement values based on the current search result filtered such that only category refinements representing children of the given category are present. | +| [getPriceRefinementDefinition](dw.catalog.ProductSearchRefinements.md#getpricerefinementdefinition)() | Returns the appropriate price refinement definition based on the search result. | +| [getPromotionRefinementDefinition](dw.catalog.ProductSearchRefinements.md#getpromotionrefinementdefinition)() | Returns the appropriate promotion refinement definition based on the search result. | +| [getRefinementValue](dw.catalog.ProductSearchRefinements.md#getrefinementvalueproductsearchrefinementdefinition-string)([ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md), [String](TopLevel.String.md)) | Returns the refinement value (incl. | +| [getRefinementValue](dw.catalog.ProductSearchRefinements.md#getrefinementvaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the refinement value (incl. | +| [getRefinementValues](dw.catalog.ProductSearchRefinements.md#getrefinementvaluesproductsearchrefinementdefinition)([ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md)) | Returns a collection of refinement values for the given refinement definition. | + +### Methods inherited from class SearchRefinements + +[getAllRefinementDefinitions](dw.catalog.SearchRefinements.md#getallrefinementdefinitions), [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring), [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring-number-number), [getRefinementDefinitions](dw.catalog.SearchRefinements.md#getrefinementdefinitions), [getRefinementValues](dw.catalog.SearchRefinements.md#getrefinementvaluesstring-number-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### categoryRefinementDefinition +- categoryRefinementDefinition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` + - : Returns the appropriate category refinement definition based on the search + result. The category refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + +--- + +### priceRefinementDefinition +- priceRefinementDefinition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` + - : Returns the appropriate price refinement definition based on the search + result. The price refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + +--- + +### promotionRefinementDefinition +- promotionRefinementDefinition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) `(read-only)` + - : Returns the appropriate promotion refinement definition based on the search + result. The promotion refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + +--- + +## Method Details + +### getAllRefinementValues(ProductSearchRefinementDefinition) +- getAllRefinementValues(definition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of refinement values for the passed + refinement definition. The returned collection includes all refinement + values for which the hit count is greater than 0 within the search result + when the passed refinement definition is excluded from filtering the + search hits but all other refinement filters are still applied. This + method is useful for rendering broadening options for definitions that + the search is currently refined by. If the search is not currently + restricted by the passed refinement definition, then this method will + return the same result as + [getRefinementValues(ProductSearchRefinementDefinition)](dw.catalog.ProductSearchRefinements.md#getrefinementvaluesproductsearchrefinementdefinition). + + + For attribute-based refinement definitions, the returned collection + depends upon how the "value set" property is configured. (Category and + price refinement definitions do not have such a property.) If this + property is set to "search result values", the behavior is as described + above. If this property is set to "all values of category", then the + returned collection will also include all refinement values for products + in the category subtree rooted at the search definition's category. This + setting is useful for refinements whose visualization is supposed to + remain constant for a certain subtree of a catalog (e.g. color pickers or + size charts). These additional values are independent of the search + result and do not contribute towards the value hit counts. If the search + result is further refined by one of these values, it is possible to get + an empty search result. Except for this one case this method does NOT + return refinement values independent of the search result. + + + **Parameters:** + - definition - The refinement definition to return refinement values for. Must not be null. + + **Returns:** + - The collection of ProductSearchRefinementValue instances, sorted + according to the settings of the refinement definition. + + + +--- + +### getCategoryRefinementDefinition() +- getCategoryRefinementDefinition(): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) + - : Returns the appropriate category refinement definition based on the search + result. The category refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + **Returns:** + - The category refinement definition or `null` if none can + be found. + + + +--- + +### getNextLevelCategoryRefinementValues(Category) +- getNextLevelCategoryRefinementValues(category: [Category](dw.catalog.Category.md)): [Collection](dw.util.Collection.md) + - : Returns category refinement values based on the current search result + filtered such that only category refinements representing children of the + given category are present. If no category is given, the method uses the + catalog's root category. The refinement value product counts represent + all hits contained in the catalog tree starting at the corresponding + child category. + + + **Parameters:** + - category - The category to return child category refinement values for. + + **Returns:** + - The refinement values for all child categories of the given + category. + + + +--- + +### getPriceRefinementDefinition() +- getPriceRefinementDefinition(): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) + - : Returns the appropriate price refinement definition based on the search + result. The price refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + **Returns:** + - The price refinement definition or `null` if none can + be found. + + + +--- + +### getPromotionRefinementDefinition() +- getPromotionRefinementDefinition(): [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) + - : Returns the appropriate promotion refinement definition based on the search + result. The promotion refinement definition returned will be the first that + can be found traversing the category tree upward starting at the deepest + common category of the search result. + + + **Returns:** + - The promotion refinement definition or `null` if none can + be found. + + + +--- + +### getRefinementValue(ProductSearchRefinementDefinition, String) +- getRefinementValue(definition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md), value: [String](TopLevel.String.md)): [ProductSearchRefinementValue](dw.catalog.ProductSearchRefinementValue.md) + - : Returns the refinement value (incl. product hit count) for the given + refinement definition and the given (selected) value. + + + **Parameters:** + - definition - The definition to return the refinement for. + - value - The value to return the refinement for. + + **Returns:** + - The refinement value. + + +--- + +### getRefinementValue(String, String) +- getRefinementValue(name: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [ProductSearchRefinementValue](dw.catalog.ProductSearchRefinementValue.md) + - : Returns the refinement value (incl. product hit count) for the given + refinement attribute and the given (selected) value. + + + **Parameters:** + - name - The name of the refinement attribute. + - value - The value to return the refinement for. + + **Returns:** + - The refinement value. + + +--- + +### getRefinementValues(ProductSearchRefinementDefinition) +- getRefinementValues(definition: [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of refinement values for the given refinement + definition. The returned refinement values only include those that are + part of the actual search result (i.e. hit count will always be > 0). + + + **Parameters:** + - definition - The refinement definition to return refinement values for. + + **Returns:** + - The collection of refinement values sorted according to the + settings of the definition. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttribute.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttribute.md new file mode 100644 index 00000000..b4a753f6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttribute.md @@ -0,0 +1,107 @@ + +# Class ProductVariationAttribute + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md) + +Represents a product variation attribute + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product variation attribute. | +| [attributeID](#attributeid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product attribute defintion related to this variation attribute. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name for the product variation attribute, which can be used in the user interface. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeID](dw.catalog.ProductVariationAttribute.md#getattributeid)() | Returns the ID of the product attribute defintion related to this variation attribute. | +| [getDisplayName](dw.catalog.ProductVariationAttribute.md#getdisplayname)() | Returns the display name for the product variation attribute, which can be used in the user interface. | +| [getID](dw.catalog.ProductVariationAttribute.md#getid)() | Returns the ID of the product variation attribute. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product variation attribute. + + +--- + +### attributeID +- attributeID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product attribute defintion related to + this variation attribute. This ID matches the + value returned by [ObjectAttributeDefinition.getID()](dw.object.ObjectAttributeDefinition.md#getid) + for the appropriate product attribute definition. + This ID is generally different than the ID returned by + [getID()](dw.catalog.ProductVariationAttribute.md#getid). + + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name for the product variation attribute, which can be used in the + user interface. + + + +--- + +## Method Details + +### getAttributeID() +- getAttributeID(): [String](TopLevel.String.md) + - : Returns the ID of the product attribute defintion related to + this variation attribute. This ID matches the + value returned by [ObjectAttributeDefinition.getID()](dw.object.ObjectAttributeDefinition.md#getid) + for the appropriate product attribute definition. + This ID is generally different than the ID returned by + [getID()](dw.catalog.ProductVariationAttribute.md#getid). + + + **Returns:** + - the ID of the product attribute definition of this variation + attribute. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name for the product variation attribute, which can be used in the + user interface. + + + **Returns:** + - the display name for the product variation attribute, which can be used in the + user interface. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the product variation attribute. + + **Returns:** + - the ID of the product variation attribute. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttributeValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttributeValue.md new file mode 100644 index 00000000..1cb1c756 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationAttributeValue.md @@ -0,0 +1,215 @@ + +# Class ProductVariationAttributeValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md) + +Represents a product variation attribute + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product variation attribute value. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of the product variation attribute value in the current locale. | +| [displayValue](#displayvalue): [String](TopLevel.String.md) `(read-only)` | Returns the display value for the product variation attribute value, which can be used in the user interface. | +| [value](#value): [Object](TopLevel.Object.md) `(read-only)` | Returns the value for the product variation attribute value. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [equals](dw.catalog.ProductVariationAttributeValue.md#equalsobject)([Object](TopLevel.Object.md)) | Returns true if the specified object is equal to this object. | +| [getDescription](dw.catalog.ProductVariationAttributeValue.md#getdescription)() | Returns the description of the product variation attribute value in the current locale. | +| [getDisplayValue](dw.catalog.ProductVariationAttributeValue.md#getdisplayvalue)() | Returns the display value for the product variation attribute value, which can be used in the user interface. | +| [getID](dw.catalog.ProductVariationAttributeValue.md#getid)() | Returns the ID of the product variation attribute value. | +| [getImage](dw.catalog.ProductVariationAttributeValue.md#getimagestring)([String](TopLevel.String.md)) | The method calls [getImages(String)](dw.catalog.ProductVariationAttributeValue.md#getimagesstring) and returns the first image of the list. | +| [getImage](dw.catalog.ProductVariationAttributeValue.md#getimagestring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | The method calls [getImages(String)](dw.catalog.ProductVariationAttributeValue.md#getimagesstring) and returns the image at the specific index. | +| [getImages](dw.catalog.ProductVariationAttributeValue.md#getimagesstring)([String](TopLevel.String.md)) | Returns all images that match the given view type and have the variant value of this value, which is typically the 'color' attribute. | +| [getValue](dw.catalog.ProductVariationAttributeValue.md#getvalue)() | Returns the value for the product variation attribute value. | +| [hashCode](dw.catalog.ProductVariationAttributeValue.md#hashcode)() | Calculates the hash code for a product variation attribute value. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product variation attribute value. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of the product variation attribute value in the current locale. + + +--- + +### displayValue +- displayValue: [String](TopLevel.String.md) `(read-only)` + - : Returns the display value for the product variation attribute value, which can be used in the + user interface. + + + +--- + +### value +- value: [Object](TopLevel.Object.md) `(read-only)` + - : Returns the value for the product variation attribute value. + + +--- + +## Method Details + +### equals(Object) +- equals(obj: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the specified object is equal to this object. + + **Parameters:** + - obj - the object to test. + + **Returns:** + - true if the specified object is equal to this object. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the product variation attribute value in the current locale. + + **Returns:** + - the description of the product variation attribute value in the current locale, + or null if it wasn't found. + + + +--- + +### getDisplayValue() +- getDisplayValue(): [String](TopLevel.String.md) + - : Returns the display value for the product variation attribute value, which can be used in the + user interface. + + + **Returns:** + - the display value for the product variation attribute value, which can be used in the + user interface. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the product variation attribute value. + + **Returns:** + - the ID of the product variation attribute value. + + +--- + +### getImage(String) +- getImage(viewtype: [String](TopLevel.String.md)): [MediaFile](dw.content.MediaFile.md) + - : The method calls [getImages(String)](dw.catalog.ProductVariationAttributeValue.md#getimagesstring) and returns the first image + of the list. The method is specifically built for handling color + swatches in an apparel site. + + If no images are defined for this variant and specified view type, then + the first image of the master product images for that view type is + returned. If no master product images are defined, the method returns + null. + + + **Parameters:** + - viewtype - the view type annotated to image + + **Returns:** + - the MediaFile or null + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getImage(String, Number) +- getImage(viewtype: [String](TopLevel.String.md), index: [Number](TopLevel.Number.md)): [MediaFile](dw.content.MediaFile.md) + - : The method calls [getImages(String)](dw.catalog.ProductVariationAttributeValue.md#getimagesstring) and returns the image at + the specific index. + + If images are defined for this view type and variant, but not for + specified index, the method returns null. + + If no images are defined for this variant and specified view type, the + image at the specified index of the master product images is returned. If + no master product image for specified index is defined, the method + returns null. + + + **Parameters:** + - viewtype - the view type annotated to image + - index - the index number of the image within image list + + **Returns:** + - the MediaFile or null + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getImages(String) +- getImages(viewtype: [String](TopLevel.String.md)): [List](dw.util.List.md) + - : Returns all images that match the given view type and have the variant + value of this value, which is typically the 'color' attribute. The images + are returned in the order of their index number ascending. + + If no images are defined for this variant, then the images of the master + for that view type are returned. + + + **Parameters:** + - viewtype - the view type annotated to images + + **Returns:** + - a list of MediaFile objects, possibly empty + + **Throws:** + - NullArgumentException - if viewtype is null + + +--- + +### getValue() +- getValue(): [Object](TopLevel.Object.md) + - : Returns the value for the product variation attribute value. + + **Returns:** + - the value for the product variation attribute value. + + +--- + +### hashCode() +- hashCode(): [Number](TopLevel.Number.md) + - : Calculates the hash code for a product variation attribute value. + + **Returns:** + - the hash code for a product variation attribute value. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationModel.md new file mode 100644 index 00000000..5dcf1adc --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.ProductVariationModel.md @@ -0,0 +1,1010 @@ + +# Class ProductVariationModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.ProductVariationModel](dw.catalog.ProductVariationModel.md) + +Class representing the complete variation information for a master product in +the system. An instance of this class provides methods to access the +following information: + + +- The variation attributes of the master product (e.g. size and color). Use [getProductVariationAttributes()](dw.catalog.ProductVariationModel.md#getproductvariationattributes). +- The variation attribute values (e.g. size=Small, Medium, Large and color=Red, Blue). Use [getAllValues(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getallvaluesproductvariationattribute). +- The variation groups which may represent a subset of variants by defining a subset of the variation attribute values (e.g. color=Red, size=empty). Use [getVariationGroups()](dw.catalog.ProductVariationModel.md#getvariationgroups). +- The variants themselves (e.g. the products representing Small Red, Large Red, Small Blue, Large Blue, etc). Use [getVariants()](dw.catalog.ProductVariationModel.md#getvariants). +- The variation attribute values of those variants. Use [getVariationValue(Product, ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getvariationvalueproduct-productvariationattribute). + + +This model only considers variants which are complete (i.e. the variant has a +value for each variation attribute), and currently online. Incomplete or +offline variants will not be returned by any method that returns Variants, +and their attribute values will not be considered in any method that returns +values. + + +In addition to providing access to this meta information, +ProductVariationModel maintains a collection of selected variation attribute +values, representing the selections that a customer makes in the storefront. +If this model was constructed for a master product, then none of the +attributes will have pre-selected values. If this model was constructed for a +variant product, then all the attribute values of that variant will be +pre-selected. + + +It is possible to query the current selections by calling +[getSelectedValue(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getselectedvalueproductvariationattribute) or +[isSelectedAttributeValue(ProductVariationAttribute, ProductVariationAttributeValue)](dw.catalog.ProductVariationModel.md#isselectedattributevalueproductvariationattribute-productvariationattributevalue). + + +The method [setSelectedAttributeValue(String, String)](dw.catalog.ProductVariationModel.md#setselectedattributevaluestring-string) can be used to modify +the selected values. Depending on the product type, it's possible to select or modify +variation attribute values: + + +- If this model was constructed for a master product, it's possible to select and modify all variation attributes. +- If this model was constructed for a variation group, it's possible to select and modify all variation attributes that are not defined by the variation group. +- If this model was constructed for a variation product, it's not possible to select or modify any of the variation attributes. + + + + +Furthermore, the model provides helper methods to generate URLs +for selecting and unselecting variation attribute values. See those methods +for details. + + +If this model was constructed for a product that is neither a +master nor a variant, then none of the methods will return useful values at +all. + + +The methods in this class which access the currently selected variation +attribute values can be used on product detail pages to render information +about which combinations are available or unavailable. The methods +[getFilteredValues(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getfilteredvaluesproductvariationattribute) and +[hasOrderableVariants(ProductVariationAttribute, ProductVariationAttributeValue)](dw.catalog.ProductVariationModel.md#hasorderablevariantsproductvariationattribute-productvariationattributevalue) +can be used to determine this type of situation and render the appropriate +message in the storefront. + + +NOTE: Several methods in this class have a version taking a +[ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md) parameter, and another +deprecated version accepting a [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) +parameter instead. The former should be strictly favored. The latter are +historical leftovers from when object attributes were used directly as the +basis for variation, and the value lists were stored directly on the +ObjectAttributeDefinition. Every ProductVariationAttribute corresponds with +exactly one ObjectAttributeDefinition, but values are now stored on the +ProductVariationAttribute and not the ObjectAttributeDefinition. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[attributeDefinitions](#attributedefinitions): [Collection](dw.util.Collection.md)~~ `(read-only)` | Returns the object attribute definitions corresponding with the product variation attributes of the master product. | +| [defaultVariant](#defaultvariant): [Variant](dw.catalog.Variant.md) `(read-only)` | Return the default variant of this model's master product. | +| [master](#master): [Product](dw.catalog.Product.md) `(read-only)` | Returns the master of the product variation. | +| [productVariationAttributes](#productvariationattributes): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of product variation attributes of the variation. | +| [selectedVariant](#selectedvariant): [Variant](dw.catalog.Variant.md) `(read-only)` | Returns the variant currently selected for this variation model. | +| [selectedVariants](#selectedvariants): [Collection](dw.util.Collection.md) `(read-only)` | Returns the variants currently selected for this variation model. | +| [variants](#variants): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of product variants of this variation model. | +| [variationGroups](#variationgroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of variation groups of this variation model. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllValues](dw.catalog.ProductVariationModel.md#getallvaluesproductvariationattribute)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns the values for the specified attribute. | +| ~~[getAllValues](dw.catalog.ProductVariationModel.md#getallvaluesobjectattributedefinition)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Returns the value definitions for the specified attribute. | +| ~~[getAttributeDefinitions](dw.catalog.ProductVariationModel.md#getattributedefinitions)()~~ | Returns the object attribute definitions corresponding with the product variation attributes of the master product. | +| [getDefaultVariant](dw.catalog.ProductVariationModel.md#getdefaultvariant)() | Return the default variant of this model's master product. | +| [getFilteredValues](dw.catalog.ProductVariationModel.md#getfilteredvaluesproductvariationattribute)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns a collection of the value definitions defined for the specified attribute, filtered based on currently selected values. | +| ~~[getFilteredValues](dw.catalog.ProductVariationModel.md#getfilteredvaluesobjectattributedefinition)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Returns a collection of the value definitions defined for the specified attribute, filtered based on currently selected values. | +| [getHtmlName](dw.catalog.ProductVariationModel.md#gethtmlnameproductvariationattribute)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns an HTML representation of the product variation attribute id. | +| ~~[getHtmlName](dw.catalog.ProductVariationModel.md#gethtmlnameobjectattributedefinition)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Returns an HTML representation of the variation attribute id. | +| [getHtmlName](dw.catalog.ProductVariationModel.md#gethtmlnamestring-productvariationattribute)([String](TopLevel.String.md), [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns an HTML representation of the product variation attribute id with the custom prefix. | +| ~~[getHtmlName](dw.catalog.ProductVariationModel.md#gethtmlnamestring-objectattributedefinition)([String](TopLevel.String.md), [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Returns an HTML representation of the variation attribute id with the custom prefix. | +| [getImage](dw.catalog.ProductVariationModel.md#getimagestring)([String](TopLevel.String.md)) | The method returns the first image appropriate for the current selected variation values with the specific index. | +| [getImage](dw.catalog.ProductVariationModel.md#getimagestring-productvariationattribute-productvariationattributevalue)([String](TopLevel.String.md), [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)) | The method returns the first image appropriate for the currently selected attribute values. | +| [getImage](dw.catalog.ProductVariationModel.md#getimagestring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | The method returns an image appropriate for the current selected variation values with the specific index. | +| [getImages](dw.catalog.ProductVariationModel.md#getimagesstring)([String](TopLevel.String.md)) | The method returns the image appropriate for the currently selected attribute values. | +| [getMaster](dw.catalog.ProductVariationModel.md#getmaster)() | Returns the master of the product variation. | +| [getProductVariationAttribute](dw.catalog.ProductVariationModel.md#getproductvariationattributestring)([String](TopLevel.String.md)) | Returns the product variation attribute for the specific id, or null if there is no product variation attribute for that id. | +| [getProductVariationAttributes](dw.catalog.ProductVariationModel.md#getproductvariationattributes)() | Returns a collection of product variation attributes of the variation. | +| [getSelectedValue](dw.catalog.ProductVariationModel.md#getselectedvalueproductvariationattribute)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns the selected value for the specified product variation attribute. | +| ~~[getSelectedValue](dw.catalog.ProductVariationModel.md#getselectedvalueobjectattributedefinition)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Returns the selected value for the specified attribute. | +| [getSelectedVariant](dw.catalog.ProductVariationModel.md#getselectedvariant)() | Returns the variant currently selected for this variation model. | +| [getSelectedVariants](dw.catalog.ProductVariationModel.md#getselectedvariants)() | Returns the variants currently selected for this variation model. | +| [getVariants](dw.catalog.ProductVariationModel.md#getvariants)() | Returns the collection of product variants of this variation model. | +| [getVariants](dw.catalog.ProductVariationModel.md#getvariantshashmap)([HashMap](dw.util.HashMap.md)) | Returns the variants that match the specified filter conditions. | +| [getVariationGroups](dw.catalog.ProductVariationModel.md#getvariationgroups)() | Returns the collection of variation groups of this variation model. | +| [getVariationValue](dw.catalog.ProductVariationModel.md#getvariationvalueproduct-productvariationattribute)([Product](dw.catalog.Product.md), [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Returns the value for the specified variant or variation group product and variation attribute. | +| [hasOrderableVariants](dw.catalog.ProductVariationModel.md#hasorderablevariantsproductvariationattribute-productvariationattributevalue)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)) | Returns true if any variant is available with the specified value of the specified variation attribute. | +| [isSelectedAttributeValue](dw.catalog.ProductVariationModel.md#isselectedattributevalueproductvariationattribute-productvariationattributevalue)([ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)) | Identifies if the specified product variation attribute value is the one currently selected. | +| ~~[isSelectedAttributeValue](dw.catalog.ProductVariationModel.md#isselectedattributevalueobjectattributedefinition-objectattributevaluedefinition)([ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md), [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md))~~ | Identifies if the specified variation value is the one currently selected. | +| [setSelectedAttributeValue](dw.catalog.ProductVariationModel.md#setselectedattributevaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Applies a selected attribute value to this model instance. | +| [url](dw.catalog.ProductVariationModel.md#urlstring-object)([String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Constructs a URL to select a set of variation attribute values. | +| [urlSelectVariationValue](dw.catalog.ProductVariationModel.md#urlselectvariationvaluestring-productvariationattribute-productvariationattributevalue)([String](TopLevel.String.md), [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)) | Generates a URL for selecting a value for a given variation attribute. | +| ~~[urlSelectVariationValue](dw.catalog.ProductVariationModel.md#urlselectvariationvaluestring-objectattributedefinition-objectattributevaluedefinition)([String](TopLevel.String.md), [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md), [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md))~~ | Constructs an URL to select the specified value of the specified variation attribute. | +| [urlUnselectVariationValue](dw.catalog.ProductVariationModel.md#urlunselectvariationvaluestring-productvariationattribute)([String](TopLevel.String.md), [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)) | Generates a URL for unselecting a value for a given variation attribute. | +| ~~[urlUnselectVariationValue](dw.catalog.ProductVariationModel.md#urlunselectvariationvaluestring-objectattributedefinition)([String](TopLevel.String.md), [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md))~~ | Constructs an URL to unselect the value of the specified variation attribute. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### attributeDefinitions +- ~~attributeDefinitions: [Collection](dw.util.Collection.md)~~ `(read-only)` + - : Returns the object attribute definitions corresponding with the product + variation attributes of the master product. + + + **Deprecated:** +:::warning +This method is deprecated since custom code should work with + ProductVariationAttributes and not directly with their + corresponding ObjectAttributeDefinitions. Use + [getProductVariationAttributes()](dw.catalog.ProductVariationModel.md#getproductvariationattributes) to get the + product variation attributes. + +::: + +--- + +### defaultVariant +- defaultVariant: [Variant](dw.catalog.Variant.md) `(read-only)` + - : Return the default variant of this model's master product. If no default + variant has been defined, return an arbitrary variant. + + + +--- + +### master +- master: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the master of the product variation. + + +--- + +### productVariationAttributes +- productVariationAttributes: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of product variation attributes of the variation. + + +--- + +### selectedVariant +- selectedVariant: [Variant](dw.catalog.Variant.md) `(read-only)` + - : Returns the variant currently selected for this variation model. + Returns null if no variant is selected. + + + +--- + +### selectedVariants +- selectedVariants: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the variants currently selected for this variation model. + Returns an empty collection if no variant is selected. + + + +--- + +### variants +- variants: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of product variants of this variation model. + This collection only includes online variants. Offline variants are + filtered out. If all variation products are required, consider using + [Product.getVariants()](dw.catalog.Product.md#getvariants). + + The product variants are returned in no particular order. + + + +--- + +### variationGroups +- variationGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of variation groups of this variation model. + This collection only includes online variation groups. Offline variation + groups are filtered out. If all variation group products are required, + consider using [Product.getVariationGroups()](dw.catalog.Product.md#getvariationgroups). + + The variation groups are returned in no particular order. + + + +--- + +## Method Details + +### getAllValues(ProductVariationAttribute) +- getAllValues(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [Collection](dw.util.Collection.md) + - : Returns the values for the specified attribute. Only values that actually + exist for at least one of the master product's currently online and + complete variants are returned. + + + Returns an empty collection if the passed attribute is not even a + variation attribute of the master product. + + + **Parameters:** + - attribute - the variation attribute whose values will be returned. + + **Returns:** + - the sorted collection of ProductVariationAttributeValue instances + representing the values defined for the specified attribute. The + collection is sorted by the explicit sort order defined for the + values. + + + +--- + +### getAllValues(ObjectAttributeDefinition) +- ~~getAllValues(attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Collection](dw.util.Collection.md)~~ + - : Returns the value definitions for the specified attribute. Only values + that actually exist for at least one of the master product's currently + online and complete variants are returned. + + + Returns an empty collection if the passed attribute is not even a + variation attribute of the master product. + + + **Parameters:** + - attribute - the attribute whose values will be returned. + + **Returns:** + - the sorted collection of ObjectAttributeValueDefinition instances + representing the value definitions defined for the specified + attribute. The collection is sorted by the explicit sort order + defined for the values. + + + **Deprecated:** +:::warning +This method is deprecated since custom code should work with + ProductVariationAttributes and not directly with their + corresponding ObjectAttributeDefinitions. Use + [getAllValues(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getallvaluesproductvariationattribute) to get the + collection of ProductVariationAttributeValue instances + instead. + +::: + +--- + +### getAttributeDefinitions() +- ~~getAttributeDefinitions(): [Collection](dw.util.Collection.md)~~ + - : Returns the object attribute definitions corresponding with the product + variation attributes of the master product. + + + **Returns:** + - the collection of ObjectAttributeDefinition instances + corresponding with the variation attributes of the master + product, sorted by explicit position. + + + **Deprecated:** +:::warning +This method is deprecated since custom code should work with + ProductVariationAttributes and not directly with their + corresponding ObjectAttributeDefinitions. Use + [getProductVariationAttributes()](dw.catalog.ProductVariationModel.md#getproductvariationattributes) to get the + product variation attributes. + +::: + +--- + +### getDefaultVariant() +- getDefaultVariant(): [Variant](dw.catalog.Variant.md) + - : Return the default variant of this model's master product. If no default + variant has been defined, return an arbitrary variant. + + + **Returns:** + - the default value of this model's master product, an arbitrary + variant if no default is defined, or null if this model does not + represent a master product with variants. + + + +--- + +### getFilteredValues(ProductVariationAttribute) +- getFilteredValues(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of the value definitions defined for the specified + attribute, filtered based on currently selected values. + + + A value is only returned if it at least one variant has the value and + also possesses the selected values for all previous attributes. It is + important to know that the filter is applied in a certain order. The + method looks at all ProductVariationAttribute instances that appear + before the passed one in the sorted collection returned by + [getProductVariationAttributes()](dw.catalog.ProductVariationModel.md#getproductvariationattributes). If the passed attribute is the + first in this collection, then this method simply returns all its values. + If an earlier attribute does not have a selected value, this method + returns an empty list. Otherwise, the filter looks at all variants + matching the selected value for all previous attributes, and considers + the range of values possessed by these variants for the passed attribute. + + + The idea behind this method is that customers in the storefront select + variation attribute values one by one in the order the variation + attributes are defined and displayed. After each selection, customer only + wants to see values that he can possibly order for the remaining + attributes. + + + Returns an empty collection if the passed attribute is not even a + variation attribute of the master product. + + + **Parameters:** + - attribute - the product variation attribute whose values are to be returned. + + **Returns:** + - a sorted and filtered collection of product variation attribute + values. The collection is sorted by the explicit sort order + defined for the values. + + + +--- + +### getFilteredValues(ObjectAttributeDefinition) +- ~~getFilteredValues(attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [Collection](dw.util.Collection.md)~~ + - : Returns a collection of the value definitions defined for the specified + attribute, filtered based on currently selected values. + + + A value is only returned if it at least one variant has the value and + also possesses the selected values for all previous attributes. It is + important to know that the filter is applied in a certain order. The + method looks at all ObjectAttributeDefinition instances that appear + before the passed one in the sorted collection returned by + [getAttributeDefinitions()](dw.catalog.ProductVariationModel.md#getattributedefinitions). If the passed attribute is the first + in this collection, then this method simply returns all its values. If an + earlier attribute does not have a selected value, this method returns an + empty list. Otherwise, the filter looks at all variants matching the + selected value for all previous attributes, and considers the range of + values possessed by these variants for the passed attribute. + + + The idea behind this method is that customers in the storefront select + variation attribute values one by one in the order the variation + attributes are defined and displayed. After each selection, customer only + wants to see values that he can possibly order for the remaining + attributes. + + + Returns an empty collection if the passed attribute is not even a + variation attribute of the master product. + + + **Parameters:** + - attribute - the attribute whose values are returned by this method. + + **Returns:** + - a sorted collection of ObjectAttributeDefinitionValue instances + calculated based on the currently selected variation values. + + + **Deprecated:** +:::warning +Use [getFilteredValues(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getfilteredvaluesproductvariationattribute) to + get the sorted and calculated collection of product variation + attribute values. + +::: + +--- + +### getHtmlName(ProductVariationAttribute) +- getHtmlName(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [String](TopLevel.String.md) + - : Returns an HTML representation of the product variation attribute id. + + **Parameters:** + - attribute - the product variation attribute whose ID is returned. + + **Returns:** + - an HTML representation of the product variation attribute id. + + +--- + +### getHtmlName(ObjectAttributeDefinition) +- ~~getHtmlName(attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [String](TopLevel.String.md)~~ + - : Returns an HTML representation of the variation attribute id. This method + is deprecated. You should use getHtmlName(ProductVariationAttribute) + instead. + + + **Parameters:** + - attribute - the attribute whose ID is returned. + + **Returns:** + - an HTML representation of the attribute id. + + **Deprecated:** +:::warning +Use [getHtmlName(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#gethtmlnameproductvariationattribute) to get + the HTML representation of the product variation attribute + id. + +::: + +--- + +### getHtmlName(String, ProductVariationAttribute) +- getHtmlName(prefix: [String](TopLevel.String.md), attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [String](TopLevel.String.md) + - : Returns an HTML representation of the product variation attribute id with the custom prefix. + + **Parameters:** + - prefix - a custom prefix. + - attribute - the product variation attribute whose ID is returned. + + **Returns:** + - an HTML representation of the product variation attribute id. + + +--- + +### getHtmlName(String, ObjectAttributeDefinition) +- ~~getHtmlName(prefix: [String](TopLevel.String.md), attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [String](TopLevel.String.md)~~ + - : Returns an HTML representation of the variation attribute id with the + custom prefix. This method is deprecated. You should use + [getHtmlName(String, ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#gethtmlnamestring-productvariationattribute) instead. + + + **Parameters:** + - prefix - a custom prefix. + - attribute - the attribute whose ID is returned. + + **Returns:** + - an HTML representation of the attribute id. + + **Deprecated:** +:::warning +Use [getHtmlName(String, ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#gethtmlnamestring-productvariationattribute) + to get the HTML representation of the product variation + attribute id with the custom prefix. + +::: + +--- + +### getImage(String) +- getImage(viewtype: [String](TopLevel.String.md)): [MediaFile](dw.content.MediaFile.md) + - : The method returns the first image appropriate for the current selected variation values + with the specific index. + + If images are defined for this view type and variants, but not for + specified index, the method returns null. + + If no images are defined for all variants and specified view type, the + image at the specified index of the master product images is returned. If + no master product image for specified index is defined, the method + returns null. + + The view type parameter is required, otherwise a exception is thrown. + + + **Parameters:** + - viewtype - the view type annotated to image + + **Returns:** + - the MediaFile or null + + +--- + +### getImage(String, ProductVariationAttribute, ProductVariationAttributeValue) +- getImage(viewtype: [String](TopLevel.String.md), attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), value: [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)): [MediaFile](dw.content.MediaFile.md) + - : The method returns the first image appropriate for the currently selected attribute values. + + The method first considers the most specific combination of attribute values (e.g + "Red leather") and if that is not found, more general (e.g "Red"). If no image group + is found for the attributes, returns null + + The view type parameter is required, otherwise a exception is thrown. + + + **Parameters:** + - viewtype - the view type annotated to image + - attribute - the variation attribute + - value - the the variation attribute value + + **Returns:** + - the first image, or null if not found + + +--- + +### getImage(String, Number) +- getImage(viewtype: [String](TopLevel.String.md), index: [Number](TopLevel.Number.md)): [MediaFile](dw.content.MediaFile.md) + - : The method returns an image appropriate for the current selected variation values + with the specific index. + + If images are defined for this view type and variants, but not for + specified index, the method returns null. + + If no images are defined for all variants and specified view type, the + image at the specified index of the master product images is returned. If + no master product image for specified index is defined, the method + returns null. + + The view type parameter is required, otherwise a exception is thrown. + + + **Parameters:** + - viewtype - the view type annotated to image + - index - the index number of the image within image list + + **Returns:** + - the MediaFile or null + + +--- + +### getImages(String) +- getImages(viewtype: [String](TopLevel.String.md)): [List](dw.util.List.md) + - : The method returns the image appropriate for the currently selected attribute values. + + The method first considers the most specific combination of attribute values (e.g + "Red leather") and if that is not found, more general (e.g "Red"). If no image group + is found for the attributes, returns null + + The view type parameter is required, otherwise a exception is thrown. + + + **Parameters:** + - viewtype - the view type annotated to image + + **Returns:** + - an array of images + + +--- + +### getMaster() +- getMaster(): [Product](dw.catalog.Product.md) + - : Returns the master of the product variation. + + **Returns:** + - the master of the product variation. + + +--- + +### getProductVariationAttribute(String) +- getProductVariationAttribute(id: [String](TopLevel.String.md)): [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md) + - : Returns the product variation attribute for the specific id, + or null if there is no product variation attribute for that id. + + + **Parameters:** + - id - the id of the product variation attribute + + **Returns:** + - the product variation attribute, or null. + + +--- + +### getProductVariationAttributes() +- getProductVariationAttributes(): [Collection](dw.util.Collection.md) + - : Returns a collection of product variation attributes of the variation. + + **Returns:** + - a collection of product variation attributes of the variation. + + +--- + +### getSelectedValue(ProductVariationAttribute) +- getSelectedValue(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md) + - : Returns the selected value for the specified product variation attribute. If no value is + selected, null is returned. + + + **Parameters:** + - attribute - the product variation attribute whose value will be returned. + + **Returns:** + - the selected product variation attribute value for the specified attribute or null. + + +--- + +### getSelectedValue(ObjectAttributeDefinition) +- ~~getSelectedValue(attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md)~~ + - : Returns the selected value for the specified attribute. If no value is + selected, null is returned. + + + **Parameters:** + - attribute - the attribute whose value will be returned. + + **Returns:** + - the selected value for the specified attribute or null. + + **Deprecated:** +:::warning +Use [getSelectedValue(ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#getselectedvalueproductvariationattribute) to + get the selected product variation attribute value for the + specified attribute. + +::: + +--- + +### getSelectedVariant() +- getSelectedVariant(): [Variant](dw.catalog.Variant.md) + - : Returns the variant currently selected for this variation model. + Returns null if no variant is selected. + + + **Returns:** + - selected variant or null. + + +--- + +### getSelectedVariants() +- getSelectedVariants(): [Collection](dw.util.Collection.md) + - : Returns the variants currently selected for this variation model. + Returns an empty collection if no variant is selected. + + + **Returns:** + - selected variants, might be empty if no valid variant was selected by the given attribute values + + +--- + +### getVariants() +- getVariants(): [Collection](dw.util.Collection.md) + - : Returns the collection of product variants of this variation model. + This collection only includes online variants. Offline variants are + filtered out. If all variation products are required, consider using + [Product.getVariants()](dw.catalog.Product.md#getvariants). + + The product variants are returned in no particular order. + + + **Returns:** + - a collection of all the product variants of the variation model. + + +--- + +### getVariants(HashMap) +- getVariants(filter: [HashMap](dw.util.HashMap.md)): [Collection](dw.util.Collection.md) + - : Returns the variants that match the specified filter conditions. The + filter conditions are specified as a hash map of - + . This method does not consider the currently selected + attribute values. + + + **Parameters:** + - filter - the filters to apply when collecting the variants. + + **Returns:** + - the collection of variants that match the specified filter + conditions. + + + +--- + +### getVariationGroups() +- getVariationGroups(): [Collection](dw.util.Collection.md) + - : Returns the collection of variation groups of this variation model. + This collection only includes online variation groups. Offline variation + groups are filtered out. If all variation group products are required, + consider using [Product.getVariationGroups()](dw.catalog.Product.md#getvariationgroups). + + The variation groups are returned in no particular order. + + + **Returns:** + - a collection of all the variation groups of the variation model. + + +--- + +### getVariationValue(Product, ProductVariationAttribute) +- getVariationValue(variantOrVariationGroup: [Product](dw.catalog.Product.md), attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md) + - : Returns the value for the specified variant or variation group product and + variation attribute. The specified product should be a [Variant](dw.catalog.Variant.md) + returned by [getVariants()](dw.catalog.ProductVariationModel.md#getvariants) or a [VariationGroup](dw.catalog.VariationGroup.md) returned by + [getVariationGroups()](dw.catalog.ProductVariationModel.md#getvariationgroups). The variation attribute should be one returned by + [getProductVariationAttributes()](dw.catalog.ProductVariationModel.md#getproductvariationattributes). If an invalid product or attribute is passed, + null is returned. If null is passed for either argument, an exception is thrown. + + + **Parameters:** + - variantOrVariationGroup - the variant or variation group product to retrieve a value for, must not be null. + - attribute - the product variation attribute to get the value for, must not be null. + + **Returns:** + - the attribute value for the specified variant or variation group and attribute, or + null if an invalid variant, variation group or attribute is passed or the variation + group define no value for the variation attribute. + + + +--- + +### hasOrderableVariants(ProductVariationAttribute, ProductVariationAttributeValue) +- hasOrderableVariants(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), value: [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if any variant is available with the specified value of the + specified variation attribute. Available means that the variant is + orderable according to the variant's availability model. This method + takes currently selected attribute values into consideration. The + specific rules are as follows: + + - If no variation value is currently selected, the method returns true if any variant with the specified value is available, else false. + - if one or more variation values are selected, the method returns true if any variant with a combination of the specified value and the selected value is available, else false. + - if all variation values are selected, the method returns true of the variant that is represented by the current selection is available, else false. + + + **Parameters:** + - attribute - The product variation attribute whose values are to be tested for orderable variants. + - value - The specific attribute value to test for orderable variants. + + **Returns:** + - true if any variant is available with the specified value of the + specified variation attribute based on the currently selected + attribute values, false otherwise. + + + +--- + +### isSelectedAttributeValue(ProductVariationAttribute, ProductVariationAttributeValue) +- isSelectedAttributeValue(attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), value: [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if the specified product variation attribute value is the one + currently selected. + + + **Parameters:** + - attribute - the attribute to check. + - value - the value to check for selection. + + **Returns:** + - true if the specified variation attribute value is currently + selected, false otherwise. + + + +--- + +### isSelectedAttributeValue(ObjectAttributeDefinition, ObjectAttributeValueDefinition) +- ~~isSelectedAttributeValue(attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md), value: [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Identifies if the specified variation value is the one currently + selected. + + + **Parameters:** + - attribute - the attribute to check. + - value - the value to check for selection. + + **Returns:** + - true if the specified variation value is currently selected, + false otherwise. + + + **Deprecated:** +:::warning +Use + [isSelectedAttributeValue(ProductVariationAttribute, ProductVariationAttributeValue)](dw.catalog.ProductVariationModel.md#isselectedattributevalueproductvariationattribute-productvariationattributevalue) + to identify if the specified product variation attribute + value is the one currently selected. + +::: + +--- + +### setSelectedAttributeValue(String, String) +- setSelectedAttributeValue(variationAttributeID: [String](TopLevel.String.md), variationAttributeValueID: [String](TopLevel.String.md)): void + - : Applies a selected attribute value to this model instance. + Usually this method is used to set the model state corresponding to the variation attribute values + specified by a URL. The URLs can be obtained by using one of the models URL methods, like + [urlSelectVariationValue(String, ProductVariationAttribute, ProductVariationAttributeValue)](dw.catalog.ProductVariationModel.md#urlselectvariationvaluestring-productvariationattribute-productvariationattributevalue) and + [urlUnselectVariationValue(String, ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#urlunselectvariationvaluestring-productvariationattribute). + + Anyway, there are some limitations to keep in mind when selecting variation attribute values. + A Variation Model created for a Variation Group or Variant Product is bound to an initial state. + Example: + + - A Variation Model created for Variation Group A can't be switched to Variation Group B. + - A Variation Model created for Variant A can't be switched to Variant B. + - The state of a Variation Model for a Variation Group that defines color = red can't be changed to color = black. + - The state of a Variation Model for a Variant that defines color = red / size = L can't be changed to color = black / size = S. However, the state of a Variation Model created for a Variation Group that defines color = red can be changed to a more specific state by adding another selected value, e.g. size = L. + + The state of a Variation Model created for a Variation Master can be changed in any possible way + because the initial state involves all variation values and Variants. + + + **Parameters:** + - variationAttributeID - the ID of an product variation attribute, must not be `null`, otherwise a exception is thrown + - variationAttributeValueID - the ID of the product variation attribute value to apply, this value must not be part of the initial model state (e.g. the variant or group that the model has been created for), otherwise a exception is thrown + + +--- + +### url(String, Object...) +- url(action: [String](TopLevel.String.md), varAttrAndValues: [Object...](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Constructs a URL to select a set of variation attribute values. The + optional `varAttrAndValues` argument can be empty, or can + contain one or more variation attribute / value pairs. This variable list + should be even in length, with attributes and values alternating. + Attributes can be specified as instances of ProductVariationAttribute, or + String variation attribute ID. (Note: ObjectAttributeDefinition IDs are + not supported.) Values can be specified as instances of + ProductVariationAttributeValue or String or Integer depending on the data + type of the variation attribute. If a parameter type is invalid, or does + not reference a valid ProductVariationAttribute or + ProductVariationAttributeValue, then the parameter pair is not included + in the generated URL. The returned URL will contain variation attributes + and values already selected in the product variation model, as well as + attributes and values specified as method parameters. + + + Sample usage: + + + + ``` + master.variationModel.url("Product-Show", "color", "red", "size", "XL"); + + master.variationModel.url("Product-Show", colorVarAttr, colorValue, sizeVarAttr, sizeValue); + + // --> on/demandware.store/Sites-SiteGenesis-Site/default/Product-Show?pid=master_id&dwvar_color=red&dwvar_size=XL + ``` + + + **Parameters:** + - action - The pipeline action. + - varAttrAndValues - Variable length list of attributes and corresponding values to select. + + **Returns:** + - The constructed URL. + + +--- + +### urlSelectVariationValue(String, ProductVariationAttribute, ProductVariationAttributeValue) +- urlSelectVariationValue(action: [String](TopLevel.String.md), attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md), value: [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md)): [String](TopLevel.String.md) + - : Generates a URL for selecting a value for a given variation attribute. + This URL is intended to be used on dynamic product detail pages. When a + customer selects which value he wants for one of the variation + attributes, the product detail page can issue a request to the passed URL + which in turn can invoke the + `UpdateProductVariationSelections` pipelet. That pipelet reads + the querystring parameters and returns an updated variation model with + the desired attribute value selected. + + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. "Product-Show". + - attribute - the product variation attribute to select a value for. + - value - the product variation attribute value to select. + + **Returns:** + - the generated URL, an absolute URL which uses the protocol of the + current request. + + + +--- + +### urlSelectVariationValue(String, ObjectAttributeDefinition, ObjectAttributeValueDefinition) +- ~~urlSelectVariationValue(action: [String](TopLevel.String.md), attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md), value: [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md)): [String](TopLevel.String.md)~~ + - : Constructs an URL to select the specified value of the specified + variation attribute. + + + The generated URL will be an absolute URL which uses the protocol of the + current request. + + + **Parameters:** + - action - the pipeline action, e.g. "Product-Show". + - attribute - the attribute to select a value for. + - value - the attribute definition value portion of the variation. + + **Returns:** + - the generated URL, an absolute URL which uses the protocol of the + current request. + + + **Deprecated:** +:::warning +Use + [urlSelectVariationValue(String, ProductVariationAttribute, ProductVariationAttributeValue)](dw.catalog.ProductVariationModel.md#urlselectvariationvaluestring-productvariationattribute-productvariationattributevalue) + to construct an URL to select the specified product variation + attribute value of the specified product variation attribute. + +::: + +--- + +### urlUnselectVariationValue(String, ProductVariationAttribute) +- urlUnselectVariationValue(action: [String](TopLevel.String.md), attribute: [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md)): [String](TopLevel.String.md) + - : Generates a URL for unselecting a value for a given variation attribute. + This URL is intended to be used on dynamic product detail pages. When a + customer deselects a value for one of the variation attributes, the + product detail page can issue a request to the passed URL which in turn + can invoke the `UpdateProductVariationSelections` pipelet. + That pipelet reads the querystring parameters and returns an updated + variation model with the desired attribute value unselected. + + + The generated URL will be an absolute URL which uses the protocol of + the current request. + + + **Parameters:** + - action - the pipeline action, e.g. "Product-Show". + - attribute - the product variation attribute to unselect. + + **Returns:** + - the generated URL, an absolute URL which uses the protocol of the + current request. + + + +--- + +### urlUnselectVariationValue(String, ObjectAttributeDefinition) +- ~~urlUnselectVariationValue(action: [String](TopLevel.String.md), attribute: [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md)): [String](TopLevel.String.md)~~ + - : Constructs an URL to unselect the value of the specified variation + attribute. + + + The generated URL will be an absolute URL which uses the protocol of the + current request. + + + **Parameters:** + - action - the pipeline action, e.g. "Product-Show". + - attribute - the attribute to unselect. + + **Returns:** + - the generated URL, an absolute URL which uses the protocol of the + current request. + + + **Deprecated:** +:::warning +Use + [urlUnselectVariationValue(String, ProductVariationAttribute)](dw.catalog.ProductVariationModel.md#urlunselectvariationvaluestring-productvariationattribute) + to unselect the product variation attribute value of the + specified product variation attribute. + +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Recommendation.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Recommendation.md new file mode 100644 index 00000000..c31d7c75 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Recommendation.md @@ -0,0 +1,327 @@ + +# Class Recommendation + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Recommendation](dw.catalog.Recommendation.md) + +Represents a recommendation in Commerce Cloud Digital. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[RECOMMENDATION_TYPE_CROSS_SELL](#recommendation_type_cross_sell): [Number](TopLevel.Number.md) = 1~~ | Represents a cross-sell recommendation. | +| ~~[RECOMMENDATION_TYPE_OTHER](#recommendation_type_other): [Number](TopLevel.Number.md) = 3~~ | Represents a recommendation that is neither a cross-sell or an up-sell. | +| ~~[RECOMMENDATION_TYPE_UP_SELL](#recommendation_type_up_sell): [Number](TopLevel.Number.md) = 2~~ | Represents an up-sell recommendation. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [calloutMsg](#calloutmsg): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the recommendation's callout message in the current locale. | +| [catalog](#catalog): [Catalog](dw.catalog.Catalog.md) `(read-only)` | Return the catalog containing the recommendation. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the recommendation's image. | +| [longDescription](#longdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the recommendation's long description in the current locale. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the recommended item in the current locale. | +| [recommendationType](#recommendationtype): [Number](TopLevel.Number.md) `(read-only)` | Returns the type of the recommendation. | +| [recommendedItem](#recommendeditem): [Object](TopLevel.Object.md) `(read-only)` | Return a reference to the recommended item. | +| [recommendedItemID](#recommendeditemid): [String](TopLevel.String.md) `(read-only)` | Return the ID of the recommended item. | +| [shortDescription](#shortdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the recommendation's short description in the current locale. | +| [sourceItem](#sourceitem): [Object](TopLevel.Object.md) `(read-only)` | Return a reference to the source item. | +| [sourceItemID](#sourceitemid): [String](TopLevel.String.md) `(read-only)` | Return the ID of the recommendation source item. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCalloutMsg](dw.catalog.Recommendation.md#getcalloutmsg)() | Returns the recommendation's callout message in the current locale. | +| [getCatalog](dw.catalog.Recommendation.md#getcatalog)() | Return the catalog containing the recommendation. | +| [getImage](dw.catalog.Recommendation.md#getimage)() | Returns the recommendation's image. | +| [getLongDescription](dw.catalog.Recommendation.md#getlongdescription)() | Returns the recommendation's long description in the current locale. | +| [getName](dw.catalog.Recommendation.md#getname)() | Returns the name of the recommended item in the current locale. | +| [getRecommendationType](dw.catalog.Recommendation.md#getrecommendationtype)() | Returns the type of the recommendation. | +| [getRecommendedItem](dw.catalog.Recommendation.md#getrecommendeditem)() | Return a reference to the recommended item. | +| [getRecommendedItemID](dw.catalog.Recommendation.md#getrecommendeditemid)() | Return the ID of the recommended item. | +| [getShortDescription](dw.catalog.Recommendation.md#getshortdescription)() | Returns the recommendation's short description in the current locale. | +| [getSourceItem](dw.catalog.Recommendation.md#getsourceitem)() | Return a reference to the source item. | +| [getSourceItemID](dw.catalog.Recommendation.md#getsourceitemid)() | Return the ID of the recommendation source item. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### RECOMMENDATION_TYPE_CROSS_SELL + +- ~~RECOMMENDATION_TYPE_CROSS_SELL: [Number](TopLevel.Number.md) = 1~~ + - : Represents a cross-sell recommendation. + + **Deprecated:** +:::warning +Use the integer value instead. The recommendation types +and their meanings are now configurable in the Business Manager. + +::: + +--- + +### RECOMMENDATION_TYPE_OTHER + +- ~~RECOMMENDATION_TYPE_OTHER: [Number](TopLevel.Number.md) = 3~~ + - : Represents a recommendation that is neither a cross-sell or an up-sell. + + **Deprecated:** +:::warning +Use the integer value instead. The recommendation types +and their meanings are now configurable in the Business Manager. + +::: + +--- + +### RECOMMENDATION_TYPE_UP_SELL + +- ~~RECOMMENDATION_TYPE_UP_SELL: [Number](TopLevel.Number.md) = 2~~ + - : Represents an up-sell recommendation. + + **Deprecated:** +:::warning +Use the integer value instead. The recommendation types +and their meanings are now configurable in the Business Manager. + +::: + +--- + +## Property Details + +### calloutMsg +- calloutMsg: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the recommendation's callout message in the current locale. + + +--- + +### catalog +- catalog: [Catalog](dw.catalog.Catalog.md) `(read-only)` + - : Return the catalog containing the recommendation. + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the recommendation's image. + + +--- + +### longDescription +- longDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the recommendation's long description in the current locale. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the recommended item in the current locale. + + +--- + +### recommendationType +- recommendationType: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the type of the recommendation. + + +--- + +### recommendedItem +- recommendedItem: [Object](TopLevel.Object.md) `(read-only)` + - : Return a reference to the recommended item. This will always be an + object of type `dw.catalog.Product` since this is the only + currently supported recommendation target type. + + + +--- + +### recommendedItemID +- recommendedItemID: [String](TopLevel.String.md) `(read-only)` + - : Return the ID of the recommended item. This will always be a product + ID since this is the only currently supported recommendation target + type. + + + +--- + +### shortDescription +- shortDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the recommendation's short description in the current locale. + + +--- + +### sourceItem +- sourceItem: [Object](TopLevel.Object.md) `(read-only)` + - : Return a reference to the source item. This will be an object of type + `dw.catalog.Product` or `dw.catalog.Category.` + + + +--- + +### sourceItemID +- sourceItemID: [String](TopLevel.String.md) `(read-only)` + - : Return the ID of the recommendation source item. This will either be a + product ID or category name. + + + +--- + +## Method Details + +### getCalloutMsg() +- getCalloutMsg(): [MarkupText](dw.content.MarkupText.md) + - : Returns the recommendation's callout message in the current locale. + + **Returns:** + - the recommendation's callout message in the current locale, or + null if it wasn't found. + + + +--- + +### getCatalog() +- getCatalog(): [Catalog](dw.catalog.Catalog.md) + - : Return the catalog containing the recommendation. + + **Returns:** + - the catalog containing the recommendation. + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the recommendation's image. + + **Returns:** + - the recommendation's image. + + +--- + +### getLongDescription() +- getLongDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the recommendation's long description in the current locale. + + **Returns:** + - The recommendation's long description in the current locale, or + null if it wasn't found. + + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the recommended item in the current locale. + + **Returns:** + - The name of the recommended item for the current locale, or null + if it wasn't found. + + + +--- + +### getRecommendationType() +- getRecommendationType(): [Number](TopLevel.Number.md) + - : Returns the type of the recommendation. + + **Returns:** + - the type of the recommendation expressed as an integer. + + +--- + +### getRecommendedItem() +- getRecommendedItem(): [Object](TopLevel.Object.md) + - : Return a reference to the recommended item. This will always be an + object of type `dw.catalog.Product` since this is the only + currently supported recommendation target type. + + + **Returns:** + - the recommended item, possibly null if the item does not exist. + + +--- + +### getRecommendedItemID() +- getRecommendedItemID(): [String](TopLevel.String.md) + - : Return the ID of the recommended item. This will always be a product + ID since this is the only currently supported recommendation target + type. + + + **Returns:** + - the recommended item ID. + + +--- + +### getShortDescription() +- getShortDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the recommendation's short description in the current locale. + + **Returns:** + - the recommendations's short description in the current locale, or + null if it wasn't found. + + + +--- + +### getSourceItem() +- getSourceItem(): [Object](TopLevel.Object.md) + - : Return a reference to the source item. This will be an object of type + `dw.catalog.Product` or `dw.catalog.Category.` + + + **Returns:** + - the source item. + + +--- + +### getSourceItemID() +- getSourceItemID(): [String](TopLevel.String.md) + - : Return the ID of the recommendation source item. This will either be a + product ID or category name. + + + **Returns:** + - the source item ID. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchModel.md new file mode 100644 index 00000000..0eb46b81 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchModel.md @@ -0,0 +1,769 @@ + +# Class SearchModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchModel](dw.catalog.SearchModel.md) + +Common search model base class. + + +## All Known Subclasses +[ContentSearchModel](dw.content.ContentSearchModel.md), [ProductSearchModel](dw.catalog.ProductSearchModel.md) +## Constant Summary + +| Constant | Description | +| --- | --- | +| [SEARCH_PHRASE_PARAMETER](#search_phrase_parameter): [String](TopLevel.String.md) = "q" | URL Parameter for the Search Phrase | +| [SORT_DIRECTION_ASCENDING](#sort_direction_ascending): [Number](TopLevel.Number.md) = 1 | Sorting parameter ASCENDING | +| [SORT_DIRECTION_DESCENDING](#sort_direction_descending): [Number](TopLevel.Number.md) = 2 | Sorting parameter DESCENDING | +| [SORT_DIRECTION_NONE](#sort_direction_none): [Number](TopLevel.Number.md) = 0 | Sorting parameter NO\_SORT - will remove a sorting condition | + +## Property Summary + +| Property | Description | +| --- | --- | +| [count](#count): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of search results found by this search. | +| [emptyQuery](#emptyquery): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the query is emtpy when no search term, search parameter or refinement was specified for the search. | +| [refinedByAttribute](#refinedbyattribute): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if this search is refined by at least one attribute. | +| [refinedSearch](#refinedsearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this was a refined search. | +| [searchPhrase](#searchphrase): [String](TopLevel.String.md) | Returns the search phrase used in this search. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [addRefinementValues](dw.catalog.SearchModel.md#addrefinementvaluesstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Adds a refinement. | +| [canRelax](dw.catalog.SearchModel.md#canrelax)() | Identifies if the search can be relaxed without creating a search for all searchable items. | +| [getCount](dw.catalog.SearchModel.md#getcount)() | Returns the number of search results found by this search. | +| [getRefinementMaxValue](dw.catalog.SearchModel.md#getrefinementmaxvaluestring)([String](TopLevel.String.md)) | Returns the maximum refinement value selected in the query for the specific attribute, or null if there is no maximum refinement value or no refinement for that attribute. | +| [getRefinementMinValue](dw.catalog.SearchModel.md#getrefinementminvaluestring)([String](TopLevel.String.md)) | Returns the minimum refinement value selected in the query for the specific attribute, or null if there is no minimum refinement value or no refinement for that attribute. | +| ~~[getRefinementValue](dw.catalog.SearchModel.md#getrefinementvaluestring)([String](TopLevel.String.md))~~ | Returns the refinement value selected in the query for the specific attribute, or null if there is no refinement for that attribute. | +| [getRefinementValues](dw.catalog.SearchModel.md#getrefinementvaluesstring)([String](TopLevel.String.md)) | Returns the list of selected refinement values for the given attribute as used in the search. | +| [getSearchPhrase](dw.catalog.SearchModel.md#getsearchphrase)() | Returns the search phrase used in this search. | +| static [getSearchRedirect](dw.catalog.SearchModel.md#getsearchredirectstring)([String](TopLevel.String.md)) | Returns an URLRedirect object for a search phrase. | +| [getSortingCondition](dw.catalog.SearchModel.md#getsortingconditionstring)([String](TopLevel.String.md)) | Returns the sorting condition for a given attribute name. | +| [isEmptyQuery](dw.catalog.SearchModel.md#isemptyquery)() | Identifies if the query is emtpy when no search term, search parameter or refinement was specified for the search. | +| [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattribute)() | The method returns true, if this search is refined by at least one attribute. | +| [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattributestring)([String](TopLevel.String.md)) | Identifies if this search has been refined on the given attribute. | +| [isRefinedByAttributeValue](dw.catalog.SearchModel.md#isrefinedbyattributevaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Identifies if this search has been refined on the given attribute and value. | +| [isRefinedSearch](dw.catalog.SearchModel.md#isrefinedsearch)() | Identifies if this was a refined search. | +| [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring)([String](TopLevel.String.md)) | Identifies if this search has been refined on the given attribute. | +| [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Identifies if this search has been refined on the given attribute and range values. | +| [removeRefinementValues](dw.catalog.SearchModel.md#removerefinementvaluesstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Removes a refinement. | +| [search](dw.catalog.SearchModel.md#search)() | Execute the search. | +| [setRefinementValueRange](dw.catalog.SearchModel.md#setrefinementvaluerangestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Sets a refinement value range for an attribute. | +| [setRefinementValues](dw.catalog.SearchModel.md#setrefinementvaluesstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Sets refinement values for an attribute. | +| [setSearchPhrase](dw.catalog.SearchModel.md#setsearchphrasestring)([String](TopLevel.String.md)) | Sets the search phrase used in this search. | +| [setSortingCondition](dw.catalog.SearchModel.md#setsortingconditionstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Sets or removes a sorting condition for the specified attribute. | +| [url](dw.catalog.SearchModel.md#urlurl)([URL](dw.web.URL.md)) | Constructs an URL that you can use to re-execute the exact same query. | +| [url](dw.catalog.SearchModel.md#urlstring)([String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the exact same query. | +| [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsorturl)([URL](dw.web.URL.md)) | Constructs an URL that you can use to re-execute the query with a default sorting. | +| [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsortstring)([String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with a default sorting. | +| [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributeurl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with an additional refinement. | +| [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with an additional refinement. | +| [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevalueurl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with an additional refinement value for a given refinement attribute. | +| [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevaluestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with an additional refinement value for a given refinement attribute. | +| [urlRefineAttributeValueRange](dw.catalog.SearchModel.md#urlrefineattributevaluerangestring-string-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query with an additional refinement value range for a given refinement attribute. | +| [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributeurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query without the specified refinement. | +| [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query without the specified refinement. | +| [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevalueurl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query without the specified refinement value. | +| [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevaluestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs an URL that you can use to re-execute the query without the specified refinement. | +| [urlSort](dw.catalog.SearchModel.md#urlsorturl-string-number)([URL](dw.web.URL.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Constructs an URL that you can use to re-execute the query with a specific sorting criteria. | +| [urlSort](dw.catalog.SearchModel.md#urlsortstring-string-number)([String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Constructs an URL that you can use to re-execute the query with a specific sorting criteria. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### SEARCH_PHRASE_PARAMETER + +- SEARCH_PHRASE_PARAMETER: [String](TopLevel.String.md) = "q" + - : URL Parameter for the Search Phrase + + +--- + +### SORT_DIRECTION_ASCENDING + +- SORT_DIRECTION_ASCENDING: [Number](TopLevel.Number.md) = 1 + - : Sorting parameter ASCENDING + + +--- + +### SORT_DIRECTION_DESCENDING + +- SORT_DIRECTION_DESCENDING: [Number](TopLevel.Number.md) = 2 + - : Sorting parameter DESCENDING + + +--- + +### SORT_DIRECTION_NONE + +- SORT_DIRECTION_NONE: [Number](TopLevel.Number.md) = 0 + - : Sorting parameter NO\_SORT - will remove a sorting condition + + +--- + +## Property Details + +### count +- count: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of search results found by this search. + + +--- + +### emptyQuery +- emptyQuery: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the query is emtpy when no search term, search parameter or + refinement was specified for the search. In case also no result is + returned. This "empty" is different to a query with a specified query and + with an empty result. + + + +--- + +### refinedByAttribute +- refinedByAttribute: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if this search is refined by at least one + attribute. + + + +--- + +### refinedSearch +- refinedSearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this was a refined search. A search is a refined search if + at least one refinement is part of the query. + + + +--- + +### searchPhrase +- searchPhrase: [String](TopLevel.String.md) + - : Returns the search phrase used in this search. + + +--- + +## Method Details + +### addRefinementValues(String, String) +- addRefinementValues(attributeID: [String](TopLevel.String.md), values: [String](TopLevel.String.md)): void + - : Adds a refinement. The method can be called to add an additional query + parameter specified as name-value pair. The values string may encode + multiple values delimited by the pipe symbol ('|'). + + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - values - the refinement value to set + + +--- + +### canRelax() +- canRelax(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the search can be relaxed without creating a search for all + searchable items. + + + **Returns:** + - true if the search can be relaxed without creating a search for + all searchable items, false otherwise. + + + +--- + +### getCount() +- getCount(): [Number](TopLevel.Number.md) + - : Returns the number of search results found by this search. + + **Returns:** + - the number of search results found by this search. + + +--- + +### getRefinementMaxValue(String) +- getRefinementMaxValue(attributeID: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the maximum refinement value selected in the query for the specific + attribute, or null if there is no maximum refinement value or no refinement for that attribute. + + + **Parameters:** + - attributeID - the attribute whose refinement value is returned. + + **Returns:** + - the maximum refinement value selected in the query for the specific + attribute. + + + +--- + +### getRefinementMinValue(String) +- getRefinementMinValue(attributeID: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the minimum refinement value selected in the query for the specific + attribute, or null if there is no minimum refinement value or no refinement for that attribute. + + + **Parameters:** + - attributeID - the attribute whose refinement value is returned. + + **Returns:** + - the minimum refinement value selected in the query for the specific + attribute. + + + +--- + +### getRefinementValue(String) +- ~~getRefinementValue(attributeID: [String](TopLevel.String.md)): [String](TopLevel.String.md)~~ + - : Returns the refinement value selected in the query for the specific + attribute, or null if there is no refinement for that attribute. + + + **Parameters:** + - attributeID - the attribute whose refinement value is returned. + + **Returns:** + - the refinement value selected in the query for the specific + attribute. + + + **Deprecated:** +:::warning +Use [getRefinementValues(String)](dw.catalog.SearchModel.md#getrefinementvaluesstring) to get the + collection of refinement values. + +::: + +--- + +### getRefinementValues(String) +- getRefinementValues(attributeID: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns the list of selected refinement values for the given attribute as + used in the search. + + + **Parameters:** + - attributeID - The name of the refinement attribute. + + **Returns:** + - A list of values currently selected for the refinement attribute. + + +--- + +### getSearchPhrase() +- getSearchPhrase(): [String](TopLevel.String.md) + - : Returns the search phrase used in this search. + + **Returns:** + - the search phrase used in this search. + + +--- + +### getSearchRedirect(String) +- static getSearchRedirect(searchPhrase: [String](TopLevel.String.md)): [URLRedirect](dw.web.URLRedirect.md) + - : Returns an URLRedirect object for a search phrase. + + **Parameters:** + - searchPhrase - a search phrase to lookup a URLRedirect for + + **Returns:** + - URLRedirect containing the location and status code, + null in case no redirect was found for the search phrase. + + + +--- + +### getSortingCondition(String) +- getSortingCondition(attributeID: [String](TopLevel.String.md)): [Number](TopLevel.Number.md) + - : Returns the sorting condition for a given attribute name. A value of 0 + indicates that no sorting condition is set. + + + **Parameters:** + - attributeID - the attribute name + + **Returns:** + - zero if no sorting order set, or the sorting order + + +--- + +### isEmptyQuery() +- isEmptyQuery(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the query is emtpy when no search term, search parameter or + refinement was specified for the search. In case also no result is + returned. This "empty" is different to a query with a specified query and + with an empty result. + + + **Returns:** + - true if the query is emtpy when no search term, search parameter + or refinement was specified for the search. + + + +--- + +### isRefinedByAttribute() +- isRefinedByAttribute(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if this search is refined by at least one + attribute. + + + **Returns:** + - true, if the search is refined by at least one attribute, false + otherwise. + + + +--- + +### isRefinedByAttribute(String) +- isRefinedByAttribute(attributeID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined on the given attribute. + + **Parameters:** + - attributeID - The ID of the refinement attribute. + + **Returns:** + - True if the search is refined on the attribute, false otherwise. + + +--- + +### isRefinedByAttributeValue(String, String) +- isRefinedByAttributeValue(attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined on the given attribute and + value. + + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - value - The value to be checked for inclusion in the refinement. + + **Returns:** + - True if the search is refined on the attribute and value, false + otherwise. + + + +--- + +### isRefinedSearch() +- isRefinedSearch(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this was a refined search. A search is a refined search if + at least one refinement is part of the query. + + + **Returns:** + - true if this is a refined search, false otherwise. + + +--- + +### isRefinementByValueRange(String) +- isRefinementByValueRange(attributeID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined on the given attribute. + + **Parameters:** + - attributeID - The ID of the refinement attribute. + + **Returns:** + - True if the search is refined on the attribute, false otherwise. + + +--- + +### isRefinementByValueRange(String, String, String) +- isRefinementByValueRange(attributeID: [String](TopLevel.String.md), minValue: [String](TopLevel.String.md), maxValue: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this search has been refined on the given attribute and range values. + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - minValue - The minimum value to be checked for inclusion in the refinement. + - maxValue - The maximum value to be checked for inclusion in the refinement. + + **Returns:** + - True if the search is refined on the attribute and range values, false otherwise. + + +--- + +### removeRefinementValues(String, String) +- removeRefinementValues(attributeID: [String](TopLevel.String.md), values: [String](TopLevel.String.md)): void + - : Removes a refinement. The method can be called to remove previously added + refinement values. The values string may encode multiple values delimited + by the pipe symbol ('|'). + + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - values - the refinement value to remove or null to remove all values + + +--- + +### search() +- search(): [SearchStatus](dw.system.SearchStatus.md) + - : Execute the search. + + **Returns:** + - the searchStatus object with search status code and description of search result. + + +--- + +### setRefinementValueRange(String, String, String) +- setRefinementValueRange(attributeID: [String](TopLevel.String.md), minValue: [String](TopLevel.String.md), maxValue: [String](TopLevel.String.md)): void + - : Sets a refinement value range for an attribute. The method can be called to set + an additional range query parameter specified as name-range-value pair. The values + string can contain only a range boundary. + Existing refinement values for the attribute will be removed. + + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - minValue - the minimum refinement boundary value to set or null to remove the minimum boundary + - maxValue - the maximum refinement boundary value to set or null to remove the maximum boundary + + +--- + +### setRefinementValues(String, String) +- setRefinementValues(attributeID: [String](TopLevel.String.md), values: [String](TopLevel.String.md)): void + - : Sets refinement values for an attribute. The method can be called to set + an additional query parameter specified as name-value pair. The value + string may encode multiple values delimited by the pipe symbol ('|'). + Existing refinement values for the attribute will be removed. + + + **Parameters:** + - attributeID - The ID of the refinement attribute. + - values - the refinement values to set (delimited by '|') or null to remove all values + + +--- + +### setSearchPhrase(String) +- setSearchPhrase(phrase: [String](TopLevel.String.md)): void + - : Sets the search phrase used in this search. The search query parser uses + the following operators: + + + - PHRASE operator (""), e.g. "cream cheese", "John Lennon" + - NOT operator (-), e.g. -cargo (will not return results containing "cargo") + - WILDCARD operator (\*), e.g. sho\* (will return results containing "shoulder", "shoes" and "shoot") + + + **Parameters:** + - phrase - the search phrase used in this search. + + +--- + +### setSortingCondition(String, Number) +- setSortingCondition(attributeID: [String](TopLevel.String.md), direction: [Number](TopLevel.Number.md)): void + - : Sets or removes a sorting condition for the specified attribute. Specify + either SORT\_DIRECTION\_ASCENDING or SORT\_DIRECTION\_DESCENDING to set a + sorting condition. Specify SORT\_DIRECTION\_NONE to remove a sorting + condition from the attribute. + + + **Parameters:** + - attributeID - the attribute ID + - direction - SORT\_DIRECTION\_ASCENDING, SORT\_DIRECTION\_DESCENDING or SORT\_DIRECTION\_NONE + + +--- + +### url(URL) +- url(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the exact same query. + The search specific parameter are appended to the provided URL. The URL + is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - the url to use. + + **Returns:** + - a new url URL that can be used to re-execute the exact same + query. + + + +--- + +### url(String) +- url(action: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the exact same query. + The provided parameter must be an action, e.g. 'Search-Show'. + + + **Parameters:** + - action - the pipeline action. + + **Returns:** + - an URL that can be used to re-execute the exact same query. + + +--- + +### urlDefaultSort(URL) +- urlDefaultSort(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with a default + sorting. The search specific parameters are appended to the provided URL. + The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - url or pipeline name + + **Returns:** + - the new URL. + + +--- + +### urlDefaultSort(String) +- urlDefaultSort(url: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with a default + sorting. The provided parameter must be an action, e.g. 'Search-Show'. + + + **Parameters:** + - url - url or pipeline name + + **Returns:** + - the new URL. + + +--- + +### urlRefineAttribute(URL, String, String) +- urlRefineAttribute(url: [URL](dw.web.URL.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with an + additional refinement. The search specific parameters are appended to the + provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - url + - attributeID - the ID of the refinement attribute + - value - value for the refinement attribute + + **Returns:** + - the new URL. + + +--- + +### urlRefineAttribute(String, String, String) +- urlRefineAttribute(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with an + additional refinement. + + + **Parameters:** + - action - the pipeline action. + - attributeID - the ID of the refinement attribute. + - value - the value for the refinement attribute. + + **Returns:** + - the new URL. + + +--- + +### urlRefineAttributeValue(URL, String, String) +- urlRefineAttributeValue(url: [URL](dw.web.URL.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with an + additional refinement value for a given refinement attribute. The + provided value will be added to the set of allowed values for the + refinement attribute. This basically broadens the search result. + + The search specific parameters are appended to the provided URL. The URL + is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - url + - attributeID - ID of the refinement attribute + - value - the additional value for the refinement attribute + + **Returns:** + - the new URL. + + +--- + +### urlRefineAttributeValue(String, String, String) +- urlRefineAttributeValue(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with an + additional refinement value for a given refinement attribute. The + provided value will be added to the set of allowed values for the + refinement attribute. This basically broadens the search result. + + + **Parameters:** + - action - the pipeline action. + - attributeID - the ID of the refinement attribute. + - value - the additional value for the refinement attribute. + + **Returns:** + - the new URL. + + +--- + +### urlRefineAttributeValueRange(String, String, String, String) +- urlRefineAttributeValueRange(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md), minValue: [String](TopLevel.String.md), maxValue: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with an additional refinement value range for a given refinement attribute. The + provided value range will be replace to the existing value range for the refinement attribute. + + The search specific parameters are appended to the provided URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - action - the pipeline action. + - attributeID - ID of the refinement attribute + - minValue - the min value for the refinement attribute + - maxValue - the max value for the refinement attribute + + **Returns:** + - the new URL. + + +--- + +### urlRelaxAttribute(URL, String) +- urlRelaxAttribute(url: [URL](dw.web.URL.md), attributeID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query without the + specified refinement. The search specific parameters are appended to the + provided URL. The URL is typically generated with one of the URLUtils + methods. + + + **Parameters:** + - url - the url to use. + - attributeID - the ID of the refinement attribute to be removed. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxAttribute(String, String) +- urlRelaxAttribute(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query without the + specified refinement. The value for the action parameter must be a + pipeline action, e.g. 'Search-Show'. + + + **Parameters:** + - action - the pipeline action. + - attributeID - ID of the refinement attribute to be removed + + **Returns:** + - the new URL. + + +--- + +### urlRelaxAttributeValue(URL, String, String) +- urlRelaxAttributeValue(url: [URL](dw.web.URL.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query without the + specified refinement value. The search specific parameters are appended + to the provided URL. The URL is typically generated with one of the + URLUtils methods. + + + **Parameters:** + - url - the url to use. + - attributeID - the ID of the refinement attribute to relax the value for. + - value - the value that should be removed from the list of refinement values. + + **Returns:** + - the new URL. + + +--- + +### urlRelaxAttributeValue(String, String, String) +- urlRelaxAttributeValue(action: [String](TopLevel.String.md), attributeID: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query without the + specified refinement. The value for the action parameter must be a + pipeline action, e.g. 'Search-Show'. + + + **Parameters:** + - action - the pipeline action. + - attributeID - ID of the refinement attribute to be removed + - value - the value that should be removed from the list of refinement values. + + **Returns:** + - the new URL. + + +--- + +### urlSort(URL, String, Number) +- urlSort(url: [URL](dw.web.URL.md), sortBy: [String](TopLevel.String.md), sortDir: [Number](TopLevel.Number.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with a + specific sorting criteria. This criteria will overwrite all previous sort + critiria. The search specific parameters are appended to the provided + URL. The URL is typically generated with one of the URLUtils methods. + + + **Parameters:** + - url - URL + - sortBy - ID of the sort attribute + - sortDir - Sort direction. 1 - ASCENDING (default), 2 - DESCENDING + + **Returns:** + - The new URL. + + +--- + +### urlSort(String, String, Number) +- urlSort(action: [String](TopLevel.String.md), sortBy: [String](TopLevel.String.md), sortDir: [Number](TopLevel.Number.md)): [URL](dw.web.URL.md) + - : Constructs an URL that you can use to re-execute the query with a + specific sorting criteria. This criteria will overwrite all previous sort + critiria. The provided parameter must be an action, e.g. 'Search-Show'. + + + **Parameters:** + - action - Pipeline action + - sortBy - ID of the sort attribute + - sortDir - Sort direction. 1 - ASCENDING (default), 2 - DESCENDING + + **Returns:** + - The new URL. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementDefinition.md new file mode 100644 index 00000000..bfa42dc3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementDefinition.md @@ -0,0 +1,145 @@ + +# Class SearchRefinementDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md) + +Common search refinement definition base class. + + +## All Known Subclasses +[ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md), [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [attributeID](#attributeid): [String](TopLevel.String.md) `(read-only)` | Returns the attribute ID. | +| [attributeRefinement](#attributerefinement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is an attribute refinement. | +| [cutoffThreshold](#cutoffthreshold): [Number](TopLevel.Number.md) `(read-only)` | Returns the cut-off threshold. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name. | +| [valueTypeCode](#valuetypecode): [Number](TopLevel.Number.md) `(read-only)` | Returns a code for the data type used for this search refinement definition. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeID](dw.catalog.SearchRefinementDefinition.md#getattributeid)() | Returns the attribute ID. | +| [getCutoffThreshold](dw.catalog.SearchRefinementDefinition.md#getcutoffthreshold)() | Returns the cut-off threshold. | +| [getDisplayName](dw.catalog.SearchRefinementDefinition.md#getdisplayname)() | Returns the display name. | +| [getValueTypeCode](dw.catalog.SearchRefinementDefinition.md#getvaluetypecode)() | Returns a code for the data type used for this search refinement definition. | +| [isAttributeRefinement](dw.catalog.SearchRefinementDefinition.md#isattributerefinement)() | Identifies if this is an attribute refinement. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### attributeID +- attributeID: [String](TopLevel.String.md) `(read-only)` + - : Returns the attribute ID. If the refinement definition is not an + attribute refinement, the method returns an empty string. + + + +--- + +### attributeRefinement +- attributeRefinement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is an attribute refinement. + + +--- + +### cutoffThreshold +- cutoffThreshold: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the cut-off threshold. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name. + + +--- + +### valueTypeCode +- valueTypeCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns a code for the data type used for this search refinement definition. See constants + defined in ObjectAttributeDefinition. + + + +--- + +## Method Details + +### getAttributeID() +- getAttributeID(): [String](TopLevel.String.md) + - : Returns the attribute ID. If the refinement definition is not an + attribute refinement, the method returns an empty string. + + + **Returns:** + - the attribute ID. + + +--- + +### getCutoffThreshold() +- getCutoffThreshold(): [Number](TopLevel.Number.md) + - : Returns the cut-off threshold. + + **Returns:** + - the cut-off threshold. + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name. + + **Returns:** + - the display name. + + +--- + +### getValueTypeCode() +- getValueTypeCode(): [Number](TopLevel.Number.md) + - : Returns a code for the data type used for this search refinement definition. See constants + defined in ObjectAttributeDefinition. + + + **Returns:** + - a code for the data type used for this search refinement definition. See constants + defined in ObjectAttributeDefinition. + + + +--- + +### isAttributeRefinement() +- isAttributeRefinement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is an attribute refinement. + + **Returns:** + - true if this is an attribute refinement, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementValue.md new file mode 100644 index 00000000..8965900a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinementValue.md @@ -0,0 +1,194 @@ + +# Class SearchRefinementValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinementValue](dw.catalog.SearchRefinementValue.md) + +Represents the value of a product or content search refinement. + + +## All Known Subclasses +[ContentSearchRefinementValue](dw.content.ContentSearchRefinementValue.md), [ProductSearchRefinementValue](dw.catalog.ProductSearchRefinementValue.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the refinement value's ID. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the optional refinement value description in the current locale. | +| [displayValue](#displayvalue): [String](TopLevel.String.md) `(read-only)` | Returns the refinement display value. | +| [hitCount](#hitcount): [Number](TopLevel.Number.md) `(read-only)` | Returns the hit count value. | +| [presentationID](#presentationid): [String](TopLevel.String.md) `(read-only)` | Returns the optional presentation ID associated with this refinement value. | +| [value](#value): [String](TopLevel.String.md) `(read-only)` | Returns the refinement value. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDescription](dw.catalog.SearchRefinementValue.md#getdescription)() | Returns the optional refinement value description in the current locale. | +| [getDisplayValue](dw.catalog.SearchRefinementValue.md#getdisplayvalue)() | Returns the refinement display value. | +| [getHitCount](dw.catalog.SearchRefinementValue.md#gethitcount)() | Returns the hit count value. | +| [getID](dw.catalog.SearchRefinementValue.md#getid)() | Returns the refinement value's ID. | +| [getPresentationID](dw.catalog.SearchRefinementValue.md#getpresentationid)() | Returns the optional presentation ID associated with this refinement value. | +| [getValue](dw.catalog.SearchRefinementValue.md#getvalue)() | Returns the refinement value. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the refinement value's ID. For attribute refinements, this will + be the ID of the corresponding + [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md). This ID is included in the + querystring parameter names returned by the URL-generating methods of + [SearchModel](dw.catalog.SearchModel.md). For price and category refinements, this + value will be empty. + + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the optional refinement value description in the current locale. + + +--- + +### displayValue +- displayValue: [String](TopLevel.String.md) `(read-only)` + - : Returns the refinement display value. For attribute refinements, this is + the appropriate display value based on optional value display names + within the object attribute definition. If no display name is defined, + the value itself is returned. For category refinements, this is the + display name of the category in the current locale. For price + refinements, this is a string representation of the range appropriate for + display. + + + +--- + +### hitCount +- hitCount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the hit count value. + + +--- + +### presentationID +- presentationID: [String](TopLevel.String.md) `(read-only)` + - : Returns the optional presentation ID associated with this refinement + value. The presentation ID can be used, for example, to associate an ID + with an HTML widget. + + + +--- + +### value +- value: [String](TopLevel.String.md) `(read-only)` + - : Returns the refinement value. For attribute refinements, this is the + attribute value if the refinement values are unbucketed, or the bucket + display name if the values are bucketed. This value is included in the + querystring parameter values returned by the URL-generating methods of + [SearchModel](dw.catalog.SearchModel.md). For price refinements, the value will be + a string representation of the price range lower bound. For category + refinements, the value will be a category ID. + + + +--- + +## Method Details + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the optional refinement value description in the current locale. + + **Returns:** + - the optional refinement value description in the current locale, + or null if none is defined. + + + +--- + +### getDisplayValue() +- getDisplayValue(): [String](TopLevel.String.md) + - : Returns the refinement display value. For attribute refinements, this is + the appropriate display value based on optional value display names + within the object attribute definition. If no display name is defined, + the value itself is returned. For category refinements, this is the + display name of the category in the current locale. For price + refinements, this is a string representation of the range appropriate for + display. + + + **Returns:** + - the refinement display value in the current locale. + + +--- + +### getHitCount() +- getHitCount(): [Number](TopLevel.Number.md) + - : Returns the hit count value. + + **Returns:** + - the hit count value. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the refinement value's ID. For attribute refinements, this will + be the ID of the corresponding + [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md). This ID is included in the + querystring parameter names returned by the URL-generating methods of + [SearchModel](dw.catalog.SearchModel.md). For price and category refinements, this + value will be empty. + + + **Returns:** + - the refinement value's ID. + + +--- + +### getPresentationID() +- getPresentationID(): [String](TopLevel.String.md) + - : Returns the optional presentation ID associated with this refinement + value. The presentation ID can be used, for example, to associate an ID + with an HTML widget. + + + **Returns:** + - the presentation ID, or null if none is defined. + + +--- + +### getValue() +- getValue(): [String](TopLevel.String.md) + - : Returns the refinement value. For attribute refinements, this is the + attribute value if the refinement values are unbucketed, or the bucket + display name if the values are bucketed. This value is included in the + querystring parameter values returned by the URL-generating methods of + [SearchModel](dw.catalog.SearchModel.md). For price refinements, the value will be + a string representation of the price range lower bound. For category + refinements, the value will be a category ID. + + + **Returns:** + - the refinement value. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinements.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinements.md new file mode 100644 index 00000000..d7079693 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SearchRefinements.md @@ -0,0 +1,238 @@ + +# Class SearchRefinements + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinements](dw.catalog.SearchRefinements.md) + +Common search refinements base class. + + +## All Known Subclasses +[ContentSearchRefinements](dw.content.ContentSearchRefinements.md), [ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ASCENDING](#ascending): [Number](TopLevel.Number.md) = 0 | Flag for an ascending sort. | +| [DESCENDING](#descending): [Number](TopLevel.Number.md) = 1 | Flag for a descending sort. | +| [SORT_VALUE_COUNT](#sort_value_count): [Number](TopLevel.Number.md) = 1 | Flag for sorting on value count. | +| [SORT_VALUE_NAME](#sort_value_name): [Number](TopLevel.Number.md) = 0 | Flag for sorting on value name. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [allRefinementDefinitions](#allrefinementdefinitions): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted list of refinement definitions that are appropriate for the deepest common category (or deepest common folder) of the search result. | +| [refinementDefinitions](#refinementdefinitions): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted list of refinement definitions that are appropriate for the deepest common category (or deepest common folder) of the search result. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllRefinementDefinitions](dw.catalog.SearchRefinements.md#getallrefinementdefinitions)() | Returns a sorted list of refinement definitions that are appropriate for the deepest common category (or deepest common folder) of the search result. | +| [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring)([String](TopLevel.String.md)) | Returns a sorted collection of refinement values for the given refinement attribute. | +| [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring-number-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a sorted collection of refinement values for the given refinement attribute. | +| [getRefinementDefinitions](dw.catalog.SearchRefinements.md#getrefinementdefinitions)() | Returns a sorted list of refinement definitions that are appropriate for the deepest common category (or deepest common folder) of the search result. | +| [getRefinementValues](dw.catalog.SearchRefinements.md#getrefinementvaluesstring-number-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Returns a collection of refinement values for the given refinement attribute, sorting mode and sorting direction. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ASCENDING + +- ASCENDING: [Number](TopLevel.Number.md) = 0 + - : Flag for an ascending sort. + + +--- + +### DESCENDING + +- DESCENDING: [Number](TopLevel.Number.md) = 1 + - : Flag for a descending sort. + + +--- + +### SORT_VALUE_COUNT + +- SORT_VALUE_COUNT: [Number](TopLevel.Number.md) = 1 + - : Flag for sorting on value count. + + +--- + +### SORT_VALUE_NAME + +- SORT_VALUE_NAME: [Number](TopLevel.Number.md) = 0 + - : Flag for sorting on value name. + + +--- + +## Property Details + +### allRefinementDefinitions +- allRefinementDefinitions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted list of refinement definitions that are appropriate for + the deepest common category (or deepest common folder) of the search + result. The method concatenates the sorted refinement definitions per + category starting at the root category until reaching the deepest common + category. + + The method does not filter out refinement definitions that do + not provide values for the current search result and can therefore also + be used on empty search results. + + + +--- + +### refinementDefinitions +- refinementDefinitions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted list of refinement definitions that are appropriate for + the deepest common category (or deepest common folder) of the search + result. The method concatenates the sorted refinement definitions per category + starting at the root category until reaching the deepest common category. + + The method also filters out refinement definitions that do not provide + any values for the current search result. + + + +--- + +## Method Details + +### getAllRefinementDefinitions() +- getAllRefinementDefinitions(): [Collection](dw.util.Collection.md) + - : Returns a sorted list of refinement definitions that are appropriate for + the deepest common category (or deepest common folder) of the search + result. The method concatenates the sorted refinement definitions per + category starting at the root category until reaching the deepest common + category. + + The method does not filter out refinement definitions that do + not provide values for the current search result and can therefore also + be used on empty search results. + + + **Returns:** + - A sorted list of refinement definitions appropriate for the + search result (based on its deepest common category) + + + +--- + +### getAllRefinementValues(String) +- getAllRefinementValues(attributeName: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of refinement values for the given refinement + attribute. The returned collection includes all refinement values for + which the hit count is greater than 0 within the search result when the + passed attribute is excluded from filtering the search hits but all other + refinement filters are still applied. This method is useful for rendering + broadening options for attributes that the search is currently refined + by. This method does NOT return refinement values independent of the + search result. + + + For product search refinements, this method may return slightly different + results based on the "value set" property of the refinement definition. + See + [ProductSearchRefinements.getAllRefinementValues(ProductSearchRefinementDefinition)](dw.catalog.ProductSearchRefinements.md#getallrefinementvaluesproductsearchrefinementdefinition) + for details. + + + **Parameters:** + - attributeName - The name of the attribute to return refinement values for. + + **Returns:** + - The collection of SearchRefinementValue instances, sorted + according to the settings of the refinement definition, or null + if there is no refinement definition for the passed attribute + name. + + + +--- + +### getAllRefinementValues(String, Number, Number) +- getAllRefinementValues(attributeName: [String](TopLevel.String.md), sortMode: [Number](TopLevel.Number.md), sortDirection: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of refinement values for the given refinement + attribute. In general, the returned collection includes all refinement + values for which hit count is greater than 0 within the search result + assuming that: + + + - The passed refinement attribute is NOT used to filter the search hits. + - All other refinements are still applied. + + + This is useful for rendering broadening options for the refinement + definitions that the search is already refined by. It is important to + note that this method does NOT return refinement values independent of + the search result. + + + For product search refinements, this method may return slightly different + results based on the "value set" of the refinement definition. See + [ProductSearchRefinements.getAllRefinementValues(ProductSearchRefinementDefinition)](dw.catalog.ProductSearchRefinements.md#getallrefinementvaluesproductsearchrefinementdefinition) + for details. + + + **Parameters:** + - attributeName - The name of the attribute to return refinement values for. + - sortMode - The sort mode to use to control how the collection is sorted. + - sortDirection - The sort direction to use. + + **Returns:** + - The collection of SearchRefinementValue instances, sorted + according to the passed parameters. + + + +--- + +### getRefinementDefinitions() +- getRefinementDefinitions(): [Collection](dw.util.Collection.md) + - : Returns a sorted list of refinement definitions that are appropriate for + the deepest common category (or deepest common folder) of the search + result. The method concatenates the sorted refinement definitions per category + starting at the root category until reaching the deepest common category. + + The method also filters out refinement definitions that do not provide + any values for the current search result. + + + **Returns:** + - A sorted list of refinement definitions appropriate for the + search result (based on its deepest common category) + + + +--- + +### getRefinementValues(String, Number, Number) +- getRefinementValues(attributeName: [String](TopLevel.String.md), sortMode: [Number](TopLevel.Number.md), sortDirection: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of refinement values for the given refinement + attribute, sorting mode and sorting direction. + + + **Parameters:** + - attributeName - The attribute name to use when collection refinement values. + - sortMode - The sort mode to use to control how the collection is sorted. + - sortDirection - The sort direction to use. + + **Returns:** + - The collection of refinement values. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingOption.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingOption.md new file mode 100644 index 00000000..24b0993d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingOption.md @@ -0,0 +1,120 @@ + +# Class SortingOption + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.catalog.SortingOption](dw.catalog.SortingOption.md) + +Represents an option for how to sort products in storefront search results. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the sorting option. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of the sorting option for the current locale. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name of the of the sorting option for the current locale. | +| [sortingRule](#sortingrule): [SortingRule](dw.catalog.SortingRule.md) `(read-only)` | Returns the sorting rule for this sorting option, or `null` if there is no associated rule. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDescription](dw.catalog.SortingOption.md#getdescription)() | Returns the description of the sorting option for the current locale. | +| [getDisplayName](dw.catalog.SortingOption.md#getdisplayname)() | Returns the display name of the of the sorting option for the current locale. | +| [getID](dw.catalog.SortingOption.md#getid)() | Returns the ID of the sorting option. | +| [getSortingRule](dw.catalog.SortingOption.md#getsortingrule)() | Returns the sorting rule for this sorting option, or `null` if there is no associated rule. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the sorting option. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of the sorting option for the current locale. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name of the of the sorting option for the current locale. + + +--- + +### sortingRule +- sortingRule: [SortingRule](dw.catalog.SortingRule.md) `(read-only)` + - : Returns the sorting rule for this sorting option, + or `null` if there is no associated rule. + + + +--- + +## Method Details + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the sorting option for the current locale. + + **Returns:** + - The value of the property for the current locale, or null if it + wasn't found. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name of the of the sorting option for the current locale. + + **Returns:** + - The value of the property for the current locale, or null if it + wasn't found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the sorting option. + + **Returns:** + - sorting option ID + + +--- + +### getSortingRule() +- getSortingRule(): [SortingRule](dw.catalog.SortingRule.md) + - : Returns the sorting rule for this sorting option, + or `null` if there is no associated rule. + + + **Returns:** + - a ProductSortingRule instance representing the rule + for this option or null. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingRule.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingRule.md new file mode 100644 index 00000000..b34f7a1d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.SortingRule.md @@ -0,0 +1,53 @@ + +# Class SortingRule + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.catalog.SortingRule](dw.catalog.SortingRule.md) + +Represents a product sorting rule for use with the [ProductSearchModel](dw.catalog.ProductSearchModel.md). + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the sorting rule. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.catalog.SortingRule.md#getid)() | Returns the ID of the sorting rule. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the sorting rule. + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the sorting rule. + + **Returns:** + - sorting rule ID + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Store.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Store.md new file mode 100644 index 00000000..ce6223c9 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Store.md @@ -0,0 +1,484 @@ + +# Class Store + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Store](dw.catalog.Store.md) + +Represents a store in Commerce Cloud Digital. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the store. | +| [address1](#address1): [String](TopLevel.String.md) `(read-only)` | Returns the address1 of the store. | +| [address2](#address2): [String](TopLevel.String.md) `(read-only)` | Returns the address2 of the store. | +| [city](#city): [String](TopLevel.String.md) `(read-only)` | Returns the city of the store. | +| [countryCode](#countrycode): [EnumValue](dw.value.EnumValue.md) `(read-only)` | Returns the countryCode of the store. | +| ~~[demandwarePosEnabled](#demandwareposenabled): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Returns the demandwarePosEnabled flag for the store. | +| [email](#email): [String](TopLevel.String.md) `(read-only)` | Returns the email of the store. | +| [fax](#fax): [String](TopLevel.String.md) `(read-only)` | Returns the fax of the store. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the store image. | +| [inventoryList](#inventorylist): [ProductInventoryList](dw.catalog.ProductInventoryList.md) `(read-only)` | Returns the inventory list the store is associated with. | +| [inventoryListID](#inventorylistid): [String](TopLevel.String.md) `(read-only)` | Returns the inventory list id the store is associated with. | +| [latitude](#latitude): [Number](TopLevel.Number.md) `(read-only)` | Returns the latitude of the store. | +| [longitude](#longitude): [Number](TopLevel.Number.md) `(read-only)` | Returns the longitude of the store. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the store. | +| [phone](#phone): [String](TopLevel.String.md) `(read-only)` | Returns the phone of the store. | +| [posEnabled](#posenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the posEnabled flag for the Store. | +| [postalCode](#postalcode): [String](TopLevel.String.md) `(read-only)` | Returns the postalCode of the store. | +| [stateCode](#statecode): [String](TopLevel.String.md) `(read-only)` | Returns the stateCode of the store. | +| [storeEvents](#storeevents): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the storeEvents of the store. | +| [storeGroups](#storegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns all the store groups this store belongs to. | +| [storeHours](#storehours): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the storeHours of the store. | +| [storeLocatorEnabled](#storelocatorenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the storeLocatorEnabled flag for the store. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAddress1](dw.catalog.Store.md#getaddress1)() | Returns the address1 of the store. | +| [getAddress2](dw.catalog.Store.md#getaddress2)() | Returns the address2 of the store. | +| [getCity](dw.catalog.Store.md#getcity)() | Returns the city of the store. | +| [getCountryCode](dw.catalog.Store.md#getcountrycode)() | Returns the countryCode of the store. | +| [getEmail](dw.catalog.Store.md#getemail)() | Returns the email of the store. | +| [getFax](dw.catalog.Store.md#getfax)() | Returns the fax of the store. | +| [getID](dw.catalog.Store.md#getid)() | Returns the ID of the store. | +| [getImage](dw.catalog.Store.md#getimage)() | Returns the store image. | +| [getInventoryList](dw.catalog.Store.md#getinventorylist)() | Returns the inventory list the store is associated with. | +| [getInventoryListID](dw.catalog.Store.md#getinventorylistid)() | Returns the inventory list id the store is associated with. | +| [getLatitude](dw.catalog.Store.md#getlatitude)() | Returns the latitude of the store. | +| [getLongitude](dw.catalog.Store.md#getlongitude)() | Returns the longitude of the store. | +| [getName](dw.catalog.Store.md#getname)() | Returns the name of the store. | +| [getPhone](dw.catalog.Store.md#getphone)() | Returns the phone of the store. | +| [getPostalCode](dw.catalog.Store.md#getpostalcode)() | Returns the postalCode of the store. | +| [getStateCode](dw.catalog.Store.md#getstatecode)() | Returns the stateCode of the store. | +| [getStoreEvents](dw.catalog.Store.md#getstoreevents)() | Returns the storeEvents of the store. | +| [getStoreGroups](dw.catalog.Store.md#getstoregroups)() | Returns all the store groups this store belongs to. | +| [getStoreHours](dw.catalog.Store.md#getstorehours)() | Returns the storeHours of the store. | +| ~~[isDemandwarePosEnabled](dw.catalog.Store.md#isdemandwareposenabled)()~~ | Returns the demandwarePosEnabled flag for the store. | +| [isPosEnabled](dw.catalog.Store.md#isposenabled)() | Returns the posEnabled flag for the Store. | +| [isStoreLocatorEnabled](dw.catalog.Store.md#isstorelocatorenabled)() | Returns the storeLocatorEnabled flag for the store. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the store. + + +--- + +### address1 +- address1: [String](TopLevel.String.md) `(read-only)` + - : Returns the address1 of the store. + + +--- + +### address2 +- address2: [String](TopLevel.String.md) `(read-only)` + - : Returns the address2 of the store. + + +--- + +### city +- city: [String](TopLevel.String.md) `(read-only)` + - : Returns the city of the store. + + +--- + +### countryCode +- countryCode: [EnumValue](dw.value.EnumValue.md) `(read-only)` + - : Returns the countryCode of the store. + + +--- + +### demandwarePosEnabled +- ~~demandwarePosEnabled: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Returns the demandwarePosEnabled flag for the store. + Indicates that this store uses Commerce Cloud Store for point-of-sale. + + + **Deprecated:** +:::warning +Use [isPosEnabled()](dw.catalog.Store.md#isposenabled) instead +::: + +--- + +### email +- email: [String](TopLevel.String.md) `(read-only)` + - : Returns the email of the store. + + +--- + +### fax +- fax: [String](TopLevel.String.md) `(read-only)` + - : Returns the fax of the store. + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the store image. + + +--- + +### inventoryList +- inventoryList: [ProductInventoryList](dw.catalog.ProductInventoryList.md) `(read-only)` + - : Returns the inventory list the store is associated with. If the + store is not associated with a inventory list, or the inventory list does not + exist, the method returns null. + + + +--- + +### inventoryListID +- inventoryListID: [String](TopLevel.String.md) `(read-only)` + - : Returns the inventory list id the store is associated with. If the + store is not associated with a inventory list, or the inventory list does not + exist, the method returns null. + + + +--- + +### latitude +- latitude: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the latitude of the store. + + +--- + +### longitude +- longitude: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the longitude of the store. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the store. + + +--- + +### phone +- phone: [String](TopLevel.String.md) `(read-only)` + - : Returns the phone of the store. + + +--- + +### posEnabled +- posEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the posEnabled flag for the Store. + Indicates that this store uses Commerce Cloud Store for point-of-sale. + + + +--- + +### postalCode +- postalCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the postalCode of the store. + + +--- + +### stateCode +- stateCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the stateCode of the store. + + +--- + +### storeEvents +- storeEvents: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the storeEvents of the store. + + +--- + +### storeGroups +- storeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all the store groups this store belongs to. + + +--- + +### storeHours +- storeHours: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the storeHours of the store. + + +--- + +### storeLocatorEnabled +- storeLocatorEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the storeLocatorEnabled flag for the store. + + +--- + +## Method Details + +### getAddress1() +- getAddress1(): [String](TopLevel.String.md) + - : Returns the address1 of the store. + + **Returns:** + - address1 of the store + + +--- + +### getAddress2() +- getAddress2(): [String](TopLevel.String.md) + - : Returns the address2 of the store. + + **Returns:** + - address2 of the store + + +--- + +### getCity() +- getCity(): [String](TopLevel.String.md) + - : Returns the city of the store. + + **Returns:** + - city of the store + + +--- + +### getCountryCode() +- getCountryCode(): [EnumValue](dw.value.EnumValue.md) + - : Returns the countryCode of the store. + + **Returns:** + - countryCode of the store + + +--- + +### getEmail() +- getEmail(): [String](TopLevel.String.md) + - : Returns the email of the store. + + **Returns:** + - email of the store + + +--- + +### getFax() +- getFax(): [String](TopLevel.String.md) + - : Returns the fax of the store. + + **Returns:** + - fax of the store + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the store. + + **Returns:** + - ID of the store + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the store image. + + **Returns:** + - the store image. + + +--- + +### getInventoryList() +- getInventoryList(): [ProductInventoryList](dw.catalog.ProductInventoryList.md) + - : Returns the inventory list the store is associated with. If the + store is not associated with a inventory list, or the inventory list does not + exist, the method returns null. + + + **Returns:** + - ProductInventoryList or null + + +--- + +### getInventoryListID() +- getInventoryListID(): [String](TopLevel.String.md) + - : Returns the inventory list id the store is associated with. If the + store is not associated with a inventory list, or the inventory list does not + exist, the method returns null. + + + **Returns:** + - the inventory list id + + +--- + +### getLatitude() +- getLatitude(): [Number](TopLevel.Number.md) + - : Returns the latitude of the store. + + **Returns:** + - latitude of the store + + +--- + +### getLongitude() +- getLongitude(): [Number](TopLevel.Number.md) + - : Returns the longitude of the store. + + **Returns:** + - longitude of the store + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the store. + + **Returns:** + - name of the store + + +--- + +### getPhone() +- getPhone(): [String](TopLevel.String.md) + - : Returns the phone of the store. + + **Returns:** + - phone of the store + + +--- + +### getPostalCode() +- getPostalCode(): [String](TopLevel.String.md) + - : Returns the postalCode of the store. + + **Returns:** + - postalCode of the store + + +--- + +### getStateCode() +- getStateCode(): [String](TopLevel.String.md) + - : Returns the stateCode of the store. + + **Returns:** + - stateCode of the store + + +--- + +### getStoreEvents() +- getStoreEvents(): [MarkupText](dw.content.MarkupText.md) + - : Returns the storeEvents of the store. + + **Returns:** + - storeEvents of the store + + +--- + +### getStoreGroups() +- getStoreGroups(): [Collection](dw.util.Collection.md) + - : Returns all the store groups this store belongs to. + + **Returns:** + - collection of store groups + + +--- + +### getStoreHours() +- getStoreHours(): [MarkupText](dw.content.MarkupText.md) + - : Returns the storeHours of the store. + + **Returns:** + - storeHours of the store + + +--- + +### isDemandwarePosEnabled() +- ~~isDemandwarePosEnabled(): [Boolean](TopLevel.Boolean.md)~~ + - : Returns the demandwarePosEnabled flag for the store. + Indicates that this store uses Commerce Cloud Store for point-of-sale. + + + **Returns:** + - the demandwarePosEnabled flag + + **Deprecated:** +:::warning +Use [isPosEnabled()](dw.catalog.Store.md#isposenabled) instead +::: + +--- + +### isPosEnabled() +- isPosEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns the posEnabled flag for the Store. + Indicates that this store uses Commerce Cloud Store for point-of-sale. + + + **Returns:** + - the posEnabled flag + + +--- + +### isStoreLocatorEnabled() +- isStoreLocatorEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns the storeLocatorEnabled flag for the store. + + **Returns:** + - the storeLocatorEnabled flag + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreGroup.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreGroup.md new file mode 100644 index 00000000..969c9fb4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreGroup.md @@ -0,0 +1,95 @@ + +# Class StoreGroup + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.StoreGroup](dw.catalog.StoreGroup.md) + +Represents a store group. Store groups can be used to group the stores for different marketing purposes. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the store group. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the store group. | +| [stores](#stores): [Collection](dw.util.Collection.md) `(read-only)` | Returns all the stores that are assigned to the store group. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.catalog.StoreGroup.md#getid)() | Returns the ID of the store group. | +| [getName](dw.catalog.StoreGroup.md#getname)() | Returns the name of the store group. | +| [getStores](dw.catalog.StoreGroup.md#getstores)() | Returns all the stores that are assigned to the store group. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the store group. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the store group. + + +--- + +### stores +- stores: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all the stores that are assigned to the store group. + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the store group. + + **Returns:** + - ID of the store group + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the store group. + + **Returns:** + - name of the store group + + +--- + +### getStores() +- getStores(): [Collection](dw.util.Collection.md) + - : Returns all the stores that are assigned to the store group. + + **Returns:** + - collection of the stores + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilter.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilter.md new file mode 100644 index 00000000..adb97990 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilter.md @@ -0,0 +1,112 @@ + +# Class StoreInventoryFilter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) + + + +This class represents a store inventory filter, which can be used at +[ProductSearchModel.setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter) to filter the search result by one or more +store inventories. Compared to the default parameter 'ilids' (Inventory List IDs) see +([ProductSearchModel.INVENTORY_LIST_IDS_PARAMETER](dw.catalog.ProductSearchModel.md#inventory_list_ids_parameter) the store inventory filter allows a customization of the +parameter name and the inventory list ID parameter values for the URL generations via all URLRefine and URLRelax +methods e.g. for [ProductSearchModel.urlRefineCategory(String, String)](dw.catalog.ProductSearchModel.md#urlrefinecategorystring-string), +[ProductSearchModel.urlRelaxPrice(URL)](dw.catalog.ProductSearchModel.md#urlrelaxpriceurl), +[SearchModel.urlRefineAttribute(String, String, String)](dw.catalog.SearchModel.md#urlrefineattributestring-string-string). + + +Example custom URL: city=Burlington|Boston + + + +``` +new dw.catalog.StoreInventoryFilter( "city", + new dw.util.ArrayList( new dw.catalog.StoreInventoryFilterValue( "Burlington", "inventory_store_store9" ), + new dw.catalog.StoreInventoryFilterValue( "Boston", "inventory_store_store8" ) ) ); +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [semanticURLParameter](#semanticurlparameter): [String](TopLevel.String.md) `(read-only)` | Returns the semantic URL parameter of this StoreInventoryFilter. | +| [storeInventoryFilterValues](#storeinventoryfiltervalues): [List](dw.util.List.md) `(read-only)` | Returns a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances used by this StoreInventoryFilter. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [StoreInventoryFilter](#storeinventoryfilterstring-list)([String](TopLevel.String.md), [List](dw.util.List.md)) | Creates a new StoreInventoryFilter instance for the given semantic URL parameter and a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getSemanticURLParameter](dw.catalog.StoreInventoryFilter.md#getsemanticurlparameter)() | Returns the semantic URL parameter of this StoreInventoryFilter. | +| [getStoreInventoryFilterValues](dw.catalog.StoreInventoryFilter.md#getstoreinventoryfiltervalues)() | Returns a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances used by this StoreInventoryFilter. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### semanticURLParameter +- semanticURLParameter: [String](TopLevel.String.md) `(read-only)` + - : Returns the semantic URL parameter of this StoreInventoryFilter. + + +--- + +### storeInventoryFilterValues +- storeInventoryFilterValues: [List](dw.util.List.md) `(read-only)` + - : Returns a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances used by this StoreInventoryFilter. + + +--- + +## Constructor Details + +### StoreInventoryFilter(String, List) +- StoreInventoryFilter(semanticURLParameter: [String](TopLevel.String.md), storeFilterValues: [List](dw.util.List.md)) + - : Creates a new StoreInventoryFilter instance for the given semantic URL parameter and a list of + [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances. The semantic URL parameter e.g. city, zip, store and the semantic + store inventory values from the storeFilterValues will be used for URL generation. The mapped inventory list IDs + from the storeFilterValues will be used for filtering. on the mapped + + + **Parameters:** + - semanticURLParameter - The semantic URL parameter which should be used for URL generation instead of 'ilids' (Inventory List IDs) + - storeFilterValues - A list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances containing the store inventory values and the related real inventory list ID. + + **Throws:** + - NullArgumentException - in case of missing required parameter. + + +--- + +## Method Details + +### getSemanticURLParameter() +- getSemanticURLParameter(): [String](TopLevel.String.md) + - : Returns the semantic URL parameter of this StoreInventoryFilter. + + **Returns:** + - the semantic URL parameter of this StoreInventoryFilter. + + +--- + +### getStoreInventoryFilterValues() +- getStoreInventoryFilterValues(): [List](dw.util.List.md) + - : Returns a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances used by this StoreInventoryFilter. + + **Returns:** + - a list of [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) instances used by this StoreInventoryFilter. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilterValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilterValue.md new file mode 100644 index 00000000..6c50eb68 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreInventoryFilterValue.md @@ -0,0 +1,111 @@ + +# Class StoreInventoryFilterValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) + + + +This class represents a store inventory filter value, which can be used for a [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) to filter +the search result by one or more store inventory list IDs via +[ProductSearchModel.setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter). Compared to +[ProductSearchModel.setInventoryListIDs(List)](dw.catalog.ProductSearchModel.md#setinventorylistidslist) the store inventory filter allows a customization of the +inventory parameter name and the inventory list ID values for URL generations. A StoreInventoryFilterValue provides +the mapping between a semantic value e.g. store1,store2 or Burlington,Boston to the related real inventory list ID. + + +Example custom URL: city=Burlington|Boston + + + +``` +new dw.catalog.StoreInventoryFilter("city", + new dw.util.ArrayList( + new dw.catalog.StoreInventoryFilterValue("Burlington","inventory_store_store9"), + new dw.catalog.StoreInventoryFilterValue("Boston","inventory_store_store8") +)); +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [inventoryListID](#inventorylistid): [String](TopLevel.String.md) `(read-only)` | Returns the real inventory list ID of this store inventory filter value. | +| [semanticInventoryID](#semanticinventoryid): [String](TopLevel.String.md) `(read-only)` | Returns the semantic inventory ID of this store inventory filter value. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [StoreInventoryFilterValue](#storeinventoryfiltervaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) |

    Creates a new StoreInventoryFilterValue instance for the semantic inventory ID and real inventory list ID. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getInventoryListID](dw.catalog.StoreInventoryFilterValue.md#getinventorylistid)() | Returns the real inventory list ID of this store inventory filter value. | +| [getSemanticInventoryID](dw.catalog.StoreInventoryFilterValue.md#getsemanticinventoryid)() | Returns the semantic inventory ID of this store inventory filter value. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### inventoryListID +- inventoryListID: [String](TopLevel.String.md) `(read-only)` + - : Returns the real inventory list ID of this store inventory filter value. + + +--- + +### semanticInventoryID +- semanticInventoryID: [String](TopLevel.String.md) `(read-only)` + - : Returns the semantic inventory ID of this store inventory filter value. + + +--- + +## Constructor Details + +### StoreInventoryFilterValue(String, String) +- StoreInventoryFilterValue(semanticInventoryListID: [String](TopLevel.String.md), inventoryListID: [String](TopLevel.String.md)) + - : + + Creates a new StoreInventoryFilterValue instance for the semantic inventory ID and real inventory list ID. + + + **Parameters:** + - semanticInventoryListID - The semantic inventory list ID of this store inventory filter value. + - inventoryListID - The real inventory list ID to filter the search result on. + + **Throws:** + - NullArgumentException - in case of missing required parameter. + + +--- + +## Method Details + +### getInventoryListID() +- getInventoryListID(): [String](TopLevel.String.md) + - : Returns the real inventory list ID of this store inventory filter value. + + **Returns:** + - the real inventory list ID of this store inventory filter value. + + +--- + +### getSemanticInventoryID() +- getSemanticInventoryID(): [String](TopLevel.String.md) + - : Returns the semantic inventory ID of this store inventory filter value. + + **Returns:** + - the semantic inventory ID of this store inventory filter value. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreMgr.md new file mode 100644 index 00000000..6e1ec1af --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.StoreMgr.md @@ -0,0 +1,223 @@ + +# Class StoreMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.StoreMgr](dw.catalog.StoreMgr.md) + +Provides helper methods for getting stores based on id and querying for +stores based on geolocation. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [allStoreGroups](#allstoregroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns all the store groups of the current site. | +| [storeIDFromSession](#storeidfromsession): [String](TopLevel.String.md) `(read-only)` | Get the store id associated with the current session. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getAllStoreGroups](dw.catalog.StoreMgr.md#getallstoregroups)() | Returns all the store groups of the current site. | +| static [getStore](dw.catalog.StoreMgr.md#getstorestring)([String](TopLevel.String.md)) | Returns the store object with the specified id or null if store with this id does not exist in the site. | +| static [getStoreGroup](dw.catalog.StoreMgr.md#getstoregroupstring)([String](TopLevel.String.md)) | Returns the store group with the specified id or null if the store group with this id does not exist in the current site. | +| static [getStoreIDFromSession](dw.catalog.StoreMgr.md#getstoreidfromsession)() | Get the store id associated with the current session. | +| static [searchStoresByCoordinates](dw.catalog.StoreMgr.md#searchstoresbycoordinatesnumber-number-string-number)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Convenience method. | +| static [searchStoresByCoordinates](dw.catalog.StoreMgr.md#searchstoresbycoordinatesnumber-number-string-number-string-object)([Number](TopLevel.Number.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Search for stores based on geo-coordinates. | +| static [searchStoresByPostalCode](dw.catalog.StoreMgr.md#searchstoresbypostalcodestring-string-string-number)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Convenience method. | +| static [searchStoresByPostalCode](dw.catalog.StoreMgr.md#searchstoresbypostalcodestring-string-string-number-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Search for stores by country/postal code and optionally by additional filter criteria. | +| static [setStoreIDToSession](dw.catalog.StoreMgr.md#setstoreidtosessionstring)([String](TopLevel.String.md)) | Set the store id for the current session. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### allStoreGroups +- allStoreGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all the store groups of the current site. + + +--- + +### storeIDFromSession +- storeIDFromSession: [String](TopLevel.String.md) `(read-only)` + - : Get the store id associated with the current session. By default, the session store id is null. + + +--- + +## Method Details + +### getAllStoreGroups() +- static getAllStoreGroups(): [Collection](dw.util.Collection.md) + - : Returns all the store groups of the current site. + + **Returns:** + - The store groups of the current site. + + +--- + +### getStore(String) +- static getStore(storeID: [String](TopLevel.String.md)): [Store](dw.catalog.Store.md) + - : Returns the store object with the specified id or null if store with this + id does not exist in the site. + + + **Parameters:** + - storeID - the store identifier. + + **Returns:** + - Store for specified id or null. + + +--- + +### getStoreGroup(String) +- static getStoreGroup(storeGroupID: [String](TopLevel.String.md)): [StoreGroup](dw.catalog.StoreGroup.md) + - : Returns the store group with the specified id or null if the store group with this id does not exist in the current site. + + **Parameters:** + - storeGroupID - the store group identifier. + + **Returns:** + - The store group for specified id or null. + + +--- + +### getStoreIDFromSession() +- static getStoreIDFromSession(): [String](TopLevel.String.md) + - : Get the store id associated with the current session. By default, the session store id is null. + + **Returns:** + - store id, null is returned and means no store id is set on session + + +--- + +### searchStoresByCoordinates(Number, Number, String, Number) +- static searchStoresByCoordinates(latitude: [Number](TopLevel.Number.md), longitude: [Number](TopLevel.Number.md), distanceUnit: [String](TopLevel.String.md), maxDistance: [Number](TopLevel.Number.md)): [LinkedHashMap](dw.util.LinkedHashMap.md) + - : Convenience method. Same as searchStoresByCoordinates(latitude, longitude, distanceUnit, maxDistance, null). + + **Parameters:** + - latitude - Latitude coordinate which is the center of the search area. Must not be null or an exception is thrown. + - longitude - Longitude coordinate which is the center of the search area. Must not be null or an exception is thrown. + - distanceUnit - The distance unit to be used for the calculation. Supported values are 'mi' and 'km' (for miles and kilometers respectively). If an invalid value is passed then 'km' will be used. + - maxDistance - Area (radius) in DistanceUnit where Stores will be searched for. If null is passed, a system default is used. + + **Returns:** + - The stores and their distance from the specified location, sorted + in ascending order by distance. + + + +--- + +### searchStoresByCoordinates(Number, Number, String, Number, String, Object...) +- static searchStoresByCoordinates(latitude: [Number](TopLevel.Number.md), longitude: [Number](TopLevel.Number.md), distanceUnit: [String](TopLevel.String.md), maxDistance: [Number](TopLevel.Number.md), queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [LinkedHashMap](dw.util.LinkedHashMap.md) + - : Search for stores based on geo-coordinates. The method returns a list of + stores for the current site that are within a specified distance of a + location on the earth and which optionally satisfy additional filter + criteria. If no additional criteria are specified, then this method + behaves similar to GetNearestStores pipelet. The criteria are specified + as a querystring, using the same syntax as + [SystemObjectMgr.querySystemObjects(String, String, String, Object...)](dw.object.SystemObjectMgr.md#querysystemobjectsstring-string-string-object) + + + The stores and their distance from the specified location are returned as + a LinkedHashMap of Store objects to distances, sorting in ascending order + by distance. The distance is interpreted either in miles or kilometers + depending on the "distanceUnit" parameter. + + + The latitude and longitude of each store is determined by first looking + at [Store.getLatitude()](dw.catalog.Store.md#getlatitude) and + [Store.getLongitude()](dw.catalog.Store.md#getlongitude). If these are not set, then the + system deduces the location of the store by looking for a configured + geolocation matching the store's postal and country codes. + + + **Parameters:** + - latitude - Latitude coordinate which is the center of the search area. Must not be null or an exception is thrown. + - longitude - Longitude coordinate which is the center of the search area. Must not be null or an exception is thrown. + - distanceUnit - The distance unit to be used for the calculation. Supported values are 'mi' and 'km' (for miles and kilometers respectively). If an invalid value is passed then 'km' will be used. + - maxDistance - Area (radius) in DistanceUnit where Stores will be searched for. If null is passed, a system default is used. + - queryString - optional filter criteria specified as querystring. + - args - the arguments to fill in the values in the querystring. + + **Returns:** + - The stores and their distance from the specified location, sorted + in ascending order by distance. + + + +--- + +### searchStoresByPostalCode(String, String, String, Number) +- static searchStoresByPostalCode(countryCode: [String](TopLevel.String.md), postalCode: [String](TopLevel.String.md), distanceUnit: [String](TopLevel.String.md), maxDistance: [Number](TopLevel.Number.md)): [LinkedHashMap](dw.util.LinkedHashMap.md) + - : Convenience method. Same as searchStoresByPostalCode(countryCode, postalCode, distanceUnit, maxDistance, null). + + **Parameters:** + - countryCode - The country code for the search area, must not be null. + - postalCode - The postal code for the center of the search area, must not be null. + - distanceUnit - The distance unit to be used for the calculation. Supported values are 'mi' and 'km' (for miles and kilometers respectively). If an invalid value is passed then 'km' will be used. + - maxDistance - Area (radius) in DistanceUnit where Stores will be searched for. If null is passed, a system default is used. + + **Returns:** + - The stores and their distance from the specified location, sorted + in ascending order by distance. + + + +--- + +### searchStoresByPostalCode(String, String, String, Number, String, Object...) +- static searchStoresByPostalCode(countryCode: [String](TopLevel.String.md), postalCode: [String](TopLevel.String.md), distanceUnit: [String](TopLevel.String.md), maxDistance: [Number](TopLevel.Number.md), queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [LinkedHashMap](dw.util.LinkedHashMap.md) + - : Search for stores by country/postal code and optionally by additional + filter criteria. This method is analagous to + [searchStoresByCoordinates(Number, Number, String, Number, String, Object...)](dw.catalog.StoreMgr.md#searchstoresbycoordinatesnumber-number-string-number-string-object) + but identifies a location on the earth indirectly using country and + postal code. The method will look first in the saved geolocations of the + system to find a geolocation matching the passed country and postal code. + If none is found, this method will return an empty map. If one is found, + it will use the latitude/longitude of the found geolocation as the center + of the search. + + + **Parameters:** + - countryCode - The country code for the search area, must not be null. + - postalCode - The postal code for the center of the search area, must not be null. + - distanceUnit - The distance unit to be used for the calculation. Supported values are 'mi' and 'km' (for miles and kilometers respectively). If an invalid value is passed then 'km' will be used. + - maxDistance - Area (radius) in DistanceUnit where Stores will be searched for. If null is passed, a system default is used. + - queryString - An optional search querystring which provides additional criteria to filter stores by. + - args - The arguments providing the dynamic values to the querystring. + + **Returns:** + - The stores and their distance from the specified location, sorted + in ascending order by distance. + + + +--- + +### setStoreIDToSession(String) +- static setStoreIDToSession(storeID: [String](TopLevel.String.md)): void + - : Set the store id for the current session. The store id is also saved on the cookie with the cookie name + "dw\_store" with no expiration time. Null is allowed to remove store id from session, when null is passed in, the + cookie will be removed when browser exits. + + + **Parameters:** + - storeID - the id of the store. The leading and trailing white spaces are removed by system from storeID + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Variant.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Variant.md new file mode 100644 index 00000000..bb34bd04 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.Variant.md @@ -0,0 +1,1000 @@ + +# Class Variant + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Product](dw.catalog.Product.md) + - [dw.catalog.Variant](dw.catalog.Variant.md) + +Represents a variant of a product variation. If the variant does not define an own value, +the value is retrieved by fallback from variation groups (sorted by their position) or the +variation master. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [EAN](#ean): [String](TopLevel.String.md) `(read-only)` | Returns the EAN of the product variant. | +| [UPC](#upc): [String](TopLevel.String.md) `(read-only)` | Returns the UPC of the product variant. | +| [allProductLinks](#allproductlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product links of the product variant. | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the brand of the product variant. | +| [classificationCategory](#classificationcategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the classification category of the product variant. | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes of the variant. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the image of the product variant. | +| [longDescription](#longdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the long description of the product variant. | +| [manufacturerName](#manufacturername): [String](TopLevel.String.md) `(read-only)` | Returns the manufacturer name of the product variant. | +| [manufacturerSKU](#manufacturersku): [String](TopLevel.String.md) `(read-only)` | Returns the manufacturer sku of the product variant. | +| [masterProduct](#masterproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the ProductMaster for this mastered product. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the product variant. | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the onlineFrom date of the product variant. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the onlineTo date of the product variant. | +| [optionProduct](#optionproduct): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the variant has any options, otherwise 'false'. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the pageDescription of the product variant. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the pageKeywords of the product variant. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the pageTitle of the product variant. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the pageURL of the product variant. | +| [productLinks](#productlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product links of the product variant for which the target product is assigned to the current site catalog. | +| [shortDescription](#shortdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the short description of the product variant. | +| [taxClassID](#taxclassid): [String](TopLevel.String.md) `(read-only)` | Returns the tax class id of the product variant. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the rendering template name of the product variant. | +| [thumbnail](#thumbnail): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the thumbnail image of the product variant. | +| [unit](#unit): [String](TopLevel.String.md) `(read-only)` | Returns the sales unit of the product variant as defined by the master product. | +| [unitQuantity](#unitquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the unitQuantity of the product variant as defined by the master product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllProductLinks](dw.catalog.Variant.md#getallproductlinks)() | Returns all product links of the product variant. | +| [getAllProductLinks](dw.catalog.Variant.md#getallproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all product links of the specified type of the product variant. | +| [getBrand](dw.catalog.Variant.md#getbrand)() | Returns the brand of the product variant. | +| [getClassificationCategory](dw.catalog.Variant.md#getclassificationcategory)() | Returns the classification category of the product variant. | +| [getCustom](dw.catalog.Variant.md#getcustom)() | Returns the custom attributes of the variant. | +| [getEAN](dw.catalog.Variant.md#getean)() | Returns the EAN of the product variant. | +| [getImage](dw.catalog.Variant.md#getimage)() | Returns the image of the product variant. | +| [getLongDescription](dw.catalog.Variant.md#getlongdescription)() | Returns the long description of the product variant. | +| [getManufacturerName](dw.catalog.Variant.md#getmanufacturername)() | Returns the manufacturer name of the product variant. | +| [getManufacturerSKU](dw.catalog.Variant.md#getmanufacturersku)() | Returns the manufacturer sku of the product variant. | +| [getMasterProduct](dw.catalog.Variant.md#getmasterproduct)() | Returns the ProductMaster for this mastered product. | +| [getName](dw.catalog.Variant.md#getname)() | Returns the name of the product variant. | +| [getOnlineFrom](dw.catalog.Variant.md#getonlinefrom)() | Returns the onlineFrom date of the product variant. | +| [getOnlineTo](dw.catalog.Variant.md#getonlineto)() | Returns the onlineTo date of the product variant. | +| [getPageDescription](dw.catalog.Variant.md#getpagedescription)() | Returns the pageDescription of the product variant. | +| [getPageKeywords](dw.catalog.Variant.md#getpagekeywords)() | Returns the pageKeywords of the product variant. | +| [getPageTitle](dw.catalog.Variant.md#getpagetitle)() | Returns the pageTitle of the product variant. | +| [getPageURL](dw.catalog.Variant.md#getpageurl)() | Returns the pageURL of the product variant. | +| [getProductLinks](dw.catalog.Variant.md#getproductlinks)() | Returns all product links of the product variant for which the target product is assigned to the current site catalog. | +| [getProductLinks](dw.catalog.Variant.md#getproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all product links of the specified type of the product variant for which the target product is assigned to the current site catalog. | +| [getRecommendations](dw.catalog.Variant.md#getrecommendationsnumber)([Number](TopLevel.Number.md)) | Retrieve the sorted collection of recommendations of the specified type for this product variant. | +| [getShortDescription](dw.catalog.Variant.md#getshortdescription)() | Returns the short description of the product variant. | +| [getTaxClassID](dw.catalog.Variant.md#gettaxclassid)() | Returns the tax class id of the product variant. | +| [getTemplate](dw.catalog.Variant.md#gettemplate)() | Returns the rendering template name of the product variant. | +| [getThumbnail](dw.catalog.Variant.md#getthumbnail)() | Returns the thumbnail image of the product variant. | +| [getUPC](dw.catalog.Variant.md#getupc)() | Returns the UPC of the product variant. | +| [getUnit](dw.catalog.Variant.md#getunit)() | Returns the sales unit of the product variant as defined by the master product. | +| [getUnitQuantity](dw.catalog.Variant.md#getunitquantity)() | Returns the unitQuantity of the product variant as defined by the master product. | +| [isOptionProduct](dw.catalog.Variant.md#isoptionproduct)() | Returns 'true' if the variant has any options, otherwise 'false'. | + +### Methods inherited from class Product + +[assignedToCategory](dw.catalog.Product.md#assignedtocategorycategory), [getActiveData](dw.catalog.Product.md#getactivedata), [getAllCategories](dw.catalog.Product.md#getallcategories), [getAllCategoryAssignments](dw.catalog.Product.md#getallcategoryassignments), [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinks), [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinksnumber), [getAllProductLinks](dw.catalog.Product.md#getallproductlinks), [getAllProductLinks](dw.catalog.Product.md#getallproductlinksnumber), [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog), [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog-number), [getAttributeModel](dw.catalog.Product.md#getattributemodel), [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodel), [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodelproductinventorylist), [getAvailableFlag](dw.catalog.Product.md#getavailableflag), [getBrand](dw.catalog.Product.md#getbrand), [getBundledProductQuantity](dw.catalog.Product.md#getbundledproductquantityproduct), [getBundledProducts](dw.catalog.Product.md#getbundledproducts), [getBundles](dw.catalog.Product.md#getbundles), [getCategories](dw.catalog.Product.md#getcategories), [getCategoryAssignment](dw.catalog.Product.md#getcategoryassignmentcategory), [getCategoryAssignments](dw.catalog.Product.md#getcategoryassignments), [getClassificationCategory](dw.catalog.Product.md#getclassificationcategory), [getEAN](dw.catalog.Product.md#getean), [getID](dw.catalog.Product.md#getid), [getImage](dw.catalog.Product.md#getimage), [getImage](dw.catalog.Product.md#getimagestring), [getImage](dw.catalog.Product.md#getimagestring-number), [getImages](dw.catalog.Product.md#getimagesstring), [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinks), [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinksnumber), [getLongDescription](dw.catalog.Product.md#getlongdescription), [getManufacturerName](dw.catalog.Product.md#getmanufacturername), [getManufacturerSKU](dw.catalog.Product.md#getmanufacturersku), [getMinOrderQuantity](dw.catalog.Product.md#getminorderquantity), [getName](dw.catalog.Product.md#getname), [getOnlineCategories](dw.catalog.Product.md#getonlinecategories), [getOnlineFlag](dw.catalog.Product.md#getonlineflag), [getOnlineFrom](dw.catalog.Product.md#getonlinefrom), [getOnlineTo](dw.catalog.Product.md#getonlineto), [getOptionModel](dw.catalog.Product.md#getoptionmodel), [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendations), [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendationsnumber), [getPageDescription](dw.catalog.Product.md#getpagedescription), [getPageKeywords](dw.catalog.Product.md#getpagekeywords), [getPageMetaTag](dw.catalog.Product.md#getpagemetatagstring), [getPageMetaTags](dw.catalog.Product.md#getpagemetatags), [getPageTitle](dw.catalog.Product.md#getpagetitle), [getPageURL](dw.catalog.Product.md#getpageurl), [getPriceModel](dw.catalog.Product.md#getpricemodel), [getPriceModel](dw.catalog.Product.md#getpricemodelproductoptionmodel), [getPrimaryCategory](dw.catalog.Product.md#getprimarycategory), [getPrimaryCategoryAssignment](dw.catalog.Product.md#getprimarycategoryassignment), [getProductLinks](dw.catalog.Product.md#getproductlinks), [getProductLinks](dw.catalog.Product.md#getproductlinksnumber), [getProductSetProducts](dw.catalog.Product.md#getproductsetproducts), [getProductSets](dw.catalog.Product.md#getproductsets), [getRecommendations](dw.catalog.Product.md#getrecommendations), [getRecommendations](dw.catalog.Product.md#getrecommendationsnumber), [getSearchPlacement](dw.catalog.Product.md#getsearchplacement), [getSearchRank](dw.catalog.Product.md#getsearchrank), [getSearchableFlag](dw.catalog.Product.md#getsearchableflag), [getSearchableIfUnavailableFlag](dw.catalog.Product.md#getsearchableifunavailableflag), [getShortDescription](dw.catalog.Product.md#getshortdescription), [getSiteMapChangeFrequency](dw.catalog.Product.md#getsitemapchangefrequency), [getSiteMapIncluded](dw.catalog.Product.md#getsitemapincluded), [getSiteMapPriority](dw.catalog.Product.md#getsitemappriority), [getStepQuantity](dw.catalog.Product.md#getstepquantity), [getStoreReceiptName](dw.catalog.Product.md#getstorereceiptname), [getStoreTaxClass](dw.catalog.Product.md#getstoretaxclass), [getTaxClassID](dw.catalog.Product.md#gettaxclassid), [getTemplate](dw.catalog.Product.md#gettemplate), [getThumbnail](dw.catalog.Product.md#getthumbnail), [getUPC](dw.catalog.Product.md#getupc), [getUnit](dw.catalog.Product.md#getunit), [getUnitQuantity](dw.catalog.Product.md#getunitquantity), [getVariants](dw.catalog.Product.md#getvariants), [getVariationGroups](dw.catalog.Product.md#getvariationgroups), [getVariationModel](dw.catalog.Product.md#getvariationmodel), [includedInBundle](dw.catalog.Product.md#includedinbundleproduct), [isAssignedToCategory](dw.catalog.Product.md#isassignedtocategorycategory), [isAssignedToSiteCatalog](dw.catalog.Product.md#isassignedtositecatalog), [isAvailable](dw.catalog.Product.md#isavailable), [isBundle](dw.catalog.Product.md#isbundle), [isBundled](dw.catalog.Product.md#isbundled), [isCategorized](dw.catalog.Product.md#iscategorized), [isFacebookEnabled](dw.catalog.Product.md#isfacebookenabled), [isMaster](dw.catalog.Product.md#ismaster), [isOnline](dw.catalog.Product.md#isonline), [isOptionProduct](dw.catalog.Product.md#isoptionproduct), [isPinterestEnabled](dw.catalog.Product.md#ispinterestenabled), [isProduct](dw.catalog.Product.md#isproduct), [isProductSet](dw.catalog.Product.md#isproductset), [isProductSetProduct](dw.catalog.Product.md#isproductsetproduct), [isRetailSet](dw.catalog.Product.md#isretailset), [isSearchable](dw.catalog.Product.md#issearchable), [isSiteProduct](dw.catalog.Product.md#issiteproduct), [isVariant](dw.catalog.Product.md#isvariant), [isVariationGroup](dw.catalog.Product.md#isvariationgroup), [setAvailableFlag](dw.catalog.Product.md#setavailableflagboolean), [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-1), [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-2), [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-1), [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-2), [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-1), [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-2), [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-1), [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-2) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### EAN +- EAN: [String](TopLevel.String.md) `(read-only)` + - : Returns the EAN of the product variant. + + + If the variant does not define an own value for 'EAN', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'EAN', the value of + the master product is returned. + + + +--- + +### UPC +- UPC: [String](TopLevel.String.md) `(read-only)` + - : Returns the UPC of the product variant. + + + If the variant does not define an own value for 'UPC', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'UPC', the value of + the master product is returned. + + + +--- + +### allProductLinks +- allProductLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product links of the product variant. + + + If the variant does not define any product links, the product links are retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define any product links, the product links are + retrieved from the master product. + + + +--- + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the brand of the product variant. + + + If the variant does not define an own value for 'brand', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'brand', the value of + the master product is returned. + + + +--- + +### classificationCategory +- classificationCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the classification category of the product variant. + + + **Please note** that the classification category is always inherited + from the master and cannot be overridden by the variant. + + + +--- + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes of the variant. + + + Custom attributes are inherited from the master product and can + be overridden by the variant. + + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the image of the product variant. + + + If the variant does not define an own value for 'image', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'image', the value of + the master product is returned. + + + +--- + +### longDescription +- longDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the long description of the product variant. + + + If the variant does not define an own value for 'longDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'longDescription', the value of + the master product is returned. + + + +--- + +### manufacturerName +- manufacturerName: [String](TopLevel.String.md) `(read-only)` + - : Returns the manufacturer name of the product variant. + + + If the variant does not define an own value for 'manufacturerName', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'manufacturerName', the value of + the master product is returned. + + + +--- + +### manufacturerSKU +- manufacturerSKU: [String](TopLevel.String.md) `(read-only)` + - : Returns the manufacturer sku of the product variant. + + + If the variant does not define an own value for 'manufacturerSKU', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'manufacturerSKU', the value of + the master product is returned. + + + +--- + +### masterProduct +- masterProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the ProductMaster for this mastered product. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the product variant. + + + If the variant does not define an own value for 'name', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'name', the value of + the master product is returned. + + + +--- + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the onlineFrom date of the product variant. + + + If the variant does not define an own value for 'onlineFrom', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'onlineFrom', the value of + the master product is returned. + + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the onlineTo date of the product variant. + + + If the variant does not define an own value for 'onlineTo', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'onlineTo', the value of + the master product is returned. + + + +--- + +### optionProduct +- optionProduct: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the variant has any options, otherwise 'false'. + Method also returns 'true' if the variant has not any options, + but the related variation groups (sorted by position) or + master product has options. + + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageDescription of the product variant. + + + If the variant does not define an own value for 'pageDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageDescription', the value of + the master product is returned. + + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageKeywords of the product variant. + + + If the variant does not define an own value for 'pageKeywords', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageKeywords', the value of + the master product is returned. + + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageTitle of the product variant. + + + If the variant does not define an own value for 'pageTitle', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageTitle', the value of + the master product is returned. + + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageURL of the product variant. + + + If the variant does not define an own value for 'pageURL', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageURL', the value of + the master product is returned. + + + +--- + +### productLinks +- productLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product links of the product variant for which the target + product is assigned to the current site catalog. + + + If the variant does not define any product links, the product links are retrieved + from the assigned variation groups, sorted by their position + + If none of the variation groups define any product links, the product links are retrieved + from the master product. + + + +--- + +### shortDescription +- shortDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the short description of the product variant. + + + If the variant does not define an own value for 'shortDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'shortDescription', the value of + the master product is returned. + + + +--- + +### taxClassID +- taxClassID: [String](TopLevel.String.md) `(read-only)` + - : Returns the tax class id of the product variant. + + + If the variant does not define an own value for 'taxClassID', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'taxClassID', the value of + the master product is returned. + + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the rendering template name of the product variant. + + + If the variant does not define an own value for 'template', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'template', the value of + the master product is returned. + + + +--- + +### thumbnail +- thumbnail: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the thumbnail image of the product variant. + + + If the variant does not define an own value for 'thumbnail', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'thumbnail', the value of + the master product is returned. + + + +--- + +### unit +- unit: [String](TopLevel.String.md) `(read-only)` + - : Returns the sales unit of the product variant as defined by the + master product. + + + If the variant does not define an own value for 'unit', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'unit', the value of + the master product is returned. + + + +--- + +### unitQuantity +- unitQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the unitQuantity of the product variant as defined by the + master product. + + + If the variant does not define an own value for 'unitQuantity', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'unitQuantity', the value of + the master product is returned. + + + +--- + +## Method Details + +### getAllProductLinks() +- getAllProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all product links of the product variant. + + + If the variant does not define any product links, the product links are retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define any product links, the product links are + retrieved from the master product. + + + **Returns:** + - All product links of the variant, variation group or master + + +--- + +### getAllProductLinks(Number) +- getAllProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all product links of the specified type of the product variant. + + + If the variant does not define any product links of the specified type, + the product links are retrieved for the specified type from the assigned + variation groups, sorted by their position. + + If none of the variation groups define any product links of the specified type, + the product links are retrieved for the specified type from the master product. + + + **Parameters:** + - type - Type of the product link + + **Returns:** + - Product links of specified type of the variant, variation group or master + + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the brand of the product variant. + + + If the variant does not define an own value for 'brand', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'brand', the value of + the master product is returned. + + + **Returns:** + - The brand of the variant, variation group or master + + +--- + +### getClassificationCategory() +- getClassificationCategory(): [Category](dw.catalog.Category.md) + - : Returns the classification category of the product variant. + + + **Please note** that the classification category is always inherited + from the master and cannot be overridden by the variant. + + + **Returns:** + - The classification category as defined for the master product of the variant + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes of the variant. + + + Custom attributes are inherited from the master product and can + be overridden by the variant. + + + **Returns:** + - the custom attributes of the variant. + + +--- + +### getEAN() +- getEAN(): [String](TopLevel.String.md) + - : Returns the EAN of the product variant. + + + If the variant does not define an own value for 'EAN', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'EAN', the value of + the master product is returned. + + + **Returns:** + - The EAN of the variant, variation group or master + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the image of the product variant. + + + If the variant does not define an own value for 'image', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'image', the value of + the master product is returned. + + + **Returns:** + - The image of the variant, variation group or master + + +--- + +### getLongDescription() +- getLongDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the long description of the product variant. + + + If the variant does not define an own value for 'longDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'longDescription', the value of + the master product is returned. + + + **Returns:** + - The long description of the variant, variation group or master + + +--- + +### getManufacturerName() +- getManufacturerName(): [String](TopLevel.String.md) + - : Returns the manufacturer name of the product variant. + + + If the variant does not define an own value for 'manufacturerName', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'manufacturerName', the value of + the master product is returned. + + + **Returns:** + - The manufacturer name of the variant, variation group or master + + +--- + +### getManufacturerSKU() +- getManufacturerSKU(): [String](TopLevel.String.md) + - : Returns the manufacturer sku of the product variant. + + + If the variant does not define an own value for 'manufacturerSKU', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'manufacturerSKU', the value of + the master product is returned. + + + **Returns:** + - The manufacturer sku of the variant, variation group or master + + +--- + +### getMasterProduct() +- getMasterProduct(): [Product](dw.catalog.Product.md) + - : Returns the ProductMaster for this mastered product. + + **Returns:** + - the ProductMaster of this mastered product + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the product variant. + + + If the variant does not define an own value for 'name', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'name', the value of + the master product is returned. + + + **Returns:** + - The name of the variant, variation group or master + + +--- + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the onlineFrom date of the product variant. + + + If the variant does not define an own value for 'onlineFrom', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'onlineFrom', the value of + the master product is returned. + + + **Returns:** + - The onlineFrom date of the variant, variation group or master + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the onlineTo date of the product variant. + + + If the variant does not define an own value for 'onlineTo', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'onlineTo', the value of + the master product is returned. + + + **Returns:** + - The onlineTo date of the variant, variation group or master + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the pageDescription of the product variant. + + + If the variant does not define an own value for 'pageDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageDescription', the value of + the master product is returned. + + + **Returns:** + - The pageDescription of the variant, variation group or master + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the pageKeywords of the product variant. + + + If the variant does not define an own value for 'pageKeywords', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageKeywords', the value of + the master product is returned. + + + **Returns:** + - The pageKeywords of the variant, variation group or master + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the pageTitle of the product variant. + + + If the variant does not define an own value for 'pageTitle', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageTitle', the value of + the master product is returned. + + + **Returns:** + - The pageTitle of the variant, variation group or master + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the pageURL of the product variant. + + + If the variant does not define an own value for 'pageURL', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'pageURL', the value of + the master product is returned. + + + **Returns:** + - The pageURL of the variant, variation group or master + + +--- + +### getProductLinks() +- getProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all product links of the product variant for which the target + product is assigned to the current site catalog. + + + If the variant does not define any product links, the product links are retrieved + from the assigned variation groups, sorted by their position + + If none of the variation groups define any product links, the product links are retrieved + from the master product. + + + **Returns:** + - Product links of the variant, variation group or master + + +--- + +### getProductLinks(Number) +- getProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all product links of the specified type of the product variant + for which the target product is assigned to the current site catalog. + + + If the variant does not define any product links of the specified type, + the product links are retrieved for the specified type from the assigned + variation groups, sorted by their position + + If none of the variation groups define any product links of the specified type, + the product links are retrieved for the specified type from the master product. + + + **Parameters:** + - type - Type of the product link + + **Returns:** + - Product links of specified type of the variant, variation group or master + + +--- + +### getRecommendations(Number) +- getRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Retrieve the sorted collection of recommendations of the specified type + for this product variant. The types (cross-sell, up-sell, etc) are + enumerated in the `dw.catalog.Recommendation` class. Only + recommendations which are stored in the current site catalog are returned. + Furthermore, a recommendation is only returned if the target of the + recommendation is assigned to the current site catalog. + + + + If the variant does not define any recommendations, recommendations are + retrieved from the assigned variation groups, sorted by their position. + + If none of the variation groups define any recommendations, the recommendations + of the master are returned. + + + **Parameters:** + - type - the recommendation type + + **Returns:** + - the sorted collection, never null but possibly empty. + + +--- + +### getShortDescription() +- getShortDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the short description of the product variant. + + + If the variant does not define an own value for 'shortDescription', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'shortDescription', the value of + the master product is returned. + + + **Returns:** + - The short description of the variant, variation group or master + + +--- + +### getTaxClassID() +- getTaxClassID(): [String](TopLevel.String.md) + - : Returns the tax class id of the product variant. + + + If the variant does not define an own value for 'taxClassID', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'taxClassID', the value of + the master product is returned. + + + **Returns:** + - The tax class id of the variant, variation group or master + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the rendering template name of the product variant. + + + If the variant does not define an own value for 'template', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'template', the value of + the master product is returned. + + + **Returns:** + - The rendering template name of the variant, variation group or master + + +--- + +### getThumbnail() +- getThumbnail(): [MediaFile](dw.content.MediaFile.md) + - : Returns the thumbnail image of the product variant. + + + If the variant does not define an own value for 'thumbnail', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'thumbnail', the value of + the master product is returned. + + + **Returns:** + - The thumbnail image of the variant, variation group or master + + +--- + +### getUPC() +- getUPC(): [String](TopLevel.String.md) + - : Returns the UPC of the product variant. + + + If the variant does not define an own value for 'UPC', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'UPC', the value of + the master product is returned. + + + **Returns:** + - The UPC of the variant, variation group or master + + +--- + +### getUnit() +- getUnit(): [String](TopLevel.String.md) + - : Returns the sales unit of the product variant as defined by the + master product. + + + If the variant does not define an own value for 'unit', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'unit', the value of + the master product is returned. + + + **Returns:** + - The sales unit of the variant, variation group or master + + +--- + +### getUnitQuantity() +- getUnitQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the unitQuantity of the product variant as defined by the + master product. + + + If the variant does not define an own value for 'unitQuantity', the value is retrieved + from the assigned variation groups, sorted by their position. + + If none of the variation groups define a value for 'unitQuantity', the value of + the master product is returned. + + + **Returns:** + - The unitQuantity of the variant, variation group or master + + +--- + +### isOptionProduct() +- isOptionProduct(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the variant has any options, otherwise 'false'. + Method also returns 'true' if the variant has not any options, + but the related variation groups (sorted by position) or + master product has options. + + + **Returns:** + - true if the variant has any options, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.VariationGroup.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.VariationGroup.md new file mode 100644 index 00000000..b43ee395 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.VariationGroup.md @@ -0,0 +1,869 @@ + +# Class VariationGroup + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.Product](dw.catalog.Product.md) + - [dw.catalog.VariationGroup](dw.catalog.VariationGroup.md) + +Class representing a group of variants within a master product who share a +common value for one or more variation attribute values. Variation groups are +used to simplify merchandising of products. + + +From a more technical perspective, variation groups are defined by two things: + + +- A relation to a master product. +- A set of variation attributes which have fixed values. + +A variant of the related master product is considered in the group if and +only if it matches on the fixed variation attribute values. + + +Similar to a Variant, a VariationGroup does a fallback to the master product +for all attributes (name, description, etc) and relations (recommendations, +etc). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [EAN](#ean): [String](TopLevel.String.md) `(read-only)` | Returns the EAN of the product variation group. | +| [UPC](#upc): [String](TopLevel.String.md) `(read-only)` | Returns the UPC of the product variation group. | +| [allProductLinks](#allproductlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product links of the product variation group. | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the brand of the product variation group. | +| [classificationCategory](#classificationcategory): [Category](dw.catalog.Category.md) `(read-only)` | Returns the classification category of the product variation group. | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes of the variation group. | +| [image](#image): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the image of the product variation group. | +| [longDescription](#longdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the long description of the product variation group. | +| [manufacturerName](#manufacturername): [String](TopLevel.String.md) `(read-only)` | Returns the manufacturer name of the product variation group. | +| [manufacturerSKU](#manufacturersku): [String](TopLevel.String.md) `(read-only)` | Returns the manufacturer sku of the product variation group. | +| [masterProduct](#masterproduct): [Product](dw.catalog.Product.md) `(read-only)` | Returns the ProductMaster for this mastered product. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the product variation group. | +| [onlineFrom](#onlinefrom): [Date](TopLevel.Date.md) `(read-only)` | Returns the onlineFrom date of the product variation group. | +| [onlineTo](#onlineto): [Date](TopLevel.Date.md) `(read-only)` | Returns the onlineTo date of the product variation group. | +| [optionProduct](#optionproduct): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns 'true' if the variation group has any options, otherwise 'false'. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the pageDescription of the product variation group. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the pageKeywords of the product variation group. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the pageTitle of the product variation group. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the pageURL of the product variation group. | +| [productLinks](#productlinks): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product links of the product variation group for which the target product is assigned to the current site catalog. | +| [shortDescription](#shortdescription): [MarkupText](dw.content.MarkupText.md) `(read-only)` | Returns the short description of the product variation group. | +| [taxClassID](#taxclassid): [String](TopLevel.String.md) `(read-only)` | Returns the tax class id of the product variation group. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the rendering template name of the product variation group. | +| [thumbnail](#thumbnail): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the thumbnail image of the product variation group. | +| [unit](#unit): [String](TopLevel.String.md) `(read-only)` | Returns the sales unit of the product variation group as defined by the master product. | +| [unitQuantity](#unitquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the unitQuantity of the product variation group as defined by the master product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllProductLinks](dw.catalog.VariationGroup.md#getallproductlinks)() | Returns all product links of the product variation group. | +| [getAllProductLinks](dw.catalog.VariationGroup.md#getallproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all product links of the specified type of the product variation group. | +| [getBrand](dw.catalog.VariationGroup.md#getbrand)() | Returns the brand of the product variation group. | +| [getClassificationCategory](dw.catalog.VariationGroup.md#getclassificationcategory)() | Returns the classification category of the product variation group. | +| [getCustom](dw.catalog.VariationGroup.md#getcustom)() | Returns the custom attributes of the variation group. | +| [getEAN](dw.catalog.VariationGroup.md#getean)() | Returns the EAN of the product variation group. | +| [getImage](dw.catalog.VariationGroup.md#getimage)() | Returns the image of the product variation group. | +| [getLongDescription](dw.catalog.VariationGroup.md#getlongdescription)() | Returns the long description of the product variation group. | +| [getManufacturerName](dw.catalog.VariationGroup.md#getmanufacturername)() | Returns the manufacturer name of the product variation group. | +| [getManufacturerSKU](dw.catalog.VariationGroup.md#getmanufacturersku)() | Returns the manufacturer sku of the product variation group. | +| [getMasterProduct](dw.catalog.VariationGroup.md#getmasterproduct)() | Returns the ProductMaster for this mastered product. | +| [getName](dw.catalog.VariationGroup.md#getname)() | Returns the name of the product variation group. | +| [getOnlineFrom](dw.catalog.VariationGroup.md#getonlinefrom)() | Returns the onlineFrom date of the product variation group. | +| [getOnlineTo](dw.catalog.VariationGroup.md#getonlineto)() | Returns the onlineTo date of the product variation group. | +| [getPageDescription](dw.catalog.VariationGroup.md#getpagedescription)() | Returns the pageDescription of the product variation group. | +| [getPageKeywords](dw.catalog.VariationGroup.md#getpagekeywords)() | Returns the pageKeywords of the product variation group. | +| [getPageTitle](dw.catalog.VariationGroup.md#getpagetitle)() | Returns the pageTitle of the product variation group. | +| [getPageURL](dw.catalog.VariationGroup.md#getpageurl)() | Returns the pageURL of the product variation group. | +| [getProductLinks](dw.catalog.VariationGroup.md#getproductlinks)() | Returns all product links of the product variation group for which the target product is assigned to the current site catalog. | +| [getProductLinks](dw.catalog.VariationGroup.md#getproductlinksnumber)([Number](TopLevel.Number.md)) | Returns all product links of the specified type of the product variation group for which the target product is assigned to the current site catalog. | +| [getRecommendations](dw.catalog.VariationGroup.md#getrecommendationsnumber)([Number](TopLevel.Number.md)) | Retrieve the sorted collection of recommendations of the specified type for this product variation group. | +| [getShortDescription](dw.catalog.VariationGroup.md#getshortdescription)() | Returns the short description of the product variation group. | +| [getTaxClassID](dw.catalog.VariationGroup.md#gettaxclassid)() | Returns the tax class id of the product variation group. | +| [getTemplate](dw.catalog.VariationGroup.md#gettemplate)() | Returns the rendering template name of the product variation group. | +| [getThumbnail](dw.catalog.VariationGroup.md#getthumbnail)() | Returns the thumbnail image of the product variation group. | +| [getUPC](dw.catalog.VariationGroup.md#getupc)() | Returns the UPC of the product variation group. | +| [getUnit](dw.catalog.VariationGroup.md#getunit)() | Returns the sales unit of the product variation group as defined by the master product. | +| [getUnitQuantity](dw.catalog.VariationGroup.md#getunitquantity)() | Returns the unitQuantity of the product variation group as defined by the master product. | +| [isOptionProduct](dw.catalog.VariationGroup.md#isoptionproduct)() | Returns 'true' if the variation group has any options, otherwise 'false'. | + +### Methods inherited from class Product + +[assignedToCategory](dw.catalog.Product.md#assignedtocategorycategory), [getActiveData](dw.catalog.Product.md#getactivedata), [getAllCategories](dw.catalog.Product.md#getallcategories), [getAllCategoryAssignments](dw.catalog.Product.md#getallcategoryassignments), [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinks), [getAllIncomingProductLinks](dw.catalog.Product.md#getallincomingproductlinksnumber), [getAllProductLinks](dw.catalog.Product.md#getallproductlinks), [getAllProductLinks](dw.catalog.Product.md#getallproductlinksnumber), [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog), [getAllRecommendations](dw.catalog.Product.md#getallrecommendationscatalog-number), [getAttributeModel](dw.catalog.Product.md#getattributemodel), [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodel), [getAvailabilityModel](dw.catalog.Product.md#getavailabilitymodelproductinventorylist), [getAvailableFlag](dw.catalog.Product.md#getavailableflag), [getBrand](dw.catalog.Product.md#getbrand), [getBundledProductQuantity](dw.catalog.Product.md#getbundledproductquantityproduct), [getBundledProducts](dw.catalog.Product.md#getbundledproducts), [getBundles](dw.catalog.Product.md#getbundles), [getCategories](dw.catalog.Product.md#getcategories), [getCategoryAssignment](dw.catalog.Product.md#getcategoryassignmentcategory), [getCategoryAssignments](dw.catalog.Product.md#getcategoryassignments), [getClassificationCategory](dw.catalog.Product.md#getclassificationcategory), [getEAN](dw.catalog.Product.md#getean), [getID](dw.catalog.Product.md#getid), [getImage](dw.catalog.Product.md#getimage), [getImage](dw.catalog.Product.md#getimagestring), [getImage](dw.catalog.Product.md#getimagestring-number), [getImages](dw.catalog.Product.md#getimagesstring), [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinks), [getIncomingProductLinks](dw.catalog.Product.md#getincomingproductlinksnumber), [getLongDescription](dw.catalog.Product.md#getlongdescription), [getManufacturerName](dw.catalog.Product.md#getmanufacturername), [getManufacturerSKU](dw.catalog.Product.md#getmanufacturersku), [getMinOrderQuantity](dw.catalog.Product.md#getminorderquantity), [getName](dw.catalog.Product.md#getname), [getOnlineCategories](dw.catalog.Product.md#getonlinecategories), [getOnlineFlag](dw.catalog.Product.md#getonlineflag), [getOnlineFrom](dw.catalog.Product.md#getonlinefrom), [getOnlineTo](dw.catalog.Product.md#getonlineto), [getOptionModel](dw.catalog.Product.md#getoptionmodel), [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendations), [getOrderableRecommendations](dw.catalog.Product.md#getorderablerecommendationsnumber), [getPageDescription](dw.catalog.Product.md#getpagedescription), [getPageKeywords](dw.catalog.Product.md#getpagekeywords), [getPageMetaTag](dw.catalog.Product.md#getpagemetatagstring), [getPageMetaTags](dw.catalog.Product.md#getpagemetatags), [getPageTitle](dw.catalog.Product.md#getpagetitle), [getPageURL](dw.catalog.Product.md#getpageurl), [getPriceModel](dw.catalog.Product.md#getpricemodel), [getPriceModel](dw.catalog.Product.md#getpricemodelproductoptionmodel), [getPrimaryCategory](dw.catalog.Product.md#getprimarycategory), [getPrimaryCategoryAssignment](dw.catalog.Product.md#getprimarycategoryassignment), [getProductLinks](dw.catalog.Product.md#getproductlinks), [getProductLinks](dw.catalog.Product.md#getproductlinksnumber), [getProductSetProducts](dw.catalog.Product.md#getproductsetproducts), [getProductSets](dw.catalog.Product.md#getproductsets), [getRecommendations](dw.catalog.Product.md#getrecommendations), [getRecommendations](dw.catalog.Product.md#getrecommendationsnumber), [getSearchPlacement](dw.catalog.Product.md#getsearchplacement), [getSearchRank](dw.catalog.Product.md#getsearchrank), [getSearchableFlag](dw.catalog.Product.md#getsearchableflag), [getSearchableIfUnavailableFlag](dw.catalog.Product.md#getsearchableifunavailableflag), [getShortDescription](dw.catalog.Product.md#getshortdescription), [getSiteMapChangeFrequency](dw.catalog.Product.md#getsitemapchangefrequency), [getSiteMapIncluded](dw.catalog.Product.md#getsitemapincluded), [getSiteMapPriority](dw.catalog.Product.md#getsitemappriority), [getStepQuantity](dw.catalog.Product.md#getstepquantity), [getStoreReceiptName](dw.catalog.Product.md#getstorereceiptname), [getStoreTaxClass](dw.catalog.Product.md#getstoretaxclass), [getTaxClassID](dw.catalog.Product.md#gettaxclassid), [getTemplate](dw.catalog.Product.md#gettemplate), [getThumbnail](dw.catalog.Product.md#getthumbnail), [getUPC](dw.catalog.Product.md#getupc), [getUnit](dw.catalog.Product.md#getunit), [getUnitQuantity](dw.catalog.Product.md#getunitquantity), [getVariants](dw.catalog.Product.md#getvariants), [getVariationGroups](dw.catalog.Product.md#getvariationgroups), [getVariationModel](dw.catalog.Product.md#getvariationmodel), [includedInBundle](dw.catalog.Product.md#includedinbundleproduct), [isAssignedToCategory](dw.catalog.Product.md#isassignedtocategorycategory), [isAssignedToSiteCatalog](dw.catalog.Product.md#isassignedtositecatalog), [isAvailable](dw.catalog.Product.md#isavailable), [isBundle](dw.catalog.Product.md#isbundle), [isBundled](dw.catalog.Product.md#isbundled), [isCategorized](dw.catalog.Product.md#iscategorized), [isFacebookEnabled](dw.catalog.Product.md#isfacebookenabled), [isMaster](dw.catalog.Product.md#ismaster), [isOnline](dw.catalog.Product.md#isonline), [isOptionProduct](dw.catalog.Product.md#isoptionproduct), [isPinterestEnabled](dw.catalog.Product.md#ispinterestenabled), [isProduct](dw.catalog.Product.md#isproduct), [isProductSet](dw.catalog.Product.md#isproductset), [isProductSetProduct](dw.catalog.Product.md#isproductsetproduct), [isRetailSet](dw.catalog.Product.md#isretailset), [isSearchable](dw.catalog.Product.md#issearchable), [isSiteProduct](dw.catalog.Product.md#issiteproduct), [isVariant](dw.catalog.Product.md#isvariant), [isVariationGroup](dw.catalog.Product.md#isvariationgroup), [setAvailableFlag](dw.catalog.Product.md#setavailableflagboolean), [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-1), [setOnlineFlag](dw.catalog.Product.md#setonlineflagboolean---variant-2), [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-1), [setSearchPlacement](dw.catalog.Product.md#setsearchplacementnumber---variant-2), [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-1), [setSearchRank](dw.catalog.Product.md#setsearchranknumber---variant-2), [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-1), [setSearchableFlag](dw.catalog.Product.md#setsearchableflagboolean---variant-2) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### EAN +- EAN: [String](TopLevel.String.md) `(read-only)` + - : Returns the EAN of the product variation group. + + + If the variation group does not define an own value for 'EAN', the value of + the master product is returned. + + + +--- + +### UPC +- UPC: [String](TopLevel.String.md) `(read-only)` + - : Returns the UPC of the product variation group. + + + If the variation group does not define an own value for 'UPC', the value of + the master product is returned. + + + +--- + +### allProductLinks +- allProductLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product links of the product variation group. + + + If the variation group does not define any product links, but the master product + does, the product links of the master are returned. + + + +--- + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the brand of the product variation group. + + + If the variation group does not define an own value for 'brand', the value of + the master product is returned. + + + +--- + +### classificationCategory +- classificationCategory: [Category](dw.catalog.Category.md) `(read-only)` + - : Returns the classification category of the product variation group. + + + **Please note** that the classification category is always inherited + from the master and cannot be overridden by the variation group. + + + +--- + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes of the variation group. + + + Custom attributes are inherited from the master product and can + be overridden by the variation group. + + + +--- + +### image +- image: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the image of the product variation group. + + + If the variation group does not define an own value for 'image', the value of + the master product is returned. + + + +--- + +### longDescription +- longDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the long description of the product variation group. + + + If the variation group does not define an own value for 'longDescription', the value of + the master product is returned. + + + +--- + +### manufacturerName +- manufacturerName: [String](TopLevel.String.md) `(read-only)` + - : Returns the manufacturer name of the product variation group. + + + If the variation group does not define an own value for 'manufacturerName', the value of + the master product is returned. + + + +--- + +### manufacturerSKU +- manufacturerSKU: [String](TopLevel.String.md) `(read-only)` + - : Returns the manufacturer sku of the product variation group. + + + If the variation group does not define an own value for 'manufacturerSKU', the value of + the master product is returned. + + + +--- + +### masterProduct +- masterProduct: [Product](dw.catalog.Product.md) `(read-only)` + - : Returns the ProductMaster for this mastered product. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the product variation group. + + + If the variation group does not define an own value for 'name', the value of + the master product is returned. + + + +--- + +### onlineFrom +- onlineFrom: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the onlineFrom date of the product variation group. + + + If the variation group does not define an own value for 'onlineFrom', the value of + the master product is returned. + + + +--- + +### onlineTo +- onlineTo: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the onlineTo date of the product variation group. + + + If the variation group does not define an own value for 'onlineTo', the value of + the master product is returned. + + + +--- + +### optionProduct +- optionProduct: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns 'true' if the variation group has any options, otherwise 'false'. + Method also returns 'true' if the variation group has not any options, + but the related master product has options. + + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageDescription of the product variation group. + + + If the variation group does not define an own value for 'pageDescription', the value of + the master product is returned. + + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageKeywords of the product variation group. + + + If the variation group does not define an own value for 'pageKeywords', the value of + the master product is returned. + + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageTitle of the product variation group. + + + If the variation group does not define an own value for 'pageTitle', the value of + the master product is returned. + + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the pageURL of the product variation group. + + + If the variation group does not define an own value for 'pageURL', the value of + the master product is returned. + + + +--- + +### productLinks +- productLinks: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product links of the product variation group for which the target + product is assigned to the current site catalog. + + + If the variation group does not define any product links, but the master product + does, the product links of the master are returned. + + + +--- + +### shortDescription +- shortDescription: [MarkupText](dw.content.MarkupText.md) `(read-only)` + - : Returns the short description of the product variation group. + + + If the variation group does not define an own value for 'shortDescription', the value of + the master product is returned. + + + +--- + +### taxClassID +- taxClassID: [String](TopLevel.String.md) `(read-only)` + - : Returns the tax class id of the product variation group. + + + If the variation group does not define an own value for 'taxClassID', the value of + the master product is returned. + + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the rendering template name of the product variation group. + + + If the variation group does not define an own value for 'template', the value of + the master product is returned. + + + +--- + +### thumbnail +- thumbnail: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the thumbnail image of the product variation group. + + + If the variation group does not define an own value for 'thumbnailImage', the value of + the master product is returned. + + + +--- + +### unit +- unit: [String](TopLevel.String.md) `(read-only)` + - : Returns the sales unit of the product variation group as defined by the + master product. + + + If the variation group does not define an own value for 'unit', the value of + the master product is returned. + + + +--- + +### unitQuantity +- unitQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the unitQuantity of the product variation group as defined by the + master product. + + + If the variation group does not define an own value for 'unitQuantity', the value of + the master product is returned. + + + +--- + +## Method Details + +### getAllProductLinks() +- getAllProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all product links of the product variation group. + + + If the variation group does not define any product links, but the master product + does, the product links of the master are returned. + + + **Returns:** + - All product links of the variation group or master + + +--- + +### getAllProductLinks(Number) +- getAllProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all product links of the specified type of the product variation group. + + + If the variation group does not define any product links, but the master product + does, the product links of the master are returned. + + + **Parameters:** + - type - Type of the product link + + **Returns:** + - Product links of specified type of the variation group or master + + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the brand of the product variation group. + + + If the variation group does not define an own value for 'brand', the value of + the master product is returned. + + + **Returns:** + - The brand of the variation group or master + + +--- + +### getClassificationCategory() +- getClassificationCategory(): [Category](dw.catalog.Category.md) + - : Returns the classification category of the product variation group. + + + **Please note** that the classification category is always inherited + from the master and cannot be overridden by the variation group. + + + **Returns:** + - The classification category as defined for the master product of the variation group + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes of the variation group. + + + Custom attributes are inherited from the master product and can + be overridden by the variation group. + + + **Returns:** + - the custom attributes of the variation group. + + +--- + +### getEAN() +- getEAN(): [String](TopLevel.String.md) + - : Returns the EAN of the product variation group. + + + If the variation group does not define an own value for 'EAN', the value of + the master product is returned. + + + **Returns:** + - The EAN of the variation group or master + + +--- + +### getImage() +- getImage(): [MediaFile](dw.content.MediaFile.md) + - : Returns the image of the product variation group. + + + If the variation group does not define an own value for 'image', the value of + the master product is returned. + + + **Returns:** + - The image of the variation group or master + + +--- + +### getLongDescription() +- getLongDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the long description of the product variation group. + + + If the variation group does not define an own value for 'longDescription', the value of + the master product is returned. + + + **Returns:** + - The long description name of the variation group or master + + +--- + +### getManufacturerName() +- getManufacturerName(): [String](TopLevel.String.md) + - : Returns the manufacturer name of the product variation group. + + + If the variation group does not define an own value for 'manufacturerName', the value of + the master product is returned. + + + **Returns:** + - The manufacturer name of the variation group or master + + +--- + +### getManufacturerSKU() +- getManufacturerSKU(): [String](TopLevel.String.md) + - : Returns the manufacturer sku of the product variation group. + + + If the variation group does not define an own value for 'manufacturerSKU', the value of + the master product is returned. + + + **Returns:** + - The manufacturer sku of the variation group or master + + +--- + +### getMasterProduct() +- getMasterProduct(): [Product](dw.catalog.Product.md) + - : Returns the ProductMaster for this mastered product. + + **Returns:** + - the ProductMaster of this mastered product + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the product variation group. + + + If the variation group does not define an own value for 'name', the value of + the master product is returned. + + + **Returns:** + - The name of the variation group or master + + +--- + +### getOnlineFrom() +- getOnlineFrom(): [Date](TopLevel.Date.md) + - : Returns the onlineFrom date of the product variation group. + + + If the variation group does not define an own value for 'onlineFrom', the value of + the master product is returned. + + + **Returns:** + - The onlineFrom date of the variation group or master + + +--- + +### getOnlineTo() +- getOnlineTo(): [Date](TopLevel.Date.md) + - : Returns the onlineTo date of the product variation group. + + + If the variation group does not define an own value for 'onlineTo', the value of + the master product is returned. + + + **Returns:** + - The onlineTo date of the variation group or master + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the pageDescription of the product variation group. + + + If the variation group does not define an own value for 'pageDescription', the value of + the master product is returned. + + + **Returns:** + - The pageDescription of the variation group or master + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the pageKeywords of the product variation group. + + + If the variation group does not define an own value for 'pageKeywords', the value of + the master product is returned. + + + **Returns:** + - The pageKeywords of the variation group or master + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the pageTitle of the product variation group. + + + If the variation group does not define an own value for 'pageTitle', the value of + the master product is returned. + + + **Returns:** + - The pageTitle of the variation group or master + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the pageURL of the product variation group. + + + If the variation group does not define an own value for 'pageURL', the value of + the master product is returned. + + + **Returns:** + - The pageURL of the variation group or master + + +--- + +### getProductLinks() +- getProductLinks(): [Collection](dw.util.Collection.md) + - : Returns all product links of the product variation group for which the target + product is assigned to the current site catalog. + + + If the variation group does not define any product links, but the master product + does, the product links of the master are returned. + + + **Returns:** + - Product links of the variation group or master + + +--- + +### getProductLinks(Number) +- getProductLinks(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns all product links of the specified type of the product variation group + for which the target product is assigned to the current site catalog. + + + If the variation group does not define any product links of the specified type, + but the master product does, the product links of the master are returned. + + + **Parameters:** + - type - Type of the product link + + **Returns:** + - Product links of specified type of the variation group or master + + +--- + +### getRecommendations(Number) +- getRecommendations(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Retrieve the sorted collection of recommendations of the specified type + for this product variation group. The types (cross-sell, up-sell, etc) are + enumerated in the `dw.catalog.Recommendation` class. Only + recommendations which are stored in the current site catalog are returned. + Furthermore, a recommendation is only returned if the target of the + recommendation is assigned to the current site catalog. + + + If the variation group does not define any recommendations, but the master + product does, the recommendations of the master are returned. + + + **Parameters:** + - type - the recommendation type + + **Returns:** + - the sorted collection, never null but possibly empty. + + +--- + +### getShortDescription() +- getShortDescription(): [MarkupText](dw.content.MarkupText.md) + - : Returns the short description of the product variation group. + + + If the variation group does not define an own value for 'shortDescription', the value of + the master product is returned. + + + **Returns:** + - The short description name of the variation group or master + + +--- + +### getTaxClassID() +- getTaxClassID(): [String](TopLevel.String.md) + - : Returns the tax class id of the product variation group. + + + If the variation group does not define an own value for 'taxClassID', the value of + the master product is returned. + + + **Returns:** + - The tax class id of the variation group or master + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the rendering template name of the product variation group. + + + If the variation group does not define an own value for 'template', the value of + the master product is returned. + + + **Returns:** + - The rendering template name of the variation group or master + + +--- + +### getThumbnail() +- getThumbnail(): [MediaFile](dw.content.MediaFile.md) + - : Returns the thumbnail image of the product variation group. + + + If the variation group does not define an own value for 'thumbnailImage', the value of + the master product is returned. + + + **Returns:** + - The thumbnail image of the variation group or master + + +--- + +### getUPC() +- getUPC(): [String](TopLevel.String.md) + - : Returns the UPC of the product variation group. + + + If the variation group does not define an own value for 'UPC', the value of + the master product is returned. + + + **Returns:** + - The UPC of the variation group or master + + +--- + +### getUnit() +- getUnit(): [String](TopLevel.String.md) + - : Returns the sales unit of the product variation group as defined by the + master product. + + + If the variation group does not define an own value for 'unit', the value of + the master product is returned. + + + **Returns:** + - The sales unit of the variation group or master + + +--- + +### getUnitQuantity() +- getUnitQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the unitQuantity of the product variation group as defined by the + master product. + + + If the variation group does not define an own value for 'unitQuantity', the value of + the master product is returned. + + + **Returns:** + - The unitQuantity of the variation group or master + + +--- + +### isOptionProduct() +- isOptionProduct(): [Boolean](TopLevel.Boolean.md) + - : Returns 'true' if the variation group has any options, otherwise 'false'. + Method also returns 'true' if the variation group has not any options, + but the related master product has options. + + + **Returns:** + - true if the variation group has any options, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.catalog.md b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.md new file mode 100644 index 00000000..4939fc6c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.catalog.md @@ -0,0 +1,50 @@ +# Package dw.catalog + +## Classes +| Class | Description | +| --- | --- | +| [Catalog](dw.catalog.Catalog.md) | Represents a Commerce Cloud Digital Catalog. | +| [CatalogMgr](dw.catalog.CatalogMgr.md) | Provides helper methods for getting categories. | +| [Category](dw.catalog.Category.md) | Represents a category in a product catalog. | +| [CategoryAssignment](dw.catalog.CategoryAssignment.md) | Represents a category assignment in Commerce Cloud Digital. | +| [CategoryLink](dw.catalog.CategoryLink.md) | A CategoryLink represents a directed relationship between two catalog categories. | +| [PriceBook](dw.catalog.PriceBook.md) | Represents a price book. | +| [PriceBookMgr](dw.catalog.PriceBookMgr.md) | Price book manager provides methods to access price books. | +| [Product](dw.catalog.Product.md) | Represents a product in Commerce Cloud Digital. | +| [ProductActiveData](dw.catalog.ProductActiveData.md) | Represents the active data for a [Product](dw.catalog.Product.md) in Commerce Cloud Digital. | +| [ProductAttributeModel](dw.catalog.ProductAttributeModel.md) | Class representing the complete attribute model for products in the system. | +| [ProductAvailabilityLevels](dw.catalog.ProductAvailabilityLevels.md) | Encapsulates the quantity of items available for each availability status. | +| [ProductAvailabilityModel](dw.catalog.ProductAvailabilityModel.md) | The ProductAvailabilityModel provides methods for retrieving all information on availability of a single product. | +| [ProductInventoryList](dw.catalog.ProductInventoryList.md) | The ProductInventoryList provides access to ID, description and defaultInStockFlag of the list. | +| [ProductInventoryMgr](dw.catalog.ProductInventoryMgr.md) | This manager provides access to inventory-related objects. | +| [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md) | The ProductInventoryRecord holds information about a Product's inventory, and availability. | +| [ProductLink](dw.catalog.ProductLink.md) | The class represents a link between two products. | +| [ProductMgr](dw.catalog.ProductMgr.md) | Provides helper methods for getting products based on Product ID or [Catalog](dw.catalog.Catalog.md). | +| [ProductOption](dw.catalog.ProductOption.md) | Represents a product option. | +| [ProductOptionModel](dw.catalog.ProductOptionModel.md) | This class represents the option model of a specific product and for a specific currency. | +| [ProductOptionValue](dw.catalog.ProductOptionValue.md) | Represents the value of a product option. | +| [ProductPriceInfo](dw.catalog.ProductPriceInfo.md) | Simple class representing a product price point. | +| [ProductPriceModel](dw.catalog.ProductPriceModel.md) | ProductPriceModel provides methods to access all the [PriceBook](dw.catalog.PriceBook.md) information of a product. | +| [ProductPriceTable](dw.catalog.ProductPriceTable.md) | A ProductPriceTable is a map of quantities to prices representing the potentially tiered prices of a product in Commerce Cloud Digital. | +| [ProductSearchHit](dw.catalog.ProductSearchHit.md) | ProductSearchHit is the result of a executed search query and wraps the actual product found by the search. | +| [ProductSearchModel](dw.catalog.ProductSearchModel.md) | The class is the central interface to a product search result and a product search refinement. | +| [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md) | This class provides an interface to refinement options for the product search. | +| [ProductSearchRefinements](dw.catalog.ProductSearchRefinements.md) | This class provides an interface to refinement options for the product search. | +| [ProductSearchRefinementValue](dw.catalog.ProductSearchRefinementValue.md) | Represents the value of a product search refinement. | +| [ProductVariationAttribute](dw.catalog.ProductVariationAttribute.md) | Represents a product variation attribute | +| [ProductVariationAttributeValue](dw.catalog.ProductVariationAttributeValue.md) | Represents a product variation attribute | +| [ProductVariationModel](dw.catalog.ProductVariationModel.md) | Class representing the complete variation information for a master product in the system. | +| [Recommendation](dw.catalog.Recommendation.md) | Represents a recommendation in Commerce Cloud Digital. | +| [SearchModel](dw.catalog.SearchModel.md) | Common search model base class. | +| [SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md) | Common search refinement definition base class. | +| [SearchRefinements](dw.catalog.SearchRefinements.md) | Common search refinements base class. | +| [SearchRefinementValue](dw.catalog.SearchRefinementValue.md) | Represents the value of a product or content search refinement. | +| [SortingOption](dw.catalog.SortingOption.md) | Represents an option for how to sort products in storefront search results. | +| [SortingRule](dw.catalog.SortingRule.md) | Represents a product sorting rule for use with the [ProductSearchModel](dw.catalog.ProductSearchModel.md). | +| [Store](dw.catalog.Store.md) | Represents a store in Commerce Cloud Digital. | +| [StoreGroup](dw.catalog.StoreGroup.md) | Represents a store group. | +| [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) |

    This class represents a store inventory filter, which can be used at [ProductSearchModel.setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter) to filter the search result by one or more store inventories. | +| [StoreInventoryFilterValue](dw.catalog.StoreInventoryFilterValue.md) |

    This class represents a store inventory filter value, which can be used for a [StoreInventoryFilter](dw.catalog.StoreInventoryFilter.md) to filter the search result by one or more store inventory list IDs via [ProductSearchModel.setStoreInventoryFilter(StoreInventoryFilter)](dw.catalog.ProductSearchModel.md#setstoreinventoryfilterstoreinventoryfilter). | +| [StoreMgr](dw.catalog.StoreMgr.md) | Provides helper methods for getting stores based on id and querying for stores based on geolocation. | +| [Variant](dw.catalog.Variant.md) | Represents a variant of a product variation. | +| [VariationGroup](dw.catalog.VariationGroup.md) | Class representing a group of variants within a master product who share a common value for one or more variation attribute values. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.Content.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.Content.md new file mode 100644 index 00000000..6aca4c7c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.Content.md @@ -0,0 +1,481 @@ + +# Class Content + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.content.Content](dw.content.Content.md) + +Class representing a Content asset in Commerce Cloud Digital. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the content asset. | +| [classificationFolder](#classificationfolder): [Folder](dw.content.Folder.md) `(read-only)` | Returns the Folder associated with this Content. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description in the current locale or null. | +| [folders](#folders): [Collection](dw.util.Collection.md) `(read-only)` | Returns all folders to which this content is assigned. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the content asset. | +| [online](#online): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status of the content. | +| [onlineFlag](#onlineflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status flag of the content. | +| [page](#page): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns if the content is a [Page](dw.experience.Page.md) or not. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the page description for the content in the current locale or null if there is no page description. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the page keywords for the content in the current locale or null if there is no page title. | +| [pageMetaTags](#pagemetatags): [Array](TopLevel.Array.md) `(read-only)` | Returns all page meta tags, defined for this instance for which content can be generated. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the page title for the content in the current locale or null if there is no page title. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the page URL for the content in the current locale or null if there is no page URL. | +| [searchable](#searchable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the search status of the content. | +| [searchableFlag](#searchableflag): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns the online status flag of the content. | +| [siteMapChangeFrequency](#sitemapchangefrequency): [String](TopLevel.String.md) `(read-only)` | Returns the contents change frequency needed for the sitemap creation. | +| [siteMapIncluded](#sitemapincluded): [Number](TopLevel.Number.md) `(read-only)` | Returns the status if the content is included into the sitemap. | +| [siteMapPriority](#sitemappriority): [Number](TopLevel.Number.md) `(read-only)` | Returns the contents priority needed for the sitemap creation. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the value of attribute 'template'. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getClassificationFolder](dw.content.Content.md#getclassificationfolder)() | Returns the Folder associated with this Content. | +| [getDescription](dw.content.Content.md#getdescription)() | Returns the description in the current locale or null. | +| [getFolders](dw.content.Content.md#getfolders)() | Returns all folders to which this content is assigned. | +| [getID](dw.content.Content.md#getid)() | Returns the ID of the content asset. | +| [getName](dw.content.Content.md#getname)() | Returns the name of the content asset. | +| [getOnlineFlag](dw.content.Content.md#getonlineflag)() | Returns the online status flag of the content. | +| [getPageDescription](dw.content.Content.md#getpagedescription)() | Returns the page description for the content in the current locale or null if there is no page description. | +| [getPageKeywords](dw.content.Content.md#getpagekeywords)() | Returns the page keywords for the content in the current locale or null if there is no page title. | +| [getPageMetaTag](dw.content.Content.md#getpagemetatagstring)([String](TopLevel.String.md)) | Returns the page meta tag for the specified id. | +| [getPageMetaTags](dw.content.Content.md#getpagemetatags)() | Returns all page meta tags, defined for this instance for which content can be generated. | +| [getPageTitle](dw.content.Content.md#getpagetitle)() | Returns the page title for the content in the current locale or null if there is no page title. | +| [getPageURL](dw.content.Content.md#getpageurl)() | Returns the page URL for the content in the current locale or null if there is no page URL. | +| [getSearchableFlag](dw.content.Content.md#getsearchableflag)() | Returns the online status flag of the content. | +| [getSiteMapChangeFrequency](dw.content.Content.md#getsitemapchangefrequency)() | Returns the contents change frequency needed for the sitemap creation. | +| [getSiteMapIncluded](dw.content.Content.md#getsitemapincluded)() | Returns the status if the content is included into the sitemap. | +| [getSiteMapPriority](dw.content.Content.md#getsitemappriority)() | Returns the contents priority needed for the sitemap creation. | +| [getTemplate](dw.content.Content.md#gettemplate)() | Returns the value of attribute 'template'. | +| [isOnline](dw.content.Content.md#isonline)() | Returns the online status of the content. | +| [isPage](dw.content.Content.md#ispage)() | Returns if the content is a [Page](dw.experience.Page.md) or not. | +| [isSearchable](dw.content.Content.md#issearchable)() | Returns the search status of the content. | +| [toPage](dw.content.Content.md#topage)() | Converts the content into the [Page](dw.experience.Page.md) representation if [isPage()](dw.content.Content.md#ispage) yields true. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the content asset. + + +--- + +### classificationFolder +- classificationFolder: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the Folder associated with this Content. The folder is + used to determine the classification of the content. + + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description in the current locale or null. + + +--- + +### folders +- folders: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all folders to which this content is assigned. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the content asset. + + +--- + +### online +- online: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status of the content. + + +--- + +### onlineFlag +- onlineFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status flag of the content. + + +--- + +### page +- page: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns if the content is a [Page](dw.experience.Page.md) or not. + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the page description for the content in the current locale + or null if there is no page description. + + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the page keywords for the content in the current locale + or null if there is no page title. + + + +--- + +### pageMetaTags +- pageMetaTags: [Array](TopLevel.Array.md) `(read-only)` + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the content detail page meta tag context and rules. + The rules are obtained from the current content or inherited from the default folder, + up to the root folder. + + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the page title for the content in the current locale + or null if there is no page title. + + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the page URL for the content in the current locale + or null if there is no page URL. + + + +--- + +### searchable +- searchable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the search status of the content. + + +--- + +### searchableFlag +- searchableFlag: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns the online status flag of the content. + + +--- + +### siteMapChangeFrequency +- siteMapChangeFrequency: [String](TopLevel.String.md) `(read-only)` + - : Returns the contents change frequency needed for the sitemap creation. + + +--- + +### siteMapIncluded +- siteMapIncluded: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the status if the content is included into the sitemap. + + +--- + +### siteMapPriority +- siteMapPriority: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the contents priority needed for the sitemap creation. + If no priority is defined, the method returns 0.0. + + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the value of attribute 'template'. + + +--- + +## Method Details + +### getClassificationFolder() +- getClassificationFolder(): [Folder](dw.content.Folder.md) + - : Returns the Folder associated with this Content. The folder is + used to determine the classification of the content. + + + **Returns:** + - the classification Folder. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description in the current locale or null. + + **Returns:** + - the description in the current locale or null. + + +--- + +### getFolders() +- getFolders(): [Collection](dw.util.Collection.md) + - : Returns all folders to which this content is assigned. + + **Returns:** + - Collection of Folder objects. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the content asset. + + **Returns:** + - the ID of the content asset. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the content asset. + + **Returns:** + - the name of the content asset. + + +--- + +### getOnlineFlag() +- getOnlineFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status flag of the content. + + **Returns:** + - true if the content is online, false otherwise. + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the page description for the content in the current locale + or null if there is no page description. + + + **Returns:** + - the page description for the content in the current locale + or null if there is no page description. + + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the page keywords for the content in the current locale + or null if there is no page title. + + + **Returns:** + - the page keywords for the content in the current locale + or null if there is no page title. + + + +--- + +### getPageMetaTag(String) +- getPageMetaTag(id: [String](TopLevel.String.md)): [PageMetaTag](dw.web.PageMetaTag.md) + - : Returns the page meta tag for the specified id. + + + The meta tag content is generated based on the content detail page meta tag context and rule. + The rule is obtained from the current content or inherited from the default folder, + up to the root folder. + + + Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the + current context, or if the rule resolves to an empty string. + + + **Parameters:** + - id - the ID to get the page meta tag for + + **Returns:** + - page meta tag containing content generated based on rules + + +--- + +### getPageMetaTags() +- getPageMetaTags(): [Array](TopLevel.Array.md) + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the content detail page meta tag context and rules. + The rules are obtained from the current content or inherited from the default folder, + up to the root folder. + + + **Returns:** + - page meta tags defined for this instance, containing content generated based on rules + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the page title for the content in the current locale + or null if there is no page title. + + + **Returns:** + - the page title for the content in the current locale + or null if there is no page title. + + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the page URL for the content in the current locale + or null if there is no page URL. + + + **Returns:** + - the page URL for the content in the current locale + or null if there is no page URL. + + + +--- + +### getSearchableFlag() +- getSearchableFlag(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status flag of the content. + + **Returns:** + - true if the content is searchable, false otherwise. + + +--- + +### getSiteMapChangeFrequency() +- getSiteMapChangeFrequency(): [String](TopLevel.String.md) + - : Returns the contents change frequency needed for the sitemap creation. + + **Returns:** + - The contents sitemap change frequency. + + +--- + +### getSiteMapIncluded() +- getSiteMapIncluded(): [Number](TopLevel.Number.md) + - : Returns the status if the content is included into the sitemap. + + **Returns:** + - the value of the attribute 'siteMapIncluded' + + +--- + +### getSiteMapPriority() +- getSiteMapPriority(): [Number](TopLevel.Number.md) + - : Returns the contents priority needed for the sitemap creation. + If no priority is defined, the method returns 0.0. + + + **Returns:** + - The contents sitemap priority. + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the value of attribute 'template'. + + **Returns:** + - the value of the attribute 'template' + + +--- + +### isOnline() +- isOnline(): [Boolean](TopLevel.Boolean.md) + - : Returns the online status of the content. + + **Returns:** + - true if the content is online, false otherwise. + + +--- + +### isPage() +- isPage(): [Boolean](TopLevel.Boolean.md) + - : Returns if the content is a [Page](dw.experience.Page.md) or not. + + **Returns:** + - true if the content is a [Page](dw.experience.Page.md), false otherwise. + + +--- + +### isSearchable() +- isSearchable(): [Boolean](TopLevel.Boolean.md) + - : Returns the search status of the content. + + **Returns:** + - true if the content is searchable, false otherwise. + + +--- + +### toPage() +- toPage(): [Page](dw.experience.Page.md) + - : Converts the content into the [Page](dw.experience.Page.md) representation if [isPage()](dw.content.Content.md#ispage) yields true. + + **Returns:** + - the [Page](dw.experience.Page.md) representation of the content if it is a page, `null` otherwise. + + **See Also:** + - [PageMgr.getPage(String)](dw.experience.PageMgr.md#getpagestring) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentMgr.md new file mode 100644 index 00000000..f8e5b495 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentMgr.md @@ -0,0 +1,147 @@ + +# Class ContentMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.content.ContentMgr](dw.content.ContentMgr.md) + +Provides helper methods for getting content assets, library folders and the +content library of the current site. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [PRIVATE_LIBRARY](#private_library): [String](TopLevel.String.md) = "PrivateLibrary" | The input string to identify that the library is a private site library when invoking [getLibrary(String)](dw.content.ContentMgr.md#getlibrarystring). | + +## Property Summary + +| Property | Description | +| --- | --- | +| [siteLibrary](#sitelibrary): [Library](dw.content.Library.md) `(read-only)` | Returns the content library of the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getContent](dw.content.ContentMgr.md#getcontentlibrary-string)([Library](dw.content.Library.md), [String](TopLevel.String.md)) | Returns the content with the corresponding identifier within the specified library. | +| static [getContent](dw.content.ContentMgr.md#getcontentstring)([String](TopLevel.String.md)) | Returns the content with the corresponding identifier within the current site's site library. | +| static [getFolder](dw.content.ContentMgr.md#getfolderlibrary-string)([Library](dw.content.Library.md), [String](TopLevel.String.md)) | Returns the folder identified by the specified id within the specified library. | +| static [getFolder](dw.content.ContentMgr.md#getfolderstring)([String](TopLevel.String.md)) | Returns the folder identified by the specified id within the current site's site library. | +| static [getLibrary](dw.content.ContentMgr.md#getlibrarystring)([String](TopLevel.String.md)) | Returns the content library specified by the given id. | +| static [getSiteLibrary](dw.content.ContentMgr.md#getsitelibrary)() | Returns the content library of the current site. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### PRIVATE_LIBRARY + +- PRIVATE_LIBRARY: [String](TopLevel.String.md) = "PrivateLibrary" + - : The input string to identify that the library is a private site library when invoking [getLibrary(String)](dw.content.ContentMgr.md#getlibrarystring). + + +--- + +## Property Details + +### siteLibrary +- siteLibrary: [Library](dw.content.Library.md) `(read-only)` + - : Returns the content library of the current site. + + +--- + +## Method Details + +### getContent(Library, String) +- static getContent(library: [Library](dw.content.Library.md), id: [String](TopLevel.String.md)): [Content](dw.content.Content.md) + - : Returns the content with the corresponding identifier within the specified library. + + **Parameters:** + - library - the content library to look for the content in + - id - the ID of the content asset to find. + + **Returns:** + - the content if found, or null if not found. + + +--- + +### getContent(String) +- static getContent(id: [String](TopLevel.String.md)): [Content](dw.content.Content.md) + - : Returns the content with the corresponding identifier within the current + site's site library. + + + **Parameters:** + - id - the ID of the content asset to find. + + **Returns:** + - the content if found, or null if not found. + + +--- + +### getFolder(Library, String) +- static getFolder(library: [Library](dw.content.Library.md), id: [String](TopLevel.String.md)): [Folder](dw.content.Folder.md) + - : Returns the folder identified by the specified id within the specified library. + + **Parameters:** + - library - the content library to look for the folder in + - id - the ID of the folder to find. + + **Returns:** + - the folder, or null if not found. + + +--- + +### getFolder(String) +- static getFolder(id: [String](TopLevel.String.md)): [Folder](dw.content.Folder.md) + - : Returns the folder identified by the specified id within the current + site's site library. + + + **Parameters:** + - id - the ID of the folder to find. + + **Returns:** + - the folder, or null if not found. + + +--- + +### getLibrary(String) +- static getLibrary(libraryId: [String](TopLevel.String.md)): [Library](dw.content.Library.md) + - : Returns the content library specified by the given id. If [PRIVATE_LIBRARY](dw.content.ContentMgr.md#private_library) is used, then the current + site's private library will be returned. + + + **Parameters:** + - libraryId - the id of the library to return. + + **Returns:** + - the library for the passed id. Returns null if there is no content library with that id. + + +--- + +### getSiteLibrary() +- static getSiteLibrary(): [Library](dw.content.Library.md) + - : Returns the content library of the current site. + + **Returns:** + - the content library of the current site, or null if there is not + content library assigned to the current site. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchModel.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchModel.md new file mode 100644 index 00000000..04a08835 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchModel.md @@ -0,0 +1,618 @@ + +# Class ContentSearchModel + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchModel](dw.catalog.SearchModel.md) + - [dw.content.ContentSearchModel](dw.content.ContentSearchModel.md) + +The class is the central interface to a content search result and a content +search refinement. It also provides utility methods to generate a search URL. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CONTENTID_PARAMETER](#contentid_parameter): [String](TopLevel.String.md) = "cid" | URL Parameter for the content ID | +| [FOLDERID_PARAMETER](#folderid_parameter): [String](TopLevel.String.md) = "fdid" | URL Parameter for the folder ID | + +## Property Summary + +| Property | Description | +| --- | --- | +| [content](#content): [Iterator](dw.util.Iterator.md) `(read-only)` | Returns an Iterator containing all Content Assets that are the result of the search. | +| [contentID](#contentid): [String](TopLevel.String.md) | Returns the content ID against which the search results apply. | +| [deepestCommonFolder](#deepestcommonfolder): [Folder](dw.content.Folder.md) `(read-only)` | Returns the deepest common folder of all content assets in the search result. | +| [filteredByFolder](#filteredbyfolder): [Boolean](TopLevel.Boolean.md) | The method returns true, if the content search result is filtered by the folder and it is not subsequently possible to search for content assets that belong to no folder (e.g. | +| [folder](#folder): [Folder](dw.content.Folder.md) `(read-only)` | Returns the folder against which the search results apply. | +| [folderID](#folderid): [String](TopLevel.String.md) | Returns the folder ID against which the search results apply. | +| [folderSearch](#foldersearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if this is a pure search for a folder. | +| [pageMetaTags](#pagemetatags): [Array](TopLevel.Array.md) `(read-only)` | Returns all page meta tags, defined for this instance for which content can be generated. | +| [recursiveFolderSearch](#recursivefoldersearch): [Boolean](TopLevel.Boolean.md) | Get the flag that determines if the folder search will be recursive. | +| [refinedByFolder](#refinedbyfolder): [Boolean](TopLevel.Boolean.md) `(read-only)` | The method returns true, if the search is refined by a folder. | +| [refinedFolderSearch](#refinedfoldersearch): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a folder search and is refined with further criteria, like a name refinement or an attribute refinement. | +| [refinements](#refinements): [ContentSearchRefinements](dw.content.ContentSearchRefinements.md) `(read-only)` | Returns the set of search refinements used in this search. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ContentSearchModel](#contentsearchmodel)() | Constructs a new ContentSearchModel. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getContent](dw.content.ContentSearchModel.md#getcontent)() | Returns an Iterator containing all Content Assets that are the result of the search. | +| [getContentID](dw.content.ContentSearchModel.md#getcontentid)() | Returns the content ID against which the search results apply. | +| [getDeepestCommonFolder](dw.content.ContentSearchModel.md#getdeepestcommonfolder)() | Returns the deepest common folder of all content assets in the search result. | +| [getFolder](dw.content.ContentSearchModel.md#getfolder)() | Returns the folder against which the search results apply. | +| [getFolderID](dw.content.ContentSearchModel.md#getfolderid)() | Returns the folder ID against which the search results apply. | +| [getPageMetaTag](dw.content.ContentSearchModel.md#getpagemetatagstring)([String](TopLevel.String.md)) | Returns the page meta tag for the specified id. | +| [getPageMetaTags](dw.content.ContentSearchModel.md#getpagemetatags)() | Returns all page meta tags, defined for this instance for which content can be generated. | +| [getRefinements](dw.content.ContentSearchModel.md#getrefinements)() | Returns the set of search refinements used in this search. | +| [isFilteredByFolder](dw.content.ContentSearchModel.md#isfilteredbyfolder)() | The method returns true, if the content search result is filtered by the folder and it is not subsequently possible to search for content assets that belong to no folder (e.g. | +| [isFolderSearch](dw.content.ContentSearchModel.md#isfoldersearch)() | The method returns true, if this is a pure search for a folder. | +| [isRecursiveFolderSearch](dw.content.ContentSearchModel.md#isrecursivefoldersearch)() | Get the flag that determines if the folder search will be recursive. | +| [isRefinedByFolder](dw.content.ContentSearchModel.md#isrefinedbyfolder)() | The method returns true, if the search is refined by a folder. | +| [isRefinedFolderSearch](dw.content.ContentSearchModel.md#isrefinedfoldersearch)() | Identifies if this is a folder search and is refined with further criteria, like a name refinement or an attribute refinement. | +| [search](dw.content.ContentSearchModel.md#search)() | Execute the search. | +| [setContentID](dw.content.ContentSearchModel.md#setcontentidstring)([String](TopLevel.String.md)) | Sets the contentID used in this search. | +| [setFilteredByFolder](dw.content.ContentSearchModel.md#setfilteredbyfolderboolean)([Boolean](TopLevel.Boolean.md)) | Set a flag to indicate if the search is filtered by the folder. | +| [setFolderID](dw.content.ContentSearchModel.md#setfolderidstring)([String](TopLevel.String.md)) | Sets the folderID used in this search. | +| [setRecursiveFolderSearch](dw.content.ContentSearchModel.md#setrecursivefoldersearchboolean)([Boolean](TopLevel.Boolean.md)) | Set a flag to indicate if the search in folder should be recursive. | +| static [urlForContent](dw.content.ContentSearchModel.md#urlforcontenturl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific Content. | +| static [urlForContent](dw.content.ContentSearchModel.md#urlforcontentstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific Content. | +| static [urlForFolder](dw.content.ContentSearchModel.md#urlforfolderurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific Folder. | +| static [urlForFolder](dw.content.ContentSearchModel.md#urlforfolderstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific Folder. | +| static [urlForRefine](dw.content.ContentSearchModel.md#urlforrefineurl-string-string)([URL](dw.web.URL.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific attribute name-value pair. | +| static [urlForRefine](dw.content.ContentSearchModel.md#urlforrefinestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns an URL that you can use to execute a query for a specific attribute name-value pair. | +| [urlRefineFolder](dw.content.ContentSearchModel.md#urlrefinefolderurl-string)([URL](dw.web.URL.md), [String](TopLevel.String.md)) | Returns an URL that you can use to re-execute the query using the specified URL and folder refinement. | +| [urlRefineFolder](dw.content.ContentSearchModel.md#urlrefinefolderstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns an URL that you can use to re-execute the query using the specified pipeline action and folder refinement. | +| [urlRelaxFolder](dw.content.ContentSearchModel.md#urlrelaxfolderurl)([URL](dw.web.URL.md)) | Returns an URL that you can use to re-execute the query with no folder refinement. | +| [urlRelaxFolder](dw.content.ContentSearchModel.md#urlrelaxfolderstring)([String](TopLevel.String.md)) | Returns an URL that you can use to re-execute the query with no folder refinement. | + +### Methods inherited from class SearchModel + +[addRefinementValues](dw.catalog.SearchModel.md#addrefinementvaluesstring-string), [canRelax](dw.catalog.SearchModel.md#canrelax), [getCount](dw.catalog.SearchModel.md#getcount), [getRefinementMaxValue](dw.catalog.SearchModel.md#getrefinementmaxvaluestring), [getRefinementMinValue](dw.catalog.SearchModel.md#getrefinementminvaluestring), [getRefinementValue](dw.catalog.SearchModel.md#getrefinementvaluestring), [getRefinementValues](dw.catalog.SearchModel.md#getrefinementvaluesstring), [getSearchPhrase](dw.catalog.SearchModel.md#getsearchphrase), [getSearchRedirect](dw.catalog.SearchModel.md#getsearchredirectstring), [getSortingCondition](dw.catalog.SearchModel.md#getsortingconditionstring), [isEmptyQuery](dw.catalog.SearchModel.md#isemptyquery), [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattribute), [isRefinedByAttribute](dw.catalog.SearchModel.md#isrefinedbyattributestring), [isRefinedByAttributeValue](dw.catalog.SearchModel.md#isrefinedbyattributevaluestring-string), [isRefinedSearch](dw.catalog.SearchModel.md#isrefinedsearch), [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring), [isRefinementByValueRange](dw.catalog.SearchModel.md#isrefinementbyvaluerangestring-string-string), [removeRefinementValues](dw.catalog.SearchModel.md#removerefinementvaluesstring-string), [search](dw.catalog.SearchModel.md#search), [setRefinementValueRange](dw.catalog.SearchModel.md#setrefinementvaluerangestring-string-string), [setRefinementValues](dw.catalog.SearchModel.md#setrefinementvaluesstring-string), [setSearchPhrase](dw.catalog.SearchModel.md#setsearchphrasestring), [setSortingCondition](dw.catalog.SearchModel.md#setsortingconditionstring-number), [url](dw.catalog.SearchModel.md#urlurl), [url](dw.catalog.SearchModel.md#urlstring), [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsorturl), [urlDefaultSort](dw.catalog.SearchModel.md#urldefaultsortstring), [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributeurl-string-string), [urlRefineAttribute](dw.catalog.SearchModel.md#urlrefineattributestring-string-string), [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevalueurl-string-string), [urlRefineAttributeValue](dw.catalog.SearchModel.md#urlrefineattributevaluestring-string-string), [urlRefineAttributeValueRange](dw.catalog.SearchModel.md#urlrefineattributevaluerangestring-string-string-string), [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributeurl-string), [urlRelaxAttribute](dw.catalog.SearchModel.md#urlrelaxattributestring-string), [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevalueurl-string-string), [urlRelaxAttributeValue](dw.catalog.SearchModel.md#urlrelaxattributevaluestring-string-string), [urlSort](dw.catalog.SearchModel.md#urlsorturl-string-number), [urlSort](dw.catalog.SearchModel.md#urlsortstring-string-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CONTENTID_PARAMETER + +- CONTENTID_PARAMETER: [String](TopLevel.String.md) = "cid" + - : URL Parameter for the content ID + + +--- + +### FOLDERID_PARAMETER + +- FOLDERID_PARAMETER: [String](TopLevel.String.md) = "fdid" + - : URL Parameter for the folder ID + + +--- + +## Property Details + +### content +- content: [Iterator](dw.util.Iterator.md) `(read-only)` + - : Returns an Iterator containing all Content Assets that are the result of the + search. + + + +--- + +### contentID +- contentID: [String](TopLevel.String.md) + - : Returns the content ID against which the search results apply. + + +--- + +### deepestCommonFolder +- deepestCommonFolder: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the deepest common folder of all content assets in the search result. + + +--- + +### filteredByFolder +- filteredByFolder: [Boolean](TopLevel.Boolean.md) + - : The method returns true, if the content search result is filtered by the folder and it is not subsequently + possible to search for content assets that belong to no folder (e.g. those for Page Designer). + + + +--- + +### folder +- folder: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the folder against which the search results apply. + + +--- + +### folderID +- folderID: [String](TopLevel.String.md) + - : Returns the folder ID against which the search results apply. + + +--- + +### folderSearch +- folderSearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if this is a pure search for a folder. The + method checks, that a folder ID is specified and no search phrase is + specified. + + + +--- + +### pageMetaTags +- pageMetaTags: [Array](TopLevel.Array.md) `(read-only)` + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the content listing page meta tag context and rules. + The rules are obtained from the current folder context or inherited from the parent folder, + up to the root folder. + + + +--- + +### recursiveFolderSearch +- recursiveFolderSearch: [Boolean](TopLevel.Boolean.md) + - : Get the flag that determines if the folder search will + be recursive. + + + +--- + +### refinedByFolder +- refinedByFolder: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : The method returns true, if the search is refined by a folder. + The method checks, that a folder ID is specified. + + + +--- + +### refinedFolderSearch +- refinedFolderSearch: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a folder search and is refined with further + criteria, like a name refinement or an attribute refinement. + + + +--- + +### refinements +- refinements: [ContentSearchRefinements](dw.content.ContentSearchRefinements.md) `(read-only)` + - : Returns the set of search refinements used in this search. + + +--- + +## Constructor Details + +### ContentSearchModel() +- ContentSearchModel() + - : Constructs a new ContentSearchModel. + + +--- + +## Method Details + +### getContent() +- getContent(): [Iterator](dw.util.Iterator.md) + - : Returns an Iterator containing all Content Assets that are the result of the + search. + + + **Returns:** + - an Iterator containing all Content Assets that are the result of the + search. + + + +--- + +### getContentID() +- getContentID(): [String](TopLevel.String.md) + - : Returns the content ID against which the search results apply. + + **Returns:** + - the content ID against which the search results apply. + + +--- + +### getDeepestCommonFolder() +- getDeepestCommonFolder(): [Folder](dw.content.Folder.md) + - : Returns the deepest common folder of all content assets in the search result. + + **Returns:** + - the deepest common folder of all content assets in the search result of this search model. + + +--- + +### getFolder() +- getFolder(): [Folder](dw.content.Folder.md) + - : Returns the folder against which the search results apply. + + **Returns:** + - the folder against which the search results apply. + + +--- + +### getFolderID() +- getFolderID(): [String](TopLevel.String.md) + - : Returns the folder ID against which the search results apply. + + **Returns:** + - the folder ID against which the search results apply. + + +--- + +### getPageMetaTag(String) +- getPageMetaTag(id: [String](TopLevel.String.md)): [PageMetaTag](dw.web.PageMetaTag.md) + - : Returns the page meta tag for the specified id. + + + The meta tag content is generated based on the content listing page meta tag context and rule. + The rule is obtained from the current folder context or inherited from the parent folder, + up to the root folder. + + + Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the + current context, or if the rule resolves to an empty string. + + + **Parameters:** + - id - the ID to get the page meta tag for + + **Returns:** + - page meta tag containing content generated based on rules + + +--- + +### getPageMetaTags() +- getPageMetaTags(): [Array](TopLevel.Array.md) + - : Returns all page meta tags, defined for this instance for which content can be generated. + + + The meta tag content is generated based on the content listing page meta tag context and rules. + The rules are obtained from the current folder context or inherited from the parent folder, + up to the root folder. + + + **Returns:** + - page meta tags defined for this instance, containing content generated based on rules + + +--- + +### getRefinements() +- getRefinements(): [ContentSearchRefinements](dw.content.ContentSearchRefinements.md) + - : Returns the set of search refinements used in this search. + + **Returns:** + - the set of search refinements used in this search. + + +--- + +### isFilteredByFolder() +- isFilteredByFolder(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if the content search result is filtered by the folder and it is not subsequently + possible to search for content assets that belong to no folder (e.g. those for Page Designer). + + + **Returns:** + - True if this is filtered by the folder of the content asset. + + +--- + +### isFolderSearch() +- isFolderSearch(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if this is a pure search for a folder. The + method checks, that a folder ID is specified and no search phrase is + specified. + + + **Returns:** + - True if this is a folder search. + + +--- + +### isRecursiveFolderSearch() +- isRecursiveFolderSearch(): [Boolean](TopLevel.Boolean.md) + - : Get the flag that determines if the folder search will + be recursive. + + + **Returns:** + - true if the folder search will be recursive, false otherwise + + +--- + +### isRefinedByFolder() +- isRefinedByFolder(): [Boolean](TopLevel.Boolean.md) + - : The method returns true, if the search is refined by a folder. + The method checks, that a folder ID is specified. + + + **Returns:** + - true, if the search is refined by a folder, false otherwise. + + +--- + +### isRefinedFolderSearch() +- isRefinedFolderSearch(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a folder search and is refined with further + criteria, like a name refinement or an attribute refinement. + + + **Returns:** + - true if this is a folder search and is refined with further + criteria, false otherwise. + + + +--- + +### search() +- search(): [SearchStatus](dw.system.SearchStatus.md) + - : Execute the search. + + **Returns:** + - the searchStatus object with search status code and description of search result. + + +--- + +### setContentID(String) +- setContentID(contentID: [String](TopLevel.String.md)): void + - : Sets the contentID used in this search. + + **Parameters:** + - contentID - the contentID used in this search. + + +--- + +### setFilteredByFolder(Boolean) +- setFilteredByFolder(filteredByFolder: [Boolean](TopLevel.Boolean.md)): void + - : Set a flag to indicate if the search is filtered by the folder. Must be set to false to return content assets that + do not belong to any folder. + + + **Parameters:** + - filteredByFolder - filter the search result by folder + + +--- + +### setFolderID(String) +- setFolderID(folderID: [String](TopLevel.String.md)): void + - : Sets the folderID used in this search. + + **Parameters:** + - folderID - the folderID used in this search. + + +--- + +### setRecursiveFolderSearch(Boolean) +- setRecursiveFolderSearch(recurse: [Boolean](TopLevel.Boolean.md)): void + - : Set a flag to indicate if the search in folder should be recursive. + + **Parameters:** + - recurse - recurse the folder in the search + + +--- + +### urlForContent(URL, String) +- static urlForContent(url: [URL](dw.web.URL.md), cid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + Content. The passed url can be either a full url or just the name for a + pipeline. In the later case a relative URL is created. + + + **Parameters:** + - url - the URL to use when constructing the new URL. + - cid - the content id. + + **Returns:** + - an URL that you can use to execute a query for a specific + Content. The passed url can be either a full url or just the name + for a pipeline. In the later case a relative URL is created. + + + +--- + +### urlForContent(String, String) +- static urlForContent(action: [String](TopLevel.String.md), cid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + Content. The passed action is used to build an initial url. All search + specific attributes are appended. + + + **Parameters:** + - action - the pipeline action to use. + - cid - the content id. + + **Returns:** + - an URL that you can use to execute a query for a specific + Content. The passed action is used to build an initial url. All + search specific attributes are appended. + + + +--- + +### urlForFolder(URL, String) +- static urlForFolder(url: [URL](dw.web.URL.md), fid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + Folder. + + + **Parameters:** + - url - the URL to use in constructing the new URL. + - fid - the id of the Folder to use. + + **Returns:** + - an URL that you can use to execute a query for a specific + Folder. + + + +--- + +### urlForFolder(String, String) +- static urlForFolder(action: [String](TopLevel.String.md), fid: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + Folder. + + + **Parameters:** + - action - the pipeline action to use. + - fid - the id of the Folder to use. + + **Returns:** + - an URL that you can use to execute a query for a specific + Folder. + + + +--- + +### urlForRefine(URL, String, String) +- static urlForRefine(url: [URL](dw.web.URL.md), name: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + attribute name-value pair. + + + **Parameters:** + - url - the URL to use when constructing the new URL. + - name - the name of the attribute. + - value - the value for the attribute. + + **Returns:** + - an URL that you can use to execute a query for a specific + attribute name-value pair. + + + +--- + +### urlForRefine(String, String, String) +- static urlForRefine(action: [String](TopLevel.String.md), name: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to execute a query for a specific + attribute name-value pair. + + + **Parameters:** + - action - the pipeline action to use. + - name - the name of the attribute. + - value - the value for the attribute. + + **Returns:** + - an URL that you can use to execute a query for a specific + attribute name-value pair. + + + +--- + +### urlRefineFolder(URL, String) +- urlRefineFolder(url: [URL](dw.web.URL.md), refineFolderID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to re-execute the query using the + specified URL and folder refinement. + + + **Parameters:** + - url - the existing URL to use when constructing the new URL. + - refineFolderID - the ID of the folder refinement to use. + + **Returns:** + - an URL that you can use to re-execute the query using the + specified URL and folder refinement. + + + +--- + +### urlRefineFolder(String, String) +- urlRefineFolder(action: [String](TopLevel.String.md), refineFolderID: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to re-execute the query using the + specified pipeline action and folder refinement. + + + **Parameters:** + - action - the action to use. + - refineFolderID - the folder ID to use as a refinement. + + **Returns:** + - an URL that you can use to re-execute the exact same query using + the specified pipeline action and folder refinement. + + + +--- + +### urlRelaxFolder(URL) +- urlRelaxFolder(url: [URL](dw.web.URL.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to re-execute the query with no folder + refinement. + + + **Parameters:** + - url - the existing URL to use when constructing the new URL. + + **Returns:** + - an URL that you can use to re-execute the query with no folder + refinement. + + + +--- + +### urlRelaxFolder(String) +- urlRelaxFolder(action: [String](TopLevel.String.md)): [URL](dw.web.URL.md) + - : Returns an URL that you can use to re-execute the query with no folder + refinement. + + + **Parameters:** + - action - the pipeline action to use in the URL. + + **Returns:** + - an URL that you can use to re-execute the query with no folder + refinement. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementDefinition.md new file mode 100644 index 00000000..7d0804c0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementDefinition.md @@ -0,0 +1,61 @@ + +# Class ContentSearchRefinementDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.catalog.SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md) + - [dw.content.ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md) + +This class provides an interface to refinement options for content search. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [folderRefinement](#folderrefinement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is a folder refinement. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [isFolderRefinement](dw.content.ContentSearchRefinementDefinition.md#isfolderrefinement)() | Identifies if this is a folder refinement. | + +### Methods inherited from class SearchRefinementDefinition + +[getAttributeID](dw.catalog.SearchRefinementDefinition.md#getattributeid), [getCutoffThreshold](dw.catalog.SearchRefinementDefinition.md#getcutoffthreshold), [getDisplayName](dw.catalog.SearchRefinementDefinition.md#getdisplayname), [getValueTypeCode](dw.catalog.SearchRefinementDefinition.md#getvaluetypecode), [isAttributeRefinement](dw.catalog.SearchRefinementDefinition.md#isattributerefinement) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### folderRefinement +- folderRefinement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is a folder refinement. + + +--- + +## Method Details + +### isFolderRefinement() +- isFolderRefinement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is a folder refinement. + + **Returns:** + - true if this is a category refinement, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementValue.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementValue.md new file mode 100644 index 00000000..7b72cc22 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinementValue.md @@ -0,0 +1,22 @@ + +# Class ContentSearchRefinementValue + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinementValue](dw.catalog.SearchRefinementValue.md) + - [dw.content.ContentSearchRefinementValue](dw.content.ContentSearchRefinementValue.md) + +Represents the value of a content search refinement. + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class SearchRefinementValue + +[getDescription](dw.catalog.SearchRefinementValue.md#getdescription), [getDisplayValue](dw.catalog.SearchRefinementValue.md#getdisplayvalue), [getHitCount](dw.catalog.SearchRefinementValue.md#gethitcount), [getID](dw.catalog.SearchRefinementValue.md#getid), [getPresentationID](dw.catalog.SearchRefinementValue.md#getpresentationid), [getValue](dw.catalog.SearchRefinementValue.md#getvalue) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinements.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinements.md new file mode 100644 index 00000000..20d878c3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.ContentSearchRefinements.md @@ -0,0 +1,218 @@ + +# Class ContentSearchRefinements + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.catalog.SearchRefinements](dw.catalog.SearchRefinements.md) + - [dw.content.ContentSearchRefinements](dw.content.ContentSearchRefinements.md) + +This class provides an interface to refinement options for the content asset +search. In a typical usage, the client application UI displays the search +refinements along with the search results and allows customers to "refine" +the results (i.e. limit the results that are shown) by specifying additional +criteria, or "relax" (i.e. broaden) the results after previously refining. +The two types of content search refinements are: + + +- **Refine By Folder:**Limit the content assets to those assigned to specific child/ancestor folder of the search folder. +- **Refine By Attribute:**Limit the content assets to those with specific values for a given attribute. Values may be grouped into "buckets" so that a given set of values are represented as a single refinement option. + + +Rendering a content search refinement UI typically begins with iterating the +refinement definitions for the search result. Call +[SearchRefinements.getRefinementDefinitions()](dw.catalog.SearchRefinements.md#getrefinementdefinitions) or +[SearchRefinements.getAllRefinementDefinitions()](dw.catalog.SearchRefinements.md#getallrefinementdefinitions) to +retrieve the appropriate collection of refinement definitions. For each +definition, display the available refinement values by calling +[getAllRefinementValues(ContentSearchRefinementDefinition)](dw.content.ContentSearchRefinements.md#getallrefinementvaluescontentsearchrefinementdefinition). Depending +on the type of the refinement definition, the application must use slightly +different logic to display the refinement widgets. For all 2 types, methods +in [ContentSearchModel](dw.content.ContentSearchModel.md) are used to generate URLs to render +hyperlinks in the UI. When clicked, these links trigger a call to the Search +pipelet which in turn applies the appropriate filters to the native search +result. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [folderRefinementDefinition](#folderrefinementdefinition): [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md) `(read-only)` | Returns the appropriate folder refinement definition based on the search result. | +| [matchingFolders](#matchingfolders): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of matching folders. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAllRefinementValues](dw.content.ContentSearchRefinements.md#getallrefinementvaluescontentsearchrefinementdefinition)([ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md)) | Returns a sorted collection of refinement values for the given refinement definition. | +| [getFolderHits](dw.content.ContentSearchRefinements.md#getfolderhitsfolder)([Folder](dw.content.Folder.md)) | Returns the number of search hits for the passed folder object. | +| [getFolderRefinementDefinition](dw.content.ContentSearchRefinements.md#getfolderrefinementdefinition)() | Returns the appropriate folder refinement definition based on the search result. | +| [getMatchingFolders](dw.content.ContentSearchRefinements.md#getmatchingfolders)() | Returns a collection of matching folders. | +| [getNextLevelFolderRefinementValues](dw.content.ContentSearchRefinements.md#getnextlevelfolderrefinementvaluesfolder)([Folder](dw.content.Folder.md)) | Returns folder refinement values based on the current search result filtered such that only folder refinements representing children of the given folder are present. | +| [getRefinementValue](dw.content.ContentSearchRefinements.md#getrefinementvaluecontentsearchrefinementdefinition-string)([ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md), [String](TopLevel.String.md)) | Returns the refinement value (incl. | +| [getRefinementValue](dw.content.ContentSearchRefinements.md#getrefinementvaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the refinement value (incl. | +| [getRefinementValues](dw.content.ContentSearchRefinements.md#getrefinementvaluescontentsearchrefinementdefinition)([ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md)) | Returns a collection of refinement values for the given refinement definition. | + +### Methods inherited from class SearchRefinements + +[getAllRefinementDefinitions](dw.catalog.SearchRefinements.md#getallrefinementdefinitions), [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring), [getAllRefinementValues](dw.catalog.SearchRefinements.md#getallrefinementvaluesstring-number-number), [getRefinementDefinitions](dw.catalog.SearchRefinements.md#getrefinementdefinitions), [getRefinementValues](dw.catalog.SearchRefinements.md#getrefinementvaluesstring-number-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### folderRefinementDefinition +- folderRefinementDefinition: [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md) `(read-only)` + - : Returns the appropriate folder refinement definition based on the search + result. The folder refinement definition returned will be the first that + can be found traversing the folder tree upward starting at the deepest + common folder of the search result. + + + +--- + +### matchingFolders +- matchingFolders: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of matching folders. + + +--- + +## Method Details + +### getAllRefinementValues(ContentSearchRefinementDefinition) +- getAllRefinementValues(definition: [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md)): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of refinement values for the given refinement + definition. The returned collection includes all refinement values for + which the hit count is greater than 0 within the search result when the + passed refinement definitions is excluded from filtering the search hits + but all other refinement filters are still applied. This is useful for + rendering broadening options for the refinement definitions that the + search is already refined by. It is important to note that this method + does NOT return refinement values independent of the search result. + + + **Parameters:** + - definition - The refinement definition to return refinement values for. + + **Returns:** + - The collection of ContentSearchRefinementValue instances sorted + according to the settings of the definition. + + + +--- + +### getFolderHits(Folder) +- getFolderHits(folder: [Folder](dw.content.Folder.md)): [Number](TopLevel.Number.md) + - : Returns the number of search hits for the passed folder object. + + **Parameters:** + - folder - Folder object. + + **Returns:** + - Number of search hits. + + +--- + +### getFolderRefinementDefinition() +- getFolderRefinementDefinition(): [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md) + - : Returns the appropriate folder refinement definition based on the search + result. The folder refinement definition returned will be the first that + can be found traversing the folder tree upward starting at the deepest + common folder of the search result. + + + **Returns:** + - The folder refinement definition or `null` if none can + be found. + + + +--- + +### getMatchingFolders() +- getMatchingFolders(): [Collection](dw.util.Collection.md) + - : Returns a collection of matching folders. + + **Returns:** + - Collection of matching folders. + + +--- + +### getNextLevelFolderRefinementValues(Folder) +- getNextLevelFolderRefinementValues(folder: [Folder](dw.content.Folder.md)): [Collection](dw.util.Collection.md) + - : Returns folder refinement values based on the current search result + filtered such that only folder refinements representing children of the + given folder are present. If no folder is given, the method uses the + library's root folder. The refinement value content counts represent all + hits contained in the library tree starting at the corresponding child + folder. + + + **Parameters:** + - folder - The folder to return child folder refinement values for. + + **Returns:** + - The refinement values for all child folders of the given folder. + + +--- + +### getRefinementValue(ContentSearchRefinementDefinition, String) +- getRefinementValue(definition: [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md), value: [String](TopLevel.String.md)): [ContentSearchRefinementValue](dw.content.ContentSearchRefinementValue.md) + - : Returns the refinement value (incl. content hit count) for the given + refinement definition and the given (selected) value. + + + **Parameters:** + - definition - The definition to return the refinement for. + - value - The value to return the refinement value for. + + **Returns:** + - The refinement value. + + +--- + +### getRefinementValue(String, String) +- getRefinementValue(name: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): [ContentSearchRefinementValue](dw.content.ContentSearchRefinementValue.md) + - : Returns the refinement value (incl. content hit count) for the given + attribute refinement and the given (selected) value. + + + **Parameters:** + - name - The name of the refinement attribute. + - value - The value to return the refinement value for. + + **Returns:** + - The refinement value. + + +--- + +### getRefinementValues(ContentSearchRefinementDefinition) +- getRefinementValues(definition: [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of refinement values for the given refinement + definition. The returned refinement values only include those that are + part of the actual search result (i.e. hit count will always be > 0). + + + **Parameters:** + - definition - The refinement definition to return refinement values for. + + **Returns:** + - The collection of refinement values sorted according to the + settings of the definition. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.Folder.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.Folder.md new file mode 100644 index 00000000..e0ea503c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.Folder.md @@ -0,0 +1,432 @@ + +# Class Folder + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.content.Folder](dw.content.Folder.md) + +Class representing a folder for organizing content assets in Commerce Cloud Digital. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the folder. | +| [content](#content): [Collection](dw.util.Collection.md) `(read-only)` | Returns the content objects for this folder, sorted by position. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description for the folder as known in the current locale or null if it cannot be found. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name for the folder as known in the current locale or null if it cannot be found. | +| [online](#online): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates if the folder is set online or offline. | +| [onlineContent](#onlinecontent): [Collection](dw.util.Collection.md) `(read-only)` | Returns the online content objects for this folder, sorted by position. | +| [onlineSubFolders](#onlinesubfolders): [Collection](dw.util.Collection.md) `(read-only)` | Returns the online subfolders of this folder, sorted by position. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the page description for this folder using the value in the current locale, or returns null if no value was found. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the page keywords for this folder using the value in the current locale, or returns null if no value was found. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the page title for this folder using the value in the current locale, or returns null if no value was found. | +| [pageURL](#pageurl): [String](TopLevel.String.md) `(read-only)` | Returns the page URL for this folder using the value in the current locale, or returns null if no value was found. | +| [parent](#parent): [Folder](dw.content.Folder.md) `(read-only)` | Returns the parent folder of this folder. | +| [root](#root): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates if this is the root folder. | +| [siteMapChangeFrequency](#sitemapchangefrequency): [String](TopLevel.String.md) `(read-only)` | Returns the folder's sitemap change frequency. | +| [siteMapIncluded](#sitemapincluded): [Number](TopLevel.Number.md) `(read-only)` | Returns the folder's sitemap inclusion. | +| [siteMapPriority](#sitemappriority): [Number](TopLevel.Number.md) `(read-only)` | Returns the folder's sitemap priority. | +| [subFolders](#subfolders): [Collection](dw.util.Collection.md) `(read-only)` | Returns the subfolders of this folder, sorted by position. | +| [template](#template): [String](TopLevel.String.md) `(read-only)` | Returns the name of the template used to render the folder in the store front. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getContent](dw.content.Folder.md#getcontent)() | Returns the content objects for this folder, sorted by position. | +| [getDescription](dw.content.Folder.md#getdescription)() | Returns the description for the folder as known in the current locale or null if it cannot be found. | +| [getDisplayName](dw.content.Folder.md#getdisplayname)() | Returns the display name for the folder as known in the current locale or null if it cannot be found. | +| [getID](dw.content.Folder.md#getid)() | Returns the ID of the folder. | +| [getOnlineContent](dw.content.Folder.md#getonlinecontent)() | Returns the online content objects for this folder, sorted by position. | +| [getOnlineSubFolders](dw.content.Folder.md#getonlinesubfolders)() | Returns the online subfolders of this folder, sorted by position. | +| [getPageDescription](dw.content.Folder.md#getpagedescription)() | Returns the page description for this folder using the value in the current locale, or returns null if no value was found. | +| [getPageKeywords](dw.content.Folder.md#getpagekeywords)() | Returns the page keywords for this folder using the value in the current locale, or returns null if no value was found. | +| [getPageTitle](dw.content.Folder.md#getpagetitle)() | Returns the page title for this folder using the value in the current locale, or returns null if no value was found. | +| [getPageURL](dw.content.Folder.md#getpageurl)() | Returns the page URL for this folder using the value in the current locale, or returns null if no value was found. | +| [getParent](dw.content.Folder.md#getparent)() | Returns the parent folder of this folder. | +| [getSiteMapChangeFrequency](dw.content.Folder.md#getsitemapchangefrequency)() | Returns the folder's sitemap change frequency. | +| [getSiteMapIncluded](dw.content.Folder.md#getsitemapincluded)() | Returns the folder's sitemap inclusion. | +| [getSiteMapPriority](dw.content.Folder.md#getsitemappriority)() | Returns the folder's sitemap priority. | +| [getSubFolders](dw.content.Folder.md#getsubfolders)() | Returns the subfolders of this folder, sorted by position. | +| [getTemplate](dw.content.Folder.md#gettemplate)() | Returns the name of the template used to render the folder in the store front. | +| [isOnline](dw.content.Folder.md#isonline)() | Indicates if the folder is set online or offline. | +| [isRoot](dw.content.Folder.md#isroot)() | Indicates if this is the root folder. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the folder. The ID can be used to uniquely + identify a folder within any given library. This folder ID provides + an alternative lookup mechanism for folders frequently used in + the storefront. + + + +--- + +### content +- content: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the content objects for this folder, sorted by position. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description for the folder as known in the current + locale or null if it cannot be found. + + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name for the folder as known in the current + locale or null if it cannot be found. + + + +--- + +### online +- online: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates if the folder is set online or + offline. Initially, all folders are set online. + + + +--- + +### onlineContent +- onlineContent: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the online content objects for this folder, sorted by position. + + +--- + +### onlineSubFolders +- onlineSubFolders: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the online subfolders of this folder, sorted by position. + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the page description for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the page keywords for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the page title for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### pageURL +- pageURL: [String](TopLevel.String.md) `(read-only)` + - : Returns the page URL for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### parent +- parent: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the parent folder of this folder. + + +--- + +### root +- root: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates if this is the root folder. + + +--- + +### siteMapChangeFrequency +- siteMapChangeFrequency: [String](TopLevel.String.md) `(read-only)` + - : Returns the folder's sitemap change frequency. + + +--- + +### siteMapIncluded +- siteMapIncluded: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the folder's sitemap inclusion. + + +--- + +### siteMapPriority +- siteMapPriority: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the folder's sitemap priority. + + +--- + +### subFolders +- subFolders: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the subfolders of this folder, sorted by position. + + +--- + +### template +- template: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the template used to render the folder + in the store front. + + + +--- + +## Method Details + +### getContent() +- getContent(): [Collection](dw.util.Collection.md) + - : Returns the content objects for this folder, sorted by position. + + **Returns:** + - the content objects for this folder, sorted by position. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description for the folder as known in the current + locale or null if it cannot be found. + + + **Returns:** + - the description for the folder as known in the current + locale or null if it cannot be found. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name for the folder as known in the current + locale or null if it cannot be found. + + + **Returns:** + - the display name for the folder as known in the current + locale or null if it cannot be found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the folder. The ID can be used to uniquely + identify a folder within any given library. This folder ID provides + an alternative lookup mechanism for folders frequently used in + the storefront. + + + **Returns:** + - the ID of the folder. + + +--- + +### getOnlineContent() +- getOnlineContent(): [Collection](dw.util.Collection.md) + - : Returns the online content objects for this folder, sorted by position. + + **Returns:** + - the online content objects for this folder, sorted by position. + + +--- + +### getOnlineSubFolders() +- getOnlineSubFolders(): [Collection](dw.util.Collection.md) + - : Returns the online subfolders of this folder, sorted by position. + + **Returns:** + - the online subfolders of this folder, sorted by position. + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the page description for this folder using the value in + the current locale, or returns null if no value was found. + + + **Returns:** + - the page description for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the page keywords for this folder using the value in + the current locale, or returns null if no value was found. + + + **Returns:** + - the page keywords for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the page title for this folder using the value in + the current locale, or returns null if no value was found. + + + **Returns:** + - the page title for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### getPageURL() +- getPageURL(): [String](TopLevel.String.md) + - : Returns the page URL for this folder using the value in + the current locale, or returns null if no value was found. + + + **Returns:** + - the page URL for this folder using the value in + the current locale, or returns null if no value was found. + + + +--- + +### getParent() +- getParent(): [Folder](dw.content.Folder.md) + - : Returns the parent folder of this folder. + + **Returns:** + - the parent folder of this folder. + + +--- + +### getSiteMapChangeFrequency() +- getSiteMapChangeFrequency(): [String](TopLevel.String.md) + - : Returns the folder's sitemap change frequency. + + **Returns:** + - the value of the attribute 'siteMapChangeFrequency'. + + +--- + +### getSiteMapIncluded() +- getSiteMapIncluded(): [Number](TopLevel.Number.md) + - : Returns the folder's sitemap inclusion. + + **Returns:** + - the value of the attribute 'siteMapIncluded'. + + +--- + +### getSiteMapPriority() +- getSiteMapPriority(): [Number](TopLevel.Number.md) + - : Returns the folder's sitemap priority. + + **Returns:** + - the value of the attribute 'siteMapPriority'. + + +--- + +### getSubFolders() +- getSubFolders(): [Collection](dw.util.Collection.md) + - : Returns the subfolders of this folder, sorted by position. + + **Returns:** + - the subfolders of this folder, sorted by position. + + +--- + +### getTemplate() +- getTemplate(): [String](TopLevel.String.md) + - : Returns the name of the template used to render the folder + in the store front. + + + **Returns:** + - the name of the template used to render the folder. + + +--- + +### isOnline() +- isOnline(): [Boolean](TopLevel.Boolean.md) + - : Indicates if the folder is set online or + offline. Initially, all folders are set online. + + + **Returns:** + - true if the folder is online, false otherwise. + + +--- + +### isRoot() +- isRoot(): [Boolean](TopLevel.Boolean.md) + - : Indicates if this is the root folder. + + **Returns:** + - true if this is the root folder, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.Library.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.Library.md new file mode 100644 index 00000000..9f4df67c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.Library.md @@ -0,0 +1,124 @@ + +# Class Library + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.content.Library](dw.content.Library.md) + +Class representing a collection of [Content](dw.content.Content.md) assets, and a +[Folder](dw.content.Folder.md) hierarchy organizing these content assets. +Currently only one library is allowed per site. An instance of this library +can be obtained by calling [ContentMgr.getSiteLibrary()](dw.content.ContentMgr.md#getsitelibrary). + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [CMSChannelID](#cmschannelid): [String](TopLevel.String.md) `(read-only)` | Returns the CMS channel of the library. | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of this library. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name for the library as known in the current locale or null if it cannot be found. | +| [root](#root): [Folder](dw.content.Folder.md) `(read-only)` | Returns the root folder for this library. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCMSChannelID](dw.content.Library.md#getcmschannelid)() | Returns the CMS channel of the library. | +| [getDisplayName](dw.content.Library.md#getdisplayname)() | Returns the display name for the library as known in the current locale or null if it cannot be found. | +| [getID](dw.content.Library.md#getid)() | Returns the ID of this library. | +| [getRoot](dw.content.Library.md#getroot)() | Returns the root folder for this library. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### CMSChannelID +- CMSChannelID: [String](TopLevel.String.md) `(read-only)` + - : Returns the CMS channel of the library. + + +--- + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of this library. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name for the library as known in the current + locale or null if it cannot be found. + + + +--- + +### root +- root: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the root folder for this library. + + +--- + +## Method Details + +### getCMSChannelID() +- getCMSChannelID(): [String](TopLevel.String.md) + - : Returns the CMS channel of the library. + + **Returns:** + - the CMS channel of the library + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name for the library as known in the current + locale or null if it cannot be found. + + + **Returns:** + - the display name for the library as known in the current + locale or null if it cannot be found. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of this library. + + **Returns:** + - the ID of this library. + + +--- + +### getRoot() +- getRoot(): [Folder](dw.content.Folder.md) + - : Returns the root folder for this library. + + **Returns:** + - the root Folder for this library. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.MarkupText.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.MarkupText.md new file mode 100644 index 00000000..1fc3cab8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.MarkupText.md @@ -0,0 +1,150 @@ + +# Class MarkupText + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.content.MarkupText](dw.content.MarkupText.md) + +The class represents a content snippet with markup. This is typically a +HTML content snippet. The class also processes the special links from +Commerce Cloud Digital content management and automatically rewrites them into +links for use in the storefront. + + +The following special links can be used inside of a MarkupText: + + + +- `**$url('' [, '', '', '', '', ...])$**` + +_Description:_ +The`$url()$`function creates and absolute URL and retains the protocol incoming +request. +_Example:_ +MarkupText: +   `$url('MyLinkPipeline-Start', 'key1', 'value1', 'key2', 'value2')$` +is rewritten to: +   `http://:/on/demandware.store//default/MyLinkPipeline-Start?key1=value1&key2=value2` +Note that the incoming protocol was http in the example above. +- `**$httpUrl('' [, '', '', '', '', ...])$**` + +_Description:_ +The`$httpUrl()$`function creates an absolute URL but always with the fix protocol +"http". The protocol type of the incomming request is ignored. + +_Example:_ +MarkupText: +   `$httpUrl('MyLinkPipeline-Start', 'key1', 'value1', 'key2', 'value2')$` +is rewritten to: +   `http://:'/on/demandware.store//default/MyLinkPipeline-Start?key1=value1&key2=value2` +- `**$httpsUrl('' [, '', '', '', '', ...])$**` + +_Description:_ +The`$httpsUrl()$`function creates an absolute URL but always with the fix protocol +"https". The protocol type of the incomming request is ignored. +_Example:_ +MarkupText: +   `$httpsUrl('MyLinkPipeline-Start', 'key1', 'value1', 'key2', 'value2')$` +is rewritten to: +   `https://:/on/demandware.store//default/MyLinkPipeline-Start?key1=value1&key2=value2` + +- `**$include('' [, '', '', '', '', ...])$**` + +_Description:_ +The`$include()$`function creates a relative URL which is post processed by the +Commerce Cloud Digital Webadapter. The result is the content generated by the given pipeline call. +_Example:_ +MarkupText: +   `$include('MyIncludePipeline-Start','key1', 'value1', 'key2' ,'value2')$` +results in the content delivered by the 'MyIncludePipeline-Start' pipeline. +- `**...?$staticlink$**` + +_Description:_ +The`$staticlink$`function can be used to create a URL to a static resource +(such as an image). The URL being generated depends on the owner of the MarkupText instance. +For example, a product's long description (which is a MarkupText) will generate +links to static resources within the catalog. Possible URL targets are catalogs +(for catalog related objects like products and categories), the content library +(for library related objects like folders and assets) or the organization +(for all objects that are not catalog or library related). +_Example:_ +MarkupText: (owned by a content asset) +   `` +is rewritten to: +   `` + + + +Note: The comma symbol `,` is not supported in parameter values for the link functions. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [markup](#markup): [String](TopLevel.String.md) `(read-only)` | Returns the content with all links rewritten for storefront use. | +| [source](#source): [String](TopLevel.String.md) `(read-only)` | Returns the original content source, without any links re-written. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getMarkup](dw.content.MarkupText.md#getmarkup)() | Returns the content with all links rewritten for storefront use. | +| [getSource](dw.content.MarkupText.md#getsource)() | Returns the original content source, without any links re-written. | +| [toString](dw.content.MarkupText.md#tostring)() | Returns a string representation of this class, the same as getMarkup(). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### markup +- markup: [String](TopLevel.String.md) `(read-only)` + - : Returns the content with all links rewritten for storefront use. + + +--- + +### source +- source: [String](TopLevel.String.md) `(read-only)` + - : Returns the original content source, without any links re-written. + + +--- + +## Method Details + +### getMarkup() +- getMarkup(): [String](TopLevel.String.md) + - : Returns the content with all links rewritten for storefront use. + + **Returns:** + - the content with all links rewritten for storefront use. + + +--- + +### getSource() +- getSource(): [String](TopLevel.String.md) + - : Returns the original content source, without any links re-written. + + **Returns:** + - the original content source, without any links re-written. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a string representation of this class, the same as getMarkup(). + + **Returns:** + - a string representation of this class, the same as getMarkup(). + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.MediaFile.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.MediaFile.md new file mode 100644 index 00000000..04775dbf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.MediaFile.md @@ -0,0 +1,367 @@ + +# Class MediaFile + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.content.MediaFile](dw.content.MediaFile.md) + +This class represents references to media content (such as images) +located within Commerce Cloud Digital or on external systems. + + +Parameter `transform`: + + +Some methods allow the specification of image transformation parameters. Image +transformation is only performed if the Dynamic Imaging Service (DIS) is available +for the Commerce Cloud Digital instance, otherwise a standard static content URL +is returned. The to-be-transformed image needs to be hosted on Commerce Cloud +Digital. + + +Image transformation parameters are specified as JavaScript object literal. They +are translated into URL parameters. See [Create Image Transformation URLs.](https://help.salesforce.com/s/articleView?id=cc.b2c\_creating\_image\_transformation\_urls.htm) + + +| Type of transformation | Parameters | Description | +| --- |--- |--- | +| Scale an image | `scaleWidth`
    `scaleHeight`
    `scaleMode` | The `scaleWidth` and `scaleHeight` parameters are both integers; setting one of these parameters triggers a scaling operation. If both are provided, the one that scales the image less is used to calculate the scale factor. The image is then automatically cropped accord to the second dimension, with a centered position of the cropped area. If the parameter would scale the image larger, only this operation is applied, if the image remains within acceptable pixel dimensions.

    Note: `scaleMode` can only be used in combination with `scaleHeight` and `scaleWidth`.

    The `scaleMode` parameter can be set to `cut` or `fit`. The default `scaleMode` is `cut`, the behavior of which is explained above. If you specify `fit` as the `scaleMode`, the system scales the image into the given box of dimensions while keeping the aspect ratio (possibly resulting in a smaller image in one dimension). | +| Overlay an image | `imageX`
    `imageY`
    `imageURI` | The `imageX` and `imageY` parameters are both integers. Valid values for these parameters are 0 or greater.

    Supported formats are `png`, `jpg`, `jp2`, and `gif`.

    The `imageURI` parameter can be set to the absolute path of the overlaid image. The value of the `imageURI` parameter must be given in proper URL encoding, and it cannot exceed 400 characters in length. The path may include query string parameters, which supports dynamically generating the overlaid image itself through this service; that is, the overlaid image can itself be a transformed image.

    If the overlaid image extends over the primary image's boundaries, the overlaid image is cropped so that it fits directly over the primary image. | +| Crop an image | `cropX`
    `cropY`
    `cropWidth`
    `cropHeight` | The `cropX`, `cropY`, `cropWidth`, `cropHeight` parameters are integers. All four parameters must be specified to trigger a cropping operation.

    Valid values for the `cropX` and `cropY` parameters are 0 or greater. If the crop location defined by `cropX` and `cropY` is outside the image area, nothing is cropped.

    Valid values for the `cropWidth` and `cropHeight` parameters are 10 or greater. If the `cropWidth` and `cropHeight` parameters specify a size that is greater than the original image, the crop area is reduced to the actual image area. If `cropWidth` and `cropHeight` are 0 or less, no transformation is applied. | +| Format an image | `format` | The `format` parameter specifies the target format of image. Supported formats are `png`, `jpg`, `jp2`, and `gif`. If no target format is specified, no format conversion is performed.

    The attribute value must reference the source image. Source image's format is recognized by the file extension which must be `tif`, `tiff`, `jpg`, `jpeg`, `png`, or `gif`.

    In the generated URL the file extension of the target format is used in the URL path. This is to make sure the image is loaded from an URL with a matching file extension. The source format is provided as URL parameter. | +| Adjust image compression quality | `quality` | The `quality` parameter specifies a quality setting for `jpg` and `jp2` images, and specifies the compression level for `png` images.

    For `jpg` and `jp2` images, you can set values from 1–100 for the highest quality. The default quality is 80. If you're not changing the default quality, you don't need to pass in a value.

    For `png` images, the quality setting has no effect on the appearance of the `png`, since the compression is always lossless. Instead you can use the quality setting to set the zlib compression level and filter-type for PNG images. The tens digit sets the zlib compression level(1-9). The ones digit sets the filter type.

    If the `png` setting is not present or set to 0, it uses a default value of 75. If this setting is set to 100, it actually equals the quality setting 90. | +| Adjust Metadata stripping | `strip` | The `strip` parameter specifies if metadata like EXIF and color profiles is stripped from the image during transformation.

    Valid values for the `strip` parameter are between `true` and `false`. The default is `true` | +| Change background color | `bgcolor(color) or bgcolor(color+alpha)` | The `bgcolor` parameter specifies the background color for images that support transparency as well as JPEG images when being converted from a format that supports transparency. Optionally, alpha setting for PNG images are also supported.

    `bgcolor` expects a 6 digit hexadecimal value of RGB with an optional two hexadecimal characters representing alpha value that determines transparency.

    FF0000 = Red

    FF000077 = Red with 50% transparency

    Alpha values are optional. When the alpha value is omitted, the resulting color is opaque. Alpha values are only valid when the image output format is PNG. | + + +Example: + + The following code + + `var url = product.getImage('thumbnail', 0).getImageURL({scaleWidth: 100, format: 'jpg'});` + + will produce an image transformation URL like + + `http:///.../on/demandware.static/...//image.jpg?sw=100&sfrm=png`. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [URL](#url): [URL](dw.web.URL.md) `(read-only)` | Returns an URL to the referenced media file. | +| [absURL](#absurl): [URL](dw.web.URL.md) `(read-only)` | Returns an absolute URL to the referenced media file. | +| [alt](#alt): [String](TopLevel.String.md) `(read-only)` | Returns the alternative text assigned to the media file in current requests locale. | +| [httpURL](#httpurl): [URL](dw.web.URL.md) `(read-only)` | Returns an absolute URL to the referenced media file. | +| [httpsURL](#httpsurl): [URL](dw.web.URL.md) `(read-only)` | Returns an absolute URL to the referenced media file. | +| [title](#title): [String](TopLevel.String.md) `(read-only)` | Returns the title assigned to the media file in current requests locale. | +| ~~[url](#url): [URL](dw.web.URL.md)~~ `(read-only)` | Returns an URL to the referenced media file. | +| [viewType](#viewtype): [String](TopLevel.String.md) `(read-only)` | Returns the view type annotation for the media file. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAbsImageURL](dw.content.MediaFile.md#getabsimageurlobject)([Object](TopLevel.Object.md)) | Returns an URL to the referenced image file. | +| [getAbsURL](dw.content.MediaFile.md#getabsurl)() | Returns an absolute URL to the referenced media file. | +| [getAlt](dw.content.MediaFile.md#getalt)() | Returns the alternative text assigned to the media file in current requests locale. | +| [getHttpImageURL](dw.content.MediaFile.md#gethttpimageurlobject)([Object](TopLevel.Object.md)) | Returns an URL to the referenced image file. | +| [getHttpURL](dw.content.MediaFile.md#gethttpurl)() | Returns an absolute URL to the referenced media file. | +| [getHttpsImageURL](dw.content.MediaFile.md#gethttpsimageurlobject)([Object](TopLevel.Object.md)) | Returns an URL to the referenced image file. | +| [getHttpsURL](dw.content.MediaFile.md#gethttpsurl)() | Returns an absolute URL to the referenced media file. | +| [getImageURL](dw.content.MediaFile.md#getimageurlobject)([Object](TopLevel.Object.md)) | Returns an URL to the referenced image file. | +| [getTitle](dw.content.MediaFile.md#gettitle)() | Returns the title assigned to the media file in current requests locale. | +| [getURL](dw.content.MediaFile.md#geturl)() | Returns an URL to the referenced media file. | +| ~~[getUrl](dw.content.MediaFile.md#geturl)()~~ | Returns an URL to the referenced media file. | +| [getViewType](dw.content.MediaFile.md#getviewtype)() | Returns the view type annotation for the media file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### URL +- URL: [URL](dw.web.URL.md) `(read-only)` + - : Returns an URL to the referenced media file. The + returned URL is a relative URL. + + + +--- + +### absURL +- absURL: [URL](dw.web.URL.md) `(read-only)` + - : Returns an absolute URL to the referenced media file. The + protocol for the reference is the current protocol of the current + HTTP request. + + + +--- + +### alt +- alt: [String](TopLevel.String.md) `(read-only)` + - : Returns the alternative text assigned to the media file in current + requests locale. If no alternative text was assigned or if no defaulting + rule was defined, the method returns null. + + + +--- + +### httpURL +- httpURL: [URL](dw.web.URL.md) `(read-only)` + - : Returns an absolute URL to the referenced media file. The + protocol is http. + + + +--- + +### httpsURL +- httpsURL: [URL](dw.web.URL.md) `(read-only)` + - : Returns an absolute URL to the referenced media file. The + protocol is https. + + + +--- + +### title +- title: [String](TopLevel.String.md) `(read-only)` + - : Returns the title assigned to the media file in current requests locale. + If no title was assigned or if no defaulting rule was defined, the + method returns null. + + + +--- + +### url +- ~~url: [URL](dw.web.URL.md)~~ `(read-only)` + - : Returns an URL to the referenced media file. The + returned URL is a relative URL. + + + **Deprecated:** +:::warning +Use [getURL()](dw.content.MediaFile.md#geturl) instead. +::: + +--- + +### viewType +- viewType: [String](TopLevel.String.md) `(read-only)` + - : Returns the view type annotation for the media file. The method returns + null, if the media file has no view type annotation. + + + +--- + +## Method Details + +### getAbsImageURL(Object) +- getAbsImageURL(transform: [Object](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Returns an URL to the referenced image file. Image transformation + can be applied to the image. The protocol for the reference is the + current protocol of the current HTTP request. + + Image transformation can only be applied to images that are hosted on + Commerce Cloud Digital. + + + **Parameters:** + - transform - Object with transformation parameters (see class header) + + **Returns:** + - an absolute URL to the referenced media file. The + protocol for the reference is the current protocol of the current + HTTP request. If the referenced media file is hosted externally, + an URL to the external file is returned. + + + +--- + +### getAbsURL() +- getAbsURL(): [URL](dw.web.URL.md) + - : Returns an absolute URL to the referenced media file. The + protocol for the reference is the current protocol of the current + HTTP request. + + + **Returns:** + - an absolute URL to the referenced media file. The + protocol for the reference is the current protocol of the current + HTTP request. + + + +--- + +### getAlt() +- getAlt(): [String](TopLevel.String.md) + - : Returns the alternative text assigned to the media file in current + requests locale. If no alternative text was assigned or if no defaulting + rule was defined, the method returns null. + + + **Returns:** + - the alternative text annotated to this media file or null + + +--- + +### getHttpImageURL(Object) +- getHttpImageURL(transform: [Object](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Returns an URL to the referenced image file. Image transformation + can be applied to the image. The protocol is http. + + Image transformation can only be applied to images that are hosted on + Commerce Cloud Digital. + + + **Parameters:** + - transform - Object with transformation parameters (see class header) + + **Returns:** + - an absolute URL to the referenced media file. The + protocol is http. If the referenced media file is hosted externally, + an URL to the external file is returned. + + + +--- + +### getHttpURL() +- getHttpURL(): [URL](dw.web.URL.md) + - : Returns an absolute URL to the referenced media file. The + protocol is http. + + + **Returns:** + - an absolute URL to the referenced media file. The + protocol is http. + + + +--- + +### getHttpsImageURL(Object) +- getHttpsImageURL(transform: [Object](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Returns an URL to the referenced image file. Image transformation + can be applied to the image. The protocol is https. + + Image transformation can only be applied to images that are hosted on + Commerce Cloud Digital. + + + **Parameters:** + - transform - Object with transformation parameters (see class header) + + **Returns:** + - an absolute URL to the referenced media file. The + protocol is https. If the referenced media file is hosted externally, + an URL to the external file is returned. + + + +--- + +### getHttpsURL() +- getHttpsURL(): [URL](dw.web.URL.md) + - : Returns an absolute URL to the referenced media file. The + protocol is https. + + + **Returns:** + - an absolute URL to the referenced media file. The + protocol is https. + + + +--- + +### getImageURL(Object) +- getImageURL(transform: [Object](TopLevel.Object.md)): [URL](dw.web.URL.md) + - : Returns an URL to the referenced image file. Image transformation + can be applied to the image. + + Image transformation can only be applied to images that are hosted on + Commerce Cloud Digital. + + + **Parameters:** + - transform - Object with transformation parameters (see class header) + + **Returns:** + - an URL to the referenced media file. The + returned URL is a relative URL. If the referenced media file is hosted + externally, an URL to the external file is returned. + + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the title assigned to the media file in current requests locale. + If no title was assigned or if no defaulting rule was defined, the + method returns null. + + + **Returns:** + - the title annotated to this media file or null + + +--- + +### getURL() +- getURL(): [URL](dw.web.URL.md) + - : Returns an URL to the referenced media file. The + returned URL is a relative URL. + + + **Returns:** + - an URL to the referenced media file. The + returned URL is a relative URL. + + + +--- + +### getUrl() +- ~~getUrl(): [URL](dw.web.URL.md)~~ + - : Returns an URL to the referenced media file. The + returned URL is a relative URL. + + + **Returns:** + - an URL to the referenced media file. The + returned URL is a relative URL. + + + **Deprecated:** +:::warning +Use [getURL()](dw.content.MediaFile.md#geturl) instead. +::: + +--- + +### getViewType() +- getViewType(): [String](TopLevel.String.md) + - : Returns the view type annotation for the media file. The method returns + null, if the media file has no view type annotation. + + + **Returns:** + - the view type annotated to this media file or null + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.content.md b/packages/b2c-tooling-sdk/data/script-api/dw.content.md new file mode 100644 index 00000000..2dd11f4a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.content.md @@ -0,0 +1,15 @@ +# Package dw.content + +## Classes +| Class | Description | +| --- | --- | +| [Content](dw.content.Content.md) | Class representing a Content asset in Commerce Cloud Digital. | +| [ContentMgr](dw.content.ContentMgr.md) | Provides helper methods for getting content assets, library folders and the content library of the current site. | +| [ContentSearchModel](dw.content.ContentSearchModel.md) | The class is the central interface to a content search result and a content search refinement. | +| [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md) | This class provides an interface to refinement options for content search. | +| [ContentSearchRefinements](dw.content.ContentSearchRefinements.md) | This class provides an interface to refinement options for the content asset search. | +| [ContentSearchRefinementValue](dw.content.ContentSearchRefinementValue.md) | Represents the value of a content search refinement. | +| [Folder](dw.content.Folder.md) | Class representing a folder for organizing content assets in Commerce Cloud Digital. | +| [Library](dw.content.Library.md) | Class representing a collection of [Content](dw.content.Content.md) assets, and a [Folder](dw.content.Folder.md) hierarchy organizing these content assets. | +| [MarkupText](dw.content.MarkupText.md) | The class represents a content snippet with markup. | +| [MediaFile](dw.content.MediaFile.md) | This class represents references to media content (such as images) located within Commerce Cloud Digital or on external systems. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateRef.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateRef.md new file mode 100644 index 00000000..bedd7af9 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateRef.md @@ -0,0 +1,59 @@ + +# Class CertificateRef + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.CertificateRef](dw.crypto.CertificateRef.md) + +This class is used as a reference to a certificate or public key. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## All Known Subclasses +[X509Certificate](dw.crypto.X509Certificate.md) +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CertificateRef](#certificaterefstring)([String](TopLevel.String.md)) | Creates a `CertificateRef` from the passed alias as a reference to a certificate in Business Manager. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [toString](dw.crypto.CertificateRef.md#tostring)() | Returns the string representation of this CertificateRef. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CertificateRef(String) +- CertificateRef(alias: [String](TopLevel.String.md)) + - : Creates a `CertificateRef` from the passed alias as a reference to a certificate in Business Manager. + No check is made whether the alias is actually valid until the time that this `CertificateRef` is + used to resolve a certificate or public key. + + + **Parameters:** + - alias - an alias that should refer to a certificate in the keystore. + + +--- + +## Method Details + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns the string representation of this CertificateRef. + + **Returns:** + - The string representation of this CertificateRef. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateUtils.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateUtils.md new file mode 100644 index 00000000..82bb1d86 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.CertificateUtils.md @@ -0,0 +1,162 @@ + +# Class CertificateUtils + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.CertificateUtils](dw.crypto.CertificateUtils.md) + +Utilities for managing certificates and keys. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CertificateUtils](#certificateutils)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [getCertificate](dw.crypto.CertificateUtils.md#getcertificatecertificateref)([CertificateRef](dw.crypto.CertificateRef.md)) | Gets the certificate from the given certificate reference. | +| static [getCertificate](dw.crypto.CertificateUtils.md#getcertificatekeyref)([KeyRef](dw.crypto.KeyRef.md)) | Gets the public certificate from the given private key reference. | +| static [getEncodedCertificate](dw.crypto.CertificateUtils.md#getencodedcertificatecertificateref)([CertificateRef](dw.crypto.CertificateRef.md)) | Encode the certificate to the base64-encoded DER format. | +| static [getEncodedPublicKey](dw.crypto.CertificateUtils.md#getencodedpublickeycertificateref)([CertificateRef](dw.crypto.CertificateRef.md)) | Gets the public key from the given certificate reference. | +| static [parseEncodedCertificate](dw.crypto.CertificateUtils.md#parseencodedcertificatestring)([String](TopLevel.String.md)) | Parse the certificate from the base64-encoded DER format. | +| static [parseEncodedPublicKey](dw.crypto.CertificateUtils.md#parseencodedpublickeystring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Parse the public key from the given key in X.509 SubjectPublicKeyInfo format. | +| static [parsePublicKeyFromJWK](dw.crypto.CertificateUtils.md#parsepublickeyfromjwkstring)([String](TopLevel.String.md)) | Parse the public key from the given base64-encoded JWK string. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CertificateUtils() +- CertificateUtils() + - : + + +--- + +## Method Details + +### getCertificate(CertificateRef) +- static getCertificate(certificateRef: [CertificateRef](dw.crypto.CertificateRef.md)): [X509Certificate](dw.crypto.X509Certificate.md) + - : Gets the certificate from the given certificate reference. + + **Parameters:** + - certificateRef - the certificate reference + + **Returns:** + - The X509Certificate + + **Throws:** + - Exception - if the reference is invalid or does not refer to an X.509 certificate + + +--- + +### getCertificate(KeyRef) +- static getCertificate(keyRef: [KeyRef](dw.crypto.KeyRef.md)): [X509Certificate](dw.crypto.X509Certificate.md) + - : Gets the public certificate from the given private key reference. + + **Parameters:** + - keyRef - the key reference + + **Returns:** + - The X509Certificate + + **Throws:** + - Exception - if the reference is invalid or there is no X.509 certificate + + +--- + +### getEncodedCertificate(CertificateRef) +- static getEncodedCertificate(certificateRef: [CertificateRef](dw.crypto.CertificateRef.md)): [String](TopLevel.String.md) + - : Encode the certificate to the base64-encoded DER format. + + **Parameters:** + - certificateRef - the certificate to encode + + **Returns:** + - base64-encoded DER certificate + + +--- + +### getEncodedPublicKey(CertificateRef) +- static getEncodedPublicKey(certificateRef: [CertificateRef](dw.crypto.CertificateRef.md)): [String](TopLevel.String.md) + - : Gets the public key from the given certificate reference. + + + It is exported in the standard X.509 SubjectPublicKeyInfo format and base64-encoded. + + + **Parameters:** + - certificateRef - the certificate reference with the public key to encode + + **Returns:** + - The encoded public key + + +--- + +### parseEncodedCertificate(String) +- static parseEncodedCertificate(certificate: [String](TopLevel.String.md)): [CertificateRef](dw.crypto.CertificateRef.md) + - : Parse the certificate from the base64-encoded DER format. + + **Parameters:** + - certificate - The encoded certificate + + **Returns:** + - Reference to the parsed certificate + + +--- + +### parseEncodedPublicKey(String, String) +- static parseEncodedPublicKey(algorithm: [String](TopLevel.String.md), encodedKey: [String](TopLevel.String.md)): [CertificateRef](dw.crypto.CertificateRef.md) + - : Parse the public key from the given key in X.509 SubjectPublicKeyInfo format. + + + The resulting reference contains only the public key. It can be used for cryptographic operations, but not + anything that requires the full certificate. + + + **Parameters:** + - algorithm - The public key algorithm, either `EC` or `RSA` + - encodedKey - The encoded key + + **Returns:** + - Reference to the public key + + +--- + +### parsePublicKeyFromJWK(String) +- static parsePublicKeyFromJWK(jwk: [String](TopLevel.String.md)): [CertificateRef](dw.crypto.CertificateRef.md) + - : Parse the public key from the given base64-encoded JWK string. + + + This returns the public key portion of the JWK, not the `x5c` certificate chain. + + + Only RSA and EC keys are supported. + + + + + The resulting reference contains only the public key. It can be used for cryptographic operations, but not + anything that requires the full certificate. + + + **Parameters:** + - jwk - Encoded JWK + + **Returns:** + - Reference to the public key + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Cipher.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Cipher.md new file mode 100644 index 00000000..6b2c8abf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Cipher.md @@ -0,0 +1,1230 @@ + +# Class Cipher + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.Cipher](dw.crypto.Cipher.md) + +This class allows access to encryption services offered through the Java +Cryptography Architecture (JCA). At this time the implementation of the +encryption/decryption methods is based on the default JCE provider of the JDK. +See the Java documentation for a reference guide to the underlying security +provider and information about the Secure Sockets Extension. + +You can find a good overview of the essential purposes of cryptography and +some common implementations in the Wikipedia article on cryptography. +Also see the website of the National Institute of Standards and Technology. +The format of various files used to hold keys, certificate signing requests, +and the like, as well as some related algorithms, are defined in the PKCS series of +documents published by RSALabs (the research arm of RSA Security). + +Many internet standards documenting security protocols and concepts are described +in documents originally described as "Request For Comment" and thus widely known +as RFCs. Many of them are available on the Internet FAQ Archives website. + + +dw.crypto.Cipher is intentionally an Adapter to the full cryptography power supplied +in the security provider implementation. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3 requirements 2, 4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CHAR_ENCODING](#char_encoding): [String](TopLevel.String.md) = "UTF8" | Strings containing keys, plain texts, cipher texts etc. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Cipher](#cipher)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-1)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1), which allows to use a key in the keystore for the decryption. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-2)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2), which allows to use a key in the keystore for the decryption. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-3)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3), which allows to use a key in the keystore for the decryption. | +| [decrypt](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the passed Base-64 encoded message using the passed key and applying the transformations described by the passed parameters. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-1)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1), which allows you to use a key in the keystore for encryption. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-2)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2), which allows you to use a key in the keystore for encryption. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-3)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3), which allows you to use a key in the keystore for encryption. | +| [encrypt](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CHAR_ENCODING + +- CHAR_ENCODING: [String](TopLevel.String.md) = "UTF8" + - : Strings containing keys, plain texts, cipher texts etc. are internally + converted into byte arrays using this encoding (currently UTF8). + + + +--- + +## Constructor Details + +### Cipher() +- Cipher() + - : + + +--- + +## Method Details + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 1 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows + to use a key in the keystore for the decryption. + + + **Parameters:** + - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)) + - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)) + - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)) + + **Returns:** + - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1)) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 1 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var base64Msg : String = "some_encoded_encrypted_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg); + var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations); + var message : String = messageBytes.toString(charset); + ``` + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 2 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows + to use a key in the keystore for the decryption. + + + **Parameters:** + - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)) + - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)) + - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)) + + **Returns:** + - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2)) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 2 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var base64Msg : String = "some_encoded_encrypted_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg); + var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations); + var message : String = messageBytes.toString(charset); + ``` + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 3 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows + to use a key in the keystore for the decryption. + + + **Parameters:** + - encryptedBytes - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)) + - saltOrIV - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)) + - iterations - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)) + + **Returns:** + - (see [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3)) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 3 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var base64Msg : String = "some_encoded_encrypted_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + var encryptedBytes : Bytes = Encoding.fromBase64(base64Msg); + var messageBytes : Bytes = Cipher.decryptBytes(encryptedBytes, key, transformation, salt, iterations); + var message : String = messageBytes.toString(charset); + ``` + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 1 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1), which allows + to use a key in the keystore for the decryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)) + - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)) + - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)) + + **Returns:** + - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1)) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 1 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the passed Base-64 encoded message using the passed key and + applying the transformations described by the passed parameters. + + + Decryption is the process of getting back the original data from the + cipher-text using a decryption key. + + + **Parameters:** + - base64Msg - the base64 encoded cipher bytes + - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). Note that for RSA the key length should be at least 2048 bits. + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data. + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 2 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2), which allows + to use a key in the keystore for the decryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)) + - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)) + - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)) + + **Returns:** + - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2)) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 2 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the passed Base-64 encoded message using the passed key and + applying the transformations described by the passed parameters. + + + Decryption is the process of getting back the original data from the + cipher-text using a decryption key. + + + **Parameters:** + - base64Msg - the base64 encoded cipher bytes + - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data. + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 3 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3), which allows + to use a key in the keystore for the decryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - base64Msg - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)) + - privateKey - A reference to a private key in the key store. + - transformation - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)) + - saltOrIV - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)) + - iterations - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)) + + **Returns:** + - (see [decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3)) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 3 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the passed Base-64 encoded message using the passed key and + applying the transformations described by the passed parameters. + + + Decryption is the process of getting back the original data from the + cipher-text using a decryption key. + + + **Parameters:** + - base64Msg - the base64 encoded cipher bytes + - key - When using a _symmetric_ cryptographic algorithm, use the same key to encrypt and decrypt. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. See the corresponding encrypt method for supported transformations. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector (see the corresponding encrypt method for details). Should be appropriate for the algorithm being used. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data that was used to encrypt the data. + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 1 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows + to use a key in the keystore for the encryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)) + - publicKey - A reference to a public key. + - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)) + - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)) + - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)) + + **Returns:** + - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1)) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 1 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the + specified key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var message : String = "some_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + // encrypt the message + var messageBytes : Bytes = new Bytes(message, charset); + var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations); + var encrypted : String = Encoding.toBase64(encryptedBytes); + ``` + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - The transformation to apply. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 2 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows + to use a key in the keystore for the encryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)) + - publicKey - A reference to a public key. + - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)) + - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)) + - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)) + + **Returns:** + - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2)) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 2 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the + specified key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var message : String = "some_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + // encrypt the message + var messageBytes : Bytes = new Bytes(message, charset); + var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations); + var encrypted : String = Encoding.toBase64(encryptedBytes); + ``` + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - The transformation to apply. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 3 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows + to use a key in the keystore for the encryption. + + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + **Parameters:** + - messageBytes - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)) + - publicKey - A reference to a public key. + - transformation - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)) + - saltOrIV - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)) + - iterations - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)) + + **Returns:** + - (see [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3)) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 3 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the + specified key and applying the transformations described by the specified + parameters. + + + Typical usage: + + + ``` + var message : String = "some_message"; + var charset : String = "UTF8"; // or "windows-1252", etc. + + // encrypt the message + var messageBytes : Bytes = new Bytes(message, charset); + var encryptedBytes : Bytes = Cipher.encryptBytes(messageBytes, key, transformation, salt, iterations); + var encrypted : String = Encoding.toBase64(encryptedBytes); + ``` + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - The transformation to apply. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 1 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to + [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1), which allows you to + use a key in the keystore for encryption. + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + For asymmetric algorithms a private/public key pair is required. + Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx. + You can assign private keys an extra password in Business Manager. Public keys + can only be imported as trusted certificates in the format \*.crt, \*.pem, + \*.der, and \*.cer. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate a public and a non-protected private key ( \*.crt and \*.key ). + + + **Parameters:** + - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)) + - publicKey - A reference to a public key. + - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)) + - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)) + - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)) + + **Returns:** + - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1)) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 1 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + + Encryption is the process of converting normal data or plain text to + something incomprehensible or cipher-text by applying transformations, + which are the operation (or set of operations) to be performed on given input + to produce some output. A transformation always includes the name of a + cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme. + The supported algorithms are listed in the parameter description below. + + + The cryptographic algorithms can be partitioned into _symmetric_ + and _asymmetric_ (or public key/private key). + + + **Symmetric** or "secret key" algorithms use the same key to encrypt + and to decrypt the data. Symmetric algorithms are what most people think + of as codes: using a well-known algorithm and a secret key to encode information, + which can be decoded using the same algorithm and the same key. The algorithm + is not secret, the secrecy is inherent to guarding the key. A significant + problem with symmetric ciphers is that it is difficult to transfer the keys + themselves securely. Symmetric algorithms include _password-based_ algorithms. + + + **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward. + Please consider switching to it if you are using any other scheme or if using AES with a + shorter key length. The rest of the symmetric algorithms will be deprecated in the future.** + + + **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key. + Only the holder of the private key will be able to decrypt. + The public key and private key together are also called a "key pair". + Data encrypted with one key can only be decrypted using the other key + from the pair, and it is not possible to deduce one key from the other. + This helps to solve the key distribution problem since it is possible to + publicise one of the keys widely (the "public key") and keep the other + a closely guarded secret (the "private key"). Many partners can then + send data encrypted with the public key, but only the holder of the + corresponding private key can decrypt it. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place. + + ``` + openssl genrsa -out rsaprivatekey.pem 2048 + ``` + + 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout + ``` + + 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt + ``` + + + + + **Modes** + + The following modes of operation are block cipher operations that + are used with some algorithms. + + - "NONE" no mode + - "CBC" Cipher Block Chaining (defined in FIPS PUB 81) + - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81) + - "CTS" CipherText Streaming mode + - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81) + - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980. + - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81) + - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4) + + + + **Paddings** + + - "NoPadding": No padding. + - OAEPWithAndPadding: + Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where should be replaced by the message digest and by the mask generation function. + Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING + - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme + - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes. + - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993. + - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher) + + + **Parameters:** + - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream) + - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include:

  • "AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding"
  • Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. Also, PKCS5Padding is the only supported Padding. NOPADDING and ISO10126PADDING have been deprecated. Supported Asymmetric transformations include:
  • "RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING"
  • Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING,OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data. + + **Returns:** + - the encrypted message encoded as a String using base 64 encoding. + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 2 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to + [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2), which allows you to + use a key in the keystore for encryption. + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + For asymmetric algorithms a private/public key pair is required. + Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx. + You can assign private keys an extra password in Business Manager. Public keys + can only be imported as trusted certificates in the format \*.crt, \*.pem, + \*.der, and \*.cer. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate a public and a non-protected private key ( \*.crt and \*.key ). + + ``` + openssl req -x509 -newkey rsa:2048 -keyout nopass.key -out nopass.crt -days 365 -nodes + ``` + + 2. Generate a keystore that contains the public and private keys ( \*.p12 ). + + ``` + openssl pkcs12 -export -out nopass.p12 -inkey nopass.key -in nopass.crt + ``` + + + To import a private or public key into the Digital keystore, navigate to + **Administration > Operations > Private Keys and Certificates** + Use a .p12 file to import a private key and a \*.crt to import a public key. + + + Typical usage: + + + ``` + var plain : String = "some_plain_text"; + var publicKeyRef = new CertificateRef("rsa-certificate-2048"); + var cipher : Cipher = new Cipher(); + var encrypted : String = cipher.encrypt(plain, publicKeyRef, "RSA", null, 0); + ``` + + + **Parameters:** + - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)) + - publicKey - A reference to a public key. + - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)) + - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)) + - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)) + + **Returns:** + - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2)) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 2 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + + Encryption is the process of converting normal data or plain text to + something incomprehensible or cipher-text by applying transformations, + which are the operation (or set of operations) to be performed on given input + to produce some output. A transformation always includes the name of a + cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme. + The supported algorithms are listed in the parameter description below. + + The cryptographic algorithms can be partitioned into _symmetric_ + and _asymmetric_ (or public key/private key). + + + **Symmetric** or "secret key" algorithms use the same key to encrypt + and to decrypt the data. Symmetric algorithms are what most people think + of as codes: using a well-known algorithm and a secret key to encode information, + which can be decoded using the same algorithm and the same key. The algorithm + is not secret, the secrecy is inherent to guarding the key. A significant + problem with symmetric ciphers is that it is difficult to transfer the keys + themselves securely. Symmetric algorithms include _password-based_ algorithms. + + + **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward. + Please consider switching to it if you are using any other scheme or if using AES with a + shorter key length. The rest of the symmetric algorithms will be deprecated in the future.** + + + **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key. + Only the holder of the private key will be able to decrypt. + The public key and private key together are also called a "key pair". + Data encrypted with one key can only be decrypted using the other key + from the pair, and it is not possible to deduce one key from the other. + This helps to solve the key distribution problem since it is possible to + publicise one of the keys widely (the "public key") and keep the other + a closely guarded secret (the "private key"). Many partners can then + send data encrypted with the public key, but only the holder of the + corresponding private key can decrypt it. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place. + + ``` + openssl genrsa -out rsaprivatekey.pem 2048 + ``` + + 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout + ``` + + 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt + ``` + + + + + **Modes** + + The following modes of operation are block cipher operations that + are used with some algorithms. + + - "NONE" no mode + - "CBC" Cipher Block Chaining (defined in FIPS PUB 81) + - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81) + - "CTS" CipherText Streaming mode + - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81) + - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980. + - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81) + - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4) + + + + **Paddings** + + - "NoPadding": No padding. + - OAEPWithAndPadding: + Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where should be replaced by the message digest and by the mask generation function. + Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING + - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme + - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes. + - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993. + - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher) + + + **Parameters:** + - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream) + - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include:
  • "AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding"
  • Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. Also, PKCS5Padding is the only supported Padding. NOPADDING and ISO10126PADDING have been deprecated. Supported Asymmetric transformations include:
  • "RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING"
  • Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING, OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. If this value is null, a default initialization value will be used by the engine. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1. DSA has a specific initialization that uses three integers to build a DSAParameterSpec (a prime, a sub-prime and a base). To use this algorithm you should use the JCE or another provider to supply a DSAParameterSpec and then supply the Base64 equivalent string as the "salt". Please see the documentation from the provider for additional restrictions. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data. + + **Returns:** + - the encrypted message encoded as a String using base 64 encoding. + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 3 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to + [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3), which allows you to + use a key in the keystore for encryption. + + + Note: Only asymmetric (public/private key pair) algorithms can be used + with this method, since only those keys can be added to a keystore. + + + For asymmetric algorithms a private/public key pair is required. + Commerce Cloud Digital only allows you to add private keys in the format \*.p12 and \*.pfx. + You can assign private keys an extra password in Business Manager. Public keys + can only be imported as trusted certificates in the format \*.crt, \*.pem, + \*.der, and \*.cer. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate a public and a non-protected private key ( \*.crt and \*.key ). + + ``` + openssl req -x509 -newkey rsa:2048 -keyout nopass.key -out nopass.crt -days 365 -nodes + ``` + + 2. Generate a keystore that contains the public and private keys ( \*.p12 ). + + ``` + openssl pkcs12 -export -out nopass.p12 -inkey nopass.key -in nopass.crt + ``` + + + To import a private or public key into the Digital keystore, navigate to + **Administration > Operations > Private Keys and Certificates** + Use a .p12 file to import a private key and a \*.crt to import a public key. + + + Typical usage: + + + ``` + var plain : String = "some_plain_text"; + var publicKeyRef = new CertificateRef("rsa-certificate-2048"); + var cipher : Cipher = new Cipher(); + var encrypted : String = cipher.encrypt(plain, publicKeyRef, "RSA", null, 0); + ``` + + + **Parameters:** + - message - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)) + - publicKey - A reference to a public key. + - transformation - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)) + - saltOrIV - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)) + - iterations - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)) + + **Returns:** + - (see [encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3)) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 3 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + + Encryption is the process of converting normal data or plain text to + something incomprehensible or cipher-text by applying transformations, + which are the operation (or set of operations) to be performed on given input + to produce some output. A transformation always includes the name of a + cryptographic algorithm (for example, RSA) and may be followed by a mode and padding scheme. + The supported algorithms are listed in the parameter description below. + + The cryptographic algorithms can be partitioned into _symmetric_ + and _asymmetric_ (or public key/private key). + + + **Symmetric** or "secret key" algorithms use the same key to encrypt + and to decrypt the data. Symmetric algorithms are what most people think + of as codes: using a well-known algorithm and a secret key to encode information, + which can be decoded using the same algorithm and the same key. The algorithm + is not secret, the secrecy is inherent to guarding the key. A significant + problem with symmetric ciphers is that it is difficult to transfer the keys + themselves securely. Symmetric algorithms include _password-based_ algorithms. + + **AES with key length of 256 bits is the preferred choice for symmetric encryption going forward. + Please consider switching to it if you are using any other scheme or if using AES with a + shorter key length. The rest of the symmetric algorithms will be deprecated in the future.** + + + **Asymmetric** or "public key" cryptography uses a public/private key pair, and then publishes the public key. + Only the holder of the private key will be able to decrypt. + The public key and private key together are also called a "key pair". + Data encrypted with one key can only be decrypted using the other key + from the pair, and it is not possible to deduce one key from the other. + This helps to solve the key distribution problem since it is possible to + publicise one of the keys widely (the "public key") and keep the other + a closely guarded secret (the "private key"). Many partners can then + send data encrypted with the public key, but only the holder of the + corresponding private key can decrypt it. + + + Key pairs for asymmetric ciphers can be generated with an arbitrary tool. + One of the most popular options is the open source tool OpenSSL. + OpenSSL has a command-line syntax and is available on major platforms. + + + The following steps are involved in **creating an RSA key pair:** + + 1. Generate an RSA private key with keylength of 2048 bits. Store this key in a safe place. + + ``` + openssl genrsa -out rsaprivatekey.pem 2048 + ``` + + 2. Generate a public key from the private key. You use the public key to encrypt messages with Cipher.encrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl rsa -in rsaprivatekey.pem -out publickey.pem -pubout + ``` + + 3. Generate a private key in PKCS\#8 format. You use that key to decrypt messages with Cipher.decrypt. OpenSSL saves the key PEM-encoded; this means the key is saved with a base64 encoding. After you removed the header and footer lines you can pass the content directly to the API method. + + ``` + openssl pkcs8 -topk8 -in rsaprivatekey.pem -out privatekey.pem -nocrypt + ``` + + + + + **Modes** + + The following modes of operation are block cipher operations that + are used with some algorithms. + + - "NONE" no mode + - "CBC" Cipher Block Chaining (defined in FIPS PUB 81) + - "CTR" Counter mode or Segmented Integer Counter mode (defined in FIPS PUB 81) + - "CTS" CipherText Streaming mode + - "CFB" Cipher Feedback Mode, can be referred to with key length referenced as "CFB8","CFB16","CFB24".."CFB64" (defined in FIPS PUB 81) + - "ECB" Electronic Cook book as defined in: The National Institute of Standards and Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of Operation," U.S. Department of Commerce, Dec 1980. + - "GCM" Galois/Counter Mode (defined in NIST SP 800-38D) + - "OFB" Output Feedback Mode, can be referred to with key length referenced as "OFB8","OFB16","OFB24".."OFB64" (defined in FIPS PUB 81) + - "PCBC" Propagating Cipher Block Chaining (defined in Kerberos V4) + + + + **Paddings** + + - "NoPadding": No padding. + - OAEPWithAndPadding: + Optimal Asymmetric Encryption Padding scheme defined in PKCS\#1, where should be replaced by the message digest and by the mask generation function. + Examples: OAEPWITHSHA-256ANDMGF1PADDING, OAEPWITHSHA-384ANDMGF1PADDING, OAEPWITHSHA-512ANDMGF1PADDING + - ISO10126PADDING: the ISO10126-2:1991 DEA padding scheme + - PKCS1Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories that can encrypt messages up to 11 bytes smaller than the modulus size in bytes. + - PKCS5Padding: Public Key Cryptography Standard \#1, a standard for padding from RSA Laboratories, "PKCS\#5: Password-Based Encryption Standard," version 1.5, November 1993. + - SSL3Padding: The padding scheme defined in the SSL Protocol Version 3.0, November 18, 1996, section 5.2.3.2 (CBC block cipher) + + + **Parameters:** + - message - A string to encrypt (will be first converted with UTF-8 encoding into a byte stream) + - key - A string ready for use with the algorithm. The key's format depends on the algorithm specified and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. The cryptographic algorithms can be partitioned into _symmetric_ and _asymmetric_ (or public key/private key). Symmetric algorithms include _password-based_ algorithms. Symmetric keys are usually a base64-encoded array of bytes. Asymmetric keys are "key pairs" with a public key and a private key. To encrypt using asymmetric algorithms, provide the public key. To decrypt using asymmetric algorithms, provide the private key from the same pair in PKCS\#8 format, base64-encoded. See class documentation on how to generate a key pair. If the cryptographic algorithm is _symmetric_ (for example, AES) or _asymmetric_ (for example, RSA), the key needs to be passed as a base64-encoded string. The only exception is the _symmetric_ cryptographic algorithms _Password Based Encryption_ (PBE). With PBE the key needs to be passed as plain string (_without_ any encoding). + - transformation - The transformation has to be in _"algorithm/mode/padding"_ format. Symmetric or "secret key" algorithms use the same key to encrypt and to decrypt the data. Asymmetric or "public key" cryptography uses a public/private key pair, and then publishes the public key. Only the holder of the private key will be able to decrypt. The public key and private key are also known as a "key pair". Supported Symmetric transformations include:
  • "AES" or Rijndael, Advanced Encryption Standard as specified by NIST **AES with key length of 256 is the preferred choice for symmetric encryption** Keysizes: 128, 192, or 256 Modes: "GCM","ECB","CBC","PCBC","CTR","CTS","CFB","CFB8","CFB16","CFB24".."CFB64", "OFB","OFB8","OFB16","OFB24".."OFB64" Padding: "PKCS5Padding" or "NoPadding" (GCM only)
  • Note that ARCFOUR, Blowfish, DES, RC2, DESede, DESedeWrap, PBEWithMD5AndDES, PBEWithMD5AndTripleDES1, PBEWithSHA1AndDESede and PBEWithSHA1AndRC2\_40 transformations have been deprecated. PKCS5Padding is the only supported Padding for most modes. NOPADDING is only supported for GCM, and ISO10126PADDING has been deprecated. Supported Asymmetric transformations include:
  • "RSA" Mode: "ECB" Padding: "OAEPWITHSHA-256ANDMGF1PADDING", "OAEPWITHSHA-384ANDMGF1PADDING", "OAEPWITHSHA-512ANDMGF1PADDING"
  • Note that for RSA the key length should be at least 2048 bits. Also, the following Padding options have been deprecated: NOPADDING, PKCS1PADDING, OAEPWITHMD5ANDMGF1PADDING, OAEPWITHSHA1ANDMGF1PADDING and OAEPWITHSHA-1ANDMGF1PADDING. + - saltOrIV - Initialization value appropriate for the algorithm, this might be a Binary Salt or AlgorithmParameter or InitializationVector. (As binary values cannot be passed, the equivalent Base64 String should be passed for any binary salt value). Should be appropriate for the algorithm being used. The same value used to Encrypt needs to be supplied to the Decrypt function for many algorithms to successfully decrypt the data, so it is best practice to specify an appropriate value. Requirements for the size and generation of DES initialization vectors (IV) are derived from FIPS 74 and FIPS 81 from the National Institute of Standards and Technology. CBC mode requires an IV with length 64 bits; CFB uses 48-64 bits; OFB uses 64 bits; GCM uses 96 bits. If the IV is to be used with DES in the OFB mode, then it is not acceptable for the IV to remain fixed for multiple encryptions, if the same key is used for those encryptions. For Block Encryption algorithms this is the encoded Base64 String equivalent to the a random number to use as a "salt" to use with the algorithm. The algorithm must contain a Feedback Mode other than ECB. This must be a binary value that is exactly the same size as the algorithm block size. RC5 uses an optional 8-byte initialization vector (IV), but only in feedback mode (see CFB above). For Password Based Encryption algorithms, the salt is the encoded Base64 String equivalent to a random number value to transform the password into a key. PBE derives an encryption key from a password. In order to make the task of getting from password to key very time-consuming for an attacker, most PBE implementations will mix in a random number, known as a salt, to create the key. The salt value and the iteration count are then combined into a PBEParameterSpecification to initialize the cipher. The PKCS\#5 spec from RSA Labs defines the parameters for password-based encryption (PBE). The RSA algorithm requires a salt with length as defined in PKCS\#1. DSA has a specific initialization that uses three integers to build a DSAParameterSpec (a prime, a sub-prime and a base). To use this algorithm you should use the JCE or another provider to supply a DSAParameterSpec and then supply the Base64 equivalent string as the "salt". Please see the documentation from the provider for additional restrictions. For GCM the base64-encoded initialization vector may be optionally suffixed with a vertical pipe followed by the number of bits in the tag length. If not present then the tag length will be 128 bits. This syntax is only supported for the GCM mode. + - iterations - The number of passes to make when turning a passphrase into a key. This is only applicable for some types of algorithm. Password Based Encryption (PBE) algorithms use this parameter, and Block Encryption algorithms do not. If this value is relevant to the algorithm it would be best practice to supply it, as the same value would be needed to decrypt the data. + + **Returns:** + - the encrypted message encoded as a String using base 64 encoding. + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Encoding.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Encoding.md new file mode 100644 index 00000000..068f9a55 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Encoding.md @@ -0,0 +1,193 @@ + +# Class Encoding + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.Encoding](dw.crypto.Encoding.md) + +Utility class which handles several common character encodings. + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [fromBase64](dw.crypto.Encoding.md#frombase64string)([String](TopLevel.String.md)) | Decode the given string which represents a sequence of characters encoded in base-64 to a byte array. | +| static [fromHex](dw.crypto.Encoding.md#fromhexstring)([String](TopLevel.String.md)) | Converts a String representing hexadecimal values into an array of bytes of those same values. | +| static [fromURI](dw.crypto.Encoding.md#fromuristring)([String](TopLevel.String.md)) | Decodes a URL safe string into its original form. | +| static [fromURI](dw.crypto.Encoding.md#fromuristring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Decodes a URL safe string into its original form using the specified encoding. | +| static [toBase64](dw.crypto.Encoding.md#tobase64bytes)([Bytes](dw.util.Bytes.md)) | Convert the given byte array to a string encoded in base-64. | +| static [toBase64URL](dw.crypto.Encoding.md#tobase64urlbytes)([Bytes](dw.util.Bytes.md)) | Convert the given byte array to a string encoded in base-64 for URLs. | +| static [toHex](dw.crypto.Encoding.md#tohexbytes)([Bytes](dw.util.Bytes.md)) | Converts an array of bytes into a string representing the hexadecimal values of each byte in order. | +| static [toURI](dw.crypto.Encoding.md#touristring)([String](TopLevel.String.md)) | Encodes a string into its URL safe form according to the "application/x-www-form-urlencoded" encoding scheme using the default encoding. | +| static [toURI](dw.crypto.Encoding.md#touristring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Encodes a string into its URL safe form according to the "application/x-www-form-urlencoded" encoding scheme using the specified encoding. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### fromBase64(String) +- static fromBase64(string: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Decode the given string which represents a sequence of characters encoded in base-64 to a byte array. This + operation supports both the base-64 and base-64 for URL formats. Characters not in the base-64 alphabet are + ignored. An exception is thrown if a null value is passed. + + + Note: This decoding operation is limited to the maximum number of bytes that a Bytes object can hold. See + [Bytes](dw.util.Bytes.md). + + + **Parameters:** + - string - A string consisting of characters in base-64 alphabet to decode. + + **Returns:** + - The decoded array of bytes. + + +--- + +### fromHex(String) +- static fromHex(string: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Converts a String representing hexadecimal values into an array of bytes + of those same values. The returned byte array will be half the length of + the passed, as it takes two characters to represent any given byte. An + exception is thrown if the passed string has an odd number of character + or if any characters in the string are not valid hexadecimal characters. + An exception is thrown if a null value is passed. + + Note: This decoding operation is limited to the maximum number of bytes + that a Bytes object can hold. See [Bytes](dw.util.Bytes.md). + + + **Parameters:** + - string - A string containing only hex characters to decode. + + **Returns:** + - The decoded array of bytes. + + +--- + +### fromURI(String) +- static fromURI(string: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Decodes a URL safe string into its original form. Escaped characters are + converted back to their original representation. An exception is thrown + if URL decoding is unsuccessful or if null is passed. + + + **Parameters:** + - string - The string to decode. + + **Returns:** + - The decoded string. + + +--- + +### fromURI(String, String) +- static fromURI(string: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Decodes a URL safe string into its original form using the specified + encoding. Escaped characters are converted back to their original + representation. An exception is thrown if URL decoding is unsuccessful or + if the specified encoding is unsupported or if null is passed for either + argument. + + + **Parameters:** + - string - The string to decode. + - encoding - The name of a supported encoding. + + **Returns:** + - The decoded string. + + +--- + +### toBase64(Bytes) +- static toBase64(bytes: [Bytes](dw.util.Bytes.md)): [String](TopLevel.String.md) + - : Convert the given byte array to a string encoded in base-64. This method + does not chunk the data by adding line breaks. An exception is thrown + if a null value is passed. + + + **Parameters:** + - bytes - The array of bytes to encode. + + **Returns:** + - The encoded string containing only Base64 characters. + + +--- + +### toBase64URL(Bytes) +- static toBase64URL(bytes: [Bytes](dw.util.Bytes.md)): [String](TopLevel.String.md) + - : Convert the given byte array to a string encoded in base-64 for URLs. This method does not chunk the data by + adding line breaks and it does not add any padding. An exception is thrown if a null value is passed. + + + **Parameters:** + - bytes - The array of bytes to encode. + + **Returns:** + - The encoded string containing only Base64URL characters. + + +--- + +### toHex(Bytes) +- static toHex(bytes: [Bytes](dw.util.Bytes.md)): [String](TopLevel.String.md) + - : Converts an array of bytes into a string representing the hexadecimal + values of each byte in order. The returned string will be double the + length of the passed array, as it takes two characters to represent any + given byte. An exception is thrown if a null value is passed. + + + **Parameters:** + - bytes - The array of bytes to encode. + + **Returns:** + - The encoded string containing only hex characters. + + +--- + +### toURI(String) +- static toURI(string: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Encodes a string into its URL safe form according to the + "application/x-www-form-urlencoded" encoding scheme using the default + encoding. Unsafe characters are escaped. An exception is thrown if a null + value is passed. + + + **Parameters:** + - string - The string to encode. + + **Returns:** + - The encoded string. + + +--- + +### toURI(String, String) +- static toURI(string: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Encodes a string into its URL safe form according to the + "application/x-www-form-urlencoded" encoding scheme using the specified + encoding. Unsafe characters are escaped. An exception is thrown if the + specified encoding is unsupported. An exception is thrown if either + argument is null. + + + **Parameters:** + - string - The string to encode. + - encoding - The name of a supported encoding. + + **Returns:** + - The encoded string. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWE.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWE.md new file mode 100644 index 00000000..e61476ab --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWE.md @@ -0,0 +1,245 @@ + +# Class JWE + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.JWE](dw.crypto.JWE.md) + +This class represents a JSON Web Encryption (JWE) object. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3 requirements 2, 4, and 12. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [algorithm](#algorithm): [String](TopLevel.String.md) `(read-only)` | Get the algorithm (`alg`) from the header. | +| [encryptionMethod](#encryptionmethod): [String](TopLevel.String.md) `(read-only)` | Get the encryption method (`enc`) from the header. | +| [headerMap](#headermap): [Map](dw.util.Map.md) `(read-only)` | Get a copy of the JWE headers as a Map. | +| [keyID](#keyid): [String](TopLevel.String.md) `(read-only)` | Get the key id (`kid`) from the header. | +| [payload](#payload): [String](TopLevel.String.md) `(read-only)` | Get the decrypted payload. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [JWE](#jwejweheader-string)([JWEHeader](dw.crypto.JWEHeader.md), [String](TopLevel.String.md)) | Construct a new JWE for encryption. | +| [JWE](#jwejweheader-bytes)([JWEHeader](dw.crypto.JWEHeader.md), [Bytes](dw.util.Bytes.md)) | Construct a new JWE for encryption. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [decrypt](dw.crypto.JWE.md#decryptkeyref)([KeyRef](dw.crypto.KeyRef.md)) | Decrypt the payload of this JWE object. | +| [encrypt](dw.crypto.JWE.md#encryptcertificateref)([CertificateRef](dw.crypto.CertificateRef.md)) | Encrypt the payload of this JWE object. | +| [getAlgorithm](dw.crypto.JWE.md#getalgorithm)() | Get the algorithm (`alg`) from the header. | +| [getEncryptionMethod](dw.crypto.JWE.md#getencryptionmethod)() | Get the encryption method (`enc`) from the header. | +| [getHeaderMap](dw.crypto.JWE.md#getheadermap)() | Get a copy of the JWE headers as a Map. | +| [getKeyID](dw.crypto.JWE.md#getkeyid)() | Get the key id (`kid`) from the header. | +| [getPayload](dw.crypto.JWE.md#getpayload)() | Get the decrypted payload. | +| static [parse](dw.crypto.JWE.md#parsestring)([String](TopLevel.String.md)) | Parse a JSON Web Encryption (JWE) object from its compact serialization format. | +| [serialize](dw.crypto.JWE.md#serialize)() | Get this JWE in compact serialization form. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### algorithm +- algorithm: [String](TopLevel.String.md) `(read-only)` + - : Get the algorithm (`alg`) from the header. + + +--- + +### encryptionMethod +- encryptionMethod: [String](TopLevel.String.md) `(read-only)` + - : Get the encryption method (`enc`) from the header. + + +--- + +### headerMap +- headerMap: [Map](dw.util.Map.md) `(read-only)` + - : Get a copy of the JWE headers as a Map. + + +--- + +### keyID +- keyID: [String](TopLevel.String.md) `(read-only)` + - : Get the key id (`kid`) from the header. + + +--- + +### payload +- payload: [String](TopLevel.String.md) `(read-only)` + - : Get the decrypted payload. + + +--- + +## Constructor Details + +### JWE(JWEHeader, String) +- JWE(header: [JWEHeader](dw.crypto.JWEHeader.md), payload: [String](TopLevel.String.md)) + - : Construct a new JWE for encryption. + + **Parameters:** + - header - JWE header. This must include a valid algorithm (`alg`) and encryption method (`enc`). See [decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for a list of supported algorithms. + - payload - Content that will be encrypted. + + +--- + +### JWE(JWEHeader, Bytes) +- JWE(header: [JWEHeader](dw.crypto.JWEHeader.md), payload: [Bytes](dw.util.Bytes.md)) + - : Construct a new JWE for encryption. + + **Parameters:** + - header - JWE header. This must include a valid algorithm (`alg`) and encryption method (`enc`). See [decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for a list of supported algorithms. + - payload - Content that will be encrypted. + + +--- + +## Method Details + +### decrypt(KeyRef) +- decrypt(privateKey: [KeyRef](dw.crypto.KeyRef.md)): void + - : Decrypt the payload of this JWE object. + + + Elliptic Curve (EC) and RSA keys are both supported. + + + Supported EC key management algorithms: + + - ECDH-ES + - ECDH-ES+A128KW + - ECDH-ES+A192KW + - ECDH-ES+A256KW + + Supported EC curves: + + - P-256 + - P-384 + - P-521 + + Supported RSA key management algorithms: + + - RSA-OAEP-256 + - RSA-OAEP-384 + - RSA-OAEP-512 + + Supported content encryption algorithms: + + - A128CBC-HS256 + - A128CBC-HS384 + - A128CBC-HS512 + - A128GCM + - A192GCM + - A256GCM + + + **Parameters:** + - privateKey - Reference to private `RSA` or `EC` key to use for decryption. + + +--- + +### encrypt(CertificateRef) +- encrypt(publicKey: [CertificateRef](dw.crypto.CertificateRef.md)): void + - : Encrypt the payload of this JWE object. + + + Elliptic Curve (EC) and RSA keys are both supported. + + + See [decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for the list of supported algorithms and encryption methods. + + + **Parameters:** + - publicKey - Reference to public `RSA` or `EC` key to use for decryption. + + +--- + +### getAlgorithm() +- getAlgorithm(): [String](TopLevel.String.md) + - : Get the algorithm (`alg`) from the header. + + **Returns:** + - Value of the algorithm or null if missing. + + +--- + +### getEncryptionMethod() +- getEncryptionMethod(): [String](TopLevel.String.md) + - : Get the encryption method (`enc`) from the header. + + **Returns:** + - Value of the encryption method or null if missing. + + +--- + +### getHeaderMap() +- getHeaderMap(): [Map](dw.util.Map.md) + - : Get a copy of the JWE headers as a Map. + + **Returns:** + - Copy of the JWE headers. + + +--- + +### getKeyID() +- getKeyID(): [String](TopLevel.String.md) + - : Get the key id (`kid`) from the header. + + **Returns:** + - Value of the key id or null if missing. + + +--- + +### getPayload() +- getPayload(): [String](TopLevel.String.md) + - : Get the decrypted payload. + + **Returns:** + - Payload or null if the payload is encrypted. + + +--- + +### parse(String) +- static parse(jwe: [String](TopLevel.String.md)): [JWE](dw.crypto.JWE.md) + - : Parse a JSON Web Encryption (JWE) object from its compact serialization format. + + **Parameters:** + - jwe - JWE in compact serialization format. + + **Returns:** + - JWE object. + + +--- + +### serialize() +- serialize(): [String](TopLevel.String.md) + - : Get this JWE in compact serialization form. + + **Returns:** + - Compact serialized object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWEHeader.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWEHeader.md new file mode 100644 index 00000000..4a0fa729 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWEHeader.md @@ -0,0 +1,147 @@ + +# Class JWEHeader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.JWEHeader](dw.crypto.JWEHeader.md) + +This class represents an immutable header of a JWE (JSON Web Encryption) object. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [algorithm](#algorithm): [String](TopLevel.String.md) `(read-only)` | Get the value of the algorithm parameter (`alg`). | +| [encryptionAlgorithm](#encryptionalgorithm): [String](TopLevel.String.md) `(read-only)` | Get the value of the encryption algorithm parameter (`enc`). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAlgorithm](dw.crypto.JWEHeader.md#getalgorithm)() | Get the value of the algorithm parameter (`alg`). | +| [getEncryptionAlgorithm](dw.crypto.JWEHeader.md#getencryptionalgorithm)() | Get the value of the encryption algorithm parameter (`enc`). | +| static [parse](dw.crypto.JWEHeader.md#parseobject)([Object](TopLevel.Object.md)) | Convert the given Map or JavaScript object into a JWE header. | +| static [parseEncoded](dw.crypto.JWEHeader.md#parseencodedstring)([String](TopLevel.String.md)) | Parse the given string as a Base64URL-encoded JWE header. | +| static [parseJSON](dw.crypto.JWEHeader.md#parsejsonstring)([String](TopLevel.String.md)) | Parse the given string as a JWE header. | +| [toMap](dw.crypto.JWEHeader.md#tomap)() | Get a copy of these headers as a Map. | +| [toString](dw.crypto.JWEHeader.md#tostring)() | Get the content of the headers as a JSON String. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### algorithm +- algorithm: [String](TopLevel.String.md) `(read-only)` + - : Get the value of the algorithm parameter (`alg`). + + +--- + +### encryptionAlgorithm +- encryptionAlgorithm: [String](TopLevel.String.md) `(read-only)` + - : Get the value of the encryption algorithm parameter (`enc`). + + +--- + +## Method Details + +### getAlgorithm() +- getAlgorithm(): [String](TopLevel.String.md) + - : Get the value of the algorithm parameter (`alg`). + + **Returns:** + - Algorithm parameter from this header. + + +--- + +### getEncryptionAlgorithm() +- getEncryptionAlgorithm(): [String](TopLevel.String.md) + - : Get the value of the encryption algorithm parameter (`enc`). + + **Returns:** + - Encryption algorithm parameter from this header. + + +--- + +### parse(Object) +- static parse(map: [Object](TopLevel.Object.md)): [JWEHeader](dw.crypto.JWEHeader.md) + - : Convert the given Map or JavaScript object into a JWE header. + + + All keys correspond to JWE parameters. The algorithm (`alg`) and encryption method + (`enc`) parameters are required. See [JWE.decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for supported values. + + + **Parameters:** + - map - Map or object data to convert. + + **Returns:** + - JWE Header. + + +--- + +### parseEncoded(String) +- static parseEncoded(base64encoded: [String](TopLevel.String.md)): [JWEHeader](dw.crypto.JWEHeader.md) + - : Parse the given string as a Base64URL-encoded JWE header. + + + The algorithm (`alg`) and encryption method (`enc`) parameters are required. See + [JWE.decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for supported values. + + + **Parameters:** + - base64encoded - Base64URL string to parse. + + **Returns:** + - JWE Header. + + +--- + +### parseJSON(String) +- static parseJSON(json: [String](TopLevel.String.md)): [JWEHeader](dw.crypto.JWEHeader.md) + - : Parse the given string as a JWE header. + + + The algorithm (`alg`) and encryption method (`enc`) parameters are required. See + [JWE.decrypt(KeyRef)](dw.crypto.JWE.md#decryptkeyref) for supported values. + + + **Parameters:** + - json - JSON string to parse. + + **Returns:** + - JWE Header. + + +--- + +### toMap() +- toMap(): [Map](dw.util.Map.md) + - : Get a copy of these headers as a Map. + + **Returns:** + - Copy of the JWE headers. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Get the content of the headers as a JSON String. + + **Returns:** + - JSON String. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWS.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWS.md new file mode 100644 index 00000000..27e23217 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWS.md @@ -0,0 +1,260 @@ + +# Class JWS + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.JWS](dw.crypto.JWS.md) + +This class represents a JSON Web Signature (JWS) object. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3 requirements 2, 4, and 12. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [algorithm](#algorithm): [String](TopLevel.String.md) `(read-only)` | Get the algorithm (`alg`) from the header. | +| [header](#header): [JWSHeader](dw.crypto.JWSHeader.md) `(read-only)` | Get a copy of the JWS header. | +| [headerMap](#headermap): [Map](dw.util.Map.md) `(read-only)` | Get a copy of the JWS header as a Map. | +| [payload](#payload): [String](TopLevel.String.md) `(read-only)` | Get the payload from this object. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [JWS](#jwsjwsheader-string)([JWSHeader](dw.crypto.JWSHeader.md), [String](TopLevel.String.md)) | Construct a new JWS for signing. | +| [JWS](#jwsjwsheader-bytes)([JWSHeader](dw.crypto.JWSHeader.md), [Bytes](dw.util.Bytes.md)) | Construct a new JWS for signing. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAlgorithm](dw.crypto.JWS.md#getalgorithm)() | Get the algorithm (`alg`) from the header. | +| [getHeader](dw.crypto.JWS.md#getheader)() | Get a copy of the JWS header. | +| [getHeaderMap](dw.crypto.JWS.md#getheadermap)() | Get a copy of the JWS header as a Map. | +| [getPayload](dw.crypto.JWS.md#getpayload)() | Get the payload from this object. | +| static [parse](dw.crypto.JWS.md#parsestring)([String](TopLevel.String.md)) | Parse a JSON Web Signature (JWS) object from its compact serialization format. | +| static [parse](dw.crypto.JWS.md#parsestring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md)) | Parse a JSON Web Signature (JWS) object from its compact serialization format. | +| static [parse](dw.crypto.JWS.md#parsestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Parse a JSON Web Signature (JWS) object from its compact serialization format. | +| [serialize](dw.crypto.JWS.md#serializeboolean)([Boolean](TopLevel.Boolean.md)) | Get this JWS in compact serialization form. | +| [sign](dw.crypto.JWS.md#signkeyref)([KeyRef](dw.crypto.KeyRef.md)) | Sign the payload using the given private key. | +| [verify](dw.crypto.JWS.md#verifycertificateref)([CertificateRef](dw.crypto.CertificateRef.md)) | Verifies the signature of the payload. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### algorithm +- algorithm: [String](TopLevel.String.md) `(read-only)` + - : Get the algorithm (`alg`) from the header. + + +--- + +### header +- header: [JWSHeader](dw.crypto.JWSHeader.md) `(read-only)` + - : Get a copy of the JWS header. + + +--- + +### headerMap +- headerMap: [Map](dw.util.Map.md) `(read-only)` + - : Get a copy of the JWS header as a Map. + + +--- + +### payload +- payload: [String](TopLevel.String.md) `(read-only)` + - : Get the payload from this object. + + + This is available even if the signature has not been verified. + + + +--- + +## Constructor Details + +### JWS(JWSHeader, String) +- JWS(header: [JWSHeader](dw.crypto.JWSHeader.md), payload: [String](TopLevel.String.md)) + - : Construct a new JWS for signing. + + **Parameters:** + - header - JWS header. This must include a valid algorithm (`alg`). See [verify(CertificateRef)](dw.crypto.JWS.md#verifycertificateref) for a list of supported algorithms. + - payload - Content that will be signed. + + +--- + +### JWS(JWSHeader, Bytes) +- JWS(header: [JWSHeader](dw.crypto.JWSHeader.md), payload: [Bytes](dw.util.Bytes.md)) + - : Construct a new JWS for signing. + + **Parameters:** + - header - JWS header. This must include a valid algorithm (`alg`). See [verify(CertificateRef)](dw.crypto.JWS.md#verifycertificateref) for a list of supported algorithms. + - payload - Content that will be signed. + + +--- + +## Method Details + +### getAlgorithm() +- getAlgorithm(): [String](TopLevel.String.md) + - : Get the algorithm (`alg`) from the header. + + **Returns:** + - Value of the algorithm or null if missing. + + +--- + +### getHeader() +- getHeader(): [JWSHeader](dw.crypto.JWSHeader.md) + - : Get a copy of the JWS header. + + **Returns:** + - Copy of the JWS header. + + +--- + +### getHeaderMap() +- getHeaderMap(): [Map](dw.util.Map.md) + - : Get a copy of the JWS header as a Map. + + **Returns:** + - Copy of the JWS header. + + +--- + +### getPayload() +- getPayload(): [String](TopLevel.String.md) + - : Get the payload from this object. + + + This is available even if the signature has not been verified. + + + **Returns:** + - UTF-8 encoded payload. + + +--- + +### parse(String) +- static parse(jws: [String](TopLevel.String.md)): [JWS](dw.crypto.JWS.md) + - : Parse a JSON Web Signature (JWS) object from its compact serialization format. + + **Parameters:** + - jws - JWS in compact serialization format. + + **Returns:** + - JWS object. + + +--- + +### parse(String, Bytes) +- static parse(jws: [String](TopLevel.String.md), payload: [Bytes](dw.util.Bytes.md)): [JWS](dw.crypto.JWS.md) + - : Parse a JSON Web Signature (JWS) object from its compact serialization format. + + **Parameters:** + - jws - JWS without a payload in compact serialization format. + - payload - Detached payload + + **Returns:** + - JWS object. + + +--- + +### parse(String, String) +- static parse(jws: [String](TopLevel.String.md), payload: [String](TopLevel.String.md)): [JWS](dw.crypto.JWS.md) + - : Parse a JSON Web Signature (JWS) object from its compact serialization format. + + **Parameters:** + - jws - JWS without a payload in compact serialization format. + - payload - Detached payload + + **Returns:** + - JWS object. + + +--- + +### serialize(Boolean) +- serialize(detachPayload: [Boolean](TopLevel.Boolean.md)): [String](TopLevel.String.md) + - : Get this JWS in compact serialization form. + + **Parameters:** + - detachPayload - true for a detached payload compliant with RFC-7797, or false to serialize the payload too. + + **Returns:** + - Compact serialized object. + + +--- + +### sign(KeyRef) +- sign(keyRef: [KeyRef](dw.crypto.KeyRef.md)): void + - : Sign the payload using the given private key. + + + The key type and size must match the algorithm given in the JWS header. + + + **Parameters:** + - keyRef - Reference to the private key. + + **Throws:** + - Exception - if there is an error while signing the payload. + + +--- + +### verify(CertificateRef) +- verify(certificateRef: [CertificateRef](dw.crypto.CertificateRef.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies the signature of the payload. + + + If the `x5c` header parameter is present, then that certificate chain will be used to verify the + signature and the given `certificateRef` must be its root certificate. If this parameter is not + present then the given `certificateRef` will be used to directly verify the signature. + + + The following algorithms are supported: + + - ES256 + - ES256K + - ES384 + - ES512 + - RS256 + - RS384 + - RS512 + - PS256 + - PS384 + - PS512 + + + **Parameters:** + - certificateRef - Reference to the certificate to use for verification. + + **Returns:** + - a boolean indicating success (true) or failure (false). + + **Throws:** + - Exception - if there is an error while processing the certificate (for example if the `x5c` is not signed by the given certificate) or the algorithm is unsupported. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWSHeader.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWSHeader.md new file mode 100644 index 00000000..16ddd6c2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.JWSHeader.md @@ -0,0 +1,128 @@ + +# Class JWSHeader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.JWSHeader](dw.crypto.JWSHeader.md) + +This class represents an immutable header of a JWS (JSON Web Signature) object. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [algorithm](#algorithm): [String](TopLevel.String.md) `(read-only)` | Get the value of the algorithm parameter (`alg`). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAlgorithm](dw.crypto.JWSHeader.md#getalgorithm)() | Get the value of the algorithm parameter (`alg`). | +| static [parse](dw.crypto.JWSHeader.md#parseobject)([Object](TopLevel.Object.md)) | Convert the given Map or JavaScript object into a JWS header. | +| static [parseEncoded](dw.crypto.JWSHeader.md#parseencodedstring)([String](TopLevel.String.md)) | Parse the given string as a Base64URL-encoded JWS header. | +| static [parseJSON](dw.crypto.JWSHeader.md#parsejsonstring)([String](TopLevel.String.md)) | Parse the given string as a JWS header. | +| [toMap](dw.crypto.JWSHeader.md#tomap)() | Get a copy of these headers as a Map. | +| [toString](dw.crypto.JWSHeader.md#tostring)() | Get the content of the headers as a JSON String. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### algorithm +- algorithm: [String](TopLevel.String.md) `(read-only)` + - : Get the value of the algorithm parameter (`alg`). + + +--- + +## Method Details + +### getAlgorithm() +- getAlgorithm(): [String](TopLevel.String.md) + - : Get the value of the algorithm parameter (`alg`). + + **Returns:** + - Algorithm parameter from this header. + + +--- + +### parse(Object) +- static parse(map: [Object](TopLevel.Object.md)): [JWSHeader](dw.crypto.JWSHeader.md) + - : Convert the given Map or JavaScript object into a JWS header. + + + All keys correspond to JWS parameters. The algorithm parameter (`alg`) is required. See + [JWS.verify(CertificateRef)](dw.crypto.JWS.md#verifycertificateref) for supported values. + + + **Parameters:** + - map - Map or object data to convert. + + **Returns:** + - JWS Header. + + +--- + +### parseEncoded(String) +- static parseEncoded(base64encoded: [String](TopLevel.String.md)): [JWSHeader](dw.crypto.JWSHeader.md) + - : Parse the given string as a Base64URL-encoded JWS header. + + + The algorithm parameter (`alg`) is required. See [JWS.verify(CertificateRef)](dw.crypto.JWS.md#verifycertificateref) for supported + values. + + + **Parameters:** + - base64encoded - Base64URL string to parse. + + **Returns:** + - JWS Header. + + +--- + +### parseJSON(String) +- static parseJSON(json: [String](TopLevel.String.md)): [JWSHeader](dw.crypto.JWSHeader.md) + - : Parse the given string as a JWS header. + + + The algorithm parameter (`alg`) is required. See [JWS.verify(CertificateRef)](dw.crypto.JWS.md#verifycertificateref) for supported + values. + + + **Parameters:** + - json - JSON string to parse. + + **Returns:** + - JWS Header. + + +--- + +### toMap() +- toMap(): [Map](dw.util.Map.md) + - : Get a copy of these headers as a Map. + + **Returns:** + - Copy of the JWS headers. + + +--- + +### toString() +- toString(): [String](TopLevel.String.md) + - : Get the content of the headers as a JSON String. + + **Returns:** + - JSON String. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.KeyRef.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.KeyRef.md new file mode 100644 index 00000000..a1bfece0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.KeyRef.md @@ -0,0 +1,77 @@ + +# Class KeyRef + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.KeyRef](dw.crypto.KeyRef.md) + +This class is used as a reference to a private key in the keystore +which can be managed in the Business Manager. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [KeyRef](#keyrefstring)([String](TopLevel.String.md)) | Creates a `KeyRef` from the passed alias. | +| ~~[KeyRef](#keyrefstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md))~~ | Creates a `KeyRef` from the passed alias. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [toString](dw.crypto.KeyRef.md#tostring)() | Returns the string representation of this KeyRef. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### KeyRef(String) +- KeyRef(alias: [String](TopLevel.String.md)) + - : Creates a `KeyRef` from the passed alias. No check + is made whether the alias is actually referring to a key in the keystore, + this check is made when the `KeyRef` is used. + + + **Parameters:** + - alias - an alias that should refer to a key in the keystore. + + +--- + +### KeyRef(String, String) +- ~~KeyRef(alias: [String](TopLevel.String.md), password: [String](TopLevel.String.md))~~ + - : Creates a `KeyRef` from the passed alias. No check + is made whether the alias is actually referring to a key in the keystore, + this check is made when the `KeyRef` is used. + + + **Parameters:** + - alias - an alias that should refer to a key in the keystore. + - password - the password that should be used to get the key from the keystore. + + **Deprecated:** +:::warning +use [KeyRef(String)](dw.crypto.KeyRef.md#keyrefstring) instead +::: + +--- + +## Method Details + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns the string representation of this KeyRef. + + **Returns:** + - The string representation of this KeyRef. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Mac.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Mac.md new file mode 100644 index 00000000..13494a0c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Mac.md @@ -0,0 +1,191 @@ + +# Class Mac + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.Mac](dw.crypto.Mac.md) + +This class provides the functionality of a "Message Authentication Code" (MAC) algorithm. +A MAC provides a way to check the integrity of information transmitted over or +stored in an unreliable medium, based on a secret key. +Typically, message authentication codes are used between two parties +that share a secret key in order to validate information transmitted between these parties. +A MAC mechanism that is based on cryptographic hash functions is referred to as HMAC. +HMAC can be used with any cryptographic hash function, e.g., SHA256, +in combination with a secret shared key. HMAC is specified in RFC 2104. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[HMAC_MD5](#hmac_md5): [String](TopLevel.String.md) = "HmacMD5"~~ | Constant representing the HMAC-MD5 keyed-hashing algorithm as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997). | +| ~~[HMAC_SHA_1](#hmac_sha_1): [String](TopLevel.String.md) = "HmacSHA1"~~ | Constant representing the HmacSHA1 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) with SHA-1 as the message digest algorithm. | +| [HMAC_SHA_256](#hmac_sha_256): [String](TopLevel.String.md) = "HmacSHA256" | Constant representing the HmacSHA256 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) with SHA-256 as the message digest algorithm. | +| [HMAC_SHA_384](#hmac_sha_384): [String](TopLevel.String.md) = "HmacSHA384" | Constant representing the HmacSHA384 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) with SHA-384 as the message digest algorithm. | +| [HMAC_SHA_512](#hmac_sha_512): [String](TopLevel.String.md) = "HmacSHA512" | Constant representing the HmacSHA512 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) with SHA-512 as the message digest algorithm. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Mac](#macstring)([String](TopLevel.String.md)) | Construct a Mac encryption instance with the specified algorithm name. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [digest](dw.crypto.Mac.md#digestbytes-bytes)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed bytes input using the passed secret key. | +| [digest](dw.crypto.Mac.md#digeststring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed string input using the passed secret key. | +| [digest](dw.crypto.Mac.md#digeststring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Computes the hash value for the passed string input using the passed secret key. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### HMAC_MD5 + +- ~~HMAC_MD5: [String](TopLevel.String.md) = "HmacMD5"~~ + - : Constant representing the HMAC-MD5 keyed-hashing algorithm as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997). + This algorithm uses as MD5 cryptographic hash function. + + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use HmacSHA256, HmacSHA384 or HmacSHA512. +::: + +--- + +### HMAC_SHA_1 + +- ~~HMAC_SHA_1: [String](TopLevel.String.md) = "HmacSHA1"~~ + - : Constant representing the HmacSHA1 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) + with SHA-1 as the message digest algorithm. + + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use HmacSHA256, HmacSHA384 or HmacSHA512. +::: + +--- + +### HMAC_SHA_256 + +- HMAC_SHA_256: [String](TopLevel.String.md) = "HmacSHA256" + - : Constant representing the HmacSHA256 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) + with SHA-256 as the message digest algorithm. + + + +--- + +### HMAC_SHA_384 + +- HMAC_SHA_384: [String](TopLevel.String.md) = "HmacSHA384" + - : Constant representing the HmacSHA384 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) + with SHA-384 as the message digest algorithm. + + + +--- + +### HMAC_SHA_512 + +- HMAC_SHA_512: [String](TopLevel.String.md) = "HmacSHA512" + - : Constant representing the HmacSHA512 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) + with SHA-512 as the message digest algorithm. + + + +--- + +## Constructor Details + +### Mac(String) +- Mac(algorithm: [String](TopLevel.String.md)) + - : Construct a Mac encryption instance with the specified algorithm name. The + supported algorithms are: + + + - SHA 256 + - SHA 384 + - SHA 512 + + + **Parameters:** + - algorithm - the standard name of the digest algorithm, must not be null. + + **Throws:** + - NullArgumentException - if algorithm is null. + - IllegalArgumentException - if the specified algorithm name is not supported. + + +--- + +## Method Details + +### digest(Bytes, Bytes) +- digest(input: [Bytes](dw.util.Bytes.md), key: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed bytes input using the passed secret key. + + **Parameters:** + - input - The bytes to calculate a RFC 2104 compliant HMAC hash value. + - key - The secret key as byte array ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + +### digest(String, Bytes) +- digest(input: [String](TopLevel.String.md), key: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed string input using the passed secret key. + Given input will be first converted with UTF-8 encoding into a byte array. + The resulting hash is typically converted with base64 back into a string. + + + **Parameters:** + - input - A string to calculate a RFC 2104 compliant HMAC hash value for. + - key - The secret key as bytes ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + +### digest(String, String) +- digest(input: [String](TopLevel.String.md), key: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed string input using the passed secret key. + Given input and the given key will be first converted with UTF-8 encoding into a byte array. + The resulting hash is typically converted with base64 back into a string. + + + **Parameters:** + - input - A string to calculate a RFC 2104 compliant HMAC hash value for. + - key - The secret key ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.MessageDigest.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.MessageDigest.md new file mode 100644 index 00000000..c394735c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.MessageDigest.md @@ -0,0 +1,243 @@ + +# Class MessageDigest + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.MessageDigest](dw.crypto.MessageDigest.md) + +This class provides the functionality of a message digest algorithm, such as +MD5 or SHA. Message digests are secure one-way hash functions that take +arbitrary-sized data and output a fixed-length hash value. This +implementation offers only stateless digest() methods. A Bytes object or +String is passed to a digest() method and the computed hash is returned. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[DIGEST_MD2](#digest_md2): [String](TopLevel.String.md) = "MD2"~~ | Constant representing the MD2 algorithm. | +| ~~[DIGEST_MD5](#digest_md5): [String](TopLevel.String.md) = "MD5"~~ | Constant representing the MD5 algorithm. | +| ~~[DIGEST_SHA](#digest_sha): [String](TopLevel.String.md) = "SHA"~~ | Constant representing the SHA algorithm. | +| ~~[DIGEST_SHA_1](#digest_sha_1): [String](TopLevel.String.md) = "SHA-1"~~ | Constant representing the SHA 1 algorithm. | +| [DIGEST_SHA_256](#digest_sha_256): [String](TopLevel.String.md) = "SHA-256" | Constant representing the SHA 256 algorithm | +| [DIGEST_SHA_512](#digest_sha_512): [String](TopLevel.String.md) = "SHA-512" | Constant representing the SHA 512 algorithm | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [MessageDigest](#messagedigeststring)([String](TopLevel.String.md)) | Construct a MessageDigest with the specified algorithm name. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [digest](dw.crypto.MessageDigest.md#digest)() | Completes the hash computation by performing final operations such as padding. | +| ~~[digest](dw.crypto.MessageDigest.md#digeststring)([String](TopLevel.String.md))~~ | Digests the passed string and returns a computed hash value as a string. | +| ~~[digest](dw.crypto.MessageDigest.md#digeststring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md))~~ | Computes the hash value for the passed array of bytes. | +| [digestBytes](dw.crypto.MessageDigest.md#digestbytesbytes)([Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed [Bytes](dw.util.Bytes.md). | +| [updateBytes](dw.crypto.MessageDigest.md#updatebytesbytes)([Bytes](dw.util.Bytes.md)) | Updates the digest using the passed [Bytes](dw.util.Bytes.md). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DIGEST_MD2 + +- ~~DIGEST_MD2: [String](TopLevel.String.md) = "MD2"~~ + - : Constant representing the MD2 algorithm. + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use SHA-256 or SHA-512. +::: + +--- + +### DIGEST_MD5 + +- ~~DIGEST_MD5: [String](TopLevel.String.md) = "MD5"~~ + - : Constant representing the MD5 algorithm. + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use SHA-256 or SHA-512. +::: + +--- + +### DIGEST_SHA + +- ~~DIGEST_SHA: [String](TopLevel.String.md) = "SHA"~~ + - : Constant representing the SHA algorithm. + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use SHA-256 or SHA-512. +::: + +--- + +### DIGEST_SHA_1 + +- ~~DIGEST_SHA_1: [String](TopLevel.String.md) = "SHA-1"~~ + - : Constant representing the SHA 1 algorithm. + + **Deprecated:** +:::warning +This algorithm is obsolete and and has been deprecated. Please use SHA-256 or SHA-512. +::: + +--- + +### DIGEST_SHA_256 + +- DIGEST_SHA_256: [String](TopLevel.String.md) = "SHA-256" + - : Constant representing the SHA 256 algorithm + + +--- + +### DIGEST_SHA_512 + +- DIGEST_SHA_512: [String](TopLevel.String.md) = "SHA-512" + - : Constant representing the SHA 512 algorithm + + +--- + +## Constructor Details + +### MessageDigest(String) +- MessageDigest(algorithm: [String](TopLevel.String.md)) + - : Construct a MessageDigest with the specified algorithm name. The + supported algorithms are: + + + - SHA-256 + - SHA-512 + + + **Parameters:** + - algorithm - The standard name of the digest algorithm, must not be null and must be a supported algorithm. + + +--- + +## Method Details + +### digest() +- digest(): [Bytes](dw.util.Bytes.md) + - : Completes the hash computation by performing final operations such as + padding. + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest() ); + ` + + + **Returns:** + - The resulting hash value. + + +--- + +### digest(String) +- ~~digest(input: [String](TopLevel.String.md)): [String](TopLevel.String.md)~~ + - : Digests the passed string and returns a computed hash value as a string. + The passed String is first encoded into a sequence of bytes using the + platform's default encoding. The digest then performs any prerequisite + padding, before computing the hash value. The hash is then converted into + a string by converting all digits to hexadecimal. + + + **Parameters:** + - input - The value to hash as String, must not be null. + + **Returns:** + - The resulting hash value as hex-encoded string. + + **Deprecated:** +:::warning +Deprecated because the conversion of the input to bytes using + the default platform encoding and the hex-encoded return + value are not generally appropriate. + +::: + +--- + +### digest(String, Bytes) +- ~~digest(algorithm: [String](TopLevel.String.md), input: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md)~~ + - : Computes the hash value for the passed array of bytes. The algorithm + argument is optional. If null, then the algorithm established at + construction time is used. + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest( "MD5", new Bytes( "my password", "UTF-8" ) ) ); + ` + + + **Parameters:** + - algorithm - The standard name of the digest algorithm, or null if the algorithm passed at construction time is to be used. The algorithm must be a supported algorithm. + - input - The value to hash, must not be null. + + **Returns:** + - The resulting hash value. + + **Deprecated:** +:::warning +Deprecated because the digest algorithm should be the one + set in the constructor. + +::: + +--- + +### digestBytes(Bytes) +- digestBytes(input: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed [Bytes](dw.util.Bytes.md). + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest( new Bytes( "my password", "UTF-8" ) ) ); + ` + + + **Parameters:** + - input - The value to hash, must not be null. + + **Returns:** + - The resulting hash value. + + +--- + +### updateBytes(Bytes) +- updateBytes(input: [Bytes](dw.util.Bytes.md)): void + - : Updates the digest using the passed [Bytes](dw.util.Bytes.md). + + **Parameters:** + - input - The value to hash, must not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.SecureRandom.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.SecureRandom.md new file mode 100644 index 00000000..fa6fbb69 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.SecureRandom.md @@ -0,0 +1,161 @@ + +# Class SecureRandom + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.SecureRandom](dw.crypto.SecureRandom.md) + +The SecureRandom class provides a cryptographically strong random number generator (RNG). +See the Internet Engineering Task Force (IETF) RFC 1750: _Randomness Recommendations for + Security_ for more information.]() + + + Typical callers of SecureRandom invoke the following methods to retrieve random bytes: + + +``` + Bytes bytes... + SecureRandom random = new SecureRandom(); + Bytes nextBytes = random.nextBytes(bytes); +``` + + +or more convenient to get a Bytes with the demanded length + + +``` + int length = 32; + SecureRandom random = new SecureRandom(); + Bytes nextBytes = random.nextBytes(length); +``` + + +dw.crypto.SecureRandom is intentionally an adapter for generating cryptographic hard random numbers. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SecureRandom](#securerandom)() | Instantiates a new secure random. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [generateSeed](dw.crypto.SecureRandom.md#generateseednumber)([Number](TopLevel.Number.md)) | Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself. | +| [nextBytes](dw.crypto.SecureRandom.md#nextbytesnumber)([Number](TopLevel.Number.md)) | Generates a user-specified number of random bytes. | +| [nextInt](dw.crypto.SecureRandom.md#nextint)() | Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence. | +| [nextInt](dw.crypto.SecureRandom.md#nextintnumber)([Number](TopLevel.Number.md)) | Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. | +| [nextNumber](dw.crypto.SecureRandom.md#nextnumber)() | Returns the next pseudorandom, uniformly distributed Number value between 0.0 (inclusive) and 1.0 (exclusive) from this random number generator's sequence. | +| [setSeed](dw.crypto.SecureRandom.md#setseedbytes)([Bytes](dw.util.Bytes.md)) | Reseeds this random object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### SecureRandom() +- SecureRandom() + - : Instantiates a new secure random. + + +--- + +## Method Details + +### generateSeed(Number) +- generateSeed(numBytes: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Returns the given number of seed bytes, computed using the seed + generation algorithm that this class uses to seed itself. This + call may be used to seed other random number generators. + + + **Parameters:** + - numBytes - the number of seed bytes to generate. + + **Returns:** + - the seed bytes. + + +--- + +### nextBytes(Number) +- nextBytes(numBits: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Generates a user-specified number of random bytes. + + + If a call to `setSeed` had not occurred previously, + the first call to this method forces this SecureRandom object + to seed itself. This self-seeding will not occur if + `setSeed` was previously called. + + + **Parameters:** + - numBits - the demanded number of bits + + **Returns:** + - a randomly filled [Bytes](dw.util.Bytes.md) + + +--- + +### nextInt() +- nextInt(): [Number](TopLevel.Number.md) + - : Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence. The general + contract of nextInt is that one int value is pseudorandomly generated and returned. All 2^32 + possible int values are produced with (approximately) equal probability. + + + **Returns:** + - the next pseudorandom, uniformly distributed int value from this random number generator's sequence + + +--- + +### nextInt(Number) +- nextInt(upperBound: [Number](TopLevel.Number.md)): [Number](TopLevel.Number.md) + - : Returns a pseudorandom, uniformly distributed int value + between 0 (inclusive) and the specified value (exclusive), drawn from + this random number generator's sequence. + + + **Parameters:** + - upperBound - the bound on the random number to be returned. Must be positive. + + **Returns:** + - the next pseudorandom, uniformly distributed int value between 0 (inclusive) and upperBound (exclusive) + from this random number generator's sequence + + + **Throws:** + - IllegalArgumentException - if n is not positive + + +--- + +### nextNumber() +- nextNumber(): [Number](TopLevel.Number.md) + - : Returns the next pseudorandom, uniformly distributed + Number value between 0.0 (inclusive) and 1.0 (exclusive) from this random number generator's sequence. + + + **Returns:** + - the next pseudorandom, uniformly distributed Number + value between 0.0 and 1.0 from this random number generator's sequence + + + +--- + +### setSeed(Bytes) +- setSeed(seed: [Bytes](dw.util.Bytes.md)): void + - : Reseeds this random object. The given seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness. + + **Parameters:** + - seed - the seed. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Signature.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Signature.md new file mode 100644 index 00000000..3f69c044 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.Signature.md @@ -0,0 +1,241 @@ + +# Class Signature + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.Signature](dw.crypto.Signature.md) + + +This class allows access to signature services offered through the Java +Cryptography Architecture (JCA). At this time the signature/verification implementation of the +methods is based on the default RSA JCE provider of the JDK - sun.security.rsa.SunRsaSign + + + +dw.crypto.Signature is an adapter to the security provider implementation +and covers several digest algorithms: + +- SHA1withRSA (deprecated) +- SHA256withRSA +- SHA384withRSA +- SHA512withRSA +- SHA256withRSA/PSS +- SHA384withRSA/PSS +- SHA512withRSA/PSS +- SHA256withECDSA +- SHA384withECDSA +- SHA512withECDSA + + + + + +Key size generally ranges between 512 and 65536 bits (the latter of which is unnecessarily large). + +Default key size for RSA is 1024. SHA384withRSA and SHA512withRSA require a key with length of at least 1024 bits. + +For ECDSA, the following key sizes are supported: + +- SHA256withECDSA: 256-bit key (NIST P-256) +- SHA384withECDSA: 384-bit key (NIST P-384) +- SHA512withECDSA: 521-bit key (NIST P-521) + +When choosing a key size - beware of the tradeoff between security and processing time: + +The longer the key, the harder to break it but also it takes more time for the two sides to sign and verify the signature. + +An exception will be thrown for keys shorter than 2048 bits in this version of the API. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, 12, and other relevant requirements. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [SUPPORTED_DIGEST_ALGORITHMS_AS_ARRAY](#supported_digest_algorithms_as_array): [String\[\]](TopLevel.String.md) | Supported digest algorithms exposed as a string array | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Signature](#signature)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [isDigestAlgorithmSupported](dw.crypto.Signature.md#isdigestalgorithmsupportedstring)([String](TopLevel.String.md)) | Checks to see if a digest algorithm is supported | +| [sign](dw.crypto.Signature.md#signstring-keyref-string)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md)) | Signs a string and returns a string | +| [sign](dw.crypto.Signature.md#signstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Signs a string and returns a string | +| [signBytes](dw.crypto.Signature.md#signbytesbytes-keyref-string)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md)) | Signs bytes and returns bytes | +| [signBytes](dw.crypto.Signature.md#signbytesbytes-string-string)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Signs bytes and returns bytes | +| [verifyBytesSignature](dw.crypto.Signature.md#verifybytessignaturebytes-bytes-certificateref-string)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md)) | Verifies a signature supplied as bytes | +| [verifyBytesSignature](dw.crypto.Signature.md#verifybytessignaturebytes-bytes-string-string)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Verifies a signature supplied as bytes | +| [verifySignature](dw.crypto.Signature.md#verifysignaturestring-string-certificateref-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md)) | Verifies a signature supplied as string | +| [verifySignature](dw.crypto.Signature.md#verifysignaturestring-string-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Verifies a signature supplied as string | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### SUPPORTED_DIGEST_ALGORITHMS_AS_ARRAY + +- SUPPORTED_DIGEST_ALGORITHMS_AS_ARRAY: [String\[\]](TopLevel.String.md) + - : Supported digest algorithms exposed as a string array + + +--- + +## Constructor Details + +### Signature() +- Signature() + - : + + +--- + +## Method Details + +### isDigestAlgorithmSupported(String) +- isDigestAlgorithmSupported(digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Checks to see if a digest algorithm is supported + + **Parameters:** + - digestAlgorithm - the digest algorithm name + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### sign(String, KeyRef, String) +- sign(contentToSign: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), digestAlgorithm: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Signs a string and returns a string + + **Parameters:** + - contentToSign - base64 encoded content to sign + - privateKey - a reference to a private key entry in the keystore + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - the base64 encoded signature + + +--- + +### sign(String, String, String) +- sign(contentToSign: [String](TopLevel.String.md), privateKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Signs a string and returns a string + + **Parameters:** + - contentToSign - base64 encoded content to sign + - privateKey - base64 encoded private key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - the base64 encoded signature + + +--- + +### signBytes(Bytes, KeyRef, String) +- signBytes(contentToSign: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Signs bytes and returns bytes + + **Parameters:** + - contentToSign - transformed with UTF-8 encoding into a byte stream + - privateKey - a reference to a private key entry in the keystore + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - signature + + +--- + +### signBytes(Bytes, String, String) +- signBytes(contentToSign: [Bytes](dw.util.Bytes.md), privateKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Signs bytes and returns bytes + + **Parameters:** + - contentToSign - transformed with UTF-8 encoding into a byte stream + - privateKey - base64 encoded private key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - signature + + +--- + +### verifyBytesSignature(Bytes, Bytes, CertificateRef, String) +- verifyBytesSignature(signature: [Bytes](dw.util.Bytes.md), contentToVerify: [Bytes](dw.util.Bytes.md), certificate: [CertificateRef](dw.crypto.CertificateRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as bytes + + **Parameters:** + - signature - signature to check as bytes + - contentToVerify - as bytes + - certificate - a reference to a trusted certificate + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifyBytesSignature(Bytes, Bytes, String, String) +- verifyBytesSignature(signature: [Bytes](dw.util.Bytes.md), contentToVerify: [Bytes](dw.util.Bytes.md), publicKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as bytes + + **Parameters:** + - signature - signature to check as bytes + - contentToVerify - as bytes + - publicKey - base64 encoded public key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifySignature(String, String, CertificateRef, String) +- verifySignature(signature: [String](TopLevel.String.md), contentToVerify: [String](TopLevel.String.md), certificate: [CertificateRef](dw.crypto.CertificateRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as string + + **Parameters:** + - signature - base64 encoded signature + - contentToVerify - base64 encoded content to verify + - certificate - a reference to a trusted certificate + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifySignature(String, String, String, String) +- verifySignature(signature: [String](TopLevel.String.md), contentToVerify: [String](TopLevel.String.md), publicKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as string + + **Parameters:** + - signature - base64 encoded signature + - contentToVerify - base64 encoded content to verify + - publicKey - base64 encoded public key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakCipher.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakCipher.md new file mode 100644 index 00000000..58509757 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakCipher.md @@ -0,0 +1,725 @@ + +# Class WeakCipher + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.WeakCipher](dw.crypto.WeakCipher.md) + +This API provides access to Deprecated algorithms. + + +See [Cipher](dw.crypto.Cipher.md) for full documentation. WeakCipher is simply a drop-in replacement that **only** supports +deprecated algorithms and key lengths. This is helpful when you need to deal with weak algorithms for backward +compatibility purposes, but Cipher should always be used for new development and for anything intended to be secure. + + +**Note:** this class handles sensitive security-related data. Pay special attention to PCI DSS v3 requirements 2, +4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CHAR_ENCODING](#char_encoding): [String](TopLevel.String.md) = "UTF8" | Strings containing keys, plain texts, cipher texts etc. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakCipher](#weakcipher)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-keyref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-keyref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-keyref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the decryption. | +| [decryptBytes](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level decryption API. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-keyref-string-string-number---variant-1)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-1), which allows using a key in the keystore for the decryption. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the message using the given parameters. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-keyref-string-string-number---variant-2)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-2), which allows using a key in the keystore for the decryption. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the message using the given parameters. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-keyref-string-string-number---variant-3)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-3), which allows using a key in the keystore for the decryption. | +| [decrypt](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Decrypts the message using the given parameters. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-certificateref-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-1)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-certificateref-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-2)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-certificateref-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in the keystore for the encryption. | +| [encryptBytes](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-3)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Lower-level encryption API. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-1)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-2)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-3)([String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | +| [encrypt](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-3)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Encrypt the passed message by using the specified key and applying the transformations described by the specified parameters. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CHAR_ENCODING + +- CHAR_ENCODING: [String](TopLevel.String.md) = "UTF8" + - : Strings containing keys, plain texts, cipher texts etc. are internally + converted into byte arrays using this encoding (currently UTF8). + + + +--- + +## Constructor Details + +### WeakCipher() +- WeakCipher() + - : + + +--- + +## Method Details + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 1 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-1), which allows to use a key in + the keystore for the decryption. See [Cipher.decryptBytes(Bytes, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-1) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - privateKey - A reference to a private key in the key store. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 1 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. See [Cipher.decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-1) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-1) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 2 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-2), which allows to use a key in + the keystore for the decryption. See [Cipher.decryptBytes(Bytes, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-2) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - privateKey - A reference to a private key in the key store. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 2 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. See [Cipher.decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-2) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-2) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decryptBytes(Bytes, KeyRef, String, String, Number) - Variant 3 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [decryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptbytesbytes-string-string-string-number---variant-3), which allows to use a key in + the keystore for the decryption. See [Cipher.decryptBytes(Bytes, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-keyref-string-string-number---variant-3) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - privateKey - A reference to a private key in the key store. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decryptBytes(Bytes, String, String, String, Number) - Variant 3 +- decryptBytes(encryptedBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level decryption API. Decrypts the passed bytes using the specified + key and applying the transformations described by the specified + parameters. See [Cipher.decryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#decryptbytesbytes-string-string-string-number---variant-3) for full + documentation. + + + **Parameters:** + - encryptedBytes - The bytes to decrypt. + - key - The key to use for decryption. + - transformation - The transformation used to originally encrypt. + - saltOrIV - the salt or IV to use. + - iterations - the iterations to use. + + **Returns:** + - The decrypted bytes. + + **See Also:** + - [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-3) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 1 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-1), which allows using a key in the + keystore for the decryption. See [Cipher.decrypt(String, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-1) for full + documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - privateKey - A reference to a private key in the key store. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 1 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the message using the given parameters. See + [Cipher.decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-1) for full documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - key - The decryption key + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 2 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-2), which allows using a key in the + keystore for the decryption. See [Cipher.decrypt(String, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-2) for full + documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - privateKey - A reference to a private key in the key store. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 2 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the message using the given parameters. See + [Cipher.decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-2) for full documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - key - The decryption key + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### decrypt(String, KeyRef, String, String, Number) - Variant 3 +- decrypt(base64Msg: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Alternative method to [decrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#decryptstring-string-string-string-number---variant-3), which allows using a key in the + keystore for the decryption. See [Cipher.decrypt(String, KeyRef, String, String, Number)](dw.crypto.Cipher.md#decryptstring-keyref-string-string-number---variant-3) for full + documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - privateKey - A reference to a private key in the key store. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### decrypt(String, String, String, String, Number) - Variant 3 +- decrypt(base64Msg: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Decrypts the message using the given parameters. See + [Cipher.decrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#decryptstring-string-string-string-number---variant-3) for full documentation. + + + **Parameters:** + - base64Msg - the base64 encoded data to decrypt + - key - The decryption key + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - the original plaintext message. + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 1 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-1), which allows + to use a key in the keystore for the encryption. See [Cipher.encryptBytes(Bytes, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-1) for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - publicKey - A reference to a public key + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, CertificateRef, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-1) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 1 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the specified key and applying the transformations + described by the specified parameters. See [Cipher.encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-1) + for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-1) + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 2 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-2), which allows + to use a key in the keystore for the encryption. See [Cipher.encryptBytes(Bytes, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-2) for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - publicKey - A reference to a public key. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, CertificateRef, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-2) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 2 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the specified key and applying the transformations + described by the specified parameters. See [Cipher.encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-2) + for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-2) + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encryptBytes(Bytes, CertificateRef, String, String, Number) - Variant 3 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Alternative method to [encryptBytes(Bytes, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptbytesbytes-string-string-string-number---variant-3), which allows + to use a key in the keystore for the encryption. See [Cipher.encryptBytes(Bytes, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-certificateref-string-string-number---variant-3) for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - publicKey - A reference to a public key. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, CertificateRef, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-certificateref-string-string-number---variant-3) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encryptBytes(Bytes, String, String, String, Number) - Variant 3 +- encryptBytes(messageBytes: [Bytes](dw.util.Bytes.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Lower-level encryption API. Encrypts the passed bytes by using the specified key and applying the transformations + described by the specified parameters. See [Cipher.encryptBytes(Bytes, String, String, String, Number)](dw.crypto.Cipher.md#encryptbytesbytes-string-string-string-number---variant-3) + for full documentation. + + + **Parameters:** + - messageBytes - The bytes to encrypt. + - key - The key to use for encryption. + - transformation - Transformation in _"algorithm/mode/padding"_ format. + - saltOrIV - Initialization value appropriate for the algorithm. + - iterations - The number of passes to make when turning a passphrase into a key. + + **Returns:** + - the encrypted bytes. + + **See Also:** + - [encrypt(String, String, String, String, Number)](dw.crypto.WeakCipher.md#encryptstring-string-string-string-number---variant-3) + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 1 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-1) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - publicKey - A reference to a public key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 1 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-1) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - key - Key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +No longer available as of version 15.5. +Under some conditions this method allowed a non-Base64 encrypted value for the salt parameter. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 2 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-2) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - publicKey - A reference to a public key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 2 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-2) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - key - Key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +Available from version 15.5. +No longer available as of version 16.2. +Requires Base64-encryption for the salt parameter. +::: + +--- + +### encrypt(String, CertificateRef, String, String, Number) - Variant 3 +- encrypt(message: [String](TopLevel.String.md), publicKey: [CertificateRef](dw.crypto.CertificateRef.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, CertificateRef, String, String, Number)](dw.crypto.Cipher.md#encryptstring-certificateref-string-string-number---variant-3) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - publicKey - A reference to a public key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + +### encrypt(String, String, String, String, Number) - Variant 3 +- encrypt(message: [String](TopLevel.String.md), key: [String](TopLevel.String.md), transformation: [String](TopLevel.String.md), saltOrIV: [String](TopLevel.String.md), iterations: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Encrypt the passed message by using the specified key and applying the + transformations described by the specified parameters. + + See [Cipher.encrypt(String, String, String, String, Number)](dw.crypto.Cipher.md#encryptstring-string-string-string-number---variant-3) for full documentation. + + + **Parameters:** + - message - Message to encrypt (this will be converted to UTF-8 first) + - key - Key + - transformation - Transformation in _"algorithm/mode/padding"_ format + - saltOrIV - Initialization value appropriate for the algorithm + - iterations - The number of passes to make when turning a passphrase into a key, if applicable + + **Returns:** + - Base64-encoded encrypted data + + **API Version:** +:::note +Available from version 16.2. +Does not use a default initialization vector. +::: + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMac.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMac.md new file mode 100644 index 00000000..b2da588c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMac.md @@ -0,0 +1,163 @@ + +# Class WeakMac + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.WeakMac](dw.crypto.WeakMac.md) + +This API provides access to Deprecated algorithms. + + +See [Mac](dw.crypto.Mac.md) for full documentation. WeakMac is simply a drop-in replacement that **only** supports +deprecated algorithms. This is helpful when you need to deal with weak algorithms for backward +compatibility purposes, but Mac should always be used for new development and for anything intended to be secure. + + +This class provides the functionality of a "Message Authentication Code" (MAC) algorithm. +A MAC provides a way to check the integrity of information transmitted over or +stored in an unreliable medium, based on a secret key. +Typically, message authentication codes are used between two parties +that share a secret key in order to validate information transmitted between these parties. +A MAC mechanism that is based on cryptographic hash functions is referred to as HMAC. +HMAC can be used with any cryptographic hash function, e.g., SHA256, +in combination with a secret shared key. HMAC is specified in RFC 2104. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [HMAC_MD5](#hmac_md5): [String](TopLevel.String.md) = "HmacMD5" | Constant representing the HMAC-MD5 keyed-hashing algorithm as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997). | +| [HMAC_SHA_1](#hmac_sha_1): [String](TopLevel.String.md) = "HmacSHA1" | Constant representing the HmacSHA1 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) with SHA-1 as the message digest algorithm. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakMac](#weakmacstring)([String](TopLevel.String.md)) | Construct a Mac encryption instance with the specified algorithm name. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [digest](dw.crypto.WeakMac.md#digestbytes-bytes)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed bytes input using the passed secret key. | +| [digest](dw.crypto.WeakMac.md#digeststring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed string input using the passed secret key. | +| [digest](dw.crypto.WeakMac.md#digeststring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Computes the hash value for the passed string input using the passed secret key. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### HMAC_MD5 + +- HMAC_MD5: [String](TopLevel.String.md) = "HmacMD5" + - : Constant representing the HMAC-MD5 keyed-hashing algorithm as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997). + This algorithm uses as MD5 cryptographic hash function. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +### HMAC_SHA_1 + +- HMAC_SHA_1: [String](TopLevel.String.md) = "HmacSHA1" + - : Constant representing the HmacSHA1 algorithms as defined in RFC 2104 "HMAC: Keyed-Hashing for Message Authentication" (February 1997) + with SHA-1 as the message digest algorithm. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +## Constructor Details + +### WeakMac(String) +- WeakMac(algorithm: [String](TopLevel.String.md)) + - : Construct a Mac encryption instance with the specified algorithm name. The + supported algorithms are: + + + - HmacMD5 + - HmacSHA1 + + + **Parameters:** + - algorithm - the standard name of the digest algorithm, must not be null. + + **Throws:** + - NullArgumentException - if algorithm is null. + - IllegalArgumentException - if the specified algorithm name is not supported. + + +--- + +## Method Details + +### digest(Bytes, Bytes) +- digest(input: [Bytes](dw.util.Bytes.md), key: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed bytes input using the passed secret key. + + **Parameters:** + - input - The bytes to calculate a RFC 2104 compliant HMAC hash value. + - key - The secret key as byte array ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + +### digest(String, Bytes) +- digest(input: [String](TopLevel.String.md), key: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed string input using the passed secret key. + Given input will be first converted with UTF-8 encoding into a byte array. + The resulting hash is typically converted with base64 back into a string. + + + **Parameters:** + - input - A string to calculate a RFC 2104 compliant HMAC hash value for. + - key - The secret key as bytes ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + +### digest(String, String) +- digest(input: [String](TopLevel.String.md), key: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed string input using the passed secret key. + Given input and the given key will be first converted with UTF-8 encoding into a byte array. + The resulting hash is typically converted with base64 back into a string. + + + **Parameters:** + - input - A string to calculate a RFC 2104 compliant HMAC hash value for. + - key - The secret key ready for use with the algorithm. The key's format depends on the chosen algorithm and the keys are assumed to be correctly formulated for the algorithm used, for example that the lengths are correct. Keys are _not_ checked for validity. Only such keys that have no key parameters associated with them. + + **Returns:** + - The resulting hash value as bytes. + + **Throws:** + - IllegalArgumentException - if algorithm is not null and the specified algorithm name is not supported. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMessageDigest.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMessageDigest.md new file mode 100644 index 00000000..d4d81510 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakMessageDigest.md @@ -0,0 +1,220 @@ + +# Class WeakMessageDigest + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.WeakMessageDigest](dw.crypto.WeakMessageDigest.md) + +This API provides access to Deprecated algorithms. + + +See [MessageDigest](dw.crypto.MessageDigest.md) for full documentation. WeakMessageDigest is simply a drop-in replacement that **only** supports +deprecated algorithms. This is helpful when you need to deal with weak algorithms for backward +compatibility purposes, but MessageDigest should always be used for new development and for anything intended to be secure. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [DIGEST_MD2](#digest_md2): [String](TopLevel.String.md) = "MD2" | Constant representing the MD2 algorithm. | +| [DIGEST_MD5](#digest_md5): [String](TopLevel.String.md) = "MD5" | Constant representing the MD5 algorithm. | +| [DIGEST_SHA](#digest_sha): [String](TopLevel.String.md) = "SHA" | Constant representing the SHA algorithm. | +| [DIGEST_SHA_1](#digest_sha_1): [String](TopLevel.String.md) = "SHA-1" | Constant representing the SHA 1 algorithm. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakMessageDigest](#weakmessagedigeststring)([String](TopLevel.String.md)) | Construct a MessageDigest with the specified algorithm name. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [digest](dw.crypto.WeakMessageDigest.md#digest)() | Completes the hash computation by performing final operations such as padding. | +| ~~[digest](dw.crypto.WeakMessageDigest.md#digeststring)([String](TopLevel.String.md))~~ | Digests the passed string and returns a computed hash value as a string. | +| ~~[digest](dw.crypto.WeakMessageDigest.md#digeststring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md))~~ | Computes the hash value for the passed array of bytes. | +| [digestBytes](dw.crypto.WeakMessageDigest.md#digestbytesbytes)([Bytes](dw.util.Bytes.md)) | Computes the hash value for the passed [Bytes](dw.util.Bytes.md). | +| [updateBytes](dw.crypto.WeakMessageDigest.md#updatebytesbytes)([Bytes](dw.util.Bytes.md)) | Updates the digest using the passed [Bytes](dw.util.Bytes.md). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DIGEST_MD2 + +- DIGEST_MD2: [String](TopLevel.String.md) = "MD2" + - : Constant representing the MD2 algorithm. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +### DIGEST_MD5 + +- DIGEST_MD5: [String](TopLevel.String.md) = "MD5" + - : Constant representing the MD5 algorithm. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +### DIGEST_SHA + +- DIGEST_SHA: [String](TopLevel.String.md) = "SHA" + - : Constant representing the SHA algorithm. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +### DIGEST_SHA_1 + +- DIGEST_SHA_1: [String](TopLevel.String.md) = "SHA-1" + - : Constant representing the SHA 1 algorithm. + + + This algorithm is obsolete. Do not use it for any sensitive data + + + +--- + +## Constructor Details + +### WeakMessageDigest(String) +- WeakMessageDigest(algorithm: [String](TopLevel.String.md)) + - : Construct a MessageDigest with the specified algorithm name. + + **Parameters:** + - algorithm - The standard name of the digest algorithm, must not be null and must be a supported algorithm. + + +--- + +## Method Details + +### digest() +- digest(): [Bytes](dw.util.Bytes.md) + - : Completes the hash computation by performing final operations such as + padding. + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest() ); + ` + + + **Returns:** + - The resulting hash value. + + +--- + +### digest(String) +- ~~digest(input: [String](TopLevel.String.md)): [String](TopLevel.String.md)~~ + - : Digests the passed string and returns a computed hash value as a string. + The passed String is first encoded into a sequence of bytes using the + platform's default encoding. The digest then performs any prerequisite + padding, before computing the hash value. The hash is then converted into + a string by converting all digits to hexadecimal. + + + **Parameters:** + - input - The value to hash as String, must not be null. + + **Returns:** + - The resulting hash value as hex-encoded string. + + **Deprecated:** +:::warning +Deprecated because the conversion of the input to bytes using + the default platform encoding and the hex-encoded return + value are not generally appropriate. + +::: + +--- + +### digest(String, Bytes) +- ~~digest(algorithm: [String](TopLevel.String.md), input: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md)~~ + - : Computes the hash value for the passed array of bytes. The algorithm + argument is optional. If null, then the algorithm established at + construction time is used. + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest( "MD5", new Bytes( "my password", "UTF-8" ) ) ); + ` + + + **Parameters:** + - algorithm - The standard name of the digest algorithm, or null if the algorithm passed at construction time is to be used. The algorithm must be a supported algorithm. + - input - The value to hash, must not be null. + + **Returns:** + - The resulting hash value. + + **Deprecated:** +:::warning +Deprecated because the digest algorithm should be the one + set in the constructor. + +::: + +--- + +### digestBytes(Bytes) +- digestBytes(input: [Bytes](dw.util.Bytes.md)): [Bytes](dw.util.Bytes.md) + - : Computes the hash value for the passed [Bytes](dw.util.Bytes.md). + + The binary representation of the message is typically derived from a + string and the resulting hash is typically converted with base64 back + into a string. Example: + + ` + Encoding.toBase64( digest( new Bytes( "my password", "UTF-8" ) ) ); + ` + + + **Parameters:** + - input - The value to hash, must not be null. + + **Returns:** + - The resulting hash value. + + +--- + +### updateBytes(Bytes) +- updateBytes(input: [Bytes](dw.util.Bytes.md)): void + - : Updates the digest using the passed [Bytes](dw.util.Bytes.md). + + **Parameters:** + - input - The value to hash, must not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakSignature.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakSignature.md new file mode 100644 index 00000000..3a5ddd12 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.WeakSignature.md @@ -0,0 +1,208 @@ + +# Class WeakSignature + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.WeakSignature](dw.crypto.WeakSignature.md) + +This API provides access to Deprecated algorithms. + + +See [Signature](dw.crypto.Signature.md) for full documentation. WeakSignature is simply a drop-in replacement that **only** supports +deprecated algorithms. This is helpful when you need to deal with weak algorithms for backward compatibility +purposes, but Signature should always be used for new development and for anything intended to be secure. + + + + +This class allows access to signature services offered through the Java Cryptography Architecture (JCA). At this time +the signature/verification implementation of the methods is based on the default RSA JCE provider of the JDK - +sun.security.rsa.SunRsaSign + + + + +dw.crypto.WeakSignature is an adapter to the security provider implementation and only covers one digest algorithm: + +- SHA1withRSA + + + + + +**Note:** this class handles sensitive security-related data. Pay special attention to PCI DSS v3. requirements 2, +4, 12, and other relevant requirements. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WeakSignature](#weaksignature)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [isDigestAlgorithmSupported](dw.crypto.WeakSignature.md#isdigestalgorithmsupportedstring)([String](TopLevel.String.md)) | Checks to see if a digest algorithm is supported | +| [sign](dw.crypto.WeakSignature.md#signstring-keyref-string)([String](TopLevel.String.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md)) | Signs a string and returns a string | +| [sign](dw.crypto.WeakSignature.md#signstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Signs a string and returns a string | +| [signBytes](dw.crypto.WeakSignature.md#signbytesbytes-keyref-string)([Bytes](dw.util.Bytes.md), [KeyRef](dw.crypto.KeyRef.md), [String](TopLevel.String.md)) | Signs bytes and returns bytes | +| [signBytes](dw.crypto.WeakSignature.md#signbytesbytes-string-string)([Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Signs bytes and returns bytes | +| [verifyBytesSignature](dw.crypto.WeakSignature.md#verifybytessignaturebytes-bytes-certificateref-string)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md)) | Verifies a signature supplied as bytes | +| [verifyBytesSignature](dw.crypto.WeakSignature.md#verifybytessignaturebytes-bytes-string-string)([Bytes](dw.util.Bytes.md), [Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Verifies a signature supplied as bytes | +| [verifySignature](dw.crypto.WeakSignature.md#verifysignaturestring-string-certificateref-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [CertificateRef](dw.crypto.CertificateRef.md), [String](TopLevel.String.md)) | Verifies a signature supplied as string | +| [verifySignature](dw.crypto.WeakSignature.md#verifysignaturestring-string-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Verifies a signature supplied as string | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### WeakSignature() +- WeakSignature() + - : + + +--- + +## Method Details + +### isDigestAlgorithmSupported(String) +- isDigestAlgorithmSupported(digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Checks to see if a digest algorithm is supported + + **Parameters:** + - digestAlgorithm - the digest algorithm name + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### sign(String, KeyRef, String) +- sign(contentToSign: [String](TopLevel.String.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), digestAlgorithm: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Signs a string and returns a string + + **Parameters:** + - contentToSign - base64 encoded content to sign + - privateKey - a reference to a private key entry in the keystore + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - the base64 encoded signature + + +--- + +### sign(String, String, String) +- sign(contentToSign: [String](TopLevel.String.md), privateKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Signs a string and returns a string + + **Parameters:** + - contentToSign - base64 encoded content to sign + - privateKey - base64 encoded private key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - the base64 encoded signature + + +--- + +### signBytes(Bytes, KeyRef, String) +- signBytes(contentToSign: [Bytes](dw.util.Bytes.md), privateKey: [KeyRef](dw.crypto.KeyRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Signs bytes and returns bytes + + **Parameters:** + - contentToSign - transformed with UTF-8 encoding into a byte stream + - privateKey - a reference to a private key entry in the keystore + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - signature + + +--- + +### signBytes(Bytes, String, String) +- signBytes(contentToSign: [Bytes](dw.util.Bytes.md), privateKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Bytes](dw.util.Bytes.md) + - : Signs bytes and returns bytes + + **Parameters:** + - contentToSign - transformed with UTF-8 encoding into a byte stream + - privateKey - base64 encoded private key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - signature + + +--- + +### verifyBytesSignature(Bytes, Bytes, CertificateRef, String) +- verifyBytesSignature(signature: [Bytes](dw.util.Bytes.md), contentToVerify: [Bytes](dw.util.Bytes.md), certificate: [CertificateRef](dw.crypto.CertificateRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as bytes + + **Parameters:** + - signature - signature to check as bytes + - contentToVerify - as bytes + - certificate - a reference to a trusted certificate + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifyBytesSignature(Bytes, Bytes, String, String) +- verifyBytesSignature(signature: [Bytes](dw.util.Bytes.md), contentToVerify: [Bytes](dw.util.Bytes.md), publicKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as bytes + + **Parameters:** + - signature - signature to check as bytes + - contentToVerify - as bytes + - publicKey - base64 encoded public key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifySignature(String, String, CertificateRef, String) +- verifySignature(signature: [String](TopLevel.String.md), contentToVerify: [String](TopLevel.String.md), certificate: [CertificateRef](dw.crypto.CertificateRef.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as string + + **Parameters:** + - signature - base64 encoded signature + - contentToVerify - base64 encoded content to verify + - certificate - a reference to a trusted certificate + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + +### verifySignature(String, String, String, String) +- verifySignature(signature: [String](TopLevel.String.md), contentToVerify: [String](TopLevel.String.md), publicKey: [String](TopLevel.String.md), digestAlgorithm: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Verifies a signature supplied as string + + **Parameters:** + - signature - base64 encoded signature + - contentToVerify - base64 encoded content to verify + - publicKey - base64 encoded public key + - digestAlgorithm - must be one of the currently supported ones + + **Returns:** + - a boolean indicating success (true) or failure (false) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.X509Certificate.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.X509Certificate.md new file mode 100644 index 00000000..74dfbe09 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.X509Certificate.md @@ -0,0 +1,180 @@ + +# Class X509Certificate + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.crypto.CertificateRef](dw.crypto.CertificateRef.md) + - [dw.crypto.X509Certificate](dw.crypto.X509Certificate.md) + +Represents an X.509 public key certificate as defined in RFC 5280. + + +It provides access to the standard fields of an X.509 certificate including version, serial number, validity period, +distinguished names, and signature algorithm. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [issuerDN](#issuerdn): [String](TopLevel.String.md) `(read-only)` | Returns the X.500 distinguished name of the entity that signed this certificate. | +| [notAfter](#notafter): [Date](TopLevel.Date.md) `(read-only)` | Returns the end date of the certificate validity period. | +| [notBefore](#notbefore): [Date](TopLevel.Date.md) `(read-only)` | Returns the start date of the certificate validity period. | +| [serialNumber](#serialnumber): [String](TopLevel.String.md) `(read-only)` | Returns the certificate serial number in string format. | +| [sigAlgName](#sigalgname): [String](TopLevel.String.md) `(read-only)` | Returns the algorithm used to sign this certificate. | +| [subjectDN](#subjectdn): [String](TopLevel.String.md) `(read-only)` | Returns the X.500 distinguished name of the entity this certificate belongs to. | +| [version](#version): [Number](TopLevel.Number.md) `(read-only)` | Returns the X.509 certificate version number. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getIssuerDN](dw.crypto.X509Certificate.md#getissuerdn)() | Returns the X.500 distinguished name of the entity that signed this certificate. | +| [getNotAfter](dw.crypto.X509Certificate.md#getnotafter)() | Returns the end date of the certificate validity period. | +| [getNotBefore](dw.crypto.X509Certificate.md#getnotbefore)() | Returns the start date of the certificate validity period. | +| [getSerialNumber](dw.crypto.X509Certificate.md#getserialnumber)() | Returns the certificate serial number in string format. | +| [getSigAlgName](dw.crypto.X509Certificate.md#getsigalgname)() | Returns the algorithm used to sign this certificate. | +| [getSubjectDN](dw.crypto.X509Certificate.md#getsubjectdn)() | Returns the X.500 distinguished name of the entity this certificate belongs to. | +| [getVersion](dw.crypto.X509Certificate.md#getversion)() | Returns the X.509 certificate version number. | + +### Methods inherited from class CertificateRef + +[toString](dw.crypto.CertificateRef.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### issuerDN +- issuerDN: [String](TopLevel.String.md) `(read-only)` + - : Returns the X.500 distinguished name of the entity that signed this certificate. + + +--- + +### notAfter +- notAfter: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the end date of the certificate validity period. + + +--- + +### notBefore +- notBefore: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the start date of the certificate validity period. + + +--- + +### serialNumber +- serialNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the certificate serial number in string format. The serial number is a unique positive integer assigned + by the CA to each certificate. + + + +--- + +### sigAlgName +- sigAlgName: [String](TopLevel.String.md) `(read-only)` + - : Returns the algorithm used to sign this certificate. The name follows the format defined in RFC 5280 (e.g., + "SHA256withRSA", "SHA384withECDSA"). + + + +--- + +### subjectDN +- subjectDN: [String](TopLevel.String.md) `(read-only)` + - : Returns the X.500 distinguished name of the entity this certificate belongs to. + + +--- + +### version +- version: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the X.509 certificate version number. + + +--- + +## Method Details + +### getIssuerDN() +- getIssuerDN(): [String](TopLevel.String.md) + - : Returns the X.500 distinguished name of the entity that signed this certificate. + + **Returns:** + - the issuer's X.500 distinguished name + + +--- + +### getNotAfter() +- getNotAfter(): [Date](TopLevel.Date.md) + - : Returns the end date of the certificate validity period. + + **Returns:** + - the date after which this certificate is not valid + + +--- + +### getNotBefore() +- getNotBefore(): [Date](TopLevel.Date.md) + - : Returns the start date of the certificate validity period. + + **Returns:** + - the date before which this certificate is not valid + + +--- + +### getSerialNumber() +- getSerialNumber(): [String](TopLevel.String.md) + - : Returns the certificate serial number in string format. The serial number is a unique positive integer assigned + by the CA to each certificate. + + + **Returns:** + - the certificate serial number as a string + + +--- + +### getSigAlgName() +- getSigAlgName(): [String](TopLevel.String.md) + - : Returns the algorithm used to sign this certificate. The name follows the format defined in RFC 5280 (e.g., + "SHA256withRSA", "SHA384withECDSA"). + + + **Returns:** + - the signature algorithm name + + +--- + +### getSubjectDN() +- getSubjectDN(): [String](TopLevel.String.md) + - : Returns the X.500 distinguished name of the entity this certificate belongs to. + + **Returns:** + - the subject's X.500 distinguished name + + +--- + +### getVersion() +- getVersion(): [Number](TopLevel.Number.md) + - : Returns the X.509 certificate version number. + + **Returns:** + - certificate version (typically 1, 2, or 3) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.crypto.md b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.md new file mode 100644 index 00000000..37071629 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.crypto.md @@ -0,0 +1,23 @@ +# Package dw.crypto + +## Classes +| Class | Description | +| --- | --- | +| [CertificateRef](dw.crypto.CertificateRef.md) | This class is used as a reference to a certificate or public key. | +| [CertificateUtils](dw.crypto.CertificateUtils.md) | Utilities for managing certificates and keys. | +| [Cipher](dw.crypto.Cipher.md) | This class allows access to encryption services offered through the Java Cryptography Architecture (JCA). | +| [Encoding](dw.crypto.Encoding.md) | Utility class which handles several common character encodings. | +| [JWE](dw.crypto.JWE.md) | This class represents a JSON Web Encryption (JWE) object. | +| [JWEHeader](dw.crypto.JWEHeader.md) | This class represents an immutable header of a JWE (JSON Web Encryption) object. | +| [JWS](dw.crypto.JWS.md) | This class represents a JSON Web Signature (JWS) object. | +| [JWSHeader](dw.crypto.JWSHeader.md) | This class represents an immutable header of a JWS (JSON Web Signature) object. | +| [KeyRef](dw.crypto.KeyRef.md) | This class is used as a reference to a private key in the keystore which can be managed in the Business Manager. | +| [Mac](dw.crypto.Mac.md) | This class provides the functionality of a "Message Authentication Code" (MAC) algorithm. | +| [MessageDigest](dw.crypto.MessageDigest.md) | This class provides the functionality of a message digest algorithm, such as MD5 or SHA. | +| [SecureRandom](dw.crypto.SecureRandom.md) | The SecureRandom class provides a cryptographically strong random number generator (RNG). | +| [Signature](dw.crypto.Signature.md) |

    This class allows access to signature services offered through the Java Cryptography Architecture (JCA). | +| [WeakCipher](dw.crypto.WeakCipher.md) | This API provides access to Deprecated algorithms. | +| [WeakMac](dw.crypto.WeakMac.md) | This API provides access to Deprecated algorithms. | +| [WeakMessageDigest](dw.crypto.WeakMessageDigest.md) | This API provides access to Deprecated algorithms. | +| [WeakSignature](dw.crypto.WeakSignature.md) | This API provides access to Deprecated algorithms. | +| [X509Certificate](dw.crypto.X509Certificate.md) | Represents an X.509 public key certificate as defined in RFC 5280. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.AddressBook.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AddressBook.md new file mode 100644 index 00000000..33e2c6d5 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AddressBook.md @@ -0,0 +1,158 @@ + +# Class AddressBook + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.AddressBook](dw.customer.AddressBook.md) + +Represents a set of addresses associated with a specific customer. +The AddressBook object gets its data from the Profile object for the customer. +When scripting, this class allows AddressBook to be treated as a separate object +from the Profile. However, data is only stored in the platform in the Profile object +and there is no separate AddressBook object. For this reason, the AddressBook ID is +always the customer profile ID. + + +**Note:** this class allows access to sensitive personal and private information. +Pay attention to appropriate legal and regulatory requirements when developing. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [addresses](#addresses): [List](dw.util.List.md) `(read-only)` | Returns a sorted list of addresses in the address book. | +| [preferredAddress](#preferredaddress): [CustomerAddress](dw.customer.CustomerAddress.md) | Returns the address that has been defined as the customer's preferred address. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createAddress](dw.customer.AddressBook.md#createaddressstring)([String](TopLevel.String.md)) | Creates a new, empty address object with the specified name. | +| [getAddress](dw.customer.AddressBook.md#getaddressstring)([String](TopLevel.String.md)) | Returns the address with the given name from the address book. | +| [getAddresses](dw.customer.AddressBook.md#getaddresses)() | Returns a sorted list of addresses in the address book. | +| [getPreferredAddress](dw.customer.AddressBook.md#getpreferredaddress)() | Returns the address that has been defined as the customer's preferred address. | +| [removeAddress](dw.customer.AddressBook.md#removeaddresscustomeraddress)([CustomerAddress](dw.customer.CustomerAddress.md)) | Removes the specified address from the address book. | +| [setPreferredAddress](dw.customer.AddressBook.md#setpreferredaddresscustomeraddress)([CustomerAddress](dw.customer.CustomerAddress.md)) | Sets the specified address as the customer's preferred address. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### addresses +- addresses: [List](dw.util.List.md) `(read-only)` + - : Returns a sorted list of addresses in the address book. The addresses + are sorted so that the preferred address is always sorted first. The + remaining addresses are sorted alphabetically by ID. + + + +--- + +### preferredAddress +- preferredAddress: [CustomerAddress](dw.customer.CustomerAddress.md) + - : Returns the address that has been defined as the customer's preferred + address. + + + +--- + +## Method Details + +### createAddress(String) +- createAddress(name: [String](TopLevel.String.md)): [CustomerAddress](dw.customer.CustomerAddress.md) + - : Creates a new, empty address object with the specified name. + + **Parameters:** + - name - the ID of the address to create, must not be null. + + **Returns:** + - the new address object or null if an address with the given name + already exists in the address book. + + + **Throws:** + - NullArgumentException - If passed 'name' is null. + - IllegalArgumentException - If passed 'name' is not null, but an empty string. + + +--- + +### getAddress(String) +- getAddress(id: [String](TopLevel.String.md)): [CustomerAddress](dw.customer.CustomerAddress.md) + - : Returns the address with the given name from the address book. The name + is a unique identifier of the address within the address book. + + + **Parameters:** + - id - An address ID, must not be null. + + **Returns:** + - The Address object or null if the address does not exist. + + **Throws:** + - NullArgumentException - If passed 'id' is null. + - IllegalArgumentException - If passed 'id' is not null, but an empty string. + + +--- + +### getAddresses() +- getAddresses(): [List](dw.util.List.md) + - : Returns a sorted list of addresses in the address book. The addresses + are sorted so that the preferred address is always sorted first. The + remaining addresses are sorted alphabetically by ID. + + + **Returns:** + - Sorted List of customer addresses in the address book. + + +--- + +### getPreferredAddress() +- getPreferredAddress(): [CustomerAddress](dw.customer.CustomerAddress.md) + - : Returns the address that has been defined as the customer's preferred + address. + + + **Returns:** + - the default CustomerAddress object, or null if there is no + preferred address. + + + +--- + +### removeAddress(CustomerAddress) +- removeAddress(address: [CustomerAddress](dw.customer.CustomerAddress.md)): void + - : Removes the specified address from the address book. Because an address + can be associated with a product list, you may want to verify if the + address is being used by a product list. See ProductListMgr.findAddress(). + + + **Parameters:** + - address - the address to remove, must not be null. + + +--- + +### setPreferredAddress(CustomerAddress) +- setPreferredAddress(anAddress: [CustomerAddress](dw.customer.CustomerAddress.md)): void + - : Sets the specified address as the customer's preferred address. If null + is passed, and there is an existing preferred address, then the address + book will have no preferred address. + + + **Parameters:** + - anAddress - the address to be set as preferred, or null if the goal is to unset the existing preferred address. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserMgr.md new file mode 100644 index 00000000..75533063 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserMgr.md @@ -0,0 +1,94 @@ + +# Class AgentUserMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.AgentUserMgr](dw.customer.AgentUserMgr.md) + +Provides helper methods for handling agent user functionality (login and logout) +Pay attention to appropriate legal and regulatory requirements related to this functionality. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [loginAgentUser](dw.customer.AgentUserMgr.md#loginagentuserstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Logs in an agent user (which for example is authorized to login on-behalf of a customer for instance to place an order). | +| static [loginOnBehalfOfCustomer](dw.customer.AgentUserMgr.md#loginonbehalfofcustomercustomer)([Customer](dw.customer.Customer.md)) | This method logs the specified customer into the current session if the current agent user has the functional permission 'Login\_On\_Behalf' in the current site. | +| static [logoutAgentUser](dw.customer.AgentUserMgr.md#logoutagentuser)() | Performs a logout of the agent user and the current customer which are attached to the current session. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### loginAgentUser(String, String) +- static loginAgentUser(login: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Status](dw.system.Status.md) + - : Logs in an agent user (which for example is authorized to login on-behalf of a customer for + instance to place an order). The login is only allowed during a secure protocol + request (https) and only in the storefront context. The user must have the permission 'Login\_Agent'. + + When the login is successful, a new session will be created. Any objects that need + to be preserved in the session need to bet set on the session afterwards. + + A Status object is returned which signals whether the login was successful or not. + In case of a login failure the status object contains the reason for this. + See [AgentUserStatusCodes](dw.customer.AgentUserStatusCodes.md) for more information. + + + **Parameters:** + - login - the login name for the agent user. + - password - the password for the agent user. + + **Returns:** + - the login status (OK if successful, error code otherwise). + + +--- + +### loginOnBehalfOfCustomer(Customer) +- static loginOnBehalfOfCustomer(customer: [Customer](dw.customer.Customer.md)): [Status](dw.system.Status.md) + - : This method logs the specified customer into the current session if the + current agent user has the functional permission 'Login\_On\_Behalf' in the + current site. + + The dwcustomer cookie will not be set. + The login is only allowed during a secure protocol request (https). + A Status object is returned indicating whether the login was successful or not (and indicating the + failure reason). See [AgentUserStatusCodes](dw.customer.AgentUserStatusCodes.md) for more information. + Error conditions include: + + - if the method is not called in the storefront context + - if the given customer is not a registered customer (anonymous) + - if the given customer is not registered for the current site + - if the given customer is disabled + - if there is no agent user at the current session + - if the agent user is not logged in + - if the agent user has not the functional permission 'Login\_On\_Behalf' + + + **Parameters:** + - customer - The customer, which should be logged instead of the agent user + + **Returns:** + - the login status (OK if successful, error code otherwise). + + +--- + +### logoutAgentUser() +- static logoutAgentUser(): [Status](dw.system.Status.md) + - : Performs a logout of the agent user and the current customer which are attached to the current session. + The logout is only allowed during a secure protocol request (https) and only in the storefront context. + + + **Returns:** + - the logout status (OK if successful, error code otherwise). + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserStatusCodes.md new file mode 100644 index 00000000..cdd77f3c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AgentUserStatusCodes.md @@ -0,0 +1,164 @@ + +# Class AgentUserStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.AgentUserStatusCodes](dw.customer.AgentUserStatusCodes.md) + +AgentUserStatusCodes contains constants representing status codes that can be +used with a [Status](dw.system.Status.md) object to indicate the success or failure of the agent +user login process. + + +**See Also:** +- [Status](dw.system.Status.md) + + +## All Known Subclasses +[AgentUserStatusCodes](dw.system.AgentUserStatusCodes.md) +## Constant Summary + +| Constant | Description | +| --- | --- | +| [AGENT_USER_NOT_AVAILABLE](#agent_user_not_available): [String](TopLevel.String.md) = "AGENT_USER_NOT_AVAILABLE" | Indicates that the agent user is not available. | +| [AGENT_USER_NOT_LOGGED_IN](#agent_user_not_logged_in): [String](TopLevel.String.md) = "AGENT_USER_NOT_LOGGED_IN" | Indicates that the agent user is not logged in. | +| [CREDENTIALS_INVALID](#credentials_invalid): [String](TopLevel.String.md) = "CREDENTIALS_INVALID" | Indicates that the given agent user login or password was wrong. | +| [CUSTOMER_DISABLED](#customer_disabled): [String](TopLevel.String.md) = "CUSTOMER_DISABLED" | Indicates that the customer is disabled. | +| [CUSTOMER_UNREGISTERED](#customer_unregistered): [String](TopLevel.String.md) = "CUSTOMER_UNREGISTERED" | Indicates that the customer is either not registered or not registered with the current site. | +| [INSECURE_CONNECTION](#insecure_connection): [String](TopLevel.String.md) = "INSECURE_CONNECTION" | Indicates that the current connection is not secure (HTTP instead of HTTPS) and the server is configured to require a secure connection. | +| [INSUFFICIENT_PERMISSION](#insufficient_permission): [String](TopLevel.String.md) = "INSUFFICIENT_PERMISSION" | Indicates that the given agent user does not have the permission 'Login\_Agent' which is required to login to the storefront as an agent user. | +| [LOGIN_SUCCESSFUL](#login_successful): [String](TopLevel.String.md) = "LOGIN_SUCCESSFUL" | Indicates that the agent user login was successful. | +| [NO_STOREFRONT](#no_storefront): [String](TopLevel.String.md) = "NO_STOREFRONT" | Indicates that the current context is not a storefront request. | +| [PASSWORD_EXPIRED](#password_expired): [String](TopLevel.String.md) = "PASSWORD_EXPIRED" | Indicates that the given agent user password has expired and needs to be changed in the Business Manager. | +| [USER_DISABLED](#user_disabled): [String](TopLevel.String.md) = "USER_DISABLED" | Indicates that the agent user account has been disabled in the Business Manager. | +| [USER_LOCKED](#user_locked): [String](TopLevel.String.md) = "USER_LOCKED" | Indicates that the agent user account is locked, because the maximum number of failed login attempts was exceeded. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [AgentUserStatusCodes](#agentuserstatuscodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### AGENT_USER_NOT_AVAILABLE + +- AGENT_USER_NOT_AVAILABLE: [String](TopLevel.String.md) = "AGENT_USER_NOT_AVAILABLE" + - : Indicates that the agent user is not available. + + +--- + +### AGENT_USER_NOT_LOGGED_IN + +- AGENT_USER_NOT_LOGGED_IN: [String](TopLevel.String.md) = "AGENT_USER_NOT_LOGGED_IN" + - : Indicates that the agent user is not logged in. + + +--- + +### CREDENTIALS_INVALID + +- CREDENTIALS_INVALID: [String](TopLevel.String.md) = "CREDENTIALS_INVALID" + - : Indicates that the given agent user login or password was wrong. + + +--- + +### CUSTOMER_DISABLED + +- CUSTOMER_DISABLED: [String](TopLevel.String.md) = "CUSTOMER_DISABLED" + - : Indicates that the customer is disabled. + + +--- + +### CUSTOMER_UNREGISTERED + +- CUSTOMER_UNREGISTERED: [String](TopLevel.String.md) = "CUSTOMER_UNREGISTERED" + - : Indicates that the customer is either not registered or not registered with the current site. + + +--- + +### INSECURE_CONNECTION + +- INSECURE_CONNECTION: [String](TopLevel.String.md) = "INSECURE_CONNECTION" + - : Indicates that the current connection is not secure (HTTP instead of HTTPS) + and the server is configured to require a secure connection. + + + +--- + +### INSUFFICIENT_PERMISSION + +- INSUFFICIENT_PERMISSION: [String](TopLevel.String.md) = "INSUFFICIENT_PERMISSION" + - : Indicates that the given agent user does not have the permission + 'Login\_Agent' which is required to login to the storefront as an agent + user. + + + +--- + +### LOGIN_SUCCESSFUL + +- LOGIN_SUCCESSFUL: [String](TopLevel.String.md) = "LOGIN_SUCCESSFUL" + - : Indicates that the agent user login was successful. + + +--- + +### NO_STOREFRONT + +- NO_STOREFRONT: [String](TopLevel.String.md) = "NO_STOREFRONT" + - : Indicates that the current context is not a storefront request. + + +--- + +### PASSWORD_EXPIRED + +- PASSWORD_EXPIRED: [String](TopLevel.String.md) = "PASSWORD_EXPIRED" + - : Indicates that the given agent user password has expired and needs to be + changed in the Business Manager. + + + +--- + +### USER_DISABLED + +- USER_DISABLED: [String](TopLevel.String.md) = "USER_DISABLED" + - : Indicates that the agent user account has been disabled in the Business + Manager. + + + +--- + +### USER_LOCKED + +- USER_LOCKED: [String](TopLevel.String.md) = "USER_LOCKED" + - : Indicates that the agent user account is locked, because the maximum + number of failed login attempts was exceeded. + + + +--- + +## Constructor Details + +### AgentUserStatusCodes() +- AgentUserStatusCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.AuthenticationStatus.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AuthenticationStatus.md new file mode 100644 index 00000000..b3e8b90a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.AuthenticationStatus.md @@ -0,0 +1,157 @@ + +# Class AuthenticationStatus + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.AuthenticationStatus](dw.customer.AuthenticationStatus.md) + +Holds the status of an authentication process. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [AUTH_OK](#auth_ok): [String](TopLevel.String.md) = "AUTH_OK" | Authentication was successful | +| [ERROR_CUSTOMER_DISABLED](#error_customer_disabled): [String](TopLevel.String.md) = "ERROR_CUSTOMER_DISABLED" | customer could be found, but is disabled. | +| [ERROR_CUSTOMER_LOCKED](#error_customer_locked): [String](TopLevel.String.md) = "ERROR_CUSTOMER_LOCKED" | customer could be found, but is locked (too many failed login attempts). | +| [ERROR_CUSTOMER_NOT_FOUND](#error_customer_not_found): [String](TopLevel.String.md) = "ERROR_CUSTOMER_NOT_FOUND" | customer could not be found | +| [ERROR_PASSWORD_EXPIRED](#error_password_expired): [String](TopLevel.String.md) = "ERROR_PASSWORD_EXPIRED" | Password does match, but is expired. | +| [ERROR_PASSWORD_MISMATCH](#error_password_mismatch): [String](TopLevel.String.md) = "ERROR_PASSWORD_MISMATCH" | the used password is not correct | +| [ERROR_UNKNOWN](#error_unknown): [String](TopLevel.String.md) = "ERROR_UNKNOWN" | Any other error | + +## Property Summary + +| Property | Description | +| --- | --- | +| [authenticated](#authenticated): [Boolean](TopLevel.Boolean.md) `(read-only)` | checks whether the authentication was successful or not | +| [customer](#customer): [Customer](dw.customer.Customer.md) `(read-only)` | The customer, corresponding to the login used during authentication. | +| [status](#status): [String](TopLevel.String.md) `(read-only)` | the status code (see the constants above) | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCustomer](dw.customer.AuthenticationStatus.md#getcustomer)() | The customer, corresponding to the login used during authentication. | +| [getStatus](dw.customer.AuthenticationStatus.md#getstatus)() | the status code (see the constants above) | +| [isAuthenticated](dw.customer.AuthenticationStatus.md#isauthenticated)() | checks whether the authentication was successful or not | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### AUTH_OK + +- AUTH_OK: [String](TopLevel.String.md) = "AUTH_OK" + - : Authentication was successful + + +--- + +### ERROR_CUSTOMER_DISABLED + +- ERROR_CUSTOMER_DISABLED: [String](TopLevel.String.md) = "ERROR_CUSTOMER_DISABLED" + - : customer could be found, but is disabled. Password was not verified. + + +--- + +### ERROR_CUSTOMER_LOCKED + +- ERROR_CUSTOMER_LOCKED: [String](TopLevel.String.md) = "ERROR_CUSTOMER_LOCKED" + - : customer could be found, but is locked (too many failed login attempts). Password was verified before. + + +--- + +### ERROR_CUSTOMER_NOT_FOUND + +- ERROR_CUSTOMER_NOT_FOUND: [String](TopLevel.String.md) = "ERROR_CUSTOMER_NOT_FOUND" + - : customer could not be found + + +--- + +### ERROR_PASSWORD_EXPIRED + +- ERROR_PASSWORD_EXPIRED: [String](TopLevel.String.md) = "ERROR_PASSWORD_EXPIRED" + - : Password does match, but is expired. + + +--- + +### ERROR_PASSWORD_MISMATCH + +- ERROR_PASSWORD_MISMATCH: [String](TopLevel.String.md) = "ERROR_PASSWORD_MISMATCH" + - : the used password is not correct + + +--- + +### ERROR_UNKNOWN + +- ERROR_UNKNOWN: [String](TopLevel.String.md) = "ERROR_UNKNOWN" + - : Any other error + + +--- + +## Property Details + +### authenticated +- authenticated: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : checks whether the authentication was successful or not + + +--- + +### customer +- customer: [Customer](dw.customer.Customer.md) `(read-only)` + - : The customer, corresponding to the login used during authentication. This customer is not logged in after authentication. + + +--- + +### status +- status: [String](TopLevel.String.md) `(read-only)` + - : the status code (see the constants above) + + +--- + +## Method Details + +### getCustomer() +- getCustomer(): [Customer](dw.customer.Customer.md) + - : The customer, corresponding to the login used during authentication. This customer is not logged in after authentication. + + **Returns:** + - the customer described by the login + + +--- + +### getStatus() +- getStatus(): [String](TopLevel.String.md) + - : the status code (see the constants above) + + **Returns:** + - the status code + + +--- + +### isAuthenticated() +- isAuthenticated(): [Boolean](TopLevel.Boolean.md) + - : checks whether the authentication was successful or not + + **Returns:** + - the when the authentication was successful + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.Credentials.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Credentials.md new file mode 100644 index 00000000..75c80433 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Credentials.md @@ -0,0 +1,524 @@ + +# Class Credentials + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.Credentials](dw.customer.Credentials.md) + +Represents the credentials of a customer. + +Since 13.6 it is possible to have customers who are not authenticated through a +login and password but through an external authentication provider via the OAuth2 protocol. + +In such cases, the AuthenticationProviderID will point to an OAuth provider configured in the system +and the ExternalID will be the unique identifier of the customer on the Authentication Provider's system. + +For example, if an authentication provider with ID "Google123" is configured pointing to Google +and the customer has a logged in into Google in the past and has created a profile there, Google +assigns a unique number identifier to that customer. If the storefront is configured to allow +authentication through Google and a new customer logs into the storefront using Google, +the AuthenticationProviderID property of his Credentials will contain "Google123" and +the ExternalID property will contain whatever unique identifier Google has assigned to him. +In such cases the password-related properties of the Credentials will be empty. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[authenticationProviderID](#authenticationproviderid): [String](TopLevel.String.md)~~ | Returns the authentication provider ID. | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this customer is enabled and can log in. | +| [enabledFlag](#enabledflag): [Boolean](TopLevel.Boolean.md) | Identifies if this customer is enabled and can log in - same as isEnabled(). | +| ~~[externalID](#externalid): [String](TopLevel.String.md)~~ | Returns the external ID of the customer. | +| [locked](#locked): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this customer is temporarily locked out because of invalid login attempts. | +| [login](#login): [String](TopLevel.String.md) | Returns the login of the user. | +| [passwordAnswer](#passwordanswer): [String](TopLevel.String.md) | Returns the answer to the password question for the customer. | +| [passwordQuestion](#passwordquestion): [String](TopLevel.String.md) | Returns the password question for the customer. | +| [passwordSet](#passwordset): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns whether the password is set. | +| [remainingLoginAttempts](#remainingloginattempts): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of consecutive failed logins after which this customer will be temporarily locked out and prevented from logging in to the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createResetPasswordToken](dw.customer.Credentials.md#createresetpasswordtoken)() | Generate a random token which can be used for resetting the password of the underlying Customer. | +| ~~[getAuthenticationProviderID](dw.customer.Credentials.md#getauthenticationproviderid)()~~ | Returns the authentication provider ID. | +| [getEnabledFlag](dw.customer.Credentials.md#getenabledflag)() | Identifies if this customer is enabled and can log in - same as isEnabled(). | +| ~~[getExternalID](dw.customer.Credentials.md#getexternalid)()~~ | Returns the external ID of the customer. | +| [getLogin](dw.customer.Credentials.md#getlogin)() | Returns the login of the user. | +| [getPasswordAnswer](dw.customer.Credentials.md#getpasswordanswer)() | Returns the answer to the password question for the customer. | +| [getPasswordQuestion](dw.customer.Credentials.md#getpasswordquestion)() | Returns the password question for the customer. | +| [getRemainingLoginAttempts](dw.customer.Credentials.md#getremainingloginattempts)() | Returns the number of consecutive failed logins after which this customer will be temporarily locked out and prevented from logging in to the current site. | +| [isEnabled](dw.customer.Credentials.md#isenabled)() | Identifies if this customer is enabled and can log in. | +| [isLocked](dw.customer.Credentials.md#islocked)() | Identifies if this customer is temporarily locked out because of invalid login attempts. | +| [isPasswordSet](dw.customer.Credentials.md#ispasswordset)() | Returns whether the password is set. | +| ~~[setAuthenticationProviderID](dw.customer.Credentials.md#setauthenticationprovideridstring)([String](TopLevel.String.md))~~ | Sets the authentication provider ID corresponding to an OAuth provider configured in the system. | +| [setEnabledFlag](dw.customer.Credentials.md#setenabledflagboolean)([Boolean](TopLevel.Boolean.md)) | Sets the enabled status of the customer. | +| ~~[setExternalID](dw.customer.Credentials.md#setexternalidstring)([String](TopLevel.String.md))~~ | Sets the external ID of the customer at the authentication provider. | +| ~~[setLogin](dw.customer.Credentials.md#setloginstring)([String](TopLevel.String.md))~~ | Sets the login value for the customer. | +| [setLogin](dw.customer.Credentials.md#setloginstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Sets the login value for the customer, and also re-encrypt the customer password based on the new login. | +| [setPassword](dw.customer.Credentials.md#setpasswordstring-string-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Sets the password of an authenticated customer.
    The method can be called for externally authenticated customers as well but these customers will still be externally authenticated so calling the method for such customers does not have an immediate practical benefit. | +| [setPasswordAnswer](dw.customer.Credentials.md#setpasswordanswerstring)([String](TopLevel.String.md)) | Sets the answer to the password question for the customer. | +| [setPasswordQuestion](dw.customer.Credentials.md#setpasswordquestionstring)([String](TopLevel.String.md)) | Sets the password question for the customer. | +| [setPasswordWithToken](dw.customer.Credentials.md#setpasswordwithtokenstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Set the password of the specified customer to the specified value. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### authenticationProviderID +- ~~authenticationProviderID: [String](TopLevel.String.md)~~ + - : Returns the authentication provider ID. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will get the Authentication Provider from +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection + +::: + +--- + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this customer is enabled and can log in. + + +--- + +### enabledFlag +- enabledFlag: [Boolean](TopLevel.Boolean.md) + - : Identifies if this customer is enabled and can log in - same as isEnabled(). + + +--- + +### externalID +- ~~externalID: [String](TopLevel.String.md)~~ + - : Returns the external ID of the customer. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will get the External ID from +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection + +::: + +--- + +### locked +- locked: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this customer is temporarily locked out because of invalid + login attempts. If customer locking is not enabled, this method always + returns false. + + + +--- + +### login +- login: [String](TopLevel.String.md) + - : Returns the login of the user. It must be unique. + + +--- + +### passwordAnswer +- passwordAnswer: [String](TopLevel.String.md) + - : Returns the answer to the password question for the customer. The answer is used + with the password question to confirm the identity of a customer when + they are trying to fetch their password. + + + +--- + +### passwordQuestion +- passwordQuestion: [String](TopLevel.String.md) + - : Returns the password question for the customer. The password question is + used with the password answer to confirm the identity of a customer when + they are trying to fetch their password. + + + +--- + +### passwordSet +- passwordSet: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns whether the password is set. Creating externally authenticated customers + results in customers with credentials for which the password is not set. + + + +--- + +### remainingLoginAttempts +- remainingLoginAttempts: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of consecutive failed logins after which this customer + will be temporarily locked out and prevented from logging in to the + current site. This value is based on the number of previous invalid + logins for this customer and customer site preferences defining the + limits. + + If this customer is already locked out, this method will always return 0. + If customer locking is disabled altogether, or if the system cannot + determine the number of failed login attempts for this customer, then + this method will return a negative number. + + + +--- + +## Method Details + +### createResetPasswordToken() +- createResetPasswordToken(): [String](TopLevel.String.md) + - : Generate a random token which can be used for resetting the password of the underlying Customer. The token is + guaranteed to be unique and will be valid for 30 minutes. Any token previously generated for this customer will + be invalidated. + + + **Returns:** + - The generated token. + + +--- + +### getAuthenticationProviderID() +- ~~getAuthenticationProviderID(): [String](TopLevel.String.md)~~ + - : Returns the authentication provider ID. + + **Returns:** + - the authentication provider ID. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will get the Authentication Provider from +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection + +::: + +--- + +### getEnabledFlag() +- getEnabledFlag(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this customer is enabled and can log in - same as isEnabled(). + + **Returns:** + - true if the customer is enabled and can log in, false otherwise. + + +--- + +### getExternalID() +- ~~getExternalID(): [String](TopLevel.String.md)~~ + - : Returns the external ID of the customer. + + **Returns:** + - the external ID of the customer. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will get the External ID from +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection + +::: + +--- + +### getLogin() +- getLogin(): [String](TopLevel.String.md) + - : Returns the login of the user. It must be unique. + + **Returns:** + - the login of the user. + + +--- + +### getPasswordAnswer() +- getPasswordAnswer(): [String](TopLevel.String.md) + - : Returns the answer to the password question for the customer. The answer is used + with the password question to confirm the identity of a customer when + they are trying to fetch their password. + + + **Returns:** + - the answer to the password question for the customer. + + +--- + +### getPasswordQuestion() +- getPasswordQuestion(): [String](TopLevel.String.md) + - : Returns the password question for the customer. The password question is + used with the password answer to confirm the identity of a customer when + they are trying to fetch their password. + + + **Returns:** + - the password question for the customer. + + +--- + +### getRemainingLoginAttempts() +- getRemainingLoginAttempts(): [Number](TopLevel.Number.md) + - : Returns the number of consecutive failed logins after which this customer + will be temporarily locked out and prevented from logging in to the + current site. This value is based on the number of previous invalid + logins for this customer and customer site preferences defining the + limits. + + If this customer is already locked out, this method will always return 0. + If customer locking is disabled altogether, or if the system cannot + determine the number of failed login attempts for this customer, then + this method will return a negative number. + + + **Returns:** + - The number of consecutive failed logins after which this customer + will be locked out. + + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this customer is enabled and can log in. + + **Returns:** + - true if the customer is enabled and can log in, false otherwise. + + +--- + +### isLocked() +- isLocked(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this customer is temporarily locked out because of invalid + login attempts. If customer locking is not enabled, this method always + returns false. + + + **Returns:** + - true if the customer is locked, false otherwise. + + +--- + +### isPasswordSet() +- isPasswordSet(): [Boolean](TopLevel.Boolean.md) + - : Returns whether the password is set. Creating externally authenticated customers + results in customers with credentials for which the password is not set. + + + **Returns:** + - true if the password is set. + + +--- + +### setAuthenticationProviderID(String) +- ~~setAuthenticationProviderID(authenticationProviderID: [String](TopLevel.String.md)): void~~ + - : Sets the authentication provider ID corresponding to an OAuth provider configured in the system. + + **Parameters:** + - authenticationProviderID - the authentication Provider ID to set. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will set the Authentication Provider on +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection if there is only one. +It will create the collection and add an element if no elements are present. +It will not change anything and will log an error if there are more than one elements in the collection. + +::: + +--- + +### setEnabledFlag(Boolean) +- setEnabledFlag(enabledFlag: [Boolean](TopLevel.Boolean.md)): void + - : Sets the enabled status of the customer. + + **Parameters:** + - enabledFlag - controls if a customer is enabled or not. + + +--- + +### setExternalID(String) +- ~~setExternalID(externalID: [String](TopLevel.String.md)): void~~ + - : Sets the external ID of the customer at the authentication provider. + The value is provided by the authentication provider during the + OAuth authentication and is unique within that provider. + + + **Parameters:** + - externalID - the external ID to set. + + **Deprecated:** +:::warning +As of release 17.2, replaced by methods on the new class [ExternalProfile](dw.customer.ExternalProfile.md) +which can be obtained from [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) + +Until the method is fully removed from the API it will set the ExternalID on +the first element of the [Customer.getExternalProfiles()](dw.customer.Customer.md#getexternalprofiles) collection if there is only one. +It will create the collection and add an element if no elements are present. +It will not change anything and will log an error if there are more than one elements in the collection. + +::: + +--- + +### setLogin(String) +- ~~setLogin(login: [String](TopLevel.String.md)): void~~ + - : Sets the login value for the customer. + + IMPORTANT: This method should no longer be used for the following + reasons: + + + - It changes the login without re-encrypting the password. (The customer password is stored internally using a one-way encryption scheme which uses the login as one of its inputs. Therefore changing the login requires re-encrypting the password.) + - It does not validate the structure of the login to ensure that it only uses acceptable characters. + - It does not correctly prevent duplicate logins. If the passed login matches a different customer's login exactly, then this method will throw an exception. However, it does not prevent the creation of inexact matches, where two customers have a login differing only by alphabetic case (e.g. "JaneDoe" and "janedoe") + + + **Parameters:** + - login - The login value for the customer. + + **Deprecated:** +:::warning +Use [setLogin(String, String)](dw.customer.Credentials.md#setloginstring-string) +::: + +--- + +### setLogin(String, String) +- setLogin(newLogin: [String](TopLevel.String.md), currentPassword: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Sets the login value for the customer, and also re-encrypt the customer + password based on the new login. Customer login must be a sequence of + letters, numbers, and the following characters: space, period, ampersand, + underscore and dash. + + This method fails to set the login and returns false in the following + cases: + + + - newLogin is of an invalid form (e.g. contains invalid characters). + - currentPassword is not the customer's correct password. + - newLogin is already in use by another customer (i.e. there is another customer in the system with the exact same login name or a name differing only by alphabetic case.) + + + If newLogin is the same as the existing login, the method does nothing and + returns true, regardless of whether currentPassword is the correct + password. + + + **Parameters:** + - newLogin - The login value for the customer. + - currentPassword - The customer's current password in plain-text. + + **Returns:** + - true if setting the login succeeded, false otherwise. + + +--- + +### setPassword(String, String, Boolean) +- setPassword(newPassword: [String](TopLevel.String.md), oldPassword: [String](TopLevel.String.md), verifyOldPassword: [Boolean](TopLevel.Boolean.md)): [Status](dw.system.Status.md) + - : Sets the password of an authenticated customer. + + + The method can be called for externally authenticated customers as well but + these customers will still be externally authenticated so calling the method + for such customers does not have an immediate practical benefit. If such customers + are converted back to regularly authenticated (via login and password) the new password + will be used. + + + + Method call will fail under any of these conditions: + + - customer is not registered + - customer is not authenticated + - verifyOldPassword=true &&oldPassword is empty + - verifyOldPassword=true and oldPassword does not match the existing password + - newPassword is empty + - newPassword does not meet acceptance criteria + + + **Parameters:** + - newPassword - the new password + - oldPassword - the old password (optional, only needed if 'verifyOldPassword' is set to 'true' + - verifyOldPassword - whether the oldPassword should be verified + + **Returns:** + - Status the status of the operation (OK or ERROR). If status is Error, there will be additional information in the Status message + + +--- + +### setPasswordAnswer(String) +- setPasswordAnswer(answer: [String](TopLevel.String.md)): void + - : Sets the answer to the password question for the customer. + + **Parameters:** + - answer - the answer to the password question. + + +--- + +### setPasswordQuestion(String) +- setPasswordQuestion(question: [String](TopLevel.String.md)): void + - : Sets the password question for the customer. + + **Parameters:** + - question - the password question. + + +--- + +### setPasswordWithToken(String, String) +- setPasswordWithToken(token: [String](TopLevel.String.md), newPassword: [String](TopLevel.String.md)): [Status](dw.system.Status.md) + - : Set the password of the specified customer to the specified value. This operation will fail if the specified + token is invalid (i.e. not associated with the specified Customer), the token is expired, or the password does + not satisfy system password requirements. + + + **Parameters:** + - token - The token required for performing the password reset. + - newPassword - The new password. Must meet all requirements for passwords + + **Returns:** + - Status the status of the operation (OK or ERROR). If status is Error, there will be additional + information in the Status message + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.Customer.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Customer.md new file mode 100644 index 00000000..3c54aead --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Customer.md @@ -0,0 +1,488 @@ + +# Class Customer + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.Customer](dw.customer.Customer.md) + +Represents a customer. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [CDPData](#cdpdata): [CustomerCDPData](dw.customer.CustomerCDPData.md) `(read-only)` | Returns the Salesforce CDP (Customer Data Platform) data for this customer. | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique, system generated ID of the customer. | +| [activeData](#activedata): [CustomerActiveData](dw.customer.CustomerActiveData.md) `(read-only)` | Returns the active data for this customer. | +| [addressBook](#addressbook): [AddressBook](dw.customer.AddressBook.md) `(read-only)` | Returns the address book for the profile of this customer, or `null` if this customer has no profile, such as for an anonymous customer. | +| [anonymous](#anonymous): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the customer is anonymous. | +| [authenticated](#authenticated): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the customer is authenticated. | +| [customerGroups](#customergroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the customer groups this customer is member of. | +| [externalProfiles](#externalprofiles): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of any external profiles the customer may have | +| [externallyAuthenticated](#externallyauthenticated): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the customer is externally authenticated. | +| [globalPartyID](#globalpartyid): [String](TopLevel.String.md) `(read-only)` | Returns the Global Party ID for the customer, if there is one. | +| [note](#note): [String](TopLevel.String.md) | Returns the note for this customer, or `null` if this customer has no note, such as for an anonymous customer or when note has 0 length. | +| [orderHistory](#orderhistory): [OrderHistory](dw.customer.OrderHistory.md) `(read-only)` | Returns the customer order history. | +| [profile](#profile): [Profile](dw.customer.Profile.md) `(read-only)` | Returns the customer profile. | +| [registered](#registered): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the customer is registered. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createExternalProfile](dw.customer.Customer.md#createexternalprofilestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Creates an externalProfile and attaches it to the list of external profiles for the customer | +| [getActiveData](dw.customer.Customer.md#getactivedata)() | Returns the active data for this customer. | +| [getAddressBook](dw.customer.Customer.md#getaddressbook)() | Returns the address book for the profile of this customer, or `null` if this customer has no profile, such as for an anonymous customer. | +| [getCDPData](dw.customer.Customer.md#getcdpdata)() | Returns the Salesforce CDP (Customer Data Platform) data for this customer. | +| [getCustomerGroups](dw.customer.Customer.md#getcustomergroups)() | Returns the customer groups this customer is member of. | +| [getExternalProfile](dw.customer.Customer.md#getexternalprofilestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | A convenience method for finding an external profile among the customer's external profiles collection | +| [getExternalProfiles](dw.customer.Customer.md#getexternalprofiles)() | Returns a collection of any external profiles the customer may have | +| [getGlobalPartyID](dw.customer.Customer.md#getglobalpartyid)() | Returns the Global Party ID for the customer, if there is one. | +| [getID](dw.customer.Customer.md#getid)() | Returns the unique, system generated ID of the customer. | +| [getNote](dw.customer.Customer.md#getnote)() | Returns the note for this customer, or `null` if this customer has no note, such as for an anonymous customer or when note has 0 length. | +| [getOrderHistory](dw.customer.Customer.md#getorderhistory)() | Returns the customer order history. | +| [getProductLists](dw.customer.Customer.md#getproductlistsnumber)([Number](TopLevel.Number.md)) | Returns the product lists of the specified type. | +| [getProfile](dw.customer.Customer.md#getprofile)() | Returns the customer profile. | +| [isAnonymous](dw.customer.Customer.md#isanonymous)() | Identifies if the customer is anonymous. | +| [isAuthenticated](dw.customer.Customer.md#isauthenticated)() | Identifies if the customer is authenticated. | +| [isExternallyAuthenticated](dw.customer.Customer.md#isexternallyauthenticated)() | Identifies if the customer is externally authenticated. | +| [isMemberOfAnyCustomerGroup](dw.customer.Customer.md#ismemberofanycustomergroupstring)([String...](TopLevel.String.md)) | Returns true if there exist [CustomerGroup](dw.customer.CustomerGroup.md) for all of the given IDs and the customer is member of at least one of that groups. | +| [isMemberOfCustomerGroup](dw.customer.Customer.md#ismemberofcustomergroupcustomergroup)([CustomerGroup](dw.customer.CustomerGroup.md)) | Returns true if the customer is member of the specified [CustomerGroup](dw.customer.CustomerGroup.md). | +| [isMemberOfCustomerGroup](dw.customer.Customer.md#ismemberofcustomergroupstring)([String](TopLevel.String.md)) | Returns true if there is a [CustomerGroup](dw.customer.CustomerGroup.md) with such an ID and the customer is member of that group. | +| [isMemberOfCustomerGroups](dw.customer.Customer.md#ismemberofcustomergroupsstring)([String...](TopLevel.String.md)) | Returns true if there exist [CustomerGroup](dw.customer.CustomerGroup.md) for all of the given IDs and the customer is member of all that groups. | +| [isRegistered](dw.customer.Customer.md#isregistered)() | Identifies if the customer is registered. | +| [removeExternalProfile](dw.customer.Customer.md#removeexternalprofileexternalprofile)([ExternalProfile](dw.customer.ExternalProfile.md)) | Removes an external profile from the customer | +| [setNote](dw.customer.Customer.md#setnotestring)([String](TopLevel.String.md)) | Sets the note for this customer. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### CDPData +- CDPData: [CustomerCDPData](dw.customer.CustomerCDPData.md) `(read-only)` + - : Returns the Salesforce CDP (Customer Data Platform) data for this customer. + + +--- + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique, system generated ID of the customer. + + +--- + +### activeData +- activeData: [CustomerActiveData](dw.customer.CustomerActiveData.md) `(read-only)` + - : Returns the active data for this customer. + + +--- + +### addressBook +- addressBook: [AddressBook](dw.customer.AddressBook.md) `(read-only)` + - : Returns the address book for the profile of this customer, + or `null` if this customer has no profile, such as for an + anonymous customer. + + + +--- + +### anonymous +- anonymous: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the customer is anonymous. An anonymous + customer is the opposite of a registered customer. + + + +--- + +### authenticated +- authenticated: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the customer is authenticated. This method checks whether + this customer is the customer associated with the session and than checks + whether the session in an authenticated state. + + Note: The pipeline debugger will always show 'false' for this value + regardless of whether the customer is authenticated or not. + + + +--- + +### customerGroups +- customerGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the customer groups this customer is member of. + + - Result contains static customer groups in storefront and job session + - Result contains dynamic customer groups in storefront and job session. Dynamic customer groups referring session or request data are not available when processing the customer in a job session, or when this customer is not the customer assigned to the current session. + - Result contains system groups 'Everyone', 'Unregistered', 'Registered' for all customers in storefront and job sessions + + + +--- + +### externalProfiles +- externalProfiles: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of any external profiles the customer may have + + +--- + +### externallyAuthenticated +- externallyAuthenticated: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the customer is externally authenticated. An externally + authenticated customer does not have the password stored in our system + but logs in through an external OAuth provider (Google, Facebook, LinkedIn, etc.) + + + +--- + +### globalPartyID +- globalPartyID: [String](TopLevel.String.md) `(read-only)` + - : Returns the Global Party ID for the customer, if there is one. + Global Party ID is created by Customer 360 and identifies a person across multiple systems. + + + +--- + +### note +- note: [String](TopLevel.String.md) + - : Returns the note for this customer, or `null` if this customer has no note, such as for an anonymous + customer or when note has 0 length. + + + +--- + +### orderHistory +- orderHistory: [OrderHistory](dw.customer.OrderHistory.md) `(read-only)` + - : Returns the customer order history. + + +--- + +### profile +- profile: [Profile](dw.customer.Profile.md) `(read-only)` + - : Returns the customer profile. + + +--- + +### registered +- registered: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the customer is registered. A registered customer + may or may not be authenticated. This method checks whether + the user has a profile. + + + +--- + +## Method Details + +### createExternalProfile(String, String) +- createExternalProfile(authenticationProviderId: [String](TopLevel.String.md), externalId: [String](TopLevel.String.md)): [ExternalProfile](dw.customer.ExternalProfile.md) + - : Creates an externalProfile and attaches it to the list of external profiles for the customer + + **Parameters:** + - authenticationProviderId - the authenticationProviderId for the externalProfile + - externalId - the externalId for the external Profile + + **Returns:** + - the new externalProfile + + +--- + +### getActiveData() +- getActiveData(): [CustomerActiveData](dw.customer.CustomerActiveData.md) + - : Returns the active data for this customer. + + **Returns:** + - the active data for this customer. + + +--- + +### getAddressBook() +- getAddressBook(): [AddressBook](dw.customer.AddressBook.md) + - : Returns the address book for the profile of this customer, + or `null` if this customer has no profile, such as for an + anonymous customer. + + + +--- + +### getCDPData() +- getCDPData(): [CustomerCDPData](dw.customer.CustomerCDPData.md) + - : Returns the Salesforce CDP (Customer Data Platform) data for this customer. + + **Returns:** + - the Salesforce CDP data for this customer. + + +--- + +### getCustomerGroups() +- getCustomerGroups(): [Collection](dw.util.Collection.md) + - : Returns the customer groups this customer is member of. + + - Result contains static customer groups in storefront and job session + - Result contains dynamic customer groups in storefront and job session. Dynamic customer groups referring session or request data are not available when processing the customer in a job session, or when this customer is not the customer assigned to the current session. + - Result contains system groups 'Everyone', 'Unregistered', 'Registered' for all customers in storefront and job sessions + + + **Returns:** + - Collection of customer groups of this customer + + +--- + +### getExternalProfile(String, String) +- getExternalProfile(authenticationProviderId: [String](TopLevel.String.md), externalId: [String](TopLevel.String.md)): [ExternalProfile](dw.customer.ExternalProfile.md) + - : A convenience method for finding an external profile among the customer's external profiles collection + + **Parameters:** + - authenticationProviderId - the authenticationProviderId to look for + - externalId - the externalId to look for + + **Returns:** + - the externalProfile found among the customer's external profile or null if not found + + +--- + +### getExternalProfiles() +- getExternalProfiles(): [Collection](dw.util.Collection.md) + - : Returns a collection of any external profiles the customer may have + + **Returns:** + - a collection of any external profiles the customer may have + + +--- + +### getGlobalPartyID() +- getGlobalPartyID(): [String](TopLevel.String.md) + - : Returns the Global Party ID for the customer, if there is one. + Global Party ID is created by Customer 360 and identifies a person across multiple systems. + + + **Returns:** + - The global party ID + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique, system generated ID of the customer. + + **Returns:** + - the ID of the customer. + + +--- + +### getNote() +- getNote(): [String](TopLevel.String.md) + - : Returns the note for this customer, or `null` if this customer has no note, such as for an anonymous + customer or when note has 0 length. + + + **Returns:** + - the note for this customer. + + +--- + +### getOrderHistory() +- getOrderHistory(): [OrderHistory](dw.customer.OrderHistory.md) + - : Returns the customer order history. + + **Returns:** + - the customer order history. + + +--- + +### getProductLists(Number) +- getProductLists(type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Returns the product lists of the specified type. + + **Parameters:** + - type - the type of product lists to return. + + **Returns:** + - the product lists of the specified type. + + **See Also:** + - [ProductList](dw.customer.ProductList.md) + + +--- + +### getProfile() +- getProfile(): [Profile](dw.customer.Profile.md) + - : Returns the customer profile. + + **Returns:** + - the customer profile. + + +--- + +### isAnonymous() +- isAnonymous(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the customer is anonymous. An anonymous + customer is the opposite of a registered customer. + + + **Returns:** + - true if the customer is anonymous, false otherwise. + + + **Note:** this method handles sensitive security-related data. + Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +--- + +### isAuthenticated() +- isAuthenticated(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the customer is authenticated. This method checks whether + this customer is the customer associated with the session and than checks + whether the session in an authenticated state. + + Note: The pipeline debugger will always show 'false' for this value + regardless of whether the customer is authenticated or not. + + + **Returns:** + - true if the customer is authenticated, false otherwise. + + +--- + +### isExternallyAuthenticated() +- isExternallyAuthenticated(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the customer is externally authenticated. An externally + authenticated customer does not have the password stored in our system + but logs in through an external OAuth provider (Google, Facebook, LinkedIn, etc.) + + + **Returns:** + - true if the customer is externally authenticated, false otherwise. + + + **Note:** this method handles sensitive security-related data. + Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +--- + +### isMemberOfAnyCustomerGroup(String...) +- isMemberOfAnyCustomerGroup(groupIDs: [String...](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if there exist [CustomerGroup](dw.customer.CustomerGroup.md) for all of the given IDs and the customer is member of at least one of that groups. + + **Parameters:** + - groupIDs - A list of unique semantic customer group IDs. + + **Returns:** + - True if customer groups exist for the given IDs and the customer is member of at least one of that existing groups. + False if none of customer groups exist or if the customer is not a member of any of that existing groups. + + + +--- + +### isMemberOfCustomerGroup(CustomerGroup) +- isMemberOfCustomerGroup(group: [CustomerGroup](dw.customer.CustomerGroup.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the customer is member of the specified + [CustomerGroup](dw.customer.CustomerGroup.md). + + + **Parameters:** + - group - Customer group + + **Returns:** + - True if customer is member of the group, otherwise false. + + +--- + +### isMemberOfCustomerGroup(String) +- isMemberOfCustomerGroup(groupID: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if there is a [CustomerGroup](dw.customer.CustomerGroup.md) with such an ID and the customer is member of that group. + + **Parameters:** + - groupID - The unique semantic customer group ID. + + **Returns:** + - True if a customer group with such an ID exist and the customer is member of that group. + False if no such customer group exist or, if the group exist, the customer is not member of that group. + + + +--- + +### isMemberOfCustomerGroups(String...) +- isMemberOfCustomerGroups(groupIDs: [String...](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if there exist [CustomerGroup](dw.customer.CustomerGroup.md) for all of the given IDs and the customer is member of all that groups. + + **Parameters:** + - groupIDs - A list of unique semantic customer group IDs. + + **Returns:** + - True if customer groups exist for all of the given IDs and the customer is member of all that groups. + False if there is at least one ID for which no customer group exist or, if all groups exist, the customer is not member of all that groups. + + + +--- + +### isRegistered() +- isRegistered(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the customer is registered. A registered customer + may or may not be authenticated. This method checks whether + the user has a profile. + + + **Returns:** + - true if the customer is registered, false otherwise. + + +--- + +### removeExternalProfile(ExternalProfile) +- removeExternalProfile(externalProfile: [ExternalProfile](dw.customer.ExternalProfile.md)): void + - : Removes an external profile from the customer + + **Parameters:** + - externalProfile - the externalProfile to be removed + + +--- + +### setNote(String) +- setNote(aValue: [String](TopLevel.String.md)): void + - : Sets the note for this customer. This is a no-op for an anonymous customer. + + **Parameters:** + - aValue - the value of the note + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerActiveData.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerActiveData.md new file mode 100644 index 00000000..1026d3ee --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerActiveData.md @@ -0,0 +1,563 @@ + +# Class CustomerActiveData + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.object.ActiveData](dw.object.ActiveData.md) + - [dw.customer.CustomerActiveData](dw.customer.CustomerActiveData.md) + +Represents the active data for a [Customer](dw.customer.Customer.md) in Commerce Cloud Digital. + + +**Note:** this class allows access to sensitive personal and private information. +Pay attention to appropriate legal and regulatory requirements when developing. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [avgOrderValue](#avgordervalue): [Number](TopLevel.Number.md) `(read-only)` | Returns the average order value of the customer, or `null` if none has been set or the value is no longer valid. | +| [discountValueWithCoupon](#discountvaluewithcoupon): [Number](TopLevel.Number.md) `(read-only)` | Returns the discount value resulting from coupons, that has been applied to orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [discountValueWithoutCoupon](#discountvaluewithoutcoupon): [Number](TopLevel.Number.md) `(read-only)` | Returns the discount value resulting from promotions other than coupons, that has been applied to orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [giftOrders](#giftorders): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders for the Customer that contained at least one product unit marked as a gift, or `null` if none has been set or the value is no longer valid. | +| [giftUnits](#giftunits): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of product units in orders for the customer that were marked as a gift, or `null` if none has been set or the value is no longer valid. | +| [lastOrderDate](#lastorderdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the date of the last order for the customer, or `null` if there are no orders for the customer. | +| [orderValue](#ordervalue): [Number](TopLevel.Number.md) `(read-only)` | Returns the lifetime order value of the customer, or `null` if none has been set or the value is no longer valid. | +| [orderValueMonth](#ordervaluemonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the order value of the customer, over the most recent 30 days, or `null` if none has been set or the value is no longer valid. | +| [orders](#orders): [Number](TopLevel.Number.md) `(read-only)` | Returns the orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [productMastersOrdered](#productmastersordered): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the master product SKUs of variation products in orders for the customer, or an empty collection if no SKUs have been set or the collection of SKUs is no longer valid. | +| [productsAbandonedMonth](#productsabandonedmonth): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the SKUs of products in baskets abandoned by the customer in the last 30 days, or an empty collection if no SKUs have been set or the collection is no longer valid. | +| [productsOrdered](#productsordered): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the SKUs of products in orders for the customer, or an empty collection if no SKUs have been set or the collection of SKUs is no longer valid. | +| [productsViewedMonth](#productsviewedmonth): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the SKUs of products viewed by the customer in the last 30 days, or an empty collection if no SKUs have been set or the collection is no longer valid. | +| [returnValue](#returnvalue): [Number](TopLevel.Number.md) `(read-only)` | Returns the returned revenue of the customer, or `null` if none has been set or the value is no longer valid. | +| [returns](#returns): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of returns of the customer, or `null` if none has been set or the value is no longer valid. | +| [sourceCodeOrders](#sourcecodeorders): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders for the customer where a source code was in effect, or `null` if none has been set or the value is no longer valid. | +| [topCategoriesOrdered](#topcategoriesordered): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the IDs of up to the top 20 categories for customer orders, or an empty list if no categories have been set or the list of categories is no longer valid. | +| [visitsMonth](#visitsmonth): [Number](TopLevel.Number.md) `(read-only)` | Returns the visits of the customer, over the most recent 30 days, or `null` if none has been set or the value is no longer valid. | +| [visitsWeek](#visitsweek): [Number](TopLevel.Number.md) `(read-only)` | Returns the visits of the customer, over the most recent 7 days, or `null` if none has been set or the value is no longer valid. | +| [visitsYear](#visitsyear): [Number](TopLevel.Number.md) `(read-only)` | Returns the visits of the customer, over the most recent 365 days, or `null` if none has been set or the value is no longer valid. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAvgOrderValue](dw.customer.CustomerActiveData.md#getavgordervalue)() | Returns the average order value of the customer, or `null` if none has been set or the value is no longer valid. | +| [getDiscountValueWithCoupon](dw.customer.CustomerActiveData.md#getdiscountvaluewithcoupon)() | Returns the discount value resulting from coupons, that has been applied to orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [getDiscountValueWithoutCoupon](dw.customer.CustomerActiveData.md#getdiscountvaluewithoutcoupon)() | Returns the discount value resulting from promotions other than coupons, that has been applied to orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [getGiftOrders](dw.customer.CustomerActiveData.md#getgiftorders)() | Returns the number of orders for the Customer that contained at least one product unit marked as a gift, or `null` if none has been set or the value is no longer valid. | +| [getGiftUnits](dw.customer.CustomerActiveData.md#getgiftunits)() | Returns the number of product units in orders for the customer that were marked as a gift, or `null` if none has been set or the value is no longer valid. | +| [getLastOrderDate](dw.customer.CustomerActiveData.md#getlastorderdate)() | Returns the date of the last order for the customer, or `null` if there are no orders for the customer. | +| [getOrderValue](dw.customer.CustomerActiveData.md#getordervalue)() | Returns the lifetime order value of the customer, or `null` if none has been set or the value is no longer valid. | +| [getOrderValueMonth](dw.customer.CustomerActiveData.md#getordervaluemonth)() | Returns the order value of the customer, over the most recent 30 days, or `null` if none has been set or the value is no longer valid. | +| [getOrders](dw.customer.CustomerActiveData.md#getorders)() | Returns the orders of the customer, or `null` if none has been set or the value is no longer valid. | +| [getProductMastersOrdered](dw.customer.CustomerActiveData.md#getproductmastersordered)() | Returns an array containing the master product SKUs of variation products in orders for the customer, or an empty collection if no SKUs have been set or the collection of SKUs is no longer valid. | +| [getProductsAbandonedMonth](dw.customer.CustomerActiveData.md#getproductsabandonedmonth)() | Returns an array containing the SKUs of products in baskets abandoned by the customer in the last 30 days, or an empty collection if no SKUs have been set or the collection is no longer valid. | +| [getProductsOrdered](dw.customer.CustomerActiveData.md#getproductsordered)() | Returns an array containing the SKUs of products in orders for the customer, or an empty collection if no SKUs have been set or the collection of SKUs is no longer valid. | +| [getProductsViewedMonth](dw.customer.CustomerActiveData.md#getproductsviewedmonth)() | Returns an array containing the SKUs of products viewed by the customer in the last 30 days, or an empty collection if no SKUs have been set or the collection is no longer valid. | +| [getReturnValue](dw.customer.CustomerActiveData.md#getreturnvalue)() | Returns the returned revenue of the customer, or `null` if none has been set or the value is no longer valid. | +| [getReturns](dw.customer.CustomerActiveData.md#getreturns)() | Returns the number of returns of the customer, or `null` if none has been set or the value is no longer valid. | +| [getSourceCodeOrders](dw.customer.CustomerActiveData.md#getsourcecodeorders)() | Returns the number of orders for the customer where a source code was in effect, or `null` if none has been set or the value is no longer valid. | +| [getTopCategoriesOrdered](dw.customer.CustomerActiveData.md#gettopcategoriesordered)() | Returns an array containing the IDs of up to the top 20 categories for customer orders, or an empty list if no categories have been set or the list of categories is no longer valid. | +| [getVisitsMonth](dw.customer.CustomerActiveData.md#getvisitsmonth)() | Returns the visits of the customer, over the most recent 30 days, or `null` if none has been set or the value is no longer valid. | +| [getVisitsWeek](dw.customer.CustomerActiveData.md#getvisitsweek)() | Returns the visits of the customer, over the most recent 7 days, or `null` if none has been set or the value is no longer valid. | +| [getVisitsYear](dw.customer.CustomerActiveData.md#getvisitsyear)() | Returns the visits of the customer, over the most recent 365 days, or `null` if none has been set or the value is no longer valid. | + +### Methods inherited from class ActiveData + +[getCustom](dw.object.ActiveData.md#getcustom), [isEmpty](dw.object.ActiveData.md#isempty) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### avgOrderValue +- avgOrderValue: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the average order value of the customer, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### discountValueWithCoupon +- discountValueWithCoupon: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the discount value resulting from coupons, that has been applied + to orders of the customer, or `null` if none has been set or + the value is no longer valid. + + + +--- + +### discountValueWithoutCoupon +- discountValueWithoutCoupon: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the discount value resulting from promotions other than coupons, + that has been applied to orders of the customer, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### giftOrders +- giftOrders: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders for the Customer that contained at least + one product unit marked as a gift, or `null` if none has been + set or the value is no longer valid. + + + +--- + +### giftUnits +- giftUnits: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of product units in orders for the customer + that were marked as a gift, or `null` if none has been set + or the value is no longer valid. + + + +--- + +### lastOrderDate +- lastOrderDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date of the last order for the customer, or `null` + if there are no orders for the customer. + + + +--- + +### orderValue +- orderValue: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the lifetime order value of the customer, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### orderValueMonth +- orderValueMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the order value of the customer, over the most recent 30 days, + or `null` if none has been set or the value is no longer valid. + + + +--- + +### orders +- orders: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the orders of the customer, or `null` if none + has been set or the value is no longer valid. + + + +--- + +### productMastersOrdered +- productMastersOrdered: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the master product SKUs of variation products + in orders for the customer, or an empty collection if no SKUs have been + set or the collection of SKUs is no longer valid. There is no specific + limit on the number of SKUs that will be returned in the collection, but + there is also no guarantee that it will contain the SKUs for all products + ordered by the customer. + + + +--- + +### productsAbandonedMonth +- productsAbandonedMonth: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the SKUs of products in baskets abandoned + by the customer in the last 30 days, or an empty collection if no SKUs + have been set or the collection is no longer valid. There is no specific + limit on the number of SKUs that will be returned in the collection, but + there is also no guarantee that it will contain the SKUs for all products + in baskets abandoned by the customer. + + + +--- + +### productsOrdered +- productsOrdered: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the SKUs of products in orders + for the customer, or an empty collection if no SKUs have been set or the + collection of SKUs is no longer valid. There is no specific limit on the + number of SKUs that will be returned in the collection, but there is also + no guarantee that it will contain the SKUs for all products ordered by + the customer. + + + +--- + +### productsViewedMonth +- productsViewedMonth: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the SKUs of products viewed by the + customer in the last 30 days, or an empty collection if no SKUs have been + set or the collection is no longer valid. There is no specific limit on + the number of SKUs that will be returned in the collection, but there is + also no guarantee that it will contain the SKUs for all products viewed + by the customer. + + + +--- + +### returnValue +- returnValue: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the returned revenue of the customer, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### returns +- returns: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of returns of the customer, or `null` + if none has been set or the value is no longer valid. + + + +--- + +### sourceCodeOrders +- sourceCodeOrders: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders for the customer where a source code was + in effect, or `null` if none has been set or the value + is no longer valid. + + + +--- + +### topCategoriesOrdered +- topCategoriesOrdered: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the IDs of up to the top 20 categories for + customer orders, or an empty list if no categories have been set or the + list of categories is no longer valid. The top category is the one for + which the most orders for the customer contained at least one product + found in that category. + + + +--- + +### visitsMonth +- visitsMonth: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the visits of the customer, over the most recent 30 days, + or `null` if none has been set or the value + is no longer valid. + + + +--- + +### visitsWeek +- visitsWeek: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the visits of the customer, over the most recent 7 days, + or `null` if none has been set or the value + is no longer valid. + + + +--- + +### visitsYear +- visitsYear: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the visits of the customer, over the most recent 365 days, + or `null` if none has been set or the value + is no longer valid. + + + +--- + +## Method Details + +### getAvgOrderValue() +- getAvgOrderValue(): [Number](TopLevel.Number.md) + - : Returns the average order value of the customer, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the average order size. + + +--- + +### getDiscountValueWithCoupon() +- getDiscountValueWithCoupon(): [Number](TopLevel.Number.md) + - : Returns the discount value resulting from coupons, that has been applied + to orders of the customer, or `null` if none has been set or + the value is no longer valid. + + + **Returns:** + - the discount value resulting from coupons. + + +--- + +### getDiscountValueWithoutCoupon() +- getDiscountValueWithoutCoupon(): [Number](TopLevel.Number.md) + - : Returns the discount value resulting from promotions other than coupons, + that has been applied to orders of the customer, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the discount value resulting from promotions other than coupons. + + +--- + +### getGiftOrders() +- getGiftOrders(): [Number](TopLevel.Number.md) + - : Returns the number of orders for the Customer that contained at least + one product unit marked as a gift, or `null` if none has been + set or the value is no longer valid. + + + **Returns:** + - the number of gift orders. + + +--- + +### getGiftUnits() +- getGiftUnits(): [Number](TopLevel.Number.md) + - : Returns the number of product units in orders for the customer + that were marked as a gift, or `null` if none has been set + or the value is no longer valid. + + + **Returns:** + - the number of gift product units. + + +--- + +### getLastOrderDate() +- getLastOrderDate(): [Date](TopLevel.Date.md) + - : Returns the date of the last order for the customer, or `null` + if there are no orders for the customer. + + + **Returns:** + - the date of the last order for the customer. + + +--- + +### getOrderValue() +- getOrderValue(): [Number](TopLevel.Number.md) + - : Returns the lifetime order value of the customer, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the lifetime value. + + +--- + +### getOrderValueMonth() +- getOrderValueMonth(): [Number](TopLevel.Number.md) + - : Returns the order value of the customer, over the most recent 30 days, + or `null` if none has been set or the value is no longer valid. + + + **Returns:** + - the value over the last 30 days. + + +--- + +### getOrders() +- getOrders(): [Number](TopLevel.Number.md) + - : Returns the orders of the customer, or `null` if none + has been set or the value is no longer valid. + + + **Returns:** + - the orders. + + +--- + +### getProductMastersOrdered() +- getProductMastersOrdered(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the master product SKUs of variation products + in orders for the customer, or an empty collection if no SKUs have been + set or the collection of SKUs is no longer valid. There is no specific + limit on the number of SKUs that will be returned in the collection, but + there is also no guarantee that it will contain the SKUs for all products + ordered by the customer. + + + **Returns:** + - a collection containing the master product SKUs of variation + products that were ordered. + + + +--- + +### getProductsAbandonedMonth() +- getProductsAbandonedMonth(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the SKUs of products in baskets abandoned + by the customer in the last 30 days, or an empty collection if no SKUs + have been set or the collection is no longer valid. There is no specific + limit on the number of SKUs that will be returned in the collection, but + there is also no guarantee that it will contain the SKUs for all products + in baskets abandoned by the customer. + + + **Returns:** + - a collection containing the SKUs of products that were abandoned. + + +--- + +### getProductsOrdered() +- getProductsOrdered(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the SKUs of products in orders + for the customer, or an empty collection if no SKUs have been set or the + collection of SKUs is no longer valid. There is no specific limit on the + number of SKUs that will be returned in the collection, but there is also + no guarantee that it will contain the SKUs for all products ordered by + the customer. + + + **Returns:** + - a collection containing the SKUs of products that were ordered. + + +--- + +### getProductsViewedMonth() +- getProductsViewedMonth(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the SKUs of products viewed by the + customer in the last 30 days, or an empty collection if no SKUs have been + set or the collection is no longer valid. There is no specific limit on + the number of SKUs that will be returned in the collection, but there is + also no guarantee that it will contain the SKUs for all products viewed + by the customer. + + + **Returns:** + - a collection containing the SKUs of products that were ordered. + + +--- + +### getReturnValue() +- getReturnValue(): [Number](TopLevel.Number.md) + - : Returns the returned revenue of the customer, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the returned revenue. + + +--- + +### getReturns() +- getReturns(): [Number](TopLevel.Number.md) + - : Returns the number of returns of the customer, or `null` + if none has been set or the value is no longer valid. + + + **Returns:** + - the returns. + + +--- + +### getSourceCodeOrders() +- getSourceCodeOrders(): [Number](TopLevel.Number.md) + - : Returns the number of orders for the customer where a source code was + in effect, or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the number of orders with source codes in effect. + + +--- + +### getTopCategoriesOrdered() +- getTopCategoriesOrdered(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the IDs of up to the top 20 categories for + customer orders, or an empty list if no categories have been set or the + list of categories is no longer valid. The top category is the one for + which the most orders for the customer contained at least one product + found in that category. + + + **Returns:** + - a list containing the top 20 categories. + + +--- + +### getVisitsMonth() +- getVisitsMonth(): [Number](TopLevel.Number.md) + - : Returns the visits of the customer, over the most recent 30 days, + or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the visits over the last 30 days. + + +--- + +### getVisitsWeek() +- getVisitsWeek(): [Number](TopLevel.Number.md) + - : Returns the visits of the customer, over the most recent 7 days, + or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the visits over the last 7 days. + + +--- + +### getVisitsYear() +- getVisitsYear(): [Number](TopLevel.Number.md) + - : Returns the visits of the customer, over the most recent 365 days, + or `null` if none has been set or the value + is no longer valid. + + + **Returns:** + - the visits over the last 365 days. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerAddress.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerAddress.md new file mode 100644 index 00000000..58d841ef --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerAddress.md @@ -0,0 +1,666 @@ + +# Class CustomerAddress + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.CustomerAddress](dw.customer.CustomerAddress.md) + +The Address class represents a customer's address. + + +**Note:** this class allows access to sensitive personal and private information. +Pay attention to appropriate legal and regulatory requirements. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) | Returns the name of the address. | +| [address1](#address1): [String](TopLevel.String.md) | Returns the customer's first address. | +| [address2](#address2): [String](TopLevel.String.md) | Returns the customer's second address value. | +| [city](#city): [String](TopLevel.String.md) | Returns the customer's city. | +| [companyName](#companyname): [String](TopLevel.String.md) | Returns the customer's company name. | +| [countryCode](#countrycode): [EnumValue](dw.value.EnumValue.md) | Returns the customer's country code. | +| [firstName](#firstname): [String](TopLevel.String.md) | Returns the customer's first name. | +| [fullName](#fullname): [String](TopLevel.String.md) `(read-only)` | Returns a concatenation of the customer's first, middle, and last names and its suffix. | +| [jobTitle](#jobtitle): [String](TopLevel.String.md) | Returns the customer's job title. | +| [lastName](#lastname): [String](TopLevel.String.md) | Returns the customer's last name. | +| [phone](#phone): [String](TopLevel.String.md) | Returns the customer's phone number. | +| [postBox](#postbox): [String](TopLevel.String.md) | Returns the customer's post box. | +| [postalCode](#postalcode): [String](TopLevel.String.md) | Returns the customer's postal code. | +| [salutation](#salutation): [String](TopLevel.String.md) | Returns the customer's salutation. | +| [secondName](#secondname): [String](TopLevel.String.md) | Returns the customer's second name. | +| [stateCode](#statecode): [String](TopLevel.String.md) | Returns the customer's state. | +| [suffix](#suffix): [String](TopLevel.String.md) | Returns the customer's suffix. | +| [suite](#suite): [String](TopLevel.String.md) | Returns the customer's suite. | +| [title](#title): [String](TopLevel.String.md) | Returns the customer's title. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAddress1](dw.customer.CustomerAddress.md#getaddress1)() | Returns the customer's first address. | +| [getAddress2](dw.customer.CustomerAddress.md#getaddress2)() | Returns the customer's second address value. | +| [getCity](dw.customer.CustomerAddress.md#getcity)() | Returns the customer's city. | +| [getCompanyName](dw.customer.CustomerAddress.md#getcompanyname)() | Returns the customer's company name. | +| [getCountryCode](dw.customer.CustomerAddress.md#getcountrycode)() | Returns the customer's country code. | +| [getFirstName](dw.customer.CustomerAddress.md#getfirstname)() | Returns the customer's first name. | +| [getFullName](dw.customer.CustomerAddress.md#getfullname)() | Returns a concatenation of the customer's first, middle, and last names and its suffix. | +| [getID](dw.customer.CustomerAddress.md#getid)() | Returns the name of the address. | +| [getJobTitle](dw.customer.CustomerAddress.md#getjobtitle)() | Returns the customer's job title. | +| [getLastName](dw.customer.CustomerAddress.md#getlastname)() | Returns the customer's last name. | +| [getPhone](dw.customer.CustomerAddress.md#getphone)() | Returns the customer's phone number. | +| [getPostBox](dw.customer.CustomerAddress.md#getpostbox)() | Returns the customer's post box. | +| [getPostalCode](dw.customer.CustomerAddress.md#getpostalcode)() | Returns the customer's postal code. | +| [getSalutation](dw.customer.CustomerAddress.md#getsalutation)() | Returns the customer's salutation. | +| [getSecondName](dw.customer.CustomerAddress.md#getsecondname)() | Returns the customer's second name. | +| [getStateCode](dw.customer.CustomerAddress.md#getstatecode)() | Returns the customer's state. | +| [getSuffix](dw.customer.CustomerAddress.md#getsuffix)() | Returns the customer's suffix. | +| [getSuite](dw.customer.CustomerAddress.md#getsuite)() | Returns the customer's suite. | +| [getTitle](dw.customer.CustomerAddress.md#gettitle)() | Returns the customer's title. | +| [isEquivalentAddress](dw.customer.CustomerAddress.md#isequivalentaddressobject)([Object](TopLevel.Object.md)) | Returns true if the specified address is equivalent to this address. | +| [setAddress1](dw.customer.CustomerAddress.md#setaddress1string)([String](TopLevel.String.md)) | Sets the value of the customer's first address. | +| [setAddress2](dw.customer.CustomerAddress.md#setaddress2string)([String](TopLevel.String.md)) | Sets the customer's second address value. | +| [setCity](dw.customer.CustomerAddress.md#setcitystring)([String](TopLevel.String.md)) | Sets the customer's city. | +| [setCompanyName](dw.customer.CustomerAddress.md#setcompanynamestring)([String](TopLevel.String.md)) | Sets the customer's company name. | +| [setCountryCode](dw.customer.CustomerAddress.md#setcountrycodestring)([String](TopLevel.String.md)) | Sets the customer's country code. | +| [setFirstName](dw.customer.CustomerAddress.md#setfirstnamestring)([String](TopLevel.String.md)) | Sets the customer's first name. | +| [setID](dw.customer.CustomerAddress.md#setidstring)([String](TopLevel.String.md)) | Sets the address name. | +| [setJobTitle](dw.customer.CustomerAddress.md#setjobtitlestring)([String](TopLevel.String.md)) | Sets the customer's job title. | +| [setLastName](dw.customer.CustomerAddress.md#setlastnamestring)([String](TopLevel.String.md)) | Sets the customer's last name. | +| [setPhone](dw.customer.CustomerAddress.md#setphonestring)([String](TopLevel.String.md)) | Sets the customer's phone number. | +| [setPostBox](dw.customer.CustomerAddress.md#setpostboxstring)([String](TopLevel.String.md)) | Sets the customer's post box. | +| [setPostalCode](dw.customer.CustomerAddress.md#setpostalcodestring)([String](TopLevel.String.md)) | Sets the customer's postal code. | +| ~~[setSaluation](dw.customer.CustomerAddress.md#setsaluationstring)([String](TopLevel.String.md))~~ | Sets the customer's salutation. | +| [setSalutation](dw.customer.CustomerAddress.md#setsalutationstring)([String](TopLevel.String.md)) | Sets the customer's salutation. | +| [setSecondName](dw.customer.CustomerAddress.md#setsecondnamestring)([String](TopLevel.String.md)) | Sets the customer's second name. | +| [setStateCode](dw.customer.CustomerAddress.md#setstatecodestring)([String](TopLevel.String.md)) | Sets the customer's state. | +| [setSuffix](dw.customer.CustomerAddress.md#setsuffixstring)([String](TopLevel.String.md)) | Sets the customer's suffix. | +| [setSuite](dw.customer.CustomerAddress.md#setsuitestring)([String](TopLevel.String.md)) | Sets the customer's suite. | +| [setTitle](dw.customer.CustomerAddress.md#settitlestring)([String](TopLevel.String.md)) | Sets the customer's title. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) + - : Returns the name of the address. + + +--- + +### address1 +- address1: [String](TopLevel.String.md) + - : Returns the customer's first address. + + +--- + +### address2 +- address2: [String](TopLevel.String.md) + - : Returns the customer's second address value. + + +--- + +### city +- city: [String](TopLevel.String.md) + - : Returns the customer's city. + + +--- + +### companyName +- companyName: [String](TopLevel.String.md) + - : Returns the customer's company name. + + +--- + +### countryCode +- countryCode: [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's country code. Commerce Cloud Digital supports two-character + country codes per ISO 3166-1 alpha-2. See + [http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm](http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm) + for additional information. + + + +--- + +### firstName +- firstName: [String](TopLevel.String.md) + - : Returns the customer's first name. + + +--- + +### fullName +- fullName: [String](TopLevel.String.md) `(read-only)` + - : Returns a concatenation of the customer's first, middle, + and last names and its suffix. + + + +--- + +### jobTitle +- jobTitle: [String](TopLevel.String.md) + - : Returns the customer's job title. + + +--- + +### lastName +- lastName: [String](TopLevel.String.md) + - : Returns the customer's last name. + + +--- + +### phone +- phone: [String](TopLevel.String.md) + - : Returns the customer's phone number. + + +--- + +### postBox +- postBox: [String](TopLevel.String.md) + - : Returns the customer's post box. + + +--- + +### postalCode +- postalCode: [String](TopLevel.String.md) + - : Returns the customer's postal code. + + +--- + +### salutation +- salutation: [String](TopLevel.String.md) + - : Returns the customer's salutation. + + +--- + +### secondName +- secondName: [String](TopLevel.String.md) + - : Returns the customer's second name. + + +--- + +### stateCode +- stateCode: [String](TopLevel.String.md) + - : Returns the customer's state. + + +--- + +### suffix +- suffix: [String](TopLevel.String.md) + - : Returns the customer's suffix. + + +--- + +### suite +- suite: [String](TopLevel.String.md) + - : Returns the customer's suite. + + +--- + +### title +- title: [String](TopLevel.String.md) + - : Returns the customer's title. + + +--- + +## Method Details + +### getAddress1() +- getAddress1(): [String](TopLevel.String.md) + - : Returns the customer's first address. + + **Returns:** + - the first address value. + + +--- + +### getAddress2() +- getAddress2(): [String](TopLevel.String.md) + - : Returns the customer's second address value. + + **Returns:** + - the value of the second address. + + +--- + +### getCity() +- getCity(): [String](TopLevel.String.md) + - : Returns the customer's city. + + **Returns:** + - the customer's city. + + +--- + +### getCompanyName() +- getCompanyName(): [String](TopLevel.String.md) + - : Returns the customer's company name. + + **Returns:** + - the company name. + + +--- + +### getCountryCode() +- getCountryCode(): [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's country code. Commerce Cloud Digital supports two-character + country codes per ISO 3166-1 alpha-2. See + [http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm](http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm) + for additional information. + + + **Returns:** + - the two-digit country code. + + +--- + +### getFirstName() +- getFirstName(): [String](TopLevel.String.md) + - : Returns the customer's first name. + + **Returns:** + - the customer first name. + + +--- + +### getFullName() +- getFullName(): [String](TopLevel.String.md) + - : Returns a concatenation of the customer's first, middle, + and last names and its suffix. + + + **Returns:** + - a concatenation of the customer's first, middle, + and last names and its suffix. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the name of the address. + + **Returns:** + - the address name. + + +--- + +### getJobTitle() +- getJobTitle(): [String](TopLevel.String.md) + - : Returns the customer's job title. + + **Returns:** + - the job title. + + +--- + +### getLastName() +- getLastName(): [String](TopLevel.String.md) + - : Returns the customer's last name. + + **Returns:** + - the last name. + + +--- + +### getPhone() +- getPhone(): [String](TopLevel.String.md) + - : Returns the customer's phone number. + + **Returns:** + - the phone number. + + +--- + +### getPostBox() +- getPostBox(): [String](TopLevel.String.md) + - : Returns the customer's post box. + + **Returns:** + - the post box. + + +--- + +### getPostalCode() +- getPostalCode(): [String](TopLevel.String.md) + - : Returns the customer's postal code. + + **Returns:** + - the postal code. + + +--- + +### getSalutation() +- getSalutation(): [String](TopLevel.String.md) + - : Returns the customer's salutation. + + **Returns:** + - the salutation. + + +--- + +### getSecondName() +- getSecondName(): [String](TopLevel.String.md) + - : Returns the customer's second name. + + **Returns:** + - the second name. + + +--- + +### getStateCode() +- getStateCode(): [String](TopLevel.String.md) + - : Returns the customer's state. + + **Returns:** + - the state. + + +--- + +### getSuffix() +- getSuffix(): [String](TopLevel.String.md) + - : Returns the customer's suffix. + + **Returns:** + - the suffix. + + +--- + +### getSuite() +- getSuite(): [String](TopLevel.String.md) + - : Returns the customer's suite. + + **Returns:** + - the suite. + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the customer's title. + + **Returns:** + - the title. + + +--- + +### isEquivalentAddress(Object) +- isEquivalentAddress(address: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the specified address is equivalent to + this address. An equivalent address is an address whose + core attributes contain the same values. The core attributes + are: + + - address1 + - address2 + - city + - companyName + - countryCode + - firstName + - lastName + - postalCode + - postBox + - stateCode + + + **Parameters:** + - address - the address to test. + + **Returns:** + - true if the specified address is equivalent to + this address, false otherwise. + + + +--- + +### setAddress1(String) +- setAddress1(value: [String](TopLevel.String.md)): void + - : Sets the value of the customer's first address. + + **Parameters:** + - value - The value to set. + + +--- + +### setAddress2(String) +- setAddress2(value: [String](TopLevel.String.md)): void + - : Sets the customer's second address value. + + **Parameters:** + - value - The value to set. + + +--- + +### setCity(String) +- setCity(city: [String](TopLevel.String.md)): void + - : Sets the customer's city. + + **Parameters:** + - city - the customer's city to set. + + +--- + +### setCompanyName(String) +- setCompanyName(companyName: [String](TopLevel.String.md)): void + - : Sets the customer's company name. + + **Parameters:** + - companyName - the name of the company. + + +--- + +### setCountryCode(String) +- setCountryCode(countryCode: [String](TopLevel.String.md)): void + - : Sets the customer's country code. Commerce Cloud Digital supports two-character + country codes per ISO 3166-1 alpha-2. See + [http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm](http://www.iso.org/iso/country\_codes/iso\_3166-faqs/iso\_3166\_faqs\_general.htm) + for additional information. + + + **Parameters:** + - countryCode - the country code, must be no more than 2 characters or will be truncated. + + +--- + +### setFirstName(String) +- setFirstName(firstName: [String](TopLevel.String.md)): void + - : Sets the customer's first name. + + **Parameters:** + - firstName - the customer's first name to set. + + +--- + +### setID(String) +- setID(value: [String](TopLevel.String.md)): void + - : Sets the address name. + + **Parameters:** + - value - the name to use. + + +--- + +### setJobTitle(String) +- setJobTitle(jobTitle: [String](TopLevel.String.md)): void + - : Sets the customer's job title. + + **Parameters:** + - jobTitle - The jobTitle to set. + + +--- + +### setLastName(String) +- setLastName(lastName: [String](TopLevel.String.md)): void + - : Sets the customer's last name. + + **Parameters:** + - lastName - The last name to set. + + +--- + +### setPhone(String) +- setPhone(phoneNumber: [String](TopLevel.String.md)): void + - : Sets the customer's phone number. The length is restricted to 32 characters. + + **Parameters:** + - phoneNumber - The phone number to set. + + +--- + +### setPostBox(String) +- setPostBox(postBox: [String](TopLevel.String.md)): void + - : Sets the customer's post box. + + **Parameters:** + - postBox - The post box to set. + + +--- + +### setPostalCode(String) +- setPostalCode(postalCode: [String](TopLevel.String.md)): void + - : Sets the customer's postal code. + + **Parameters:** + - postalCode - The postal code to set. + + +--- + +### setSaluation(String) +- ~~setSaluation(value: [String](TopLevel.String.md)): void~~ + - : Sets the customer's salutation. + + **Parameters:** + - value - the salutation. + + **Deprecated:** +:::warning +Use [setSalutation(String)](dw.customer.CustomerAddress.md#setsalutationstring) +::: + +--- + +### setSalutation(String) +- setSalutation(value: [String](TopLevel.String.md)): void + - : Sets the customer's salutation. + + **Parameters:** + - value - the salutation. + + +--- + +### setSecondName(String) +- setSecondName(secondName: [String](TopLevel.String.md)): void + - : Sets the customer's second name. + + **Parameters:** + - secondName - The second name to set. + + +--- + +### setStateCode(String) +- setStateCode(state: [String](TopLevel.String.md)): void + - : Sets the customer's state. + + **Parameters:** + - state - The state to set. + + +--- + +### setSuffix(String) +- setSuffix(suffix: [String](TopLevel.String.md)): void + - : Sets the customer's suffix. + + **Parameters:** + - suffix - The suffix to set. + + +--- + +### setSuite(String) +- setSuite(value: [String](TopLevel.String.md)): void + - : Sets the customer's suite. The length is restricted to 32 characters. + + **Parameters:** + - value - the suite to set. + + +--- + +### setTitle(String) +- setTitle(title: [String](TopLevel.String.md)): void + - : Sets the customer's title. + + **Parameters:** + - title - The title to set. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerCDPData.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerCDPData.md new file mode 100644 index 00000000..6f663411 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerCDPData.md @@ -0,0 +1,70 @@ + +# Class CustomerCDPData + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerCDPData](dw.customer.CustomerCDPData.md) + +Represents the read-only Customer's Salesforce CDP (Customer Data Platform) data for a [Customer](dw.customer.Customer.md) in Commerce +Cloud. Please see Salesforce CDP enablement documentation + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [empty](#empty): [Boolean](TopLevel.Boolean.md) `(read-only)` | Return true if the CDPData is empty (has no meaningful data) | +| [segments](#segments): [String\[\]](TopLevel.String.md) `(read-only)` | Returns an array containing the CDP segments for the customer, or an empty array if no segments found | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getSegments](dw.customer.CustomerCDPData.md#getsegments)() | Returns an array containing the CDP segments for the customer, or an empty array if no segments found | +| [isEmpty](dw.customer.CustomerCDPData.md#isempty)() | Return true if the CDPData is empty (has no meaningful data) | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### empty +- empty: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Return true if the CDPData is empty (has no meaningful data) + + +--- + +### segments +- segments: [String\[\]](TopLevel.String.md) `(read-only)` + - : Returns an array containing the CDP segments for the customer, or an empty array if no segments found + + +--- + +## Method Details + +### getSegments() +- getSegments(): [String\[\]](TopLevel.String.md) + - : Returns an array containing the CDP segments for the customer, or an empty array if no segments found + + **Returns:** + - a collection containing the CDP segments for the customer + + +--- + +### isEmpty() +- isEmpty(): [Boolean](TopLevel.Boolean.md) + - : Return true if the CDPData is empty (has no meaningful data) + + **Returns:** + - true if CDPData is empty, false otherwise + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerContextMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerContextMgr.md new file mode 100644 index 00000000..b6276c62 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerContextMgr.md @@ -0,0 +1,62 @@ + +# Class CustomerContextMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerContextMgr](dw.customer.CustomerContextMgr.md) + +Provides helper methods for managing customer context, such as the Effective Time for which the customer is shopping +at + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [effectiveTime](#effectivetime): [Date](TopLevel.Date.md) | Get the effective time associated with the customer. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getEffectiveTime](dw.customer.CustomerContextMgr.md#geteffectivetime)() | Get the effective time associated with the customer. | +| static [setEffectiveTime](dw.customer.CustomerContextMgr.md#seteffectivetimedate)([Date](TopLevel.Date.md)) | Set the effective time for the customer. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### effectiveTime +- effectiveTime: [Date](TopLevel.Date.md) + - : Get the effective time associated with the customer. By default, the effective time is null. + + +--- + +## Method Details + +### getEffectiveTime() +- static getEffectiveTime(): [Date](TopLevel.Date.md) + - : Get the effective time associated with the customer. By default, the effective time is null. + + **Returns:** + - effective time. When null is returned it means no effective time is associated with the customer + + +--- + +### setEffectiveTime(Date) +- static setEffectiveTime(effectiveTime: [Date](TopLevel.Date.md)): void + - : Set the effective time for the customer. Null is allowed to remove effective time from the customer. + + **Parameters:** + - effectiveTime - the effective time. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerGroup.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerGroup.md new file mode 100644 index 00000000..17abca4b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerGroup.md @@ -0,0 +1,146 @@ + +# Class CustomerGroup + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.CustomerGroup](dw.customer.CustomerGroup.md) + +CustomerGroups provide a means to segment customers by various criteria. A +merchant can then provide different site experiences (e.g. promotions, +prices, sorting rules) to each customer segment. Customer groups can consist +of either an explicit list of customers or a business rule that dynamically +determines whether a customer is a member. The former type is called +"explicit" and the latter type is called "dynamic". + + +- **Explicit customer group:**Consists of an explicit list of customers. Only registered customers can be member of such a group. isRuleBased==false. +- **Dynamic customer group:**Memberships are evaluated by a business rule that is attached to the customer group. Registered as well as anonymous customers can be member of such a group. isRuleBased==true. + + + +**Note:** this class might allow access to sensitive personal and private +information, depending on how you segment your customers and the names given to +your custoemer groups. Pay attention to appropriate legal and regulatory requirements +when developing with this data. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique ID of the customer group. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Gets the value of the description of the customer group. | +| [ruleBased](#rulebased): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if the group determines the membership of customers based on rules. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [assignCustomer](dw.customer.CustomerGroup.md#assigncustomercustomer)([Customer](dw.customer.Customer.md)) | Assigns the specified customer to this group. | +| [getDescription](dw.customer.CustomerGroup.md#getdescription)() | Gets the value of the description of the customer group. | +| [getID](dw.customer.CustomerGroup.md#getid)() | Returns the unique ID of the customer group. | +| [isRuleBased](dw.customer.CustomerGroup.md#isrulebased)() | Returns true if the group determines the membership of customers based on rules. | +| [unassignCustomer](dw.customer.CustomerGroup.md#unassigncustomercustomer)([Customer](dw.customer.Customer.md)) | Unassigns the specified customer from this group. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique ID of the customer group. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Gets the value of the description of the customer group. + + +--- + +### ruleBased +- ruleBased: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if the group determines the membership of customers + based on rules. Returns false if the group provides explicit assignement + of customers. + + + +--- + +## Method Details + +### assignCustomer(Customer) +- assignCustomer(customer: [Customer](dw.customer.Customer.md)): void + - : Assigns the specified customer to this group. + + The customer must be registered and the group must not be rule-based. + + + **Parameters:** + - customer - Registered customer, must not be null. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Gets the value of the description of the customer group. + + **Returns:** + - the description of the customer group + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique ID of the customer group. + + **Returns:** + - The unique semantic ID of the customer group. + + +--- + +### isRuleBased() +- isRuleBased(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the group determines the membership of customers + based on rules. Returns false if the group provides explicit assignement + of customers. + + + **Returns:** + - `True`, if the customer group is rule based. + + +--- + +### unassignCustomer(Customer) +- unassignCustomer(customer: [Customer](dw.customer.Customer.md)): void + - : Unassigns the specified customer from this group. + + The customer must be registered and the group must not be rule-based. + + + **Parameters:** + - customer - Registered customer, must not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerList.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerList.md new file mode 100644 index 00000000..1a6bcd7b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerList.md @@ -0,0 +1,76 @@ + +# Class CustomerList + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerList](dw.customer.CustomerList.md) + +Object representing the collection of customers who are registered +for a given site. In Commerce Cloud Digital, every site has exactly +one assigned customer list but multiple sites may share a customer +list. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Get the ID of the customer list. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Get the optional description of the customer list. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDescription](dw.customer.CustomerList.md#getdescription)() | Get the optional description of the customer list. | +| [getID](dw.customer.CustomerList.md#getid)() | Get the ID of the customer list. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Get the ID of the customer list. For customer lists that were created automatically + for a given site, this is equal to the ID of the site itself. + + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Get the optional description of the customer list. + + +--- + +## Method Details + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Get the optional description of the customer list. + + **Returns:** + - The optional description of the list. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Get the ID of the customer list. For customer lists that were created automatically + for a given site, this is equal to the ID of the site itself. + + + **Returns:** + - The ID of the customer list. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerMgr.md new file mode 100644 index 00000000..dc94be77 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerMgr.md @@ -0,0 +1,1046 @@ + +# Class CustomerMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerMgr](dw.customer.CustomerMgr.md) + +Provides helper methods for managing customers and customer +profiles. +**Note:** this class allows access to sensitive information through +operations that retrieve the Profile object. +Pay attention to appropriate legal and regulatory requirements related to this data. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [customerGroups](#customergroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns the customer groups of the current site. | +| [passwordConstraints](#passwordconstraints): [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) `(read-only)` | Returns an instance of [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) for the customer list assigned to the current site. | +| [registeredCustomerCount](#registeredcustomercount): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of registered customers in the system. | +| [siteCustomerList](#sitecustomerlist): [CustomerList](dw.customer.CustomerList.md) `(read-only)` | Returns the customer list of the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [authenticateCustomer](dw.customer.CustomerMgr.md#authenticatecustomerstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | This method authenticates a customer using the supplied login and password. | +| static [createCustomer](dw.customer.CustomerMgr.md#createcustomerstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Creates a new Customer using the supplied login, password. | +| static [createCustomer](dw.customer.CustomerMgr.md#createcustomerstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Creates a new Customer using the supplied login, password, and a customerNo. | +| static [createExternallyAuthenticatedCustomer](dw.customer.CustomerMgr.md#createexternallyauthenticatedcustomerstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Given an authentication provider Id and an external Id: creates a Customer record in the system if one does not exist already for the same 'authenticationProviderId' and 'externalId' pair. | +| static [describeProfileType](dw.customer.CustomerMgr.md#describeprofiletype)() | Returns the meta data for profiles. | +| static [getCustomerByCustomerNumber](dw.customer.CustomerMgr.md#getcustomerbycustomernumberstring)([String](TopLevel.String.md)) | Returns the customer with the specified customer number. | +| static [getCustomerByLogin](dw.customer.CustomerMgr.md#getcustomerbyloginstring)([String](TopLevel.String.md)) | Returns the customer for the specified login name. | +| static [getCustomerByToken](dw.customer.CustomerMgr.md#getcustomerbytokenstring)([String](TopLevel.String.md)) | Returns the customer associated with the specified password reset token. | +| static [getCustomerGroup](dw.customer.CustomerMgr.md#getcustomergroupstring)([String](TopLevel.String.md)) | Returns the customer group with the specified ID or null if group does not exists. | +| static [getCustomerGroups](dw.customer.CustomerMgr.md#getcustomergroups)() | Returns the customer groups of the current site. | +| static [getCustomerList](dw.customer.CustomerMgr.md#getcustomerliststring)([String](TopLevel.String.md)) | Returns the customer list identified by the specified ID. | +| static [getExternallyAuthenticatedCustomerProfile](dw.customer.CustomerMgr.md#getexternallyauthenticatedcustomerprofilestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Given an authentication provider Id and external Id returns the Customer Profile in our system. | +| static [getPasswordConstraints](dw.customer.CustomerMgr.md#getpasswordconstraints)() | Returns an instance of [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) for the customer list assigned to the current site. | +| static [getProfile](dw.customer.CustomerMgr.md#getprofilestring)([String](TopLevel.String.md)) | Returns the profile with the specified customer number. | +| static [getRegisteredCustomerCount](dw.customer.CustomerMgr.md#getregisteredcustomercount)() | Returns the number of registered customers in the system. | +| static [getSiteCustomerList](dw.customer.CustomerMgr.md#getsitecustomerlist)() | Returns the customer list of the current site. | +| static [isAcceptablePassword](dw.customer.CustomerMgr.md#isacceptablepasswordstring)([String](TopLevel.String.md)) | Checks if the given password matches the password constraints (for example password length) of the current site's assigned customerlist. | +| static [isPasswordExpired](dw.customer.CustomerMgr.md#ispasswordexpiredstring)([String](TopLevel.String.md)) | Checks if the password for the given customer is expired | +| static [loginCustomer](dw.customer.CustomerMgr.md#logincustomerauthenticationstatus-boolean)([AuthenticationStatus](dw.customer.AuthenticationStatus.md), [Boolean](TopLevel.Boolean.md)) | This method logs in the authenticated customer (from a previous authenticateCustomer() call). | +| ~~static [loginCustomer](dw.customer.CustomerMgr.md#logincustomerstring-string-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md))~~ | This method authenticates the current session using the supplied login and password. | +| static [loginExternallyAuthenticatedCustomer](dw.customer.CustomerMgr.md#loginexternallyauthenticatedcustomerstring-string-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Logs in externally authenticated customer if it has already been created in the system and the profile is not disabled or locked | +| static [logoutCustomer](dw.customer.CustomerMgr.md#logoutcustomerboolean)([Boolean](TopLevel.Boolean.md)) | Logs out the customer currently logged into the storefront. | +| static [processProfiles](dw.customer.CustomerMgr.md#processprofilesfunction-string-object)([Function](TopLevel.Function.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Executes a user-definable function on a set of customer profiles. | +| ~~static [queryProfile](dw.customer.CustomerMgr.md#queryprofilestring-object)([String](TopLevel.String.md), [Object...](TopLevel.Object.md))~~ |

    Searches for a single profile instance. | +| ~~static [queryProfiles](dw.customer.CustomerMgr.md#queryprofilesmap-string)([Map](dw.util.Map.md), [String](TopLevel.String.md))~~ |

    Searches for profile instances. | +| ~~static [queryProfiles](dw.customer.CustomerMgr.md#queryprofilesstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md))~~ | Searches for profile instances. | +| static [removeCustomer](dw.customer.CustomerMgr.md#removecustomercustomer)([Customer](dw.customer.Customer.md)) | Logs out the supplied customer and deletes the customer record. | +| static [removeCustomerTrackingData](dw.customer.CustomerMgr.md#removecustomertrackingdatacustomer)([Customer](dw.customer.Customer.md)) | Removes (asynchronously) tracking data for this customer (from external systems or data stores). | +| static [searchProfile](dw.customer.CustomerMgr.md#searchprofilestring-object)([String](TopLevel.String.md), [Object...](TopLevel.Object.md)) |

    Searches for a single profile instance. | +| static [searchProfiles](dw.customer.CustomerMgr.md#searchprofilesmap-string)([Map](dw.util.Map.md), [String](TopLevel.String.md)) |

    Searches for profile instances. | +| static [searchProfiles](dw.customer.CustomerMgr.md#searchprofilesstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Searches for profile instances. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### customerGroups +- customerGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the customer groups of the current site. + + +--- + +### passwordConstraints +- passwordConstraints: [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) `(read-only)` + - : Returns an instance of [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) + for the customer list assigned to the current site. + + + +--- + +### registeredCustomerCount +- registeredCustomerCount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of registered customers in the system. This number can be used for reporting + purposes. + + + +--- + +### siteCustomerList +- siteCustomerList: [CustomerList](dw.customer.CustomerList.md) `(read-only)` + - : Returns the customer list of the current site. + + +--- + +## Method Details + +### authenticateCustomer(String, String) +- static authenticateCustomer(login: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [AuthenticationStatus](dw.customer.AuthenticationStatus.md) + - : This method authenticates a customer using the supplied login and password. It will not log in the customer into + the current session, but returns only a status indicating success or failure (with different error codes for the failure cases). + Upon successful authentication (status code 'AUTH\_OK') the status object also holds the authenticated customer. + To continue the login process, call the loginCustomer(AuthenticationStatus, boolean) method. + + This method verifies that the password for the customer is not expired. If it is expired the authentication will fail, with a status code of + ERROR\_PASSWORD\_EXPIRED. This allows the storefront to require the customer to change the password, and then the login can proceed. + + + **Parameters:** + - login - Login name, must not be null. + - password - Password, must not be null. + + **Returns:** + - the status of the authentication process + + +--- + +### createCustomer(String, String) +- static createCustomer(login: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Creates a new Customer using the supplied login, password. The system automatically assigns a customer number based on + the customer sequence numbers configured for the site or organization. The number is guaranteed to be unique, but is not guaranteed to be sequential. + It can be higher or lower than a previously created number. As a result, sorting customers by customer number is not guaranteed to sort them in their + order of creation. + + + The method throws an exception if any of the following conditions are encountered: + + - A Customer with the supplied Login already exists + - The Login is not acceptable. + - The Password is not acceptable. + - The system cannot create the Customer. + + + + A valid login name is between 1 and 256 characters in length (not counting leading or trailing whitespace), and may contain only the + following characters: + + - alphanumeric (Unicode letters or decimal digits) + - space + - period + - dash + - underscore + - @ + + + + Note: a storefront can be customized to provide further constraints on characters in a login name, but it cannot remove any constraints described above. + + + If customers are created using this Script API call then any updated to the customer records should be done through Script API calls as well. + The customer records created with Script API call should not be updated with OCAPI calls as the email validation is handled + differently in these calls and may result in InvalidEmailException. + + + **Parameters:** + - login - The unique login name associated with the new customer and its profile, must not be null. If login is already in use, an exception will be thrown. + - password - Customer plain customer password, which is encrypted before it is stored at the profile, must not be null. + + **Returns:** + - customer The new customer object. + + +--- + +### createCustomer(String, String, String) +- static createCustomer(login: [String](TopLevel.String.md), password: [String](TopLevel.String.md), customerNo: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Creates a new Customer using the supplied login, password, and a customerNo. If the customerNo is not specified, + the system automatically assigns a customer number based on the customer sequence numbers configured for the site or organization. An automatically assigned + number is guaranteed to be unique, but is not guaranteed to be sequential. It can be higher or lower than a previously created number. As a result, sorting + customers by customer number is not guaranteed to sort them in their order of creation. + + + The method throws an exception if any of the following conditions are encountered: + + - A Customer with the supplied Login already exists + - A Customer with the explicitly provided or calculated customer number already exists. + - The Login is not acceptable. + - The Password is not acceptable. + - The system cannot create the Customer. + + + + A valid login name is between 1 and 256 characters in length (not counting leading or trailing whitespace), and may contain only the + following characters: + + - alphanumeric (Unicode letters or decimal digits) + - space + - period + - dash + - underscore + - @ + + + + Note: a storefront can be customized to provide further constraints on characters in a login name, but it cannot remove any constraints described above. + + + A valid CustomerNo is between 1 and 100 characters in length (not counting leading or trailing whitespace). Commerce Cloud Digital recommends that a CustomerNo only + contain characters valid for URLs. + + + If customers are created using this Script API call then any updated to the customer records should be done through Script API calls as well. + The customer records created with Script API call should not be updated with OCAPI calls as the email validation is handled + differently in these calls and may result in InvalidEmailException. + + + **Parameters:** + - login - The unique login name associated with the new customer and its profile, must not be null. If login is already in use, an exception will be thrown. + - password - Customer plain customer password, which is encrypted before it is stored at the profile, must not be null. + - customerNo - The unique customerNo can be null, the system will then automatically assign a new value. If provided explicitly, the system will make sure that no other customer uses the same value and will throw an exception otherwise. + + **Returns:** + - customer The new customer object. + + +--- + +### createExternallyAuthenticatedCustomer(String, String) +- static createExternallyAuthenticatedCustomer(authenticationProviderId: [String](TopLevel.String.md), externalId: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Given an authentication provider Id and an external Id: creates a Customer record in the system if one does not + exist already for the same 'authenticationProviderId' and 'externalId' pair. If one already exists - it is returned. + + + **Parameters:** + - authenticationProviderId - the Id of the authentication provider as configured in Commerce Cloud Digital. + - externalId - the Id of the customer at the authentication provider. Each authentication provider generates these in a different way, they are unique within their system + + **Returns:** + - On success: the created customer. On failure - null + + +--- + +### describeProfileType() +- static describeProfileType(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : Returns the meta data for profiles. + + **Returns:** + - the meta data for profiles. + + +--- + +### getCustomerByCustomerNumber(String) +- static getCustomerByCustomerNumber(customerNumber: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Returns the customer with the specified customer number. If no customer with this customer number exists, null is returned. + + **Parameters:** + - customerNumber - the customer number associated with the customer, must not be null. + + **Returns:** + - The customer if found, null otherwise + + +--- + +### getCustomerByLogin(String) +- static getCustomerByLogin(login: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Returns the customer for the specified login name. If no customer with this login name exists, null is returned. + + **Parameters:** + - login - the unique login name associated with the customer, must not be null. + + **Returns:** + - The customer if found, null otherwise + + +--- + +### getCustomerByToken(String) +- static getCustomerByToken(token: [String](TopLevel.String.md)): [Customer](dw.customer.Customer.md) + - : Returns the customer associated with the specified password reset token. A valid token is one that is associated + with a customer record and is not expired. Such a token can be generated by + [Credentials.createResetPasswordToken()](dw.customer.Credentials.md#createresetpasswordtoken). If the passed token is valid, the associated customer + is returned. Otherwise `null` is returned + + + **Parameters:** + - token - password reset token + + **Returns:** + - The customer associated with the token. `Null` if the token is invalid. + + +--- + +### getCustomerGroup(String) +- static getCustomerGroup(id: [String](TopLevel.String.md)): [CustomerGroup](dw.customer.CustomerGroup.md) + - : Returns the customer group with the specified ID or null if group + does not exists. + + + **Parameters:** + - id - the customer group identifier. + + **Returns:** + - Customer group for ID or null + + +--- + +### getCustomerGroups() +- static getCustomerGroups(): [Collection](dw.util.Collection.md) + - : Returns the customer groups of the current site. + + **Returns:** + - Customer groups of current site. + + +--- + +### getCustomerList(String) +- static getCustomerList(id: [String](TopLevel.String.md)): [CustomerList](dw.customer.CustomerList.md) + - : Returns the customer list identified by the specified ID. + Returns null if no customer list with the specified id exists. + + + Note: Typically the ID of an automatically created customer + list is equal to the ID of the site. + + + **Parameters:** + - id - The ID of the customer list. + + **Returns:** + - The CustomerList, or null if not found. + + +--- + +### getExternallyAuthenticatedCustomerProfile(String, String) +- static getExternallyAuthenticatedCustomerProfile(authenticationProviderId: [String](TopLevel.String.md), externalId: [String](TopLevel.String.md)): [Profile](dw.customer.Profile.md) + - : Given an authentication provider Id and external Id returns the Customer Profile + in our system. + + + **Parameters:** + - authenticationProviderId - the Id of the authentication provider as configured in Commerce Cloud Digital. + - externalId - the Id of the customer at the authentication provider. Each authentication provider generates these in a different way, they are unique within their system + + **Returns:** + - The Profile of the customer if found, null otherwise + + +--- + +### getPasswordConstraints() +- static getPasswordConstraints(): [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) + - : Returns an instance of [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) + for the customer list assigned to the current site. + + + **Returns:** + - customer password constraints for current site + + +--- + +### getProfile(String) +- static getProfile(customerNumber: [String](TopLevel.String.md)): [Profile](dw.customer.Profile.md) + - : Returns the profile with the specified customer number. + + **Parameters:** + - customerNumber - the customer number of the customer of the to be retrieved profile + + **Returns:** + - Profile for specified customer number + + +--- + +### getRegisteredCustomerCount() +- static getRegisteredCustomerCount(): [Number](TopLevel.Number.md) + - : Returns the number of registered customers in the system. This number can be used for reporting + purposes. + + + **Returns:** + - the number of registered customers in the system. + + +--- + +### getSiteCustomerList() +- static getSiteCustomerList(): [CustomerList](dw.customer.CustomerList.md) + - : Returns the customer list of the current site. + + **Returns:** + - The customer list assigned to the current site. + + +--- + +### isAcceptablePassword(String) +- static isAcceptablePassword(password: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Checks if the given password matches the password constraints (for example password length) of + the current site's assigned customerlist. + + + **Parameters:** + - password - the to be checked password + + **Returns:** + - true if the given password matches all required criteria + + +--- + +### isPasswordExpired(String) +- static isPasswordExpired(login: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Checks if the password for the given customer is expired + + **Parameters:** + - login - the login for the customer to be checked + + **Returns:** + - true if the password is expired + + +--- + +### loginCustomer(AuthenticationStatus, Boolean) +- static loginCustomer(authStatus: [AuthenticationStatus](dw.customer.AuthenticationStatus.md), rememberMe: [Boolean](TopLevel.Boolean.md)): [Customer](dw.customer.Customer.md) + - : This method logs in the authenticated customer (from a previous authenticateCustomer() call). If a different customer is currently authenticated in the session, then this + customer is "logged out" and all privacy-relevant data and all form data are deleted. If the previous authentication was not successful, then null is returned and no changes + to the session are made. + + + If the input value "RememberMe" is set to true, this method stores a cookie on the customer's machine which will be used to identify the customer when the next + session is initiated. The cookie is set to expire in 180 days (i.e. 6 months). Note that a customer who is remembered is not automatically authenticated and will + have to explicitly log in to access any personal information. + + + **Parameters:** + - authStatus - the authentication status from the previous authenticateCustomer call + - rememberMe - Boolean value indicating if the customer wants to be remembered on the current computer. If a value of true is supplied a cookie identifying the customer is stored upon successful login. If a value of false, or a null value, is supplied, then no cookie is stored and any existing cookie is removed. + + **Returns:** + - Customer successfully authenticated customer. Null if the authentication status was not indicating success of the authentication. + + +--- + +### loginCustomer(String, String, Boolean) +- ~~static loginCustomer(login: [String](TopLevel.String.md), password: [String](TopLevel.String.md), rememberMe: [Boolean](TopLevel.Boolean.md)): [Customer](dw.customer.Customer.md)~~ + - : This method authenticates the current session using the supplied login and password. If a different customer is currently authenticated in the session, then this + customer is "logged out" and her/his privacy and form data are deleted. If the authentication with the given credentials fails, then null is returned and no changes + to the session are made. The authentication will be sucessful even when the password of the customer is already expired (according to the customer list settings). + + + If the input value "RememberMe" is set to true, this method stores a cookie on the customer's machine which will be used to identify the customer when the next + session is initiated. The cookie is set to expire in 180 days (i.e. 6 months). Note that a customer who is remembered is not automatically authenticated and will + have to explicitly log in to access any personal information. + + + **Parameters:** + - login - Login name, must not be null. + - password - Password, must not be null. + - rememberMe - Boolean value indicating if the customer wants to be remembered on the current computer. If a value of true is supplied a cookie identifying the customer is stored upon successful login. If a value of false, or a null value, is supplied, then no cookie is stored and any existing cookie is removed. + + **Returns:** + - Customer successfully authenticated customer. Null if the authentication with the given credentials fails. + + **Deprecated:** +:::warning +use authenticateCustomer(login, password) and loginCustomer(authStatus, rememberMe) instead since they correctly check for expired passwords +::: + +--- + +### loginExternallyAuthenticatedCustomer(String, String, Boolean) +- static loginExternallyAuthenticatedCustomer(authenticationProviderId: [String](TopLevel.String.md), externalId: [String](TopLevel.String.md), rememberMe: [Boolean](TopLevel.Boolean.md)): [Customer](dw.customer.Customer.md) + - : Logs in externally authenticated customer if it has already been created in the system and the profile is not disabled or locked + + **Parameters:** + - authenticationProviderId - the Id of the authentication provider as configured in Commerce Cloud Digital. + - externalId - the Id of the customer at the authentication provider. + - rememberMe - whether to drop the remember me cookie + + **Returns:** + - Customer if found in the system and not disabled or locked. + [getExternallyAuthenticatedCustomerProfile(String, String)](dw.customer.CustomerMgr.md#getexternallyauthenticatedcustomerprofilestring-string) + + + +--- + +### logoutCustomer(Boolean) +- static logoutCustomer(rememberMe: [Boolean](TopLevel.Boolean.md)): [Customer](dw.customer.Customer.md) + - : Logs out the customer currently logged into the storefront. The boolean value "RememberMe" indicates, if the customer would like to be remembered on the current + browser. If a value of true is supplied, the customer authentication state is set to "not logged in" and additionally the following session data is removed: the customer + session private data, the form status data, dictionary information of interaction continue nodes, basket reference information, the secure token cookie. If the value is set + to false or null, the complete session dictionary is cleaned up. The customer and anonymous cookie are removed and a new session cookie is set. + + + **Parameters:** + - rememberMe - Boolean value indicating if the customer wants to be remembered on the current browser. If a value of true is supplied, the customer authentication state is set to "not logged in" and additionally the following session data is removed: the customer session private data, the form status data, dictionary information of interaction continue nodes, basket reference information, the secure token cookie. If the value is set to false or null, the complete session dictionary is cleaned up. The customer and anonymous cookie are removed and a new session cookie is set. + + **Returns:** + - the new customer identity after logout. If rememberMe is true, null is returned. + + +--- + +### processProfiles(Function, String, Object...) +- static processProfiles(processFunction: [Function](TopLevel.Function.md), queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): void + - : Executes a user-definable function on a set of customer profiles. This method is intended to be used in batch processes and jobs, + since it allows efficient processing of large result sets (which might take a while to process). + + First, a search with the given parameters is executed. Then the given function is executed once for each profile of the search result. + The profile is handed over as the only parameter to this function. + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + For a description of this query language, see the [queryProfile(String, Object...)](dw.customer.CustomerMgr.md#queryprofilestring-object) method. + + The callback function will be supplied with a single argument of type 'Profile'. When the callback function defines + additional arguments, they will be undefined when the function is called. When the callback function doesn't define + any arguments at all, it will be called anyway (no error will happen, but the function won't get a profile as parameter). + + Error during execution of the callback function will be logged, and execution will continue with the next element from the + result set. + + This method can be used as in this example (which counts the number of men): + + + ``` + var count=0; + function callback(profile: Profile) + { + count++; + dw.system.Logger.debug("customer found: "+profile.customerNo) + } + CustomerMgr.processProfiles(callback, "gender=1"); + dw.system.Logger.debug("found "+count+" men in customer list"); + ``` + + + **Parameters:** + - processFunction - the function to execute for each profile + - queryString - the query string to use when searching for a profile. + - args - the query string arguments. + + +--- + +### queryProfile(String, Object...) +- ~~static queryProfile(queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [Profile](dw.customer.Profile.md)~~ + - : + Searches for a single profile instance. + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + The following **operators** are supported in a condition: + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' + and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + + The query language provides a placeholder syntax to pass objects as + additional search parameters. Each passed object is related to a + placeholder in the query string. The placeholder must be an Integer that + is surrounded by braces. The first Integer value must be '0', the second + '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + If there is more than one object matching the specified query criteria, the + result is not deterministic. In order to retrieve a single object from a sorted result + set it is recommended to use the following code: + `queryProfiles("", "custom.myAttr asc", null).first()`. + The method `first()` returns only the next element and closes the + iterator. + + + + + **This method is deprecated and will be removed in a future release.** + One of the following methods should be used instead: + [searchProfile(String, Object...)](dw.customer.CustomerMgr.md#searchprofilestring-object), + [searchProfiles(Map, String)](dw.customer.CustomerMgr.md#searchprofilesmap-string) and + [searchProfiles(String, String, Object...)](dw.customer.CustomerMgr.md#searchprofilesstring-string-object) to search for customers and + [processProfiles(Function, String, Object...)](dw.customer.CustomerMgr.md#processprofilesfunction-string-object) to search and process customers in jobs. + + + **Parameters:** + - queryString - the query string to use when searching for a profile. + - args - the query string arguments. + + **Returns:** + - the profile which was found when executing the `queryString`. + + **Deprecated:** +:::warning +use [searchProfile(String, Object...)](dw.customer.CustomerMgr.md#searchprofilestring-object) instead. +::: + +--- + +### queryProfiles(Map, String) +- ~~static queryProfiles(queryAttributes: [Map](dw.util.Map.md), sortString: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md)~~ + - : + Searches for profile instances. + + + The search can be configured with a map, which key-value pairs are + converted into a query expression. The key-value pairs are turned into a + sequence of '=' or 'like' conditions, which are combined with AND + statements. + + + Example: + + A map with the key/value pairs: _'name'/'tom\*', 'age'/66_ + will be converted as follows: `"name like 'tom*' and age = 66"` + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + The **sorting** parameter is optional and may contain a comma separated list of + attribute names to sort by. Each sort attribute name may be followed by an + optional sort direction specifier ('asc' | 'desc'). Default sorting directions is + ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is + currently not supported. + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + See [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + + + + **This method is deprecated and will be removed in a future release.** + One of the following methods should be used instead: + [searchProfile(String, Object...)](dw.customer.CustomerMgr.md#searchprofilestring-object), + [searchProfiles(Map, String)](dw.customer.CustomerMgr.md#searchprofilesmap-string) and + [searchProfiles(String, String, Object...)](dw.customer.CustomerMgr.md#searchprofilesstring-string-object) to search for customers and + [processProfiles(Function, String, Object...)](dw.customer.CustomerMgr.md#processprofilesfunction-string-object) to search and process customers in jobs. + + + **Parameters:** + - queryAttributes - key-value pairs that define the query. + - sortString - an optional sorting or null if no sorting is necessary. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **Deprecated:** +:::warning +use [searchProfiles(Map, String)](dw.customer.CustomerMgr.md#searchprofilesmap-string) instead. +::: + +--- + +### queryProfiles(String, String, Object...) +- ~~static queryProfiles(queryString: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md)~~ + - : Searches for profile instances. + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + For a description of this query language, see the [queryProfile(String, Object...)](dw.customer.CustomerMgr.md#queryprofilestring-object) method. + + + + **This method is deprecated and will be removed in a future release.** + One of the following methods should be used instead: + [searchProfile(String, Object...)](dw.customer.CustomerMgr.md#searchprofilestring-object), + [searchProfiles(Map, String)](dw.customer.CustomerMgr.md#searchprofilesmap-string) and + [searchProfiles(String, String, Object...)](dw.customer.CustomerMgr.md#searchprofilesstring-string-object) to search for customers and + [processProfiles(Function, String, Object...)](dw.customer.CustomerMgr.md#processprofilesfunction-string-object) to search and process customers in jobs. + + + **Parameters:** + - queryString - the actual query. + - sortString - an optional sorting or null if no sorting is necessary. + - args - optional parameters for the query string. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **Deprecated:** +:::warning +use [searchProfiles(String, String, Object...)](dw.customer.CustomerMgr.md#searchprofilesstring-string-object) instead. +::: + +--- + +### removeCustomer(Customer) +- static removeCustomer(customer: [Customer](dw.customer.Customer.md)): void + - : Logs out the supplied customer and deletes the customer record. The customer must be a registered customer and the customer must currently be logged in. The customer must be + logged in for security reasons to ensure that only the customer itself can remove itself from the system. While logout the customers session is reset to an anonymous session and, if present, the "Remember me" cookie of the customer is removed. + Deleting the customer record includes the customer credentials, profile, address-book with all addresses, customer payment instruments, product lists and memberships in + customer groups. Orders placed by this customer won't be deleted. If the supplied customer is not a registered customer or is not logged in, the API throws an exception + + + **Parameters:** + - customer - The customer to remove, must not be null. + + +--- + +### removeCustomerTrackingData(Customer) +- static removeCustomerTrackingData(customer: [Customer](dw.customer.Customer.md)): void + - : Removes (asynchronously) tracking data for this customer (from external systems or data stores). This will not remove the + customer from the database, nor will it prevent tracking to start again in the future for this customer. + + The customer is identified by login / email /customerNo / cookie when its a registered customer, and by cookie + when its an anonymous customer. + + + **Parameters:** + - customer - the customer + + +--- + +### searchProfile(String, Object...) +- static searchProfile(queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [Profile](dw.customer.Profile.md) + - : + Searches for a single profile instance. + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + The following **operators** are supported in a condition: + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' + and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + + The query language provides a placeholder syntax to pass objects as + additional search parameters. Each passed object is related to a + placeholder in the query string. The placeholder must be an Integer that + is surrounded by braces. The first Integer value must be '0', the second + '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + + If there is more than one object matching the specified query criteria, the + result is not deterministic. In order to retrieve a single object from a sorted result + set it is recommended to use the following code: + `queryProfiles("", "custom.myAttr asc", null).first()`. + The method `first()` returns only the next element and closes the + iterator. + + + If the customer search API is configured to use the new Search Service, these differences apply: + + + - Search may match and return documents with missing (NULL) values in search fields, depending on how the query is structured, potentially leading to broader result sets. For example, a query like `custom.searchField != "some value"`also returns documents where `custom.searchField`is NULL — whereas in relational databases, such documents are excluded. + - Newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index) + - Wildcards are filtered from the query (\*, %, +) and replaced by spaces + - LIKE and ILIKE queries are executed as fulltext queries (working on whole words), not as substring searches + - LIKE queries are always case insensitive + - Using logical operators may change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined + - Using logical operators may result in degraded performance, depending on how they are combined + + + **Parameters:** + - queryString - the query string to use when searching for a profile. + - args - the query string arguments. + + **Returns:** + - the profile which was found when executing the `queryString`. + + +--- + +### searchProfiles(Map, String) +- static searchProfiles(queryAttributes: [Map](dw.util.Map.md), sortString: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + Searches for profile instances. + + + The search can be configured with a map, which key-value pairs are + converted into a query expression. The key-value pairs are turned into a + sequence of '=' or 'like' conditions, which are combined with AND + statements. + + + Example: + + A map with the key/value pairs: _'name'/'tom\*', 'age'/66_ + will be converted as follows: `"name like 'tom*' and age = 66"` + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + The **sorting** parameter is optional and may contain a comma separated list of + attribute names to sort by. Each sort attribute name may be followed by an + optional sort direction specifier ('asc' | 'desc'). Default sorting directions is + ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is + currently not supported. + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + + If the customer search API is configured to use the new Search Service, these differences apply: + + + - Search may match and return documents with missing (NULL) values in search fields, depending on how the query is structured, potentially leading to broader result sets. For example, a query like `custom.searchField != "some value"`also returns documents where `custom.searchField`is NULL — whereas in relational databases, such documents are excluded. + - Newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index) + - Wildcards are filtered from the query (\*, %, +) and replaced by spaces + - LIKE and ILIKE queries are executed as fulltext queries (working on whole words), not as substring searches + - LIKE queries are always case insensitive + - Using logical operators may change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined + - Using logical operators may result in degraded performance, depending on how they are combined + - The search returns only the first 1000 hits from the search result + + + **Parameters:** + - queryAttributes - key-value pairs that define the query. + - sortString - an optional sorting or null if no sorting is necessary. + + **Returns:** + - SeekableIterator containing the result set of the query. + + +--- + +### searchProfiles(String, String, Object...) +- static searchProfiles(queryString: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Searches for profile instances. + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + For a description of this query language, see the [searchProfile(String, Object...)](dw.customer.CustomerMgr.md#searchprofilestring-object) method. + + + If the customer search API is configured to use the new Search Service, these differences apply: + + + - Search may match and return documents with missing (NULL) values in search fields, depending on how the query is structured, potentially leading to broader result sets. For example, a query like `custom.searchField != "some value"`also returns documents where `custom.searchField`is NULL — whereas in relational databases, such documents are excluded. + - Newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index) + - Wildcards are filtered from the query (\*, %, +) and replaced by spaces + - LIKE and ILIKE queries are executed as fulltext queries (working on whole words), not as substring searches + - LIKE queries are always case insensitive + - Using logical operators may change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined + - Using logical operators may result in degraded performance, depending on how they are combined + - The search returns only the first 1000 hits from the search result + + + **Parameters:** + - queryString - the actual query. + - sortString - an optional sorting or null if no sorting is necessary. + - args - optional parameters for the query string. + + **Returns:** + - SeekableIterator containing the result set of the query. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPasswordConstraints.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPasswordConstraints.md new file mode 100644 index 00000000..9a0f5507 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPasswordConstraints.md @@ -0,0 +1,125 @@ + +# Class CustomerPasswordConstraints + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) + +Provides access to the constraints of customer passwords. An instance of this class can be obtained via [CustomerMgr.getPasswordConstraints()](dw.customer.CustomerMgr.md#getpasswordconstraints). + + +## Property Summary + +| Property | Description | +| --- | --- | +| [forceLetters](#forceletters): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if letters are enforced. | +| [forceMixedCase](#forcemixedcase): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if mixed case is enforced. | +| [forceNumbers](#forcenumbers): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if numbers are enforced. | +| [minLength](#minlength): [Number](TopLevel.Number.md) `(read-only)` | Returns the minimum length. | +| [minSpecialChars](#minspecialchars): [Number](TopLevel.Number.md) `(read-only)` | Returns the minimum number of special characters. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getMinLength](dw.customer.CustomerPasswordConstraints.md#getminlength)() | Returns the minimum length. | +| static [getMinSpecialChars](dw.customer.CustomerPasswordConstraints.md#getminspecialchars)() | Returns the minimum number of special characters. | +| static [isForceLetters](dw.customer.CustomerPasswordConstraints.md#isforceletters)() | Returns `true` if letters are enforced. | +| static [isForceMixedCase](dw.customer.CustomerPasswordConstraints.md#isforcemixedcase)() | Returns `true` if mixed case is enforced. | +| static [isForceNumbers](dw.customer.CustomerPasswordConstraints.md#isforcenumbers)() | Returns `true` if numbers are enforced. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### forceLetters +- forceLetters: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if letters are enforced. + + +--- + +### forceMixedCase +- forceMixedCase: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if mixed case is enforced. + + +--- + +### forceNumbers +- forceNumbers: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if numbers are enforced. + + +--- + +### minLength +- minLength: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the minimum length. + + +--- + +### minSpecialChars +- minSpecialChars: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the minimum number of special characters. + + +--- + +## Method Details + +### getMinLength() +- static getMinLength(): [Number](TopLevel.Number.md) + - : Returns the minimum length. + + **Returns:** + - the minimum length + + +--- + +### getMinSpecialChars() +- static getMinSpecialChars(): [Number](TopLevel.Number.md) + - : Returns the minimum number of special characters. + + **Returns:** + - the minimum number of special characters + + +--- + +### isForceLetters() +- static isForceLetters(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if letters are enforced. + + **Returns:** + - if letters are enforced + + +--- + +### isForceMixedCase() +- static isForceMixedCase(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if mixed case is enforced. + + **Returns:** + - if mixed case is enforced + + +--- + +### isForceNumbers() +- static isForceNumbers(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if numbers are enforced. + + **Returns:** + - if numbers are enforced + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPaymentInstrument.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPaymentInstrument.md new file mode 100644 index 00000000..210fffac --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerPaymentInstrument.md @@ -0,0 +1,161 @@ + +# Class CustomerPaymentInstrument + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.EncryptedObject](dw.customer.EncryptedObject.md) + - [dw.order.PaymentInstrument](dw.order.PaymentInstrument.md) + - [dw.customer.CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) + +Represents any payment instrument stored in the customers profile, such as +credit card or bank transfer. The object defines standard methods for credit +card payment, and can be extended by attributes appropriate for other +payment methods. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bankAccountDriversLicense](#bankaccountdriverslicense): [String](TopLevel.String.md) `(read-only)` | Returns the driver's license number of the bank account number if the calling context meets the following criteria:

    • If the method call happens in the context of a storefront request and the current customer is registered and authenticated, and the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS
    Otherwise, the method returns the masked driver's license number of the bank account. | +| [bankAccountNumber](#bankaccountnumber): [String](TopLevel.String.md) `(read-only)` | Returns the bank account number if the calling context meets the following criteria:
    • If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS
    Otherwise, the method returns the masked bank account number. | +| [creditCardNumber](#creditcardnumber): [String](TopLevel.String.md) `(read-only)` | Returns the decrypted credit card number if the calling context meets the following criteria:
    • If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBankAccountDriversLicense](dw.customer.CustomerPaymentInstrument.md#getbankaccountdriverslicense)() | Returns the driver's license number of the bank account number if the calling context meets the following criteria:
      • If the method call happens in the context of a storefront request and the current customer is registered and authenticated, and the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS
      Otherwise, the method returns the masked driver's license number of the bank account. | +| [getBankAccountNumber](dw.customer.CustomerPaymentInstrument.md#getbankaccountnumber)() | Returns the bank account number if the calling context meets the following criteria:
      • If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS
      Otherwise, the method returns the masked bank account number. | +| [getCreditCardNumber](dw.customer.CustomerPaymentInstrument.md#getcreditcardnumber)() | Returns the decrypted credit card number if the calling context meets the following criteria:
      • If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS. | + +### Methods inherited from class PaymentInstrument + +[getBankAccountDriversLicense](dw.order.PaymentInstrument.md#getbankaccountdriverslicense), [getBankAccountDriversLicenseLastDigits](dw.order.PaymentInstrument.md#getbankaccountdriverslicenselastdigits), [getBankAccountDriversLicenseLastDigits](dw.order.PaymentInstrument.md#getbankaccountdriverslicenselastdigitsnumber), [getBankAccountDriversLicenseStateCode](dw.order.PaymentInstrument.md#getbankaccountdriverslicensestatecode), [getBankAccountHolder](dw.order.PaymentInstrument.md#getbankaccountholder), [getBankAccountNumber](dw.order.PaymentInstrument.md#getbankaccountnumber), [getBankAccountNumberLastDigits](dw.order.PaymentInstrument.md#getbankaccountnumberlastdigits), [getBankAccountNumberLastDigits](dw.order.PaymentInstrument.md#getbankaccountnumberlastdigitsnumber), [getBankRoutingNumber](dw.order.PaymentInstrument.md#getbankroutingnumber), [getCreditCardExpirationMonth](dw.order.PaymentInstrument.md#getcreditcardexpirationmonth), [getCreditCardExpirationYear](dw.order.PaymentInstrument.md#getcreditcardexpirationyear), [getCreditCardHolder](dw.order.PaymentInstrument.md#getcreditcardholder), [getCreditCardIssueNumber](dw.order.PaymentInstrument.md#getcreditcardissuenumber), [getCreditCardNumber](dw.order.PaymentInstrument.md#getcreditcardnumber), [getCreditCardNumberLastDigits](dw.order.PaymentInstrument.md#getcreditcardnumberlastdigits), [getCreditCardNumberLastDigits](dw.order.PaymentInstrument.md#getcreditcardnumberlastdigitsnumber), [getCreditCardToken](dw.order.PaymentInstrument.md#getcreditcardtoken), [getCreditCardType](dw.order.PaymentInstrument.md#getcreditcardtype), [getCreditCardValidFromMonth](dw.order.PaymentInstrument.md#getcreditcardvalidfrommonth), [getCreditCardValidFromYear](dw.order.PaymentInstrument.md#getcreditcardvalidfromyear), [getEncryptedBankAccountDriversLicense](dw.order.PaymentInstrument.md#getencryptedbankaccountdriverslicensestring-string), [getEncryptedBankAccountNumber](dw.order.PaymentInstrument.md#getencryptedbankaccountnumberstring-string), [getEncryptedCreditCardNumber](dw.order.PaymentInstrument.md#getencryptedcreditcardnumberstring-certificateref), [getEncryptedCreditCardNumber](dw.order.PaymentInstrument.md#getencryptedcreditcardnumberstring-string), [getGiftCertificateCode](dw.order.PaymentInstrument.md#getgiftcertificatecode), [getGiftCertificateID](dw.order.PaymentInstrument.md#getgiftcertificateid), [getMaskedBankAccountDriversLicense](dw.order.PaymentInstrument.md#getmaskedbankaccountdriverslicense), [getMaskedBankAccountDriversLicense](dw.order.PaymentInstrument.md#getmaskedbankaccountdriverslicensenumber), [getMaskedBankAccountNumber](dw.order.PaymentInstrument.md#getmaskedbankaccountnumber), [getMaskedBankAccountNumber](dw.order.PaymentInstrument.md#getmaskedbankaccountnumbernumber), [getMaskedCreditCardNumber](dw.order.PaymentInstrument.md#getmaskedcreditcardnumber), [getMaskedCreditCardNumber](dw.order.PaymentInstrument.md#getmaskedcreditcardnumbernumber), [getMaskedGiftCertificateCode](dw.order.PaymentInstrument.md#getmaskedgiftcertificatecode), [getMaskedGiftCertificateCode](dw.order.PaymentInstrument.md#getmaskedgiftcertificatecodenumber), [getPaymentMethod](dw.order.PaymentInstrument.md#getpaymentmethod), [isCreditCardExpired](dw.order.PaymentInstrument.md#iscreditcardexpired), [isPermanentlyMasked](dw.order.PaymentInstrument.md#ispermanentlymasked), [setBankAccountDriversLicense](dw.order.PaymentInstrument.md#setbankaccountdriverslicensestring), [setBankAccountDriversLicenseStateCode](dw.order.PaymentInstrument.md#setbankaccountdriverslicensestatecodestring), [setBankAccountHolder](dw.order.PaymentInstrument.md#setbankaccountholderstring), [setBankAccountNumber](dw.order.PaymentInstrument.md#setbankaccountnumberstring), [setBankRoutingNumber](dw.order.PaymentInstrument.md#setbankroutingnumberstring), [setCreditCardExpirationMonth](dw.order.PaymentInstrument.md#setcreditcardexpirationmonthnumber), [setCreditCardExpirationYear](dw.order.PaymentInstrument.md#setcreditcardexpirationyearnumber), [setCreditCardHolder](dw.order.PaymentInstrument.md#setcreditcardholderstring), [setCreditCardIssueNumber](dw.order.PaymentInstrument.md#setcreditcardissuenumberstring), [setCreditCardNumber](dw.order.PaymentInstrument.md#setcreditcardnumberstring), [setCreditCardToken](dw.order.PaymentInstrument.md#setcreditcardtokenstring), [setCreditCardType](dw.order.PaymentInstrument.md#setcreditcardtypestring), [setCreditCardValidFromMonth](dw.order.PaymentInstrument.md#setcreditcardvalidfrommonthnumber), [setCreditCardValidFromYear](dw.order.PaymentInstrument.md#setcreditcardvalidfromyearnumber), [setGiftCertificateCode](dw.order.PaymentInstrument.md#setgiftcertificatecodestring), [setGiftCertificateID](dw.order.PaymentInstrument.md#setgiftcertificateidstring) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bankAccountDriversLicense +- bankAccountDriversLicense: [String](TopLevel.String.md) `(read-only)` + - : Returns the driver's license number of the bank account number + if the calling context meets the following criteria: + + + - If the method call happens in the context of a storefront request and the current customer is registered and authenticated, and the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS + + Otherwise, the method returns the masked driver's license number of the bank account. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + +### bankAccountNumber +- bankAccountNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank account number if the calling context meets + the following criteria: + + + - If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS + + Otherwise, the method returns the masked bank account number. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + +### creditCardNumber +- creditCardNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the decrypted credit card number if the calling context meets + the following criteria: + + + - If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS. + + Otherwise, the method returns the masked credit card number. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + +## Method Details + +### getBankAccountDriversLicense() +- getBankAccountDriversLicense(): [String](TopLevel.String.md) + - : Returns the driver's license number of the bank account number + if the calling context meets the following criteria: + + + - If the method call happens in the context of a storefront request and the current customer is registered and authenticated, and the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS + + Otherwise, the method returns the masked driver's license number of the bank account. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + +### getBankAccountNumber() +- getBankAccountNumber(): [String](TopLevel.String.md) + - : Returns the bank account number if the calling context meets + the following criteria: + + + - If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS + + Otherwise, the method returns the masked bank account number. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + +### getCreditCardNumber() +- getCreditCardNumber(): [String](TopLevel.String.md) + - : Returns the decrypted credit card number if the calling context meets + the following criteria: + + + - If the method call happens in the context of a storefront request, the current customer is registered and authenticated, the payment instrument is associated to the profile of the current customer, and the current protocol is HTTPS. + + Otherwise, the method returns the masked credit card number. + + + **Note:** this method handles sensitive financial and card holder data. + Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerStatusCodes.md new file mode 100644 index 00000000..1d9e4a78 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.CustomerStatusCodes.md @@ -0,0 +1,55 @@ + +# Class CustomerStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.CustomerStatusCodes](dw.customer.CustomerStatusCodes.md) + +CustomerStatusCodes contains constants representing +status codes that can be used with a Status object to +indicate the success or failure of an operation. + + +**See Also:** +- [Status](dw.system.Status.md) + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST](#customer_address_referenced_by_product_list): [String](TopLevel.String.md) = "CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST" | Indicates that an error occurred when trying to perform an operation on an address that is currently associated with a product list. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CustomerStatusCodes](#customerstatuscodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST + +- CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST: [String](TopLevel.String.md) = "CUSTOMER_ADDRESS_REFERENCED_BY_PRODUCT_LIST" + - : Indicates that an error occurred when trying to perform + an operation on an address that is currently associated + with a product list. + + + +--- + +## Constructor Details + +### CustomerStatusCodes() +- CustomerStatusCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.EncryptedObject.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.EncryptedObject.md new file mode 100644 index 00000000..5e734e5d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.EncryptedObject.md @@ -0,0 +1,34 @@ + +# Class EncryptedObject + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.EncryptedObject](dw.customer.EncryptedObject.md) + +Defines a API base class for classes containing +encrypted attributes like credit cards. + + +**Note:** this method handles sensitive financial and card holder data. +Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9. + + + +## All Known Subclasses +[CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md), [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [PaymentInstrument](dw.order.PaymentInstrument.md), [Profile](dw.customer.Profile.md), [ServiceCredential](dw.svc.ServiceCredential.md) +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ExternalProfile.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ExternalProfile.md new file mode 100644 index 00000000..a1347527 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ExternalProfile.md @@ -0,0 +1,154 @@ + +# Class ExternalProfile + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.ExternalProfile](dw.customer.ExternalProfile.md) + +Represents the credentials of a customer. + +Since 13.6 it is possible to have customers who are not authenticated through a +login and password but through an external authentication provider via the OAuth2 protocol. + +In such cases, the AuthenticationProviderID will point to an OAuth provider configured in the system +and the ExternalID will be the unique identifier of the customer on the Authentication Provider's system. + +For example, if an authentication provider with ID "Google123" is configured pointing to Google +and the customer has a logged in into Google in the past and has created a profile there, Google +assigns a unique number identifier to that customer. If the storefront is configured to allow +authentication through Google and a new customer logs into the storefront using Google, +the AuthenticationProviderID property of his Credentials will contain "Google123" and +the ExternalID property will contain whatever unique identifier Google has assigned to him. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [authenticationProviderID](#authenticationproviderid): [String](TopLevel.String.md) `(read-only)` | Returns the authentication provider ID. | +| [customer](#customer): [Customer](dw.customer.Customer.md) `(read-only)` | Returns the customer object related to this profile. | +| [email](#email): [String](TopLevel.String.md) | Returns the customer's email address. | +| [externalID](#externalid): [String](TopLevel.String.md) `(read-only)` | Returns the external ID. | +| [lastLoginTime](#lastlogintime): [Date](TopLevel.Date.md) `(read-only)` | Returns the last login time of the customer through the external provider | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAuthenticationProviderID](dw.customer.ExternalProfile.md#getauthenticationproviderid)() | Returns the authentication provider ID. | +| [getCustomer](dw.customer.ExternalProfile.md#getcustomer)() | Returns the customer object related to this profile. | +| [getEmail](dw.customer.ExternalProfile.md#getemail)() | Returns the customer's email address. | +| [getExternalID](dw.customer.ExternalProfile.md#getexternalid)() | Returns the external ID. | +| [getLastLoginTime](dw.customer.ExternalProfile.md#getlastlogintime)() | Returns the last login time of the customer through the external provider | +| [setEmail](dw.customer.ExternalProfile.md#setemailstring)([String](TopLevel.String.md)) | Sets the customer's email address. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### authenticationProviderID +- authenticationProviderID: [String](TopLevel.String.md) `(read-only)` + - : Returns the authentication provider ID. + + +--- + +### customer +- customer: [Customer](dw.customer.Customer.md) `(read-only)` + - : Returns the customer object related to this profile. + + +--- + +### email +- email: [String](TopLevel.String.md) + - : Returns the customer's email address. + + +--- + +### externalID +- externalID: [String](TopLevel.String.md) `(read-only)` + - : Returns the external ID. + + +--- + +### lastLoginTime +- lastLoginTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the last login time of the customer through the external provider + + +--- + +## Method Details + +### getAuthenticationProviderID() +- getAuthenticationProviderID(): [String](TopLevel.String.md) + - : Returns the authentication provider ID. + + **Returns:** + - the authentication provider ID. + + +--- + +### getCustomer() +- getCustomer(): [Customer](dw.customer.Customer.md) + - : Returns the customer object related to this profile. + + **Returns:** + - customer object related to profile. + + +--- + +### getEmail() +- getEmail(): [String](TopLevel.String.md) + - : Returns the customer's email address. + + **Returns:** + - the customer's email address. + + +--- + +### getExternalID() +- getExternalID(): [String](TopLevel.String.md) + - : Returns the external ID. + + **Returns:** + - the external ID. + + +--- + +### getLastLoginTime() +- getLastLoginTime(): [Date](TopLevel.Date.md) + - : Returns the last login time of the customer through the external provider + + **Returns:** + - the time, when the customer was last logged in through this external provider + + +--- + +### setEmail(String) +- setEmail(email: [String](TopLevel.String.md)): void + - : Sets the customer's email address. + + **Parameters:** + - email - the customer's email address. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.OrderHistory.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.OrderHistory.md new file mode 100644 index 00000000..1c2c5c3a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.OrderHistory.md @@ -0,0 +1,167 @@ + +# Class OrderHistory + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.OrderHistory](dw.customer.OrderHistory.md) + +The class provides access to past orders of the customer. + + +**Note:** This class allows access to sensitive financial and cardholder data. Pay special attention to PCI DSS +v3. requirements 1, 3, 7, and 9. It also allows access to sensitive personal and private information. Pay attention +to appropriate legal and regulatory requirements related to this data. +**Note:** The following methods do not work with Salesforce Order Management orders. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [orderCount](#ordercount): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of orders the customer has placed in the store. | +| [orders](#orders): [SeekableIterator](dw.util.SeekableIterator.md) `(read-only)` | Retrieves the order history for the customer in the current storefront site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getOrderCount](dw.customer.OrderHistory.md#getordercount)() | Returns the number of orders the customer has placed in the store. | +| [getOrders](dw.customer.OrderHistory.md#getorders)() | Retrieves the order history for the customer in the current storefront site. | +| [getOrders](dw.customer.OrderHistory.md#getordersstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Retrieves the order history for the customer in the current storefront site. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### orderCount +- orderCount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of orders the customer has placed in the store. + + + If the customer is anonymous, this method always returns zero. If an active data record is available for this + customer, the orders count is retrieved from that record, otherwise a real-time query is used to get the count. + + + +--- + +### orders +- orders: [SeekableIterator](dw.util.SeekableIterator.md) `(read-only)` + - : Retrieves the order history for the customer in the current storefront site. + + + If the result exceeds 1000 orders, only the first 1000 orders are retrieved. Same as + + + ``` + orderHistory.getOrders( null, "creationDate DESC" ) + ``` + + + + + + It is strongly recommended to call `[SeekableIterator.close()](dw.util.SeekableIterator.md#close)` on the returned + SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system + resources. + + + **See Also:** + - [getOrders(String, String, Object...)](dw.customer.OrderHistory.md#getordersstring-string-object) + + +--- + +## Method Details + +### getOrderCount() +- getOrderCount(): [Number](TopLevel.Number.md) + - : Returns the number of orders the customer has placed in the store. + + + If the customer is anonymous, this method always returns zero. If an active data record is available for this + customer, the orders count is retrieved from that record, otherwise a real-time query is used to get the count. + + + **Returns:** + - the number of orders the customer has placed in the store. + + +--- + +### getOrders() +- getOrders(): [SeekableIterator](dw.util.SeekableIterator.md) + - : Retrieves the order history for the customer in the current storefront site. + + + If the result exceeds 1000 orders, only the first 1000 orders are retrieved. Same as + + + ``` + orderHistory.getOrders( null, "creationDate DESC" ) + ``` + + + + + + It is strongly recommended to call `[SeekableIterator.close()](dw.util.SeekableIterator.md#close)` on the returned + SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system + resources. + + + **Returns:** + - the orders + + **See Also:** + - [getOrders(String, String, Object...)](dw.customer.OrderHistory.md#getordersstring-string-object) + + +--- + +### getOrders(String, String, Object...) +- getOrders(query: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), params: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Retrieves the order history for the customer in the current storefront site. + + + If the result exceeds 1000 orders, only the first 1000 orders are retrieved. Optionally, you can retrieve a subset + of the orders by specifying a query. At maximum 3 expressions are allowed to be specified and no custom attribute + expressions are allowed. + + + + + It is strongly recommended to call `[SeekableIterator.close()](dw.util.SeekableIterator.md#close)` on the returned + SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system + resources. + + + Example: + + + ``` + var orderHistory : dw.customer.OrderHistory = customer.getOrderHistory(); + var orders = orderHistory.getOrders("status = {0}", "creationDate DESC", dw.order.Order.ORDER_STATUS_NEW); + for each (var order : dw.order.Order in orders) { + // ... process orders + } + orders.close(); + ``` + + + **Parameters:** + - query - optional query + - sortString - optional sort string + - params - optional parameters for the query + + **Returns:** + - the orders + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductList.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductList.md new file mode 100644 index 00000000..e2985c2e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductList.md @@ -0,0 +1,870 @@ + +# Class ProductList + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.ProductList](dw.customer.ProductList.md) + +Represents a list of products (and optionally a gift certificate) that is +typically maintained by a customer. This class can be used to implement +a number of different storefront features, e.g. shopping list, wish list and gift registry. +A product list is always owned by a customer. The owner can be anonymous or a registered customer. +The owner can be the person for which items from that list will be purchased (wish list). +Or it can be a person who maintains the list, for example a gift registry, on behalf of the bridal couple. +Each product list can have a registrant and a co-registrant. A registrant is typically associated with an event related product list +such as a gift registry. It holds information about a person associated with the +event such as a bride or groom. +A shipping address can be associated with this product list to ship the items, +e.g. to an event location. A post-event shipping address can be associated to +ship items to which could not be delivered on event date. +The product list can also hold information about the event date and event location. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [EXPORT_STATUS_EXPORTED](#export_status_exported): [Number](TopLevel.Number.md) = 1 | Constant for when Export Status is Exported | +| [EXPORT_STATUS_NOTEXPORTED](#export_status_notexported): [Number](TopLevel.Number.md) = 0 | Constant for when Export Status is Not Exported | +| [TYPE_CUSTOM_1](#type_custom_1): [Number](TopLevel.Number.md) = 100 | Constant representing a custom list type attribute. | +| [TYPE_CUSTOM_2](#type_custom_2): [Number](TopLevel.Number.md) = 101 | Constant representing a custom list type attribute. | +| [TYPE_CUSTOM_3](#type_custom_3): [Number](TopLevel.Number.md) = 102 | Constant representing a custom list type attribute. | +| [TYPE_GIFT_REGISTRY](#type_gift_registry): [Number](TopLevel.Number.md) = 11 | Constant representing the gift registry type attribute. | +| [TYPE_SHOPPING_LIST](#type_shopping_list): [Number](TopLevel.Number.md) = 12 | Constant representing the shopping list type attribute. | +| [TYPE_WISH_LIST](#type_wish_list): [Number](TopLevel.Number.md) = 10 | Constant representing the wish list registry type attribute. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique system generated ID of the object. | +| [anonymous](#anonymous): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if this product list is owned by an anonymous customer. | +| [coRegistrant](#coregistrant): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) `(read-only)` | Returns the ProductListRegistrant assigned to the coRegistrant attribute or null if this list has no co-registrant. | +| [currentShippingAddress](#currentshippingaddress): [CustomerAddress](dw.customer.CustomerAddress.md) `(read-only)` | This is a helper method typically used with an event related list. | +| [description](#description): [String](TopLevel.String.md) | Returns a description text that, for example, explains the purpose of this product list. | +| [eventCity](#eventcity): [String](TopLevel.String.md) | For event related uses (e.g. | +| [eventCountry](#eventcountry): [String](TopLevel.String.md) | For event related uses (e.g. | +| [eventDate](#eventdate): [Date](TopLevel.Date.md) | For event related uses (e.g. | +| [eventState](#eventstate): [String](TopLevel.String.md) | For event related uses (e.g. | +| [eventType](#eventtype): [String](TopLevel.String.md) | For event related uses (e.g. | +| [exportStatus](#exportstatus): [EnumValue](dw.value.EnumValue.md) `(read-only)` | Returns the export status of the product list.
        Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.customer.ProductList.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.customer.ProductList.md#export_status_exported). | +| [giftCertificateItem](#giftcertificateitem): [ProductListItem](dw.customer.ProductListItem.md) `(read-only)` | Returns the item in the list that represents a gift certificate. | +| [items](#items): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing all items in the list. | +| [lastExportTime](#lastexporttime): [Date](TopLevel.Date.md) `(read-only)` | Returns the date where this product list has been exported successfully the last time. | +| [name](#name): [String](TopLevel.String.md) | Returns the name of this product list given by its owner. | +| [owner](#owner): [Customer](dw.customer.Customer.md) `(read-only)` | Returns the customer that created and owns the product list. | +| [postEventShippingAddress](#posteventshippingaddress): [CustomerAddress](dw.customer.CustomerAddress.md) | Returns the shipping address for purchases made after the event date. | +| [productItems](#productitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing all items in the list that reference products. | +| [public](#public): [Boolean](TopLevel.Boolean.md) | A flag, typically used to determine if the object is searchable by other customers. | +| [publicItems](#publicitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing all items in the list that are flagged as public. | +| [purchases](#purchases): [Collection](dw.util.Collection.md) `(read-only)` | Returns the aggregated purchases from all the individual items. | +| [registrant](#registrant): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) `(read-only)` | Returns the ProductListRegistrant assigned to the registrant attribute or null if this list has no registrant. | +| [shippingAddress](#shippingaddress): [CustomerAddress](dw.customer.CustomerAddress.md) | Return the address that should be used as the shipping address for purchases made from the list. | +| [type](#type): [Number](TopLevel.Number.md) `(read-only)` | Returns an int representing the type of object (e.g. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createCoRegistrant](dw.customer.ProductList.md#createcoregistrant)() | Create a ProductListRegistrant and assign it to the coRegistrant attribute of the list. | +| [createGiftCertificateItem](dw.customer.ProductList.md#creategiftcertificateitem)() | Create an item in the list that represents a gift certificate. | +| [createProductItem](dw.customer.ProductList.md#createproductitemproduct)([Product](dw.catalog.Product.md)) | Create an item in the list that references the specified product. | +| [createRegistrant](dw.customer.ProductList.md#createregistrant)() | Create a ProductListRegistrant and assign it to the registrant attribute of the list. | +| [getCoRegistrant](dw.customer.ProductList.md#getcoregistrant)() | Returns the ProductListRegistrant assigned to the coRegistrant attribute or null if this list has no co-registrant. | +| [getCurrentShippingAddress](dw.customer.ProductList.md#getcurrentshippingaddress)() | This is a helper method typically used with an event related list. | +| [getDescription](dw.customer.ProductList.md#getdescription)() | Returns a description text that, for example, explains the purpose of this product list. | +| [getEventCity](dw.customer.ProductList.md#geteventcity)() | For event related uses (e.g. | +| [getEventCountry](dw.customer.ProductList.md#geteventcountry)() | For event related uses (e.g. | +| [getEventDate](dw.customer.ProductList.md#geteventdate)() | For event related uses (e.g. | +| [getEventState](dw.customer.ProductList.md#geteventstate)() | For event related uses (e.g. | +| [getEventType](dw.customer.ProductList.md#geteventtype)() | For event related uses (e.g. | +| [getExportStatus](dw.customer.ProductList.md#getexportstatus)() | Returns the export status of the product list.
        Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.customer.ProductList.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.customer.ProductList.md#export_status_exported). | +| [getGiftCertificateItem](dw.customer.ProductList.md#getgiftcertificateitem)() | Returns the item in the list that represents a gift certificate. | +| [getID](dw.customer.ProductList.md#getid)() | Returns the unique system generated ID of the object. | +| [getItem](dw.customer.ProductList.md#getitemstring)([String](TopLevel.String.md)) | Returns the item from the list that has the specified ID. | +| [getItems](dw.customer.ProductList.md#getitems)() | Returns a collection containing all items in the list. | +| [getLastExportTime](dw.customer.ProductList.md#getlastexporttime)() | Returns the date where this product list has been exported successfully the last time. | +| [getName](dw.customer.ProductList.md#getname)() | Returns the name of this product list given by its owner. | +| [getOwner](dw.customer.ProductList.md#getowner)() | Returns the customer that created and owns the product list. | +| [getPostEventShippingAddress](dw.customer.ProductList.md#getposteventshippingaddress)() | Returns the shipping address for purchases made after the event date. | +| [getProductItems](dw.customer.ProductList.md#getproductitems)() | Returns a collection containing all items in the list that reference products. | +| [getPublicItems](dw.customer.ProductList.md#getpublicitems)() | Returns a collection containing all items in the list that are flagged as public. | +| [getPurchases](dw.customer.ProductList.md#getpurchases)() | Returns the aggregated purchases from all the individual items. | +| [getRegistrant](dw.customer.ProductList.md#getregistrant)() | Returns the ProductListRegistrant assigned to the registrant attribute or null if this list has no registrant. | +| [getShippingAddress](dw.customer.ProductList.md#getshippingaddress)() | Return the address that should be used as the shipping address for purchases made from the list. | +| [getType](dw.customer.ProductList.md#gettype)() | Returns an int representing the type of object (e.g. | +| [isAnonymous](dw.customer.ProductList.md#isanonymous)() | Returns true if this product list is owned by an anonymous customer. | +| [isPublic](dw.customer.ProductList.md#ispublic)() | A flag, typically used to determine if the object is searchable by other customers. | +| [removeCoRegistrant](dw.customer.ProductList.md#removecoregistrant)() | Removes the ProductListRegistrant assigned to the coRegistrant attribute. | +| [removeItem](dw.customer.ProductList.md#removeitemproductlistitem)([ProductListItem](dw.customer.ProductListItem.md)) | Removes the specified item from the list. | +| [removeRegistrant](dw.customer.ProductList.md#removeregistrant)() | Removes the ProductListRegistrant assigned to the registrant attribute. | +| [setDescription](dw.customer.ProductList.md#setdescriptionstring)([String](TopLevel.String.md)) | Set the description of this product list. | +| [setEventCity](dw.customer.ProductList.md#seteventcitystring)([String](TopLevel.String.md)) | Set the event city to which this product list is related. | +| [setEventCountry](dw.customer.ProductList.md#seteventcountrystring)([String](TopLevel.String.md)) | Set the event country to which this product list is related. | +| [setEventDate](dw.customer.ProductList.md#seteventdatedate)([Date](TopLevel.Date.md)) | Set the date of the event to which this product list is related. | +| [setEventState](dw.customer.ProductList.md#seteventstatestring)([String](TopLevel.String.md)) | Set the event state to which this product list is related. | +| [setEventType](dw.customer.ProductList.md#seteventtypestring)([String](TopLevel.String.md)) | Set the event type for which this product list was created by the owner. | +| [setName](dw.customer.ProductList.md#setnamestring)([String](TopLevel.String.md)) | Set the name of this product list. | +| [setPostEventShippingAddress](dw.customer.ProductList.md#setposteventshippingaddresscustomeraddress)([CustomerAddress](dw.customer.CustomerAddress.md)) | This is typically used by an event related list (e.g. | +| [setPublic](dw.customer.ProductList.md#setpublicboolean)([Boolean](TopLevel.Boolean.md)) | Makes this product list visible to other customers or hides it. | +| [setShippingAddress](dw.customer.ProductList.md#setshippingaddresscustomeraddress)([CustomerAddress](dw.customer.CustomerAddress.md)) | Associate an address, used as the shipping address for purchases made from the list. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### EXPORT_STATUS_EXPORTED + +- EXPORT_STATUS_EXPORTED: [Number](TopLevel.Number.md) = 1 + - : Constant for when Export Status is Exported + + +--- + +### EXPORT_STATUS_NOTEXPORTED + +- EXPORT_STATUS_NOTEXPORTED: [Number](TopLevel.Number.md) = 0 + - : Constant for when Export Status is Not Exported + + +--- + +### TYPE_CUSTOM_1 + +- TYPE_CUSTOM_1: [Number](TopLevel.Number.md) = 100 + - : Constant representing a custom list type attribute. + + +--- + +### TYPE_CUSTOM_2 + +- TYPE_CUSTOM_2: [Number](TopLevel.Number.md) = 101 + - : Constant representing a custom list type attribute. + + +--- + +### TYPE_CUSTOM_3 + +- TYPE_CUSTOM_3: [Number](TopLevel.Number.md) = 102 + - : Constant representing a custom list type attribute. + + +--- + +### TYPE_GIFT_REGISTRY + +- TYPE_GIFT_REGISTRY: [Number](TopLevel.Number.md) = 11 + - : Constant representing the gift registry type attribute. + + +--- + +### TYPE_SHOPPING_LIST + +- TYPE_SHOPPING_LIST: [Number](TopLevel.Number.md) = 12 + - : Constant representing the shopping list type attribute. + + +--- + +### TYPE_WISH_LIST + +- TYPE_WISH_LIST: [Number](TopLevel.Number.md) = 10 + - : Constant representing the wish list registry type attribute. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique system generated ID of the object. + + +--- + +### anonymous +- anonymous: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if this product list is owned by an anonymous customer. + + +--- + +### coRegistrant +- coRegistrant: [ProductListRegistrant](dw.customer.ProductListRegistrant.md) `(read-only)` + - : Returns the ProductListRegistrant assigned to the coRegistrant attribute or null + if this list has no co-registrant. + + + +--- + +### currentShippingAddress +- currentShippingAddress: [CustomerAddress](dw.customer.CustomerAddress.md) `(read-only)` + - : This is a helper method typically used with an event related list. + It provides the appropriate shipping address based on the eventDate. + If the current date is after the eventDate, then the postEventShippingAddress + is returned, otherwise the shippingAddress is returned. If the eventDate + is null, then null is returned. + + + +--- + +### description +- description: [String](TopLevel.String.md) + - : Returns a description text that, for example, explains the purpose of this product list. + + +--- + +### eventCity +- eventCity: [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event city. + + +--- + +### eventCountry +- eventCountry: [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event country. + + +--- + +### eventDate +- eventDate: [Date](TopLevel.Date.md) + - : For event related uses (e.g. gift registry), this holds the date + of the event. + + + +--- + +### eventState +- eventState: [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event state. + + +--- + +### eventType +- eventType: [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the type + of event, e.g. Wedding, Baby Shower. + + + +--- + +### exportStatus +- exportStatus: [EnumValue](dw.value.EnumValue.md) `(read-only)` + - : Returns the export status of the product list. + + Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.customer.ProductList.md#export_status_notexported), + [EXPORT_STATUS_EXPORTED](dw.customer.ProductList.md#export_status_exported). + + + +--- + +### giftCertificateItem +- giftCertificateItem: [ProductListItem](dw.customer.ProductListItem.md) `(read-only)` + - : Returns the item in the list that represents a gift certificate. + + +--- + +### items +- items: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing all items in the list. + + +--- + +### lastExportTime +- lastExportTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date where this product list has been exported successfully + the last time. + + + +--- + +### name +- name: [String](TopLevel.String.md) + - : Returns the name of this product list given by its owner. + + +--- + +### owner +- owner: [Customer](dw.customer.Customer.md) `(read-only)` + - : Returns the customer that created and owns the product list. + + +--- + +### postEventShippingAddress +- postEventShippingAddress: [CustomerAddress](dw.customer.CustomerAddress.md) + - : Returns the shipping address for purchases made after the event date. + + +--- + +### productItems +- productItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing all items in the list that reference products. + + +--- + +### public +- public: [Boolean](TopLevel.Boolean.md) + - : A flag, typically used to determine if the object is searchable + by other customers. + + + +--- + +### publicItems +- publicItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing all items in the list that are flagged as public. + + +--- + +### purchases +- purchases: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the aggregated purchases from all the individual items. + + +--- + +### registrant +- registrant: [ProductListRegistrant](dw.customer.ProductListRegistrant.md) `(read-only)` + - : Returns the ProductListRegistrant assigned to the registrant attribute or null + if this list has no registrant. + + + +--- + +### shippingAddress +- shippingAddress: [CustomerAddress](dw.customer.CustomerAddress.md) + - : Return the address that should be used as the shipping address for purchases + made from the list. + + + +--- + +### type +- type: [Number](TopLevel.Number.md) `(read-only)` + - : Returns an int representing the type of object (e.g. wish list, + gift registry). This is set at object creation time. + + + +--- + +## Method Details + +### createCoRegistrant() +- createCoRegistrant(): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) + - : Create a ProductListRegistrant and assign it to the coRegistrant attribute + of the list. An exception is thrown if the list already has a coRegistrant + assigned to it. + + + **Returns:** + - the created ProductListRegistrant instance. + + **Throws:** + - CreateException - if one already exists + + +--- + +### createGiftCertificateItem() +- createGiftCertificateItem(): [ProductListItem](dw.customer.ProductListItem.md) + - : Create an item in the list that represents a gift certificate. + A list may only contain a single gift certificate, so an exception + is thrown if one already exists in the list. + + + **Returns:** + - the created item. + + **Throws:** + - CreateException - if a gift certificate item already exists in the list. + + +--- + +### createProductItem(Product) +- createProductItem(product: [Product](dw.catalog.Product.md)): [ProductListItem](dw.customer.ProductListItem.md) + - : Create an item in the list that references the specified product. + + **Parameters:** + - product - the product to use to create the list item. + + **Returns:** + - the created item. + + +--- + +### createRegistrant() +- createRegistrant(): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) + - : Create a ProductListRegistrant and assign it to the registrant attribute + of the list. An exception is thrown if the list already has a registrant + assigned to it. + + + **Returns:** + - the created ProductListRegistrant instance. + + **Throws:** + - CreateException - if one already exists + + +--- + +### getCoRegistrant() +- getCoRegistrant(): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) + - : Returns the ProductListRegistrant assigned to the coRegistrant attribute or null + if this list has no co-registrant. + + + **Returns:** + - the ProductListRegistrant assigned to the coRegistrant attribute or null + if this list has no co-registrant. + + + +--- + +### getCurrentShippingAddress() +- getCurrentShippingAddress(): [CustomerAddress](dw.customer.CustomerAddress.md) + - : This is a helper method typically used with an event related list. + It provides the appropriate shipping address based on the eventDate. + If the current date is after the eventDate, then the postEventShippingAddress + is returned, otherwise the shippingAddress is returned. If the eventDate + is null, then null is returned. + + + **Returns:** + - the appropriate address, as described above. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns a description text that, for example, explains the purpose of this product list. + + **Returns:** + - a description text explaining the purpose of this product list. + Returns an empty string if the description is not set. + + + +--- + +### getEventCity() +- getEventCity(): [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event city. + + **Returns:** + - the event city. The event city or an empty string if no event city is set. + + +--- + +### getEventCountry() +- getEventCountry(): [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event country. + + **Returns:** + - the event country. The event country or an empty string if no event country is set. + + +--- + +### getEventDate() +- getEventDate(): [Date](TopLevel.Date.md) + - : For event related uses (e.g. gift registry), this holds the date + of the event. + + + **Returns:** + - the date of the event. + + +--- + +### getEventState() +- getEventState(): [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the event state. + + **Returns:** + - the event state. The event state or an empty string if no event state is set. + + +--- + +### getEventType() +- getEventType(): [String](TopLevel.String.md) + - : For event related uses (e.g. gift registry), this holds the type + of event, e.g. Wedding, Baby Shower. + + + **Returns:** + - the type of event. Returns an empty string, if not set. + + +--- + +### getExportStatus() +- getExportStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the export status of the product list. + + Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.customer.ProductList.md#export_status_notexported), + [EXPORT_STATUS_EXPORTED](dw.customer.ProductList.md#export_status_exported). + + + **Returns:** + - Product list export status + + +--- + +### getGiftCertificateItem() +- getGiftCertificateItem(): [ProductListItem](dw.customer.ProductListItem.md) + - : Returns the item in the list that represents a gift certificate. + + **Returns:** + - the gift certificate item, or null if it doesn't exist. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique system generated ID of the object. + + **Returns:** + - the ID of object. + + +--- + +### getItem(String) +- getItem(ID: [String](TopLevel.String.md)): [ProductListItem](dw.customer.ProductListItem.md) + - : Returns the item from the list that has the specified ID. + + **Parameters:** + - ID - the product list item identifier. + + **Returns:** + - the specified item, or null if it's not found in the list. + + +--- + +### getItems() +- getItems(): [Collection](dw.util.Collection.md) + - : Returns a collection containing all items in the list. + + **Returns:** + - all items. + + +--- + +### getLastExportTime() +- getLastExportTime(): [Date](TopLevel.Date.md) + - : Returns the date where this product list has been exported successfully + the last time. + + + **Returns:** + - The time of the last successful export or null if this product list + was not exported yet. + + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of this product list given by its owner. + + **Returns:** + - the name of this product list. Returns an empty string if the name is not set. + + +--- + +### getOwner() +- getOwner(): [Customer](dw.customer.Customer.md) + - : Returns the customer that created and owns the product list. + + **Returns:** + - Owning customer + + +--- + +### getPostEventShippingAddress() +- getPostEventShippingAddress(): [CustomerAddress](dw.customer.CustomerAddress.md) + - : Returns the shipping address for purchases made after the event date. + + **Returns:** + - the shipping address for purchases made after the event date. + Returns null if no post-event shipping address is associated. + + + +--- + +### getProductItems() +- getProductItems(): [Collection](dw.util.Collection.md) + - : Returns a collection containing all items in the list that reference products. + + **Returns:** + - all product items. + + +--- + +### getPublicItems() +- getPublicItems(): [Collection](dw.util.Collection.md) + - : Returns a collection containing all items in the list that are flagged as public. + + **Returns:** + - all public items. + + +--- + +### getPurchases() +- getPurchases(): [Collection](dw.util.Collection.md) + - : Returns the aggregated purchases from all the individual items. + + **Returns:** + - purchases + + +--- + +### getRegistrant() +- getRegistrant(): [ProductListRegistrant](dw.customer.ProductListRegistrant.md) + - : Returns the ProductListRegistrant assigned to the registrant attribute or null + if this list has no registrant. + + + **Returns:** + - the ProductListRegistrant assigned to the registrant attribute or null + if this list has no registrant. + + + +--- + +### getShippingAddress() +- getShippingAddress(): [CustomerAddress](dw.customer.CustomerAddress.md) + - : Return the address that should be used as the shipping address for purchases + made from the list. + + + **Returns:** + - the shipping address. The shipping address of this list or null + if no address is associated. + + + +--- + +### getType() +- getType(): [Number](TopLevel.Number.md) + - : Returns an int representing the type of object (e.g. wish list, + gift registry). This is set at object creation time. + + + **Returns:** + - the type of object. + + +--- + +### isAnonymous() +- isAnonymous(): [Boolean](TopLevel.Boolean.md) + - : Returns true if this product list is owned by an anonymous customer. + + **Returns:** + - true if the owner of this product list is anonymous, false otherwise. + + +--- + +### isPublic() +- isPublic(): [Boolean](TopLevel.Boolean.md) + - : A flag, typically used to determine if the object is searchable + by other customers. + + + **Returns:** + - true if the product list is public. False otherwise. + + +--- + +### removeCoRegistrant() +- removeCoRegistrant(): void + - : Removes the ProductListRegistrant assigned to the coRegistrant attribute. + + +--- + +### removeItem(ProductListItem) +- removeItem(item: [ProductListItem](dw.customer.ProductListItem.md)): void + - : Removes the specified item from the list. This will also cause + all purchase information associated with that item to be removed. + + + **Parameters:** + - item - The item to remove. + + +--- + +### removeRegistrant() +- removeRegistrant(): void + - : Removes the ProductListRegistrant assigned to the registrant attribute. + + +--- + +### setDescription(String) +- setDescription(description: [String](TopLevel.String.md)): void + - : Set the description of this product list. + + **Parameters:** + - description - The description of this product list. The description can have up to 256 characters, longer descriptions get truncated. If an empty string is provided, the description gets set to null. + + +--- + +### setEventCity(String) +- setEventCity(eventCity: [String](TopLevel.String.md)): void + - : Set the event city to which this product list is related. + + **Parameters:** + - eventCity - The event city can have up to 256 characters, longer event city get truncated. If an empty string is provided, the event city gets set to null. + + +--- + +### setEventCountry(String) +- setEventCountry(eventCountry: [String](TopLevel.String.md)): void + - : Set the event country to which this product list is related. + + **Parameters:** + - eventCountry - The event country can have up to 256 characters, longer event country get truncated. If an empty string is provided, the event country gets set to null. + + +--- + +### setEventDate(Date) +- setEventDate(eventDate: [Date](TopLevel.Date.md)): void + - : Set the date of the event to which this product list is related. + + **Parameters:** + - eventDate - The event date or null if no event date should be available. + + +--- + +### setEventState(String) +- setEventState(eventState: [String](TopLevel.String.md)): void + - : Set the event state to which this product list is related. + + **Parameters:** + - eventState - The event state can have up to 256 characters, longer event state get truncated. If an empty string is provided, the event state gets set to null. + + +--- + +### setEventType(String) +- setEventType(eventType: [String](TopLevel.String.md)): void + - : Set the event type for which this product list was created by the owner. + + **Parameters:** + - eventType - The event type can have up to 256 characters, longer event type get truncated. If an empty string is provided, the event type gets set to null. + + +--- + +### setName(String) +- setName(name: [String](TopLevel.String.md)): void + - : Set the name of this product list. + + **Parameters:** + - name - The name of this product list. The name can have up to 256 characters, longer names get truncated. If an empty string is provided, the name gets set to null. + + +--- + +### setPostEventShippingAddress(CustomerAddress) +- setPostEventShippingAddress(address: [CustomerAddress](dw.customer.CustomerAddress.md)): void + - : This is typically used by an event related list (e.g. gift registry) to + specify a shipping address for purchases made after the event date. + + + **Parameters:** + - address - The shipping address. + + +--- + +### setPublic(Boolean) +- setPublic(flag: [Boolean](TopLevel.Boolean.md)): void + - : Makes this product list visible to other customers or hides it. + + **Parameters:** + - flag - If true, this product list becomes visible to other customers. If false, this product list can only be seen and searched by its owner. + + +--- + +### setShippingAddress(CustomerAddress) +- setShippingAddress(address: [CustomerAddress](dw.customer.CustomerAddress.md)): void + - : Associate an address, used as the shipping address for purchases + made from the list. + + + **Parameters:** + - address - The shipping address. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItem.md new file mode 100644 index 00000000..6136ca24 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItem.md @@ -0,0 +1,469 @@ + +# Class ProductListItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.ProductListItem](dw.customer.ProductListItem.md) + +An item in a product list. Types of items are: + + +- An item that references a product via the product's SKU. +- An item that represents a gift certificate. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [TYPE_GIFT_CERTIFICATE](#type_gift_certificate): [Number](TopLevel.Number.md) = 2 | Constant representing a gift certificate list item type. | +| [TYPE_PRODUCT](#type_product): [Number](TopLevel.Number.md) = 1 | Constant representing a product list item type. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the unique system generated ID of the object. | +| [list](#list): [ProductList](dw.customer.ProductList.md) `(read-only)` | Returns the product list that this item belongs to. | +| [priority](#priority): [Number](TopLevel.Number.md) | Specify the priority level for the item. | +| [product](#product): [Product](dw.catalog.Product.md) | Returns the referenced product for this item. | +| [productID](#productid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the product referenced by this item. | +| [productOptionModel](#productoptionmodel): [ProductOptionModel](dw.catalog.ProductOptionModel.md) | Returns the ProductOptionModel for the product associated with this item, or null if there is no valid product associated with this item. | +| [public](#public): [Boolean](TopLevel.Boolean.md) | A flag, typically used to determine whether the item should display in a customer's view of the list (as opposed to the list owner's view). | +| [purchasedQuantity](#purchasedquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the sum of the quantities of all the individual purchase records for this item. | +| [purchasedQuantityValue](#purchasedquantityvalue): [Number](TopLevel.Number.md) `(read-only)` | Returns the value part of the underlying purchased quantity object, as distinct from the unit. | +| [purchases](#purchases): [Collection](dw.util.Collection.md) `(read-only)` | Returns all purchases made for this item. | +| [quantity](#quantity): [Quantity](dw.value.Quantity.md) | Returns the quantity of the item. | +| [quantityValue](#quantityvalue): [Number](TopLevel.Number.md) | Returns the value part of the underlying quantity object, as distinct from the unit. | +| [type](#type): [Number](TopLevel.Number.md) `(read-only)` | Returns the type of this product list item. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createPurchase](dw.customer.ProductListItem.md#createpurchasenumber-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Create a purchase record for this item. | +| [getID](dw.customer.ProductListItem.md#getid)() | Returns the unique system generated ID of the object. | +| [getList](dw.customer.ProductListItem.md#getlist)() | Returns the product list that this item belongs to. | +| [getPriority](dw.customer.ProductListItem.md#getpriority)() | Specify the priority level for the item. | +| [getProduct](dw.customer.ProductListItem.md#getproduct)() | Returns the referenced product for this item. | +| [getProductID](dw.customer.ProductListItem.md#getproductid)() | Returns the ID of the product referenced by this item. | +| [getProductOptionModel](dw.customer.ProductListItem.md#getproductoptionmodel)() | Returns the ProductOptionModel for the product associated with this item, or null if there is no valid product associated with this item. | +| [getPurchasedQuantity](dw.customer.ProductListItem.md#getpurchasedquantity)() | Returns the sum of the quantities of all the individual purchase records for this item. | +| [getPurchasedQuantityValue](dw.customer.ProductListItem.md#getpurchasedquantityvalue)() | Returns the value part of the underlying purchased quantity object, as distinct from the unit. | +| [getPurchases](dw.customer.ProductListItem.md#getpurchases)() | Returns all purchases made for this item. | +| [getQuantity](dw.customer.ProductListItem.md#getquantity)() | Returns the quantity of the item. | +| [getQuantityValue](dw.customer.ProductListItem.md#getquantityvalue)() | Returns the value part of the underlying quantity object, as distinct from the unit. | +| [getType](dw.customer.ProductListItem.md#gettype)() | Returns the type of this product list item. | +| [isPublic](dw.customer.ProductListItem.md#ispublic)() | A flag, typically used to determine whether the item should display in a customer's view of the list (as opposed to the list owner's view). | +| [setPriority](dw.customer.ProductListItem.md#setprioritynumber)([Number](TopLevel.Number.md)) | Specify the priority level for the item. | +| ~~[setProduct](dw.customer.ProductListItem.md#setproductproduct)([Product](dw.catalog.Product.md))~~ | Sets the referenced product for this item by storing the product's id. | +| [setProductOptionModel](dw.customer.ProductListItem.md#setproductoptionmodelproductoptionmodel)([ProductOptionModel](dw.catalog.ProductOptionModel.md)) | Store a product option model with this object. | +| [setPublic](dw.customer.ProductListItem.md#setpublicboolean)([Boolean](TopLevel.Boolean.md)) | Typically used to determine if the item is visible to other customers. | +| ~~[setQuantity](dw.customer.ProductListItem.md#setquantityquantity)([Quantity](dw.value.Quantity.md))~~ | Sets the quantity of the item. | +| [setQuantityValue](dw.customer.ProductListItem.md#setquantityvaluenumber)([Number](TopLevel.Number.md)) | Set the value part of the underlying quantity object, as distinct from the unit. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### TYPE_GIFT_CERTIFICATE + +- TYPE_GIFT_CERTIFICATE: [Number](TopLevel.Number.md) = 2 + - : Constant representing a gift certificate list item type. + + +--- + +### TYPE_PRODUCT + +- TYPE_PRODUCT: [Number](TopLevel.Number.md) = 1 + - : Constant representing a product list item type. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique system generated ID of the object. + + +--- + +### list +- list: [ProductList](dw.customer.ProductList.md) `(read-only)` + - : Returns the product list that this item belongs to. + + +--- + +### priority +- priority: [Number](TopLevel.Number.md) + - : Specify the priority level for the item. Typically the lower the + number, the higher the priority. This can be used by the owner of the product list + to express which items he/she likes to get purchased first. + + + +--- + +### product +- product: [Product](dw.catalog.Product.md) + - : Returns the referenced product for this item. The reference is made + via the product ID attribute. This method returns null if there is + no such product in the system or if the product exists but is not + assigned to the site catalog. + + + +--- + +### productID +- productID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the product referenced by this item. + This attribute is set when a product is assigned via setProduct(). + It is possible for the ID to reference a product that doesn't exist + anymore. In this case getProduct() would return null. + + + +--- + +### productOptionModel +- productOptionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md) + - : Returns the ProductOptionModel for the product associated with this item, + or null if there is no valid product associated with this item. + + + +--- + +### public +- public: [Boolean](TopLevel.Boolean.md) + - : A flag, typically used to determine whether the item should display + in a customer's view of the list (as opposed to the list owner's view). + + + +--- + +### purchasedQuantity +- purchasedQuantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the sum of the quantities of all the individual purchase records + for this item. + + + +--- + +### purchasedQuantityValue +- purchasedQuantityValue: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the value part of the underlying purchased quantity object, as distinct + from the unit. + + + +--- + +### purchases +- purchases: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all purchases made for this item. + + +--- + +### quantity +- quantity: [Quantity](dw.value.Quantity.md) + - : Returns the quantity of the item. + The quantity is the number of products or gift certificates + that get shipped when purchasing this product list item. + + + +--- + +### quantityValue +- quantityValue: [Number](TopLevel.Number.md) + - : Returns the value part of the underlying quantity object, as distinct + from the unit. + + + +--- + +### type +- type: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the type of this product list item. + + +--- + +## Method Details + +### createPurchase(Number, String) +- createPurchase(quantity: [Number](TopLevel.Number.md), purchaserName: [String](TopLevel.String.md)): [ProductListItemPurchase](dw.customer.ProductListItemPurchase.md) + - : Create a purchase record for this item. + + **Parameters:** + - quantity - The number of items purchased. + - purchaserName - The name of the purchaser. + + **Returns:** + - the purchase record. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the unique system generated ID of the object. + + **Returns:** + - the ID of object. + + +--- + +### getList() +- getList(): [ProductList](dw.customer.ProductList.md) + - : Returns the product list that this item belongs to. + + **Returns:** + - the list. + + +--- + +### getPriority() +- getPriority(): [Number](TopLevel.Number.md) + - : Specify the priority level for the item. Typically the lower the + number, the higher the priority. This can be used by the owner of the product list + to express which items he/she likes to get purchased first. + + + **Returns:** + - the specified priority level. + + +--- + +### getProduct() +- getProduct(): [Product](dw.catalog.Product.md) + - : Returns the referenced product for this item. The reference is made + via the product ID attribute. This method returns null if there is + no such product in the system or if the product exists but is not + assigned to the site catalog. + + + **Returns:** + - the product referenced by this item, or null. + + +--- + +### getProductID() +- getProductID(): [String](TopLevel.String.md) + - : Returns the ID of the product referenced by this item. + This attribute is set when a product is assigned via setProduct(). + It is possible for the ID to reference a product that doesn't exist + anymore. In this case getProduct() would return null. + + + **Returns:** + - the product ID, or null if none exists. + + +--- + +### getProductOptionModel() +- getProductOptionModel(): [ProductOptionModel](dw.catalog.ProductOptionModel.md) + - : Returns the ProductOptionModel for the product associated with this item, + or null if there is no valid product associated with this item. + + + **Returns:** + - the associated ProductOptionModel or null. + + +--- + +### getPurchasedQuantity() +- getPurchasedQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the sum of the quantities of all the individual purchase records + for this item. + + + **Returns:** + - the sum of the quantities of all the individual purchase records + for this item. + + + +--- + +### getPurchasedQuantityValue() +- getPurchasedQuantityValue(): [Number](TopLevel.Number.md) + - : Returns the value part of the underlying purchased quantity object, as distinct + from the unit. + + + **Returns:** + - the value part of the underlying purchased quantity object, as distinct + from the unit. + + + +--- + +### getPurchases() +- getPurchases(): [Collection](dw.util.Collection.md) + - : Returns all purchases made for this item. + + **Returns:** + - the collection of purchase records for this item. Returns an empty list + if this item has not been purchased yet. + + + +--- + +### getQuantity() +- getQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of the item. + The quantity is the number of products or gift certificates + that get shipped when purchasing this product list item. + + + **Returns:** + - the quantity of the item. + + +--- + +### getQuantityValue() +- getQuantityValue(): [Number](TopLevel.Number.md) + - : Returns the value part of the underlying quantity object, as distinct + from the unit. + + + **Returns:** + - the value part of the underlying quantity object, as distinct + from the unit. + + + +--- + +### getType() +- getType(): [Number](TopLevel.Number.md) + - : Returns the type of this product list item. + + **Returns:** + - a code that specifies the type of item (i.e. product or gift certificate). + + +--- + +### isPublic() +- isPublic(): [Boolean](TopLevel.Boolean.md) + - : A flag, typically used to determine whether the item should display + in a customer's view of the list (as opposed to the list owner's view). + + + **Returns:** + - true if the item is public. + + +--- + +### setPriority(Number) +- setPriority(priority: [Number](TopLevel.Number.md)): void + - : Specify the priority level for the item. Typically the lower the + number, the higher the priority. This can be used by the owner of the product list + to express which items he/she likes to get purchased first. + + + **Parameters:** + - priority - The new priority level. + + +--- + +### setProduct(Product) +- ~~setProduct(product: [Product](dw.catalog.Product.md)): void~~ + - : Sets the referenced product for this item by storing the product's id. + If null is specified, then the id is set to null. + + + **Parameters:** + - product - The referenced product for this item. + + **Deprecated:** +:::warning +Use [ProductList.createProductItem(Product)](dw.customer.ProductList.md#createproductitemproduct) instead. +::: + +--- + +### setProductOptionModel(ProductOptionModel) +- setProductOptionModel(productOptionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md)): void + - : Store a product option model with this object. This stores a copy + of the specified model, rather than an assocation to the same instance. + + + **Parameters:** + - productOptionModel - The object to store. + + +--- + +### setPublic(Boolean) +- setPublic(flag: [Boolean](TopLevel.Boolean.md)): void + - : Typically used to determine if the item is visible to other customers. + + **Parameters:** + - flag - If true, this product list becomes visible to other customers. If false, this product list can only be seen by the owner of the product list. + + +--- + +### setQuantity(Quantity) +- ~~setQuantity(value: [Quantity](dw.value.Quantity.md)): void~~ + - : Sets the quantity of the item. + + **Parameters:** + - value - the new quantity of the item. + + **Deprecated:** +:::warning +Use [setQuantityValue(Number)](dw.customer.ProductListItem.md#setquantityvaluenumber) instead. +::: + +--- + +### setQuantityValue(Number) +- setQuantityValue(value: [Number](TopLevel.Number.md)): void + - : Set the value part of the underlying quantity object, as distinct from + the unit. + + + **Parameters:** + - value - the value to use. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItemPurchase.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItemPurchase.md new file mode 100644 index 00000000..31ee09e3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListItemPurchase.md @@ -0,0 +1,139 @@ + +# Class ProductListItemPurchase + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.ProductListItemPurchase](dw.customer.ProductListItemPurchase.md) + +A record of the purchase of an item contained in a product list. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [item](#item): [ProductListItem](dw.customer.ProductListItem.md) `(read-only)` | Returns the item that was purchased. | +| [orderNo](#orderno): [String](TopLevel.String.md) `(read-only)` | Returns the number of the order in which the product list item was purchased. | +| [purchaseDate](#purchasedate): [Date](TopLevel.Date.md) `(read-only)` | Returns the date on which the product list item was purchased. | +| [purchaserName](#purchasername): [String](TopLevel.String.md) `(read-only)` | Returns the name of the purchaser of the product list item. | +| [quantity](#quantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity of the product list item that was purchased. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getItem](dw.customer.ProductListItemPurchase.md#getitem)() | Returns the item that was purchased. | +| [getOrderNo](dw.customer.ProductListItemPurchase.md#getorderno)() | Returns the number of the order in which the product list item was purchased. | +| [getPurchaseDate](dw.customer.ProductListItemPurchase.md#getpurchasedate)() | Returns the date on which the product list item was purchased. | +| [getPurchaserName](dw.customer.ProductListItemPurchase.md#getpurchasername)() | Returns the name of the purchaser of the product list item. | +| [getQuantity](dw.customer.ProductListItemPurchase.md#getquantity)() | Returns the quantity of the product list item that was purchased. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### item +- item: [ProductListItem](dw.customer.ProductListItem.md) `(read-only)` + - : Returns the item that was purchased. + + +--- + +### orderNo +- orderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the number of the order in which the + product list item was purchased. + + + +--- + +### purchaseDate +- purchaseDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date on which the product list item was purchased. + + +--- + +### purchaserName +- purchaserName: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the purchaser of the product list item. + + +--- + +### quantity +- quantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity of the product list item that was purchased. + + +--- + +## Method Details + +### getItem() +- getItem(): [ProductListItem](dw.customer.ProductListItem.md) + - : Returns the item that was purchased. + + **Returns:** + - the item that was purchased. + + +--- + +### getOrderNo() +- getOrderNo(): [String](TopLevel.String.md) + - : Returns the number of the order in which the + product list item was purchased. + + + **Returns:** + - the number of the order in which the + product list item was purchased. + + + +--- + +### getPurchaseDate() +- getPurchaseDate(): [Date](TopLevel.Date.md) + - : Returns the date on which the product list item was purchased. + + **Returns:** + - the date on which the product list item was purchased. + + +--- + +### getPurchaserName() +- getPurchaserName(): [String](TopLevel.String.md) + - : Returns the name of the purchaser of the product list item. + + **Returns:** + - the name of the purchaser of the product list item. + + +--- + +### getQuantity() +- getQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of the product list item that was purchased. + + **Returns:** + - the quantity of the product list item that was purchased. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListMgr.md new file mode 100644 index 00000000..6384780d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListMgr.md @@ -0,0 +1,350 @@ + +# Class ProductListMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.ProductListMgr](dw.customer.ProductListMgr.md) + +ProductListMgr provides methods for retrieving, creating, searching for, and +removing product lists. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [createProductList](dw.customer.ProductListMgr.md#createproductlistcustomer-number)([Customer](dw.customer.Customer.md), [Number](TopLevel.Number.md)) | Creates a new instance of a product list, of the specified type. | +| ~~static [getProductList](dw.customer.ProductListMgr.md#getproductlistprofile-number)([Profile](dw.customer.Profile.md), [Number](TopLevel.Number.md))~~ | Returns the first product list belonging to the customer with the specified profile. | +| static [getProductList](dw.customer.ProductListMgr.md#getproductliststring)([String](TopLevel.String.md)) | Gets the product list by its ID. | +| static [getProductLists](dw.customer.ProductListMgr.md#getproductlistscustomer-number)([Customer](dw.customer.Customer.md), [Number](TopLevel.Number.md)) | Retrieve all product lists of the specified type owned by the specified customer. | +| static [getProductLists](dw.customer.ProductListMgr.md#getproductlistscustomer-number-string)([Customer](dw.customer.Customer.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Retrieve all the product lists of the specified type and event type belonging to the specified customer. | +| static [getProductLists](dw.customer.ProductListMgr.md#getproductlistscustomeraddress)([CustomerAddress](dw.customer.CustomerAddress.md)) | Returns the collection of product lists that have the specified address as the shipping address. | +| static [queryProductLists](dw.customer.ProductListMgr.md#queryproductlistsmap-string)([Map](dw.util.Map.md), [String](TopLevel.String.md)) |

        Searches for product list instances. | +| static [queryProductLists](dw.customer.ProductListMgr.md#queryproductlistsstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) |

        Searches for product list instances. | +| static [removeProductList](dw.customer.ProductListMgr.md#removeproductlistproductlist)([ProductList](dw.customer.ProductList.md)) | Removes the specified product list from the system. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### createProductList(Customer, Number) +- static createProductList(customer: [Customer](dw.customer.Customer.md), type: [Number](TopLevel.Number.md)): [ProductList](dw.customer.ProductList.md) + - : Creates a new instance of a product list, of the specified type. + + **Parameters:** + - customer - The customer owning the product list, must not be null. + - type - The type of list (e.g. wish list, gift registry). The types are defined as constants within [ProductList](dw.customer.ProductList.md). + + **Returns:** + - the new list instance. + + +--- + +### getProductList(Profile, Number) +- ~~static getProductList(profile: [Profile](dw.customer.Profile.md), type: [Number](TopLevel.Number.md)): [ProductList](dw.customer.ProductList.md)~~ + - : Returns the first product list belonging to the customer with the + specified profile. + + + **Parameters:** + - profile - The profile of the customer whose product list is to be retrieved. + - type - The type of list (e.g. wish list, gift registry). The types are defined as constants within [ProductList](dw.customer.ProductList.md). + + **Returns:** + - the product list, or null if none exists. + + **Deprecated:** +:::warning +Use [getProductLists(Customer, Number)](dw.customer.ProductListMgr.md#getproductlistscustomer-number) or [getProductLists(Customer, Number, String)](dw.customer.ProductListMgr.md#getproductlistscustomer-number-string) instead. +::: + +--- + +### getProductList(String) +- static getProductList(ID: [String](TopLevel.String.md)): [ProductList](dw.customer.ProductList.md) + - : Gets the product list by its ID. + + **Parameters:** + - ID - The product list ID. + + **Returns:** + - the ProductList instance, or null if a list with the specified + UUID doesn't exist. + + + +--- + +### getProductLists(Customer, Number) +- static getProductLists(customer: [Customer](dw.customer.Customer.md), type: [Number](TopLevel.Number.md)): [Collection](dw.util.Collection.md) + - : Retrieve all product lists of the specified type owned by the + specified customer. + + + **Parameters:** + - customer - The customer used for the query, must not be null. + - type - The type of list used for the query. The types are defined as constants within [ProductList](dw.customer.ProductList.md). + + **Returns:** + - the unsorted collection of ProductList instances of the specified + type belonging to the specified customer. + + + +--- + +### getProductLists(Customer, Number, String) +- static getProductLists(customer: [Customer](dw.customer.Customer.md), type: [Number](TopLevel.Number.md), eventType: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Retrieve all the product lists of the specified type and event type + belonging to the specified customer. + + + **Parameters:** + - customer - The customer used for the query, must not be null. + - type - The type of list used for the query. The types are defined as constants within [ProductList](dw.customer.ProductList.md). + - eventType - The event type used for the query, must not be null. + + **Returns:** + - the unsorted collection of ProductList instances of the specified + type and event type belonging to the specified customer. + + + +--- + +### getProductLists(CustomerAddress) +- static getProductLists(customerAddress: [CustomerAddress](dw.customer.CustomerAddress.md)): [Collection](dw.util.Collection.md) + - : Returns the collection of product lists that have the specified address + as the shipping address. + + + **Parameters:** + - customerAddress - the address to test, must not be null. + + **Returns:** + - the unsorted collection of ProductList instances using this + address. + + + +--- + +### queryProductLists(Map, String) +- static queryProductLists(queryAttributes: [Map](dw.util.Map.md), sortString: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + Searches for product list instances. + + + + The search can be configured with a map, which key-value pairs are + converted into a query expression. The key-value pairs are turned into a + sequence of '=' or 'like' conditions, which are combined with AND + statements. + + + + Example: + + A map with the key/value pairs: _'name'/'tom\*', 'age'/66_ + will be converted as follows: `"name like 'tom*' and age = 66"` + + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + + The **sorting** parameter is optional and may contain a comma separated list of + attribute names to sort by. Each sort attribute name may be followed by an + optional sort direction specifier ('asc' | 'desc'). Default sorting directions is + ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is + currently not supported. + + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - queryAttributes - key-value pairs, which define the query. + - sortString - an optional sorting or null if no sorting is necessary. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### queryProductLists(String, String, Object...) +- static queryProductLists(queryString: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + Searches for product list instances. + + + + The search can be configured using a simple query language, which + provides most common filter and operator functionality. + + + + The identifier for an **attribute** to use in a query condition is always the + ID of the attribute as defined in the type definition. For custom defined attributes + the prefix custom is required in the search term (e.g. `custom.color = {1}`), + while for system attributes no prefix is used (e.g. `name = {4}`). + + + + Supported attribute value **types** with sample expression values: + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + The following types of attributes are not queryable: + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + Note, that some system attributes are not queryable by default regardless of the + actual value type code. + + + + + The following **operators** are supported in a condition: + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' + and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + + + The query language provides a placeholder syntax to pass objects as + additional search parameters. Each passed object is related to a + placeholder in the query string. The placeholder must be an Integer that + is surrounded by braces. The first Integer value must be '0', the second + '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + + + The **sorting** parameter is optional and may contain a comma separated list of + attribute names to sort by. Each sort attribute name may be followed by an + optional sort direction specifier ('asc' | 'desc'). Default sorting directions is + ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is + currently not supported. + + + + Sometimes it is desired to get all instances with a special sorting condition. + This can be easily done by providing the 'sortString' in combination with + an empty 'queryString', e.g. `querySystemObjects("sample", "", "ID asc")` + + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - queryString - the actual query. + - sortString - an optional sorting or null if no sorting is necessary. + - args - optional parameters for the queryString. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### removeProductList(ProductList) +- static removeProductList(productList: [ProductList](dw.customer.ProductList.md)): void + - : Removes the specified product list from the system. + + **Parameters:** + - productList - The list to remove, must not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListRegistrant.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListRegistrant.md new file mode 100644 index 00000000..ed1ebdf5 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.ProductListRegistrant.md @@ -0,0 +1,165 @@ + +# Class ProductListRegistrant + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.ProductListRegistrant](dw.customer.ProductListRegistrant.md) + +A ProductListRegistrant is typically associated with an event related product list +such as a gift registry. It holds information about a person associated with the +event such as a bride or groom. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [email](#email): [String](TopLevel.String.md) | Returns the email address of the registrant or null. | +| [firstName](#firstname): [String](TopLevel.String.md) | Returns the first name of the registrant or null. | +| [lastName](#lastname): [String](TopLevel.String.md) | Returns the last name of the registrant or null. | +| [role](#role): [String](TopLevel.String.md) | Returns the role of the registrant or null. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getEmail](dw.customer.ProductListRegistrant.md#getemail)() | Returns the email address of the registrant or null. | +| [getFirstName](dw.customer.ProductListRegistrant.md#getfirstname)() | Returns the first name of the registrant or null. | +| [getLastName](dw.customer.ProductListRegistrant.md#getlastname)() | Returns the last name of the registrant or null. | +| [getRole](dw.customer.ProductListRegistrant.md#getrole)() | Returns the role of the registrant or null. | +| [setEmail](dw.customer.ProductListRegistrant.md#setemailstring)([String](TopLevel.String.md)) | Sets the email address of the registrant. | +| [setFirstName](dw.customer.ProductListRegistrant.md#setfirstnamestring)([String](TopLevel.String.md)) | Sets the first name of the registrant. | +| [setLastName](dw.customer.ProductListRegistrant.md#setlastnamestring)([String](TopLevel.String.md)) | Sets the last name of the registrant. | +| [setRole](dw.customer.ProductListRegistrant.md#setrolestring)([String](TopLevel.String.md)) | Sets the role of the registrant. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### email +- email: [String](TopLevel.String.md) + - : Returns the email address of the registrant or null. + + +--- + +### firstName +- firstName: [String](TopLevel.String.md) + - : Returns the first name of the registrant or null. + + +--- + +### lastName +- lastName: [String](TopLevel.String.md) + - : Returns the last name of the registrant or null. + + +--- + +### role +- role: [String](TopLevel.String.md) + - : Returns the role of the registrant or null. The role of a registrant + can be for example the bride of a bridal couple. + + + +--- + +## Method Details + +### getEmail() +- getEmail(): [String](TopLevel.String.md) + - : Returns the email address of the registrant or null. + + **Returns:** + - the email address of the registrant or null. + + +--- + +### getFirstName() +- getFirstName(): [String](TopLevel.String.md) + - : Returns the first name of the registrant or null. + + **Returns:** + - the first name of the registrant or null. + + +--- + +### getLastName() +- getLastName(): [String](TopLevel.String.md) + - : Returns the last name of the registrant or null. + + **Returns:** + - the last name of the registrant or null. + + +--- + +### getRole() +- getRole(): [String](TopLevel.String.md) + - : Returns the role of the registrant or null. The role of a registrant + can be for example the bride of a bridal couple. + + + **Returns:** + - the role name of the registrant or null. + + +--- + +### setEmail(String) +- setEmail(email: [String](TopLevel.String.md)): void + - : Sets the email address of the registrant. + + **Parameters:** + - email - the email address of the registrant. + + +--- + +### setFirstName(String) +- setFirstName(firstName: [String](TopLevel.String.md)): void + - : Sets the first name of the registrant. + + **Parameters:** + - firstName - the first name of the registrant. + + +--- + +### setLastName(String) +- setLastName(lastName: [String](TopLevel.String.md)): void + - : Sets the last name of the registrant. + + **Parameters:** + - lastName - the last name of the registrant. + + +--- + +### setRole(String) +- setRole(role: [String](TopLevel.String.md)): void + - : Sets the role of the registrant. + + **Parameters:** + - role - the role of the registrant. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.Profile.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Profile.md new file mode 100644 index 00000000..b0127508 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Profile.md @@ -0,0 +1,895 @@ + +# Class Profile + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.customer.EncryptedObject](dw.customer.EncryptedObject.md) + - [dw.customer.Profile](dw.customer.Profile.md) + +The class represents a customer profile. It also provides access to the +customers address book and credentials. + + +**Note:** this class handles sensitive security-related data. +Pay special attention to PCI DSS v3. requirements 2, 4, and 12. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [addressBook](#addressbook): [AddressBook](dw.customer.AddressBook.md) `(read-only)` | Returns the customer's address book. | +| [birthday](#birthday): [Date](TopLevel.Date.md) | Returns the customer's birthday as a date. | +| [companyName](#companyname): [String](TopLevel.String.md) | Returns the customer's company name. | +| [credentials](#credentials): [Credentials](dw.customer.Credentials.md) `(read-only)` | Returns the customer's credentials. | +| [customer](#customer): [Customer](dw.customer.Customer.md) `(read-only)` | Returns the customer object related to this profile. | +| [customerNo](#customerno): [String](TopLevel.String.md) `(read-only)` | Returns the customer's number, which is a number used to identify the Customer. | +| [email](#email): [String](TopLevel.String.md) | Returns the customer's email address. | +| [fax](#fax): [String](TopLevel.String.md) | Returns the fax number to use for the customer. | +| [female](#female): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates that the customer is female when set to true. | +| [firstName](#firstname): [String](TopLevel.String.md) | Returns the customer's first name. | +| [gender](#gender): [EnumValue](dw.value.EnumValue.md) | Returns the customer's gender. | +| [jobTitle](#jobtitle): [String](TopLevel.String.md) | Returns the customer's job title. | +| [lastLoginTime](#lastlogintime): [Date](TopLevel.Date.md) `(read-only)` | Returns the last login time of the customer. | +| [lastName](#lastname): [String](TopLevel.String.md) | Returns the customer's last name. | +| [lastVisitTime](#lastvisittime): [Date](TopLevel.Date.md) `(read-only)` | Returns the last visit time of the customer. | +| [male](#male): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates that the customer is male when set to true. | +| [nextBirthday](#nextbirthday): [Date](TopLevel.Date.md) `(read-only)` | Returns the upcoming customer's birthday as a date. | +| [phoneBusiness](#phonebusiness): [String](TopLevel.String.md) | Returns the business phone number to use for the customer. | +| [phoneHome](#phonehome): [String](TopLevel.String.md) | Returns the phone number to use for the customer. | +| [phoneMobile](#phonemobile): [String](TopLevel.String.md) | Returns the mobile phone number to use for the customer. | +| [preferredLocale](#preferredlocale): [String](TopLevel.String.md) | Returns the customer's preferred locale. | +| [previousLoginTime](#previouslogintime): [Date](TopLevel.Date.md) `(read-only)` | Returns the time the customer logged in prior to the current login. | +| [previousVisitTime](#previousvisittime): [Date](TopLevel.Date.md) `(read-only)` | Returns the time the customer visited the store prior to the current visit. | +| [salutation](#salutation): [String](TopLevel.String.md) | Returns the salutation to use for the customer. | +| [secondName](#secondname): [String](TopLevel.String.md) | Returns the customer's second name. | +| [suffix](#suffix): [String](TopLevel.String.md) | Returns the customer's suffix, such as "Jr." or "Sr.". | +| [taxID](#taxid): [String](TopLevel.String.md) | Returns the tax ID value. | +| [taxIDMasked](#taxidmasked): [String](TopLevel.String.md) `(read-only)` | Returns the masked value of the tax ID. | +| [taxIDType](#taxidtype): [EnumValue](dw.value.EnumValue.md) | Returns the tax ID type. | +| [title](#title): [String](TopLevel.String.md) | Returns the customer's title, such as "Mrs" or "Mr". | +| [wallet](#wallet): [Wallet](dw.customer.Wallet.md) `(read-only)` | Returns the wallet of this customer. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAddressBook](dw.customer.Profile.md#getaddressbook)() | Returns the customer's address book. | +| [getBirthday](dw.customer.Profile.md#getbirthday)() | Returns the customer's birthday as a date. | +| [getCompanyName](dw.customer.Profile.md#getcompanyname)() | Returns the customer's company name. | +| [getCredentials](dw.customer.Profile.md#getcredentials)() | Returns the customer's credentials. | +| [getCustomer](dw.customer.Profile.md#getcustomer)() | Returns the customer object related to this profile. | +| [getCustomerNo](dw.customer.Profile.md#getcustomerno)() | Returns the customer's number, which is a number used to identify the Customer. | +| [getEmail](dw.customer.Profile.md#getemail)() | Returns the customer's email address. | +| [getFax](dw.customer.Profile.md#getfax)() | Returns the fax number to use for the customer. | +| [getFirstName](dw.customer.Profile.md#getfirstname)() | Returns the customer's first name. | +| [getGender](dw.customer.Profile.md#getgender)() | Returns the customer's gender. | +| [getJobTitle](dw.customer.Profile.md#getjobtitle)() | Returns the customer's job title. | +| [getLastLoginTime](dw.customer.Profile.md#getlastlogintime)() | Returns the last login time of the customer. | +| [getLastName](dw.customer.Profile.md#getlastname)() | Returns the customer's last name. | +| [getLastVisitTime](dw.customer.Profile.md#getlastvisittime)() | Returns the last visit time of the customer. | +| [getNextBirthday](dw.customer.Profile.md#getnextbirthday)() | Returns the upcoming customer's birthday as a date. | +| [getPhoneBusiness](dw.customer.Profile.md#getphonebusiness)() | Returns the business phone number to use for the customer. | +| [getPhoneHome](dw.customer.Profile.md#getphonehome)() | Returns the phone number to use for the customer. | +| [getPhoneMobile](dw.customer.Profile.md#getphonemobile)() | Returns the mobile phone number to use for the customer. | +| [getPreferredLocale](dw.customer.Profile.md#getpreferredlocale)() | Returns the customer's preferred locale. | +| [getPreviousLoginTime](dw.customer.Profile.md#getpreviouslogintime)() | Returns the time the customer logged in prior to the current login. | +| [getPreviousVisitTime](dw.customer.Profile.md#getpreviousvisittime)() | Returns the time the customer visited the store prior to the current visit. | +| [getSalutation](dw.customer.Profile.md#getsalutation)() | Returns the salutation to use for the customer. | +| [getSecondName](dw.customer.Profile.md#getsecondname)() | Returns the customer's second name. | +| [getSuffix](dw.customer.Profile.md#getsuffix)() | Returns the customer's suffix, such as "Jr." or "Sr.". | +| [getTaxID](dw.customer.Profile.md#gettaxid)() | Returns the tax ID value. | +| [getTaxIDMasked](dw.customer.Profile.md#gettaxidmasked)() | Returns the masked value of the tax ID. | +| [getTaxIDType](dw.customer.Profile.md#gettaxidtype)() | Returns the tax ID type. | +| [getTitle](dw.customer.Profile.md#gettitle)() | Returns the customer's title, such as "Mrs" or "Mr". | +| [getWallet](dw.customer.Profile.md#getwallet)() | Returns the wallet of this customer. | +| [isFemale](dw.customer.Profile.md#isfemale)() | Indicates that the customer is female when set to true. | +| [isMale](dw.customer.Profile.md#ismale)() | Indicates that the customer is male when set to true. | +| [setBirthday](dw.customer.Profile.md#setbirthdaydate)([Date](TopLevel.Date.md)) | Sets the customer's birthday as a date. | +| [setCompanyName](dw.customer.Profile.md#setcompanynamestring)([String](TopLevel.String.md)) | Sets the customer's company name. | +| [setEmail](dw.customer.Profile.md#setemailstring)([String](TopLevel.String.md)) | Sets the customer's email address. | +| [setFax](dw.customer.Profile.md#setfaxstring)([String](TopLevel.String.md)) | Sets the fax number to use for the customer. | +| [setFirstName](dw.customer.Profile.md#setfirstnamestring)([String](TopLevel.String.md)) | Sets the customer's first name. | +| [setGender](dw.customer.Profile.md#setgendernumber)([Number](TopLevel.Number.md)) | Sets the customer's gender. | +| [setJobTitle](dw.customer.Profile.md#setjobtitlestring)([String](TopLevel.String.md)) | Sets the customer's job title. | +| [setLastName](dw.customer.Profile.md#setlastnamestring)([String](TopLevel.String.md)) | Sets the customer's last name. | +| [setPhoneBusiness](dw.customer.Profile.md#setphonebusinessstring)([String](TopLevel.String.md)) | Sets the business phone number to use for the customer. | +| [setPhoneHome](dw.customer.Profile.md#setphonehomestring)([String](TopLevel.String.md)) | Sets the phone number to use for the customer. | +| [setPhoneMobile](dw.customer.Profile.md#setphonemobilestring)([String](TopLevel.String.md)) | Sets the mobile phone number to use for the customer. | +| [setPreferredLocale](dw.customer.Profile.md#setpreferredlocalestring)([String](TopLevel.String.md)) | Sets the customer's preferred locale. | +| ~~[setSaluation](dw.customer.Profile.md#setsaluationstring)([String](TopLevel.String.md))~~ | Sets the salutation to use for the customer. | +| [setSalutation](dw.customer.Profile.md#setsalutationstring)([String](TopLevel.String.md)) | Sets the salutation to use for the customer. | +| [setSecondName](dw.customer.Profile.md#setsecondnamestring)([String](TopLevel.String.md)) | Sets the customer's second name. | +| [setSuffix](dw.customer.Profile.md#setsuffixstring)([String](TopLevel.String.md)) | Sets the the customer's suffix. | +| [setTaxID](dw.customer.Profile.md#settaxidstring)([String](TopLevel.String.md)) | Sets the tax ID value. | +| [setTaxIDType](dw.customer.Profile.md#settaxidtypestring)([String](TopLevel.String.md)) | Sets the tax ID type. | +| [setTitle](dw.customer.Profile.md#settitlestring)([String](TopLevel.String.md)) | Sets the customer's title. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### addressBook +- addressBook: [AddressBook](dw.customer.AddressBook.md) `(read-only)` + - : Returns the customer's address book. + + +--- + +### birthday +- birthday: [Date](TopLevel.Date.md) + - : Returns the customer's birthday as a date. + + +--- + +### companyName +- companyName: [String](TopLevel.String.md) + - : Returns the customer's company name. + + +--- + +### credentials +- credentials: [Credentials](dw.customer.Credentials.md) `(read-only)` + - : Returns the customer's credentials. + + +--- + +### customer +- customer: [Customer](dw.customer.Customer.md) `(read-only)` + - : Returns the customer object related to this profile. + + +--- + +### customerNo +- customerNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the customer's number, which is a number used to identify the Customer. + + +--- + +### email +- email: [String](TopLevel.String.md) + - : Returns the customer's email address. + + +--- + +### fax +- fax: [String](TopLevel.String.md) + - : Returns the fax number to use for the customer. + The length is restricted to 32 characters. + + + +--- + +### female +- female: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates that the customer is female when set to true. + + +--- + +### firstName +- firstName: [String](TopLevel.String.md) + - : Returns the customer's first name. + + +--- + +### gender +- gender: [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's gender. + + +--- + +### jobTitle +- jobTitle: [String](TopLevel.String.md) + - : Returns the customer's job title. + + +--- + +### lastLoginTime +- lastLoginTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the last login time of the customer. + + +--- + +### lastName +- lastName: [String](TopLevel.String.md) + - : Returns the customer's last name. + + +--- + +### lastVisitTime +- lastVisitTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the last visit time of the customer. + + +--- + +### male +- male: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates that the customer is male when set to true. + + +--- + +### nextBirthday +- nextBirthday: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the upcoming customer's birthday as a date. + If the customer already had birthday this year the method returns the birthday of the next year. + Otherwise its birthday in this year. + If the customer has not set a birthday this method returns null. + + + +--- + +### phoneBusiness +- phoneBusiness: [String](TopLevel.String.md) + - : Returns the business phone number to use for the customer. + + +--- + +### phoneHome +- phoneHome: [String](TopLevel.String.md) + - : Returns the phone number to use for the customer. + + +--- + +### phoneMobile +- phoneMobile: [String](TopLevel.String.md) + - : Returns the mobile phone number to use for the customer. + + +--- + +### preferredLocale +- preferredLocale: [String](TopLevel.String.md) + - : Returns the customer's preferred locale. + + +--- + +### previousLoginTime +- previousLoginTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the time the customer logged in prior to the current login. + + +--- + +### previousVisitTime +- previousVisitTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the time the customer visited the store prior to the current visit. + + +--- + +### salutation +- salutation: [String](TopLevel.String.md) + - : Returns the salutation to use for the customer. + + +--- + +### secondName +- secondName: [String](TopLevel.String.md) + - : Returns the customer's second name. + + +--- + +### suffix +- suffix: [String](TopLevel.String.md) + - : Returns the customer's suffix, such as "Jr." or "Sr.". + + +--- + +### taxID +- taxID: [String](TopLevel.String.md) + - : Returns the tax ID value. The value is returned either plain + text if the current context allows plain text access, or + if it's not allowed, the ID value will be returned masked. + The following criteria must be met in order to have plain text access: + + + + - the method call must happen in the context of a storefront request; + - the current customer must be registered and authenticated; + - it is the profile of the current customer; + - and the current protocol is HTTPS. + + + +--- + +### taxIDMasked +- taxIDMasked: [String](TopLevel.String.md) `(read-only)` + - : Returns the masked value of the tax ID. + + +--- + +### taxIDType +- taxIDType: [EnumValue](dw.value.EnumValue.md) + - : Returns the tax ID type. + + +--- + +### title +- title: [String](TopLevel.String.md) + - : Returns the customer's title, such as "Mrs" or "Mr". + + +--- + +### wallet +- wallet: [Wallet](dw.customer.Wallet.md) `(read-only)` + - : Returns the wallet of this customer. + + +--- + +## Method Details + +### getAddressBook() +- getAddressBook(): [AddressBook](dw.customer.AddressBook.md) + - : Returns the customer's address book. + + **Returns:** + - the customer's address book. + + +--- + +### getBirthday() +- getBirthday(): [Date](TopLevel.Date.md) + - : Returns the customer's birthday as a date. + + **Returns:** + - the customer's birthday as a date. + + +--- + +### getCompanyName() +- getCompanyName(): [String](TopLevel.String.md) + - : Returns the customer's company name. + + **Returns:** + - the customer's company name. + + +--- + +### getCredentials() +- getCredentials(): [Credentials](dw.customer.Credentials.md) + - : Returns the customer's credentials. + + **Returns:** + - the customer's credentials. + + +--- + +### getCustomer() +- getCustomer(): [Customer](dw.customer.Customer.md) + - : Returns the customer object related to this profile. + + **Returns:** + - customer object related to profile. + + +--- + +### getCustomerNo() +- getCustomerNo(): [String](TopLevel.String.md) + - : Returns the customer's number, which is a number used to identify the Customer. + + **Returns:** + - the customer's number. + + +--- + +### getEmail() +- getEmail(): [String](TopLevel.String.md) + - : Returns the customer's email address. + + **Returns:** + - the customer's email address. + + +--- + +### getFax() +- getFax(): [String](TopLevel.String.md) + - : Returns the fax number to use for the customer. + The length is restricted to 32 characters. + + + **Returns:** + - the fax mobile phone number to use for the customer. + + +--- + +### getFirstName() +- getFirstName(): [String](TopLevel.String.md) + - : Returns the customer's first name. + + **Returns:** + - the customer's first name. + + +--- + +### getGender() +- getGender(): [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's gender. + + **Returns:** + - the customer's gender. + + +--- + +### getJobTitle() +- getJobTitle(): [String](TopLevel.String.md) + - : Returns the customer's job title. + + **Returns:** + - the customer's job title. + + +--- + +### getLastLoginTime() +- getLastLoginTime(): [Date](TopLevel.Date.md) + - : Returns the last login time of the customer. + + **Returns:** + - the time, when the customer was last logged in. + + +--- + +### getLastName() +- getLastName(): [String](TopLevel.String.md) + - : Returns the customer's last name. + + **Returns:** + - the customer's last name. + + +--- + +### getLastVisitTime() +- getLastVisitTime(): [Date](TopLevel.Date.md) + - : Returns the last visit time of the customer. + + **Returns:** + - the time, when the customer has visited the storefront the + last time (with enabled remember me functionality). + + + +--- + +### getNextBirthday() +- getNextBirthday(): [Date](TopLevel.Date.md) + - : Returns the upcoming customer's birthday as a date. + If the customer already had birthday this year the method returns the birthday of the next year. + Otherwise its birthday in this year. + If the customer has not set a birthday this method returns null. + + + **Returns:** + - the customer's next birthday as a date. + + +--- + +### getPhoneBusiness() +- getPhoneBusiness(): [String](TopLevel.String.md) + - : Returns the business phone number to use for the customer. + + **Returns:** + - the business phone number to use for the customer. + + +--- + +### getPhoneHome() +- getPhoneHome(): [String](TopLevel.String.md) + - : Returns the phone number to use for the customer. + + **Returns:** + - the phone number to use for the customer. + + +--- + +### getPhoneMobile() +- getPhoneMobile(): [String](TopLevel.String.md) + - : Returns the mobile phone number to use for the customer. + + **Returns:** + - the mobile phone number to use for the customer. + + +--- + +### getPreferredLocale() +- getPreferredLocale(): [String](TopLevel.String.md) + - : Returns the customer's preferred locale. + + **Returns:** + - the customer's preferred locale. + + +--- + +### getPreviousLoginTime() +- getPreviousLoginTime(): [Date](TopLevel.Date.md) + - : Returns the time the customer logged in prior to the current login. + + **Returns:** + - the time the customer logged in prior to the current login. + + +--- + +### getPreviousVisitTime() +- getPreviousVisitTime(): [Date](TopLevel.Date.md) + - : Returns the time the customer visited the store prior to the current visit. + + **Returns:** + - the time the customer visited the store prior to the current visit. + + +--- + +### getSalutation() +- getSalutation(): [String](TopLevel.String.md) + - : Returns the salutation to use for the customer. + + **Returns:** + - the salutation to use for the customer. + + +--- + +### getSecondName() +- getSecondName(): [String](TopLevel.String.md) + - : Returns the customer's second name. + + **Returns:** + - the customer's second name. + + +--- + +### getSuffix() +- getSuffix(): [String](TopLevel.String.md) + - : Returns the customer's suffix, such as "Jr." or "Sr.". + + **Returns:** + - the customer's suffix. + + +--- + +### getTaxID() +- getTaxID(): [String](TopLevel.String.md) + - : Returns the tax ID value. The value is returned either plain + text if the current context allows plain text access, or + if it's not allowed, the ID value will be returned masked. + The following criteria must be met in order to have plain text access: + + + + - the method call must happen in the context of a storefront request; + - the current customer must be registered and authenticated; + - it is the profile of the current customer; + - and the current protocol is HTTPS. + + + **Returns:** + - the tax ID value + + +--- + +### getTaxIDMasked() +- getTaxIDMasked(): [String](TopLevel.String.md) + - : Returns the masked value of the tax ID. + + **Returns:** + - the masked value of the tax ID + + +--- + +### getTaxIDType() +- getTaxIDType(): [EnumValue](dw.value.EnumValue.md) + - : Returns the tax ID type. + + **Returns:** + - the tax ID type + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the customer's title, such as "Mrs" or "Mr". + + **Returns:** + - the customer's title. + + +--- + +### getWallet() +- getWallet(): [Wallet](dw.customer.Wallet.md) + - : Returns the wallet of this customer. + + **Returns:** + - the wallet of this customer. + + +--- + +### isFemale() +- isFemale(): [Boolean](TopLevel.Boolean.md) + - : Indicates that the customer is female when set to true. + + **Returns:** + - true if the customer is a female, false otherwise. + + +--- + +### isMale() +- isMale(): [Boolean](TopLevel.Boolean.md) + - : Indicates that the customer is male when set to true. + + **Returns:** + - true if the customer is a male, false otherwise. + + +--- + +### setBirthday(Date) +- setBirthday(aValue: [Date](TopLevel.Date.md)): void + - : Sets the customer's birthday as a date. + + **Parameters:** + - aValue - the customer's birthday as a date. + + +--- + +### setCompanyName(String) +- setCompanyName(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's company name. + + **Parameters:** + - aValue - the customer's company name. + + +--- + +### setEmail(String) +- setEmail(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's email address. + + **Parameters:** + - aValue - the customer's email address. + + +--- + +### setFax(String) +- setFax(number: [String](TopLevel.String.md)): void + - : Sets the fax number to use for the customer. + The length is restricted to 32 characters. + + + **Parameters:** + - number - the fax number to use for the customer. + + +--- + +### setFirstName(String) +- setFirstName(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's first name. + + **Parameters:** + - aValue - the customer's first name. + + +--- + +### setGender(Number) +- setGender(aValue: [Number](TopLevel.Number.md)): void + - : Sets the customer's gender. + + **Parameters:** + - aValue - the customer's gender. + + +--- + +### setJobTitle(String) +- setJobTitle(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's job title. + + **Parameters:** + - aValue - the customer's job title. + + +--- + +### setLastName(String) +- setLastName(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's last name. + + **Parameters:** + - aValue - the customer's last name. + + +--- + +### setPhoneBusiness(String) +- setPhoneBusiness(number: [String](TopLevel.String.md)): void + - : Sets the business phone number to use for the customer. + The length is restricted to 32 characters. + + + **Parameters:** + - number - the business phone number to use for the customer. + + +--- + +### setPhoneHome(String) +- setPhoneHome(number: [String](TopLevel.String.md)): void + - : Sets the phone number to use for the customer. + The length is restricted to 32 characters. + + + **Parameters:** + - number - the phone number to use for the customer. + + +--- + +### setPhoneMobile(String) +- setPhoneMobile(number: [String](TopLevel.String.md)): void + - : Sets the mobile phone number to use for the customer. + The length is restricted to 32 characters. + + + **Parameters:** + - number - the mobile phone number to use for the customer. + + +--- + +### setPreferredLocale(String) +- setPreferredLocale(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's preferred locale. + + **Parameters:** + - aValue - the customer's preferred locale. + + +--- + +### setSaluation(String) +- ~~setSaluation(salutation: [String](TopLevel.String.md)): void~~ + - : Sets the salutation to use for the customer. + + **Parameters:** + - salutation - the salutation to use for the customer. + + **Deprecated:** +:::warning +Use [setSalutation(String)](dw.customer.Profile.md#setsalutationstring) +::: + +--- + +### setSalutation(String) +- setSalutation(salutation: [String](TopLevel.String.md)): void + - : Sets the salutation to use for the customer. + + **Parameters:** + - salutation - the salutation to use for the customer. + + +--- + +### setSecondName(String) +- setSecondName(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's second name. + + **Parameters:** + - aValue - the customer's second name. + + +--- + +### setSuffix(String) +- setSuffix(aValue: [String](TopLevel.String.md)): void + - : Sets the the customer's suffix. + + **Parameters:** + - aValue - the customer's suffix. + + +--- + +### setTaxID(String) +- setTaxID(taxID: [String](TopLevel.String.md)): void + - : Sets the tax ID value. The value can be set if the current context + allows write access. + The current context allows write access if the currently + logged in user owns this profile and the connection is secured. + + + **Parameters:** + - taxID - the tax ID value to set + + +--- + +### setTaxIDType(String) +- setTaxIDType(taxIdType: [String](TopLevel.String.md)): void + - : Sets the tax ID type. + + **Parameters:** + - taxIdType - the tax ID type to set + + +--- + +### setTitle(String) +- setTitle(aValue: [String](TopLevel.String.md)): void + - : Sets the customer's title. + + **Parameters:** + - aValue - the customer's title. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.Wallet.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Wallet.md new file mode 100644 index 00000000..d8f8bf4a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.Wallet.md @@ -0,0 +1,136 @@ + +# Class Wallet + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.Wallet](dw.customer.Wallet.md) + +Represents a set of payment instruments associated with a registered customer. + + +**Note:** this class allows access to sensitive personal and private +information. Pay attention to appropriate legal and regulatory requirements +when developing. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [defaultPaymentInstrument](#defaultpaymentinstrument): [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) `(read-only)` | Returns the default payment instrument associated with the related customer. | +| [paymentInstruments](#paymentinstruments): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all payment instruments associated with the related customer. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createPaymentInstrument](dw.customer.Wallet.md#createpaymentinstrumentstring)([String](TopLevel.String.md)) | Creates a new, empty payment instrument object associated with the related customer for the given payment method. | +| [getDefaultPaymentInstrument](dw.customer.Wallet.md#getdefaultpaymentinstrument)() | Returns the default payment instrument associated with the related customer. | +| [getPaymentInstruments](dw.customer.Wallet.md#getpaymentinstruments)() | Returns a collection of all payment instruments associated with the related customer. | +| [getPaymentInstruments](dw.customer.Wallet.md#getpaymentinstrumentsstring)([String](TopLevel.String.md)) | Returns a collection of all payment instruments associated with the related customer filtered by the given payment method id. | +| [removePaymentInstrument](dw.customer.Wallet.md#removepaymentinstrumentcustomerpaymentinstrument)([CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md)) | Removes a payment instrument associated with the customer. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### defaultPaymentInstrument +- defaultPaymentInstrument: [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) `(read-only)` + - : Returns the default payment instrument associated with the related customer. If not available, returns the first + payment instrument or null if no payment instruments are associated with the customer. + + + +--- + +### paymentInstruments +- paymentInstruments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all payment instruments associated with the + related customer. + + + +--- + +## Method Details + +### createPaymentInstrument(String) +- createPaymentInstrument(paymentMethodId: [String](TopLevel.String.md)): [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) + - : Creates a new, empty payment instrument object associated with the + related customer for the given payment method. + + + **Parameters:** + - paymentMethodId - the id of a payment method + + **Returns:** + - the new payment instrument object. + + **Throws:** + - NullArgumentException - If passed 'paymentMethodId' is null. + + +--- + +### getDefaultPaymentInstrument() +- getDefaultPaymentInstrument(): [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) + - : Returns the default payment instrument associated with the related customer. If not available, returns the first + payment instrument or null if no payment instruments are associated with the customer. + + + **Returns:** + - The default payment instrument object. + + +--- + +### getPaymentInstruments() +- getPaymentInstruments(): [Collection](dw.util.Collection.md) + - : Returns a collection of all payment instruments associated with the + related customer. + + + **Returns:** + - Collection of all payment instruments. + + +--- + +### getPaymentInstruments(String) +- getPaymentInstruments(paymentMethodID: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns a collection of all payment instruments associated with the + related customer filtered by the given payment method id. If + `null` is passed as payment method id all payment instruments + of the customer will be retrieved. If for the given payment method id no + payment instrument is associated with the customer an empty collection + will be returned. + + + **Parameters:** + - paymentMethodID - the paymentMethodID the payment method id to filter for + + **Returns:** + - Collection of payment instruments for a payment method. + + +--- + +### removePaymentInstrument(CustomerPaymentInstrument) +- removePaymentInstrument(instrument: [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md)): void + - : Removes a payment instrument associated with the customer. + + **Parameters:** + - instrument - the instrument associated with this customer + + **Throws:** + - NullArgumentException - If passed 'instrument' is null. + - IllegalArgumentException - If passed 'instrument' belongs to an other customer + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.md new file mode 100644 index 00000000..ab6f7eaf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.md @@ -0,0 +1,31 @@ +# Package dw.customer + +## Classes +| Class | Description | +| --- | --- | +| [AddressBook](dw.customer.AddressBook.md) | Represents a set of addresses associated with a specific customer. | +| [AgentUserMgr](dw.customer.AgentUserMgr.md) | Provides helper methods for handling agent user functionality (login and logout) Pay attention to appropriate legal and regulatory requirements related to this functionality. | +| [AgentUserStatusCodes](dw.customer.AgentUserStatusCodes.md) | AgentUserStatusCodes contains constants representing status codes that can be used with a [Status](dw.system.Status.md) object to indicate the success or failure of the agent user login process. | +| [AuthenticationStatus](dw.customer.AuthenticationStatus.md) | Holds the status of an authentication process. | +| [Credentials](dw.customer.Credentials.md) | Represents the credentials of a customer. | +| [Customer](dw.customer.Customer.md) | Represents a customer. | +| [CustomerActiveData](dw.customer.CustomerActiveData.md) | Represents the active data for a [Customer](dw.customer.Customer.md) in Commerce Cloud Digital. | +| [CustomerAddress](dw.customer.CustomerAddress.md) | The Address class represents a customer's address. | +| [CustomerCDPData](dw.customer.CustomerCDPData.md) | Represents the read-only Customer's Salesforce CDP (Customer Data Platform) data for a [Customer](dw.customer.Customer.md) in Commerce Cloud. | +| [CustomerContextMgr](dw.customer.CustomerContextMgr.md) | Provides helper methods for managing customer context, such as the Effective Time for which the customer is shopping at | +| [CustomerGroup](dw.customer.CustomerGroup.md) | CustomerGroups provide a means to segment customers by various criteria. | +| [CustomerList](dw.customer.CustomerList.md) | Object representing the collection of customers who are registered for a given site. | +| [CustomerMgr](dw.customer.CustomerMgr.md) | Provides helper methods for managing customers and customer profiles. | +| [CustomerPasswordConstraints](dw.customer.CustomerPasswordConstraints.md) | Provides access to the constraints of customer passwords. | +| [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md) | Represents any payment instrument stored in the customers profile, such as credit card or bank transfer. | +| [CustomerStatusCodes](dw.customer.CustomerStatusCodes.md) | CustomerStatusCodes contains constants representing status codes that can be used with a Status object to indicate the success or failure of an operation. | +| [EncryptedObject](dw.customer.EncryptedObject.md) | Defines a API base class for classes containing encrypted attributes like credit cards. | +| [ExternalProfile](dw.customer.ExternalProfile.md) | Represents the credentials of a customer. | +| [OrderHistory](dw.customer.OrderHistory.md) | The class provides access to past orders of the customer. | +| [ProductList](dw.customer.ProductList.md) | Represents a list of products (and optionally a gift certificate) that is typically maintained by a customer. | +| [ProductListItem](dw.customer.ProductListItem.md) | An item in a product list. | +| [ProductListItemPurchase](dw.customer.ProductListItemPurchase.md) | A record of the purchase of an item contained in a product list. | +| [ProductListMgr](dw.customer.ProductListMgr.md) | ProductListMgr provides methods for retrieving, creating, searching for, and removing product lists. | +| [ProductListRegistrant](dw.customer.ProductListRegistrant.md) | A ProductListRegistrant is typically associated with an event related product list such as a gift registry. | +| [Profile](dw.customer.Profile.md) | The class represents a customer profile. | +| [Wallet](dw.customer.Wallet.md) | Represents a set of payment instruments associated with a registered customer. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthAccessTokenResponse.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthAccessTokenResponse.md new file mode 100644 index 00000000..eb498933 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthAccessTokenResponse.md @@ -0,0 +1,171 @@ + +# Class OAuthAccessTokenResponse + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.oauth.OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) + +Contains OAuth-related artifacts from the HTTP response from the third-party +OAuth server when requesting an access token + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [IDToken](#idtoken): [String](TopLevel.String.md) `(read-only)` | Returns the ID token, if available | +| [accessToken](#accesstoken): [String](TopLevel.String.md) `(read-only)` | Returns the access token | +| [accessTokenExpiry](#accesstokenexpiry): [Number](TopLevel.Number.md) `(read-only)` | Returns the access token expiration | +| [errorStatus](#errorstatus): [String](TopLevel.String.md) `(read-only)` | Returns the error status. | +| [extraTokens](#extratokens): [Map](dw.util.Map.md) `(read-only)` | Returns a map of additional tokens found in the response. | +| [oauthProviderId](#oauthproviderid): [String](TopLevel.String.md) `(read-only)` | Returns the OAuth provider id | +| [refreshToken](#refreshtoken): [String](TopLevel.String.md) `(read-only)` | Returns the refresh token | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAccessToken](dw.customer.oauth.OAuthAccessTokenResponse.md#getaccesstoken)() | Returns the access token | +| [getAccessTokenExpiry](dw.customer.oauth.OAuthAccessTokenResponse.md#getaccesstokenexpiry)() | Returns the access token expiration | +| [getErrorStatus](dw.customer.oauth.OAuthAccessTokenResponse.md#geterrorstatus)() | Returns the error status. | +| [getExtraTokens](dw.customer.oauth.OAuthAccessTokenResponse.md#getextratokens)() | Returns a map of additional tokens found in the response. | +| [getIDToken](dw.customer.oauth.OAuthAccessTokenResponse.md#getidtoken)() | Returns the ID token, if available | +| [getOauthProviderId](dw.customer.oauth.OAuthAccessTokenResponse.md#getoauthproviderid)() | Returns the OAuth provider id | +| [getRefreshToken](dw.customer.oauth.OAuthAccessTokenResponse.md#getrefreshtoken)() | Returns the refresh token | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### IDToken +- IDToken: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID token, if available + + +--- + +### accessToken +- accessToken: [String](TopLevel.String.md) `(read-only)` + - : Returns the access token + + +--- + +### accessTokenExpiry +- accessTokenExpiry: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the access token expiration + + +--- + +### errorStatus +- errorStatus: [String](TopLevel.String.md) `(read-only)` + - : Returns the error status. + In cases of errors - more detailed error information + can be seen in the error log files (specifity of error details vary by OAuth provider). + + + +--- + +### extraTokens +- extraTokens: [Map](dw.util.Map.md) `(read-only)` + - : Returns a map of additional tokens found in the response. + + +--- + +### oauthProviderId +- oauthProviderId: [String](TopLevel.String.md) `(read-only)` + - : Returns the OAuth provider id + + +--- + +### refreshToken +- refreshToken: [String](TopLevel.String.md) `(read-only)` + - : Returns the refresh token + + +--- + +## Method Details + +### getAccessToken() +- getAccessToken(): [String](TopLevel.String.md) + - : Returns the access token + + **Returns:** + - the access token, if available, null otherwise + + +--- + +### getAccessTokenExpiry() +- getAccessTokenExpiry(): [Number](TopLevel.Number.md) + - : Returns the access token expiration + + **Returns:** + - the access token expiration + + +--- + +### getErrorStatus() +- getErrorStatus(): [String](TopLevel.String.md) + - : Returns the error status. + In cases of errors - more detailed error information + can be seen in the error log files (specifity of error details vary by OAuth provider). + + + **Returns:** + - the error status, if available, null otherwise + + +--- + +### getExtraTokens() +- getExtraTokens(): [Map](dw.util.Map.md) + - : Returns a map of additional tokens found in the response. + + **Returns:** + - Additional tokens provided by the token end-point. May be null or empty. + + +--- + +### getIDToken() +- getIDToken(): [String](TopLevel.String.md) + - : Returns the ID token, if available + + **Returns:** + - the ID token, if available, null otherwise + + +--- + +### getOauthProviderId() +- getOauthProviderId(): [String](TopLevel.String.md) + - : Returns the OAuth provider id + + **Returns:** + - the OAuth provider id + + +--- + +### getRefreshToken() +- getRefreshToken(): [String](TopLevel.String.md) + - : Returns the refresh token + + **Returns:** + - the refresh token, if available, null otherwise + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthFinalizedResponse.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthFinalizedResponse.md new file mode 100644 index 00000000..9f8ec56d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthFinalizedResponse.md @@ -0,0 +1,75 @@ + +# Class OAuthFinalizedResponse + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.oauth.OAuthFinalizedResponse](dw.customer.oauth.OAuthFinalizedResponse.md) + +Contains the combined responses from the third-party OAuth server when +finalizing the authentication. + + +Contains both the [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) + +and the [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [accessTokenResponse](#accesstokenresponse): [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) `(read-only)` | Returns the access token response | +| [userInfoResponse](#userinforesponse): [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) `(read-only)` | Returns the user info response | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAccessTokenResponse](dw.customer.oauth.OAuthFinalizedResponse.md#getaccesstokenresponse)() | Returns the access token response | +| [getUserInfoResponse](dw.customer.oauth.OAuthFinalizedResponse.md#getuserinforesponse)() | Returns the user info response | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### accessTokenResponse +- accessTokenResponse: [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) `(read-only)` + - : Returns the access token response + + +--- + +### userInfoResponse +- userInfoResponse: [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) `(read-only)` + - : Returns the user info response + + +--- + +## Method Details + +### getAccessTokenResponse() +- getAccessTokenResponse(): [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) + - : Returns the access token response + + **Returns:** + - the access token response + + +--- + +### getUserInfoResponse() +- getUserInfoResponse(): [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) + - : Returns the user info response + + **Returns:** + - the user info response + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthLoginFlowMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthLoginFlowMgr.md new file mode 100644 index 00000000..3e8ee7d6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthLoginFlowMgr.md @@ -0,0 +1,165 @@ + +# Class OAuthLoginFlowMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.oauth.OAuthLoginFlowMgr](dw.customer.oauth.OAuthLoginFlowMgr.md) + +The OAuthLoginFlowMgr encapsulates interactions with third party +OAuth providers to support the Authorization Code Flow. + +The way to use is: + +- call [initiateOAuthLogin(String)](dw.customer.oauth.OAuthLoginFlowMgr.md#initiateoauthloginstring) +- redirect the user to the returned link +- when the user authenticates there the server will call back to a URL configured on the provider's web site +- when processing the request made from the provider's web site you have two choices - either call the [obtainAccessToken()](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainaccesstoken)and [obtainUserInfo(String, String)](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainuserinfostring-string)methods one after another separately (gives you more flexibility), or call the [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin)method which internally calls the other two (simpler to use). + +Sample code for using it: + +``` +var finalizedResponse : OAuthFinalizedResponse = OAuthLoginFlowMgr.finalizeOAuthLogin(); +var userInfo = finalizedResponse.userInfoResponse.userInfo; +``` + +or: + +``` +var accessTokenResponse : OAuthAccessTokenResponse = OAuthLoginFlowMgr.obtainAccessToken(); +var userInfoResponse : OAuthUserInfoResponse = OAuthLoginFlowMgr.obtainUserInfo( + accessTokenResponse.oauthProviderId, accessTokenResponse.accessToken); +var userInfo = userInfoResponse.userInfo; +``` + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [OAuthLoginFlowMgr](#oauthloginflowmgr)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| static [finalizeOAuthLogin](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin)() | This method works in tandem with the [initiateOAuthLogin(String)](dw.customer.oauth.OAuthLoginFlowMgr.md#initiateoauthloginstring) method. | +| static [initiateOAuthLogin](dw.customer.oauth.OAuthLoginFlowMgr.md#initiateoauthloginstring)([String](TopLevel.String.md)) | This method works in tandem with another method - [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). | +| static [obtainAccessToken](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainaccesstoken)() | This method is called internally by [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). | +| static [obtainUserInfo](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainuserinfostring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | This method is called internally by [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### OAuthLoginFlowMgr() +- OAuthLoginFlowMgr() + - : + + +--- + +## Method Details + +### finalizeOAuthLogin() +- static finalizeOAuthLogin(): [OAuthFinalizedResponse](dw.customer.oauth.OAuthFinalizedResponse.md) + - : This method works in tandem with the [initiateOAuthLogin(String)](dw.customer.oauth.OAuthLoginFlowMgr.md#initiateoauthloginstring) method. + After the user has been redirected to the URL returned by that method + to the external OAuth2 provider and the user has interacted with the provider's + site, the browser is redirected to a URL configured on the provider's web + site. This URL should be that of a pipeline that contains + a script invoking the finalizeOAuthLogin method. + + + At this point the user has either been authenticated by the external provider + or not (forgot password, or simply refused to provide credentials). If the user + has been authenticated by the external provider and the provider returns an + authentication code, this method exchanges the code for a token and with that + token it requests from the provider the user information specified by the + configured scope (id, first/last name, email, etc.). + + + + The method is aggregation of two other methods - [obtainAccessToken()](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainaccesstoken) + and [obtainUserInfo(String, String)](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainuserinfostring-string) + and is provided for convenience. You may want to + use the two individual methods instead if you need more flexibility. + + + + This supports the Authorization Code Flow. + + + **Returns:** + - the user info on success, null otherwise + + +--- + +### initiateOAuthLogin(String) +- static initiateOAuthLogin(oauthProviderId: [String](TopLevel.String.md)): [URLRedirect](dw.web.URLRedirect.md) + - : This method works in tandem with another method - [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). + It starts the process of authentication via an external OAuth2 provider. It + takes one parameter - OAuthProviderId (as configured in the system). Outputs + an URL pointing to the OAuth2 provider's web page to which the browser should + redirect to initiate the actual user authentication or NULL if there is an + invalid configuration or an error occurs. + The method stores a few key/values in the session + ([Session.getPrivacy()](dw.system.Session.md#getprivacy), implementation specific parameters and may change at any time) + to be picked up by the [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin) method when the provider redirects back. + + + + This supports the Authorization Code Flow. + + + **Parameters:** + - oauthProviderId - the OAuth provider id + + **Returns:** + - URL to redirect to + + +--- + +### obtainAccessToken() +- static obtainAccessToken(): [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) + - : This method is called internally by [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). + There are customer requests to expose a more granular way of + doing the interactions that finalizeOAuthLogin is currently doing + with the third party OAuth server to accommodate certain providers. + + + + This supports the Authorization Code Flow. + + + **Returns:** + - the access token response + + +--- + +### obtainUserInfo(String, String) +- static obtainUserInfo(oauthProviderId: [String](TopLevel.String.md), accessToken: [String](TopLevel.String.md)): [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) + - : This method is called internally by [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin). + There are customer requests to expose a more granular way of + doing the interactions that finalizeOAuthLogin is currently doing + with the third party OAuth server to accommodate certain providers. + + + + This supports the Authorization Code Flow. + + + **Parameters:** + - oauthProviderId - the OAuth provider id + - accessToken - the OAuth provider's access token + + **Returns:** + - the user info response + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthUserInfoResponse.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthUserInfoResponse.md new file mode 100644 index 00000000..fbeb141a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.OAuthUserInfoResponse.md @@ -0,0 +1,84 @@ + +# Class OAuthUserInfoResponse + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.oauth.OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) + +Contains the response from the third-party OAuth server when +requesting user info. Refer to the corresponding OAuth provider documentation +regarding what the format might be (in most cases it would be JSON). +The data returned would also vary depending on the scope. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [errorStatus](#errorstatus): [String](TopLevel.String.md) `(read-only)` | Returns the error status In cases of errors - more detailed error information can be seen in the error log files (specificity of error details vary by OAuth provider). | +| [userInfo](#userinfo): [String](TopLevel.String.md) `(read-only)` | Returns the user info as a String. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getErrorStatus](dw.customer.oauth.OAuthUserInfoResponse.md#geterrorstatus)() | Returns the error status In cases of errors - more detailed error information can be seen in the error log files (specificity of error details vary by OAuth provider). | +| [getUserInfo](dw.customer.oauth.OAuthUserInfoResponse.md#getuserinfo)() | Returns the user info as a String. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### errorStatus +- errorStatus: [String](TopLevel.String.md) `(read-only)` + - : Returns the error status + In cases of errors - more detailed error information + can be seen in the error log files (specificity of error details vary by OAuth provider). + + + +--- + +### userInfo +- userInfo: [String](TopLevel.String.md) `(read-only)` + - : Returns the user info as a String. Refer to the corresponding OAuth provider documentation + regarding what the format might be (in most cases it would be JSON). + The data returned would also vary depending on the configured 'scope'. + + + +--- + +## Method Details + +### getErrorStatus() +- getErrorStatus(): [String](TopLevel.String.md) + - : Returns the error status + In cases of errors - more detailed error information + can be seen in the error log files (specificity of error details vary by OAuth provider). + + + **Returns:** + - the error status + + +--- + +### getUserInfo() +- getUserInfo(): [String](TopLevel.String.md) + - : Returns the user info as a String. Refer to the corresponding OAuth provider documentation + regarding what the format might be (in most cases it would be JSON). + The data returned would also vary depending on the configured 'scope'. + + + **Returns:** + - the user info + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.md new file mode 100644 index 00000000..102161dd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.oauth.md @@ -0,0 +1,9 @@ +# Package dw.customer.oauth + +## Classes +| Class | Description | +| --- | --- | +| [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md) | Contains OAuth-related artifacts from the HTTP response from the third-party OAuth server when requesting an access token | +| [OAuthFinalizedResponse](dw.customer.oauth.OAuthFinalizedResponse.md) | Contains the combined responses from the third-party OAuth server when finalizing the authentication.

        Contains both the [OAuthAccessTokenResponse](dw.customer.oauth.OAuthAccessTokenResponse.md)
        and the [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) | +| [OAuthLoginFlowMgr](dw.customer.oauth.OAuthLoginFlowMgr.md) | The OAuthLoginFlowMgr encapsulates interactions with third party OAuth providers to support the Authorization Code Flow.
        The way to use is:

        • call [initiateOAuthLogin(String)](dw.customer.oauth.OAuthLoginFlowMgr.md#initiateoauthloginstring)
        • redirect the user to the returned link
        • when the user authenticates there the server will call back to a URL configured on the provider's web site
        • when processing the request made from the provider's web site you have two choices - either call the [obtainAccessToken()](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainaccesstoken) and [obtainUserInfo(String, String)](dw.customer.oauth.OAuthLoginFlowMgr.md#obtainuserinfostring-string) methods one after another separately (gives you more flexibility), or call the [finalizeOAuthLogin()](dw.customer.oauth.OAuthLoginFlowMgr.md#finalizeoauthlogin) method which internally calls the other two (simpler to use).
        Sample code for using it: | +| [OAuthUserInfoResponse](dw.customer.oauth.OAuthUserInfoResponse.md) | Contains the response from the third-party OAuth server when requesting user info. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContext.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContext.md new file mode 100644 index 00000000..8444973e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContext.md @@ -0,0 +1,369 @@ + +# Class ShopperContext + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.shoppercontext.ShopperContext](dw.customer.shoppercontext.ShopperContext.md) + +The class represents Shopper Context. It is used to manage personalized shopping experiences on your storefront. + + +Shopper Context is used to personalize shopper experiences with context values such as custom session attributes, +assignment qualifiers, geolocation, clientIP address, effective date time, source code, coupon code and customer +groups. + + + + +When Shopper Context is set for a shopper, the context is applied in the next request and can activate promotions or +price books assigned to customer groups, source codes, or stores (via assignments). +Also see: [ShopperContextMgr](dw.customer.shoppercontext.ShopperContextMgr.md) + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [assignmentQualifiers](#assignmentqualifiers): [Map](dw.util.Map.md) | Returns the assignment qualifiers from the Shopper Context. | +| [clientIP](#clientip): [String](TopLevel.String.md) | Returns the IP address of the client from the Shopper Context. | +| [couponCodes](#couponcodes): [Set](dw.util.Set.md) | Returns the Coupon codes from the Shopper Context. | +| [customQualifiers](#customqualifiers): [Map](dw.util.Map.md) | Returns the custom qualifiers from the Shopper Context. | +| [customerGroupIDs](#customergroupids): [Set](dw.util.Set.md) | Returns customer group IDs from the Shopper Context to apply. | +| [effectiveDateTime](#effectivedatetime): [Date](TopLevel.Date.md) | Returns the effective date time from the Shopper Context. | +| [geolocation](#geolocation): [Geolocation](dw.util.Geolocation.md) | Returns the geographic location from the Shopper Context. | +| [sourceCode](#sourcecode): [String](TopLevel.String.md) | Returns the source code from the Shopper Context. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ShopperContext](#shoppercontext)() | Constructor for ShopperContext. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAssignmentQualifiers](dw.customer.shoppercontext.ShopperContext.md#getassignmentqualifiers)() | Returns the assignment qualifiers from the Shopper Context. | +| [getClientIP](dw.customer.shoppercontext.ShopperContext.md#getclientip)() | Returns the IP address of the client from the Shopper Context. | +| [getCouponCodes](dw.customer.shoppercontext.ShopperContext.md#getcouponcodes)() | Returns the Coupon codes from the Shopper Context. | +| [getCustomQualifiers](dw.customer.shoppercontext.ShopperContext.md#getcustomqualifiers)() | Returns the custom qualifiers from the Shopper Context. | +| [getCustomerGroupIDs](dw.customer.shoppercontext.ShopperContext.md#getcustomergroupids)() | Returns customer group IDs from the Shopper Context to apply. | +| [getEffectiveDateTime](dw.customer.shoppercontext.ShopperContext.md#geteffectivedatetime)() | Returns the effective date time from the Shopper Context. | +| [getGeolocation](dw.customer.shoppercontext.ShopperContext.md#getgeolocation)() | Returns the geographic location from the Shopper Context. | +| [getSourceCode](dw.customer.shoppercontext.ShopperContext.md#getsourcecode)() | Returns the source code from the Shopper Context. | +| [setAssignmentQualifiers](dw.customer.shoppercontext.ShopperContext.md#setassignmentqualifiersmap)([Map](dw.util.Map.md)) | Sets the assignment qualifiers in the Shopper Context. | +| [setClientIP](dw.customer.shoppercontext.ShopperContext.md#setclientipstring)([String](TopLevel.String.md)) | Sets the IP address of the client in the Shopper Context. | +| [setCouponCodes](dw.customer.shoppercontext.ShopperContext.md#setcouponcodesset)([Set](dw.util.Set.md)) | Sets the Coupon codes in the Shopper Context. | +| [setCustomQualifiers](dw.customer.shoppercontext.ShopperContext.md#setcustomqualifiersmap)([Map](dw.util.Map.md)) | Sets the session custom attributes as custom qualifiers in the Shopper Context. | +| [setCustomerGroupIDs](dw.customer.shoppercontext.ShopperContext.md#setcustomergroupidsset)([Set](dw.util.Set.md)) | Sets the customer group IDs for the Shopper Context to apply. | +| [setEffectiveDateTime](dw.customer.shoppercontext.ShopperContext.md#seteffectivedatetimedate)([Date](TopLevel.Date.md)) | Sets the effective date time for the context to apply. | +| [setGeolocation](dw.customer.shoppercontext.ShopperContext.md#setgeolocationgeolocation)([Geolocation](dw.util.Geolocation.md)) | Sets the geographic location of the client in the Shopper Context. | +| [setSourceCode](dw.customer.shoppercontext.ShopperContext.md#setsourcecodestring)([String](TopLevel.String.md)) | Sets the source code for the Shopper Context to apply. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### assignmentQualifiers +- assignmentQualifiers: [Map](dw.util.Map.md) + - : Returns the assignment qualifiers from the Shopper Context. Assignment qualifiers are set when using the + assignment framework to trigger pricing and promotion experiences for Products, Product Search, Basket, Shipping + methods etc. + + + +--- + +### clientIP +- clientIP: [String](TopLevel.String.md) + - : Returns the IP address of the client from the Shopper Context. + + +--- + +### couponCodes +- couponCodes: [Set](dw.util.Set.md) + - : Returns the Coupon codes from the Shopper Context. + + +--- + +### customQualifiers +- customQualifiers: [Map](dw.util.Map.md) + - : Returns the custom qualifiers from the Shopper Context. Custom qualifiers contain the custom session attributes + set in the Shopper Context. + + + +--- + +### customerGroupIDs +- customerGroupIDs: [Set](dw.util.Set.md) + - : Returns customer group IDs from the Shopper Context to apply. The customer group IDs set in Shopper Context + evaluate to customer groups that trigger the promotions (campaign assignment) assigned to the customer groups. + + + +--- + +### effectiveDateTime +- effectiveDateTime: [Date](TopLevel.Date.md) + - : Returns the effective date time from the Shopper Context. With the effective date time you can retrieve + promotions that are active at a particular time. For example, "Shop the Future" use cases. + + + +--- + +### geolocation +- geolocation: [Geolocation](dw.util.Geolocation.md) + - : Returns the geographic location from the Shopper Context. + + +--- + +### sourceCode +- sourceCode: [String](TopLevel.String.md) + - : Returns the source code from the Shopper Context. The source code set in Shopper Context evaluates to source code + group that triggers the promotion (campaign assignment) and Price books (assigned to Source code group). + + + +--- + +## Constructor Details + +### ShopperContext() +- ShopperContext() + - : Constructor for ShopperContext. + + + This constructor is used to create an empty object. The object will be empty and must be populated with the + appropriate setter methods. For example: + + ``` + ShopperContext context = new ShopperContext(); + context.setSourceCode( "sourcecode" ); + ShopperContextMgr.setShopperContext( context, true ); + ``` + + + +--- + +## Method Details + +### getAssignmentQualifiers() +- getAssignmentQualifiers(): [Map](dw.util.Map.md) + - : Returns the assignment qualifiers from the Shopper Context. Assignment qualifiers are set when using the + assignment framework to trigger pricing and promotion experiences for Products, Product Search, Basket, Shipping + methods etc. + + + **Returns:** + - A map of assignment qualifiers set in the Shopper Context. + + +--- + +### getClientIP() +- getClientIP(): [String](TopLevel.String.md) + - : Returns the IP address of the client from the Shopper Context. + + **Returns:** + - The IP address of the client set in the Shopper Context. + + +--- + +### getCouponCodes() +- getCouponCodes(): [Set](dw.util.Set.md) + - : Returns the Coupon codes from the Shopper Context. + + **Returns:** + - The Coupon codes set in the Shopper Context. + + +--- + +### getCustomQualifiers() +- getCustomQualifiers(): [Map](dw.util.Map.md) + - : Returns the custom qualifiers from the Shopper Context. Custom qualifiers contain the custom session attributes + set in the Shopper Context. + + + **Returns:** + - A map containing the custom qualifiers set in the Shopper Context. + + +--- + +### getCustomerGroupIDs() +- getCustomerGroupIDs(): [Set](dw.util.Set.md) + - : Returns customer group IDs from the Shopper Context to apply. The customer group IDs set in Shopper Context + evaluate to customer groups that trigger the promotions (campaign assignment) assigned to the customer groups. + + + **Returns:** + - The customer group IDs for the Shopper Context to apply. + + +--- + +### getEffectiveDateTime() +- getEffectiveDateTime(): [Date](TopLevel.Date.md) + - : Returns the effective date time from the Shopper Context. With the effective date time you can retrieve + promotions that are active at a particular time. For example, "Shop the Future" use cases. + + + **Returns:** + - The effective date time in UTC for the Shopper Context to apply. + + +--- + +### getGeolocation() +- getGeolocation(): [Geolocation](dw.util.Geolocation.md) + - : Returns the geographic location from the Shopper Context. + + **Returns:** + - The geographic location set in the Shopper Context. + + +--- + +### getSourceCode() +- getSourceCode(): [String](TopLevel.String.md) + - : Returns the source code from the Shopper Context. The source code set in Shopper Context evaluates to source code + group that triggers the promotion (campaign assignment) and Price books (assigned to Source code group). + + + **Returns:** + - The source code for the Shopper Context to apply. + + +--- + +### setAssignmentQualifiers(Map) +- setAssignmentQualifiers(assignmentQualifiers: [Map](dw.util.Map.md)): void + - : Sets the assignment qualifiers in the Shopper Context. Assignment qualifiers are set when using the assignment + framework to trigger pricing and promotion experiences for Products, Product Search, Basket, Shipping methods + etc. + + + **Example: Assignment qualifier for store can be set as follows: ** + + ``` + var assignmentQualifiers = new dw.util.HashMap(); + assignmentQualifiers.put( "storeId", "Boston" ); + ShopperContext context = new ShopperContext(); + context.setAssignmentQualifiers( customQualifiers ); + ShopperContextMgr.setShopperContext( context, true ); + ``` + + + **Parameters:** + - assignmentQualifiers - A map which contains the assignment qualifiers to save in the Shopper Context. + + +--- + +### setClientIP(String) +- setClientIP(clientIP: [String](TopLevel.String.md)): void + - : Sets the IP address of the client in the Shopper Context. The client IP evaluates to a geolocation. If the client + IP address is not a valid IPv4/IPv6 address an error is thrown. + + + **Parameters:** + - clientIP - The IP Address of the client to set in the Shopper Context. + + +--- + +### setCouponCodes(Set) +- setCouponCodes(couponCodes: [Set](dw.util.Set.md)): void + - : Sets the Coupon codes in the Shopper Context. When you set coupon codes, it is saved as context for subsequent + requests and can then trigger promotions via the campaign which are tied to the coupon. A maximum of 5 coupon + codes can be set in the ShopperContext. + + + **Parameters:** + - couponCodes - The set of coupon codes to set in the Shopper Context. A maximum of 5 coupon codes per ShopperContext are allowed. + + +--- + +### setCustomQualifiers(Map) +- setCustomQualifiers(customQualifiers: [Map](dw.util.Map.md)): void + - : Sets the session custom attributes as custom qualifiers in the Shopper Context. Custom qualifiers are set when + you want to trigger pricing and promotion experiences using a dynamic session-based customer groups. + + + **Example: A session custom attribute 'device\_type' can be saved as follows: ** + + ``` + var customQualifiers = new dw.util.HashMap(); + customQualifiers.put( "deviceType", "iPad" ); + ShopperContext context = new ShopperContext(); + context.setCustomQualifiers( customQualifiers ); + ShopperContextMgr.setShopperContext( context, true ); + ``` + + + **Parameters:** + - customQualifiers - A map which contains the custom session attributes to save in the Shopper Context. + + +--- + +### setCustomerGroupIDs(Set) +- setCustomerGroupIDs(customerGroupIDs: [Set](dw.util.Set.md)): void + - : Sets the customer group IDs for the Shopper Context to apply. Set the customer group IDs to evaluate customer + groups that trigger the promotions (campaign assignment) assigned to the customer groups. + + + **Parameters:** + - customerGroupIDs - The customer group IDs for the Shopper Context to apply. + + +--- + +### setEffectiveDateTime(Date) +- setEffectiveDateTime(effectiveDateTime: [Date](TopLevel.Date.md)): void + - : Sets the effective date time for the context to apply. With the effective date time you can retrieve promotions + that are active at a particular time. For example, "Shop the Future" use cases. + + + **Parameters:** + - effectiveDateTime - The effective date time to set in the Shopper Context. + + +--- + +### setGeolocation(Geolocation) +- setGeolocation(geolocation: [Geolocation](dw.util.Geolocation.md)): void + - : Sets the geographic location of the client in the Shopper Context. When you set a geolocation, it is saved as + context for subsequent requests. This overrides any context previously saved using clientIP in the Shopper + Context. + + + **Parameters:** + - geolocation - The geographic location of the client to set in the Shopper Context. + + +--- + +### setSourceCode(String) +- setSourceCode(sourceCode: [String](TopLevel.String.md)): void + - : Sets the source code for the Shopper Context to apply. Set the source code to evaluate source code group that + triggers the promotion (campaign assignment) and Price books (assigned to Source code group). + + + **Parameters:** + - sourceCode - The source code to set in the Shopper Context. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextErrorCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextErrorCodes.md new file mode 100644 index 00000000..5df04218 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextErrorCodes.md @@ -0,0 +1,111 @@ + +# Class ShopperContextErrorCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.shoppercontext.ShopperContextErrorCodes](dw.customer.shoppercontext.ShopperContextErrorCodes.md) + +Helper class containing error codes to indicate why a Shopper Context cannot be accessed, set or modified. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED](#assignment_qualifiers_limit_exceeded): [String](TopLevel.String.md) = "ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED" | Indicates that the assignment qualifiers limit exceeded | +| [COUPON_CODES_LIMIT_EXCEEDED](#coupon_codes_limit_exceeded): [String](TopLevel.String.md) = "COUPON_CODES_LIMIT_EXCEEDED" | Indicates that the coupon codes limit exceeded | +| [CUSTOM_QUALIFIERS_LIMIT_EXCEEDED](#custom_qualifiers_limit_exceeded): [String](TopLevel.String.md) = "CUSTOM_QUALIFIERS_LIMIT_EXCEEDED" | Indicates that the custom qualifiers limit exceeded | +| [FEATURE_DISABLED](#feature_disabled): [String](TopLevel.String.md) = "FEATURE_DISABLED" | Indicates that the feature toggle 'ShopperContextEnabled' is not enabled. | +| [INTERNAL_ERROR](#internal_error): [String](TopLevel.String.md) = "INTERNAL_ERROR" | Indicates that an internal error occurred while setting, retrieving or deleting the shopper context | +| [INVALID_ARGUMENT](#invalid_argument): [String](TopLevel.String.md) = "INVALID_ARGUMENT" | Indicates an invalid argument was provided | +| [INVALID_REQUEST_TYPE](#invalid_request_type): [String](TopLevel.String.md) = "INVALID_REQUEST_TYPE" | Indicates that the request type is invalid. | +| [QUOTA_LIMIT_EXCEEDED](#quota_limit_exceeded): [String](TopLevel.String.md) = "QUOTA_LIMIT_EXCEEDED" | Indicates that the quota limit for the shopper context has been reached. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ShopperContextErrorCodes](#shoppercontexterrorcodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED + +- ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED" + - : Indicates that the assignment qualifiers limit exceeded + + +--- + +### COUPON_CODES_LIMIT_EXCEEDED + +- COUPON_CODES_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "COUPON_CODES_LIMIT_EXCEEDED" + - : Indicates that the coupon codes limit exceeded + + +--- + +### CUSTOM_QUALIFIERS_LIMIT_EXCEEDED + +- CUSTOM_QUALIFIERS_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "CUSTOM_QUALIFIERS_LIMIT_EXCEEDED" + - : Indicates that the custom qualifiers limit exceeded + + +--- + +### FEATURE_DISABLED + +- FEATURE_DISABLED: [String](TopLevel.String.md) = "FEATURE_DISABLED" + - : Indicates that the feature toggle 'ShopperContextEnabled' is not enabled. + + +--- + +### INTERNAL_ERROR + +- INTERNAL_ERROR: [String](TopLevel.String.md) = "INTERNAL_ERROR" + - : Indicates that an internal error occurred while setting, retrieving or deleting the shopper context + + +--- + +### INVALID_ARGUMENT + +- INVALID_ARGUMENT: [String](TopLevel.String.md) = "INVALID_ARGUMENT" + - : Indicates an invalid argument was provided + + +--- + +### INVALID_REQUEST_TYPE + +- INVALID_REQUEST_TYPE: [String](TopLevel.String.md) = "INVALID_REQUEST_TYPE" + - : Indicates that the request type is invalid. Request must be a SCAPI request, or a hybrid storefront request, or + an ocapi request using a SLAS token. + + + +--- + +### QUOTA_LIMIT_EXCEEDED + +- QUOTA_LIMIT_EXCEEDED: [String](TopLevel.String.md) = "QUOTA_LIMIT_EXCEEDED" + - : Indicates that the quota limit for the shopper context has been reached. + + +--- + +## Constructor Details + +### ShopperContextErrorCodes() +- ShopperContextErrorCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextException.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextException.md new file mode 100644 index 00000000..d8df6899 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextException.md @@ -0,0 +1,77 @@ + +# Class ShopperContextException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.shoppercontext.ShopperContextException](dw.customer.shoppercontext.ShopperContextException.md) + +This exception could be thrown by +[ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean), +[ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) and +[ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) when an error occurs. + + +'errorCode' property is set to one of the following values: + +- [ShopperContextErrorCodes.FEATURE_DISABLED](dw.customer.shoppercontext.ShopperContextErrorCodes.md#feature_disabled)= Indicates that the Shopper Context Feature is not enabled. +- [ShopperContextErrorCodes.CUSTOM_QUALIFIERS_LIMIT_EXCEEDED](dw.customer.shoppercontext.ShopperContextErrorCodes.md#custom_qualifiers_limit_exceeded)= Indicates that the number of custom qualifiers in [ShopperContext](dw.customer.shoppercontext.ShopperContext.md)has exceeded the allowed limit. +- [ShopperContextErrorCodes.ASSIGNMENT_QUALIFIERS_LIMIT_EXCEEDED](dw.customer.shoppercontext.ShopperContextErrorCodes.md#assignment_qualifiers_limit_exceeded)= Indicates that the number of assignment qualifiers in [ShopperContext](dw.customer.shoppercontext.ShopperContext.md)has exceeded the allowed limit. +- [ShopperContextErrorCodes.QUOTA_LIMIT_EXCEEDED](dw.customer.shoppercontext.ShopperContextErrorCodes.md#quota_limit_exceeded)= Indicates that the quota limit for the Shopper Context has been reached. +For more information on shopper context quota limits please refer to: [Shopper Context Quota Limits](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html\#constraints) + +- [ShopperContextErrorCodes.INTERNAL_ERROR](dw.customer.shoppercontext.ShopperContextErrorCodes.md#internal_error)= Indicates that an error occurred while setting, retrieving or deleting the shopper context. +- [ShopperContextErrorCodes.INVALID_ARGUMENT](dw.customer.shoppercontext.ShopperContextErrorCodes.md#invalid_argument)= Indicates that an invalid client IP address was set in the Shopper Context. +- [ShopperContextErrorCodes.INVALID_REQUEST_TYPE](dw.customer.shoppercontext.ShopperContextErrorCodes.md#invalid_request_type)= Indicates that the request type is invalid. Request must be a SCAPI request, or a hybrid storefront request, or an OCAPI request using a SLAS token. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [errorCode](#errorcode): [String](TopLevel.String.md) `(read-only)` | Indicates reason why the following methods failed: [ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean) or [ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) or [ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) failed. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getErrorCode](dw.customer.shoppercontext.ShopperContextException.md#geterrorcode)() | Indicates reason why the following methods failed: [ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean) or [ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) or [ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) failed. | + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### errorCode +- errorCode: [String](TopLevel.String.md) `(read-only)` + - : Indicates reason why the following methods failed: + [ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean) or + [ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) or + [ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) failed. + + + +--- + +## Method Details + +### getErrorCode() +- getErrorCode(): [String](TopLevel.String.md) + - : Indicates reason why the following methods failed: + [ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean) or + [ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) or + [ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) failed. + + + **Returns:** + - The error code. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextMgr.md new file mode 100644 index 00000000..42e9c012 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.ShopperContextMgr.md @@ -0,0 +1,209 @@ + +# Class ShopperContextMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.customer.shoppercontext.ShopperContextMgr](dw.customer.shoppercontext.ShopperContextMgr.md) + + + +Provides static helper methods for managing Shopper Context. + + + + +Shopper Context is used to personalize shopper experiences with context values such as custom session attributes, +assignment qualifiers, geolocation, effective datetime, source code and more. When Shopper Context is set for a +shopper, it can activate promotions or price books assigned to customer groups, source codes, or stores (via +assignments) in the subsequent requests, not the current request. + + + + +Shopper Context is used to personalize the shopper experience in case of Composable/Headless or Hybrid storefront +implementations that use Shopper Login and API Access Service (SLAS). + + + + +NOTE: This script API is not intended to be used for standard server-side storefront implementations. Only for +Composable/Headless or Hybrid storefront implementations. + + + + +Unlike [CustomerContextMgr](dw.customer.CustomerContextMgr.md) which is used to set just Effective Time for which the customer is +shopping at, Shopper Context API provides a way to set many types of contexts such as custom session attributes, +assignment qualifiers, geolocation, effective datetime, source code etc. + + + + +The following feature toggles and site preferences must be enabled in order to use this script API: + +- Enable Shopper Context Feature +- Hybrid Auth Settings' site preference - only in case of Hybrid storefront implementations + + + + + +For more details on Shopper Context please refer to: [Shopper Context +API Overview](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary) + + + + +For more details on Hybrid Authentication for Hybrid storefronts please refer to: +[Hybrid +Authentication](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hybrid-auth.html) + + + + +[ShopperContextMgr](dw.customer.shoppercontext.ShopperContextMgr.md) is used to create, access and delete Shopper Context. + +- To add Shopper Context, use methods [setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean). - To access Shopper Context, use method [getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext). - To delete Shopper Context, use methods [removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext). - To fetch Geolocation based on clientIP already set in Shopper Context, use method [getGeolocation()](dw.customer.shoppercontext.ShopperContextMgr.md#getgeolocation) + +Typical usage: + ``` + // get the ShopperContext if it exists ShopperContext context = ShopperContextMgr.getShopperContext(); if (context == null) { context = new ShopperContext(); } // set the values in the ShopperContext object context.setSourceCode( "sourcecode" ); var customQualifiers = new dw.util.HashMap(); customQualifiers.put( "deviceType", "iPad" ); context.setCustomQualifiers( customQualifiers ); // Save the ShopperContext ShopperContextMgr.setShopperContext( context, true ); + ``` +NOTE: Ensure the ShopperContext object is saved using [setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean)after setting or updating the context values. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [geolocation](#geolocation): [Geolocation](dw.util.Geolocation.md) `(read-only)` | Gets the [Geolocation](dw.util.Geolocation.md) object for the clientIP set in [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) or null if no shopperContext is found, or no clientIP was set or Geolocation for the clientIP was not found. | +| [shopperContext](#shoppercontext): [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) | Returns the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) if it exists for the customer. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getGeolocation](dw.customer.shoppercontext.ShopperContextMgr.md#getgeolocation)() | Gets the [Geolocation](dw.util.Geolocation.md) object for the clientIP set in [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) or null if no shopperContext is found, or no clientIP was set or Geolocation for the clientIP was not found. | +| static [getShopperContext](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext)() | Returns the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) if it exists for the customer. | +| static [removeShopperContext](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext)() | Removes the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) for the customer. | +| static [setShopperContext](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean)([ShopperContext](dw.customer.shoppercontext.ShopperContext.md), [Boolean](TopLevel.Boolean.md)) |

        Sets new [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) for the customer or overwrites the existing context. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### geolocation +- geolocation: [Geolocation](dw.util.Geolocation.md) `(read-only)` + - : Gets the [Geolocation](dw.util.Geolocation.md) object for the clientIP set in + [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) or null if no shopperContext is found, or no clientIP was set + or Geolocation for the clientIP was not found. + + + The method throws an exception if the call fails. + + + +--- + +### shopperContext +- shopperContext: [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) + - : Returns the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) if it exists for the customer. Returns null if it + does not exist. + + + +--- + +## Method Details + +### getGeolocation() +- static getGeolocation(): [Geolocation](dw.util.Geolocation.md) + - : Gets the [Geolocation](dw.util.Geolocation.md) object for the clientIP set in + [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) or null if no shopperContext is found, or no clientIP was set + or Geolocation for the clientIP was not found. + + + The method throws an exception if the call fails. + + + **Throws:** + - dw.customer.shoppercontext.ShopperContextException - This exception is thrown if error occurs while trying to retrieve Geolocation string from the Shopper Context. + + +--- + +### getShopperContext() +- static getShopperContext(): [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) + - : Returns the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) if it exists for the customer. Returns null if it + does not exist. + + + **Returns:** + - The Shopper Context or null. + + **Throws:** + - dw.customer.shoppercontext.ShopperContextException - This exception is thrown if an error occurs while fetching the Shopper Context. + + +--- + +### removeShopperContext() +- static removeShopperContext(): void + - : Removes the [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) for the customer. + + + The method throws an exception if the deletion of Shopper Context fails. + + + **Throws:** + - dw.customer.shoppercontext.ShopperContextException - This exception is thrown if error occurs while deleting the Shopper Context. + + +--- + +### setShopperContext(ShopperContext, Boolean) +- static setShopperContext(shopperContext: [ShopperContext](dw.customer.shoppercontext.ShopperContext.md), evaluateContextWithClientIP: [Boolean](TopLevel.Boolean.md)): void + - : + + Sets new [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) for the customer or overwrites the existing context. + + + + + Note: This method does not save the attributes from the given Shopper Context such as - custom session + attributes, source code, effective date time etc., - in the current session object. These attributes are read + from Shopper Context and stored in the corresponding session attributes during subsequent requests and not in the + current request. Hence, promotions, price books etc., are triggered in subsequent requests. + + + If `clientIP` is set in [ShopperContext](dw.customer.shoppercontext.ShopperContext.md), the geolocation information + is retrieved and set in `x-geolocation` header. + + + And if the parameter `evaluateContextWithClientIP` is set to true, the `clientIP` will be + saved to the Shopper Context. + + + If parameter `evaluateContextWithClientIP` is set to false, the `clientIP` will not be + saved to the Shopper Context. + + + If the `geoLocation` attribute is set, it overrides any geolocation context set by + `clientIP`. + + + **Parameters:** + - shopperContext - The new Shopper Context to set. See documentation for [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) + - evaluateContextWithClientIP - The boolean to determine if Shopper Context should be evaluated with clientIP address. + + **Throws:** + - dw.customer.shoppercontext.ShopperContextException - This exception is thrown if the Shopper Context is not saved or if validation fails. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.md b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.md new file mode 100644 index 00000000..fdbc9bb6 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.customer.shoppercontext.md @@ -0,0 +1,9 @@ +# Package dw.customer.shoppercontext + +## Classes +| Class | Description | +| --- | --- | +| [ShopperContext](dw.customer.shoppercontext.ShopperContext.md) | The class represents Shopper Context. | +| [ShopperContextErrorCodes](dw.customer.shoppercontext.ShopperContextErrorCodes.md) | Helper class containing error codes to indicate why a Shopper Context cannot be accessed, set or modified. | +| [ShopperContextException](dw.customer.shoppercontext.ShopperContextException.md) | This exception could be thrown by [ShopperContextMgr.setShopperContext(ShopperContext, Boolean)](dw.customer.shoppercontext.ShopperContextMgr.md#setshoppercontextshoppercontext-boolean), [ShopperContextMgr.getShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#getshoppercontext) and [ShopperContextMgr.removeShopperContext()](dw.customer.shoppercontext.ShopperContextMgr.md#removeshoppercontext) when an error occurs. | +| [ShopperContextMgr](dw.customer.shoppercontext.ShopperContextMgr.md) |

        Provides static helper methods for managing Shopper Context. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.AspectAttributeValidationException.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.AspectAttributeValidationException.md new file mode 100644 index 00000000..49a34a6e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.AspectAttributeValidationException.md @@ -0,0 +1,25 @@ + +# Class AspectAttributeValidationException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.AspectAttributeValidationException](dw.experience.AspectAttributeValidationException.md) + +This APIException is thrown by method [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) +and [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) +to indicate that the passed aspect attributes failed during validation against the +definition provided through the aspect type of the page. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.Component.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Component.md new file mode 100644 index 00000000..56706328 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Component.md @@ -0,0 +1,166 @@ + +# Class Component + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.Component](dw.experience.Component.md) + +This class represents a page designer managed component as part of a +page. A component comprises of multiple regions that again hold components, +thus spanning a hierarchical tree of components. Using the [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or +[PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) a region can be rendered which +implicitly includes rendering of all contained visible components. All +content attributes (defined by the corresponding component type) can be +accessed, reading the accordant persisted values as provided by the content editor +who created this component. + + +**See Also:** +- [Page](dw.experience.Page.md) +- [Region](dw.experience.Region.md) +- [PageMgr](dw.experience.PageMgr.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the id of this component. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of this component | +| [typeID](#typeid): [String](TopLevel.String.md) `(read-only)` | Returns the type id of this component. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttribute](dw.experience.Component.md#getattributestring)([String](TopLevel.String.md)) |

        Returns the raw attribute value identified by the specified attribute id. | +| [getID](dw.experience.Component.md#getid)() | Returns the id of this component. | +| [getName](dw.experience.Component.md#getname)() | Returns the name of this component | +| [getRegion](dw.experience.Component.md#getregionstring)([String](TopLevel.String.md)) | Returns the component region that matches the given id. | +| [getTypeID](dw.experience.Component.md#gettypeid)() | Returns the type id of this component. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the id of this component. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of this component + + +--- + +### typeID +- typeID: [String](TopLevel.String.md) `(read-only)` + - : Returns the type id of this component. + + +--- + +## Method Details + +### getAttribute(String) +- getAttribute(attributeID: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : + Returns the raw attribute value identified by the specified attribute id. + By raw attribute value we denote the unprocessed value as provided for the attribute + driven by the type of the respective attribute definition: + + - `boolean`-> boolean + - `category`-> string representing a catalog category ID + - `custom`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object + - `cms_record`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object whose entries must adhere to the `cmsrecord.json`schema + - `enum`-> either string or integer + - `file`-> string representing a file path within a library + - `image`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object whose entries must adhere to the `content/schema/image.json`schema + - `integer`-> integer + - `markup`-> string representing HTML markup + - `page`-> string representing a page ID + - `product`-> string representing a product SKU + - `string`-> string + - `text`-> string + - `url`-> string representing a URL + + + + + + There is two places an attribute value can come from - either it was persisted at design time (e.g. + by the merchant by editing a component in Page Designer) or it was injected in shape of an aspect attribute at rendering time + through the execution of code. The persistent value, if existing, takes precedence over the injected aspect + attribute one. Injection of a value through an aspect attribute will only occur if the component attribute's + attribute definition was declared using the `"dynamic_lookup"` property and its aspect attribute alias matches + the ID of the respective aspect attribute. + + + + Accessing the raw value can be helpful if render and serialization logic of the + component needs to operate on these unprocessed values. An unprocessed value + might be fundamentally different from its processed counterpart, the latter being + provided through the content dictionary (see [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent)) + when the render/serialize function of the component is invoked. + + + **Parameters:** + - attributeID - the id of the desired attribute + + **Returns:** + - the unprocessed raw value of the desired attribute, or null if not found + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the id of this component. + + **Returns:** + - the component id + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of this component + + **Returns:** + - the component name + + +--- + +### getRegion(String) +- getRegion(id: [String](TopLevel.String.md)): [Region](dw.experience.Region.md) + - : Returns the component region that matches the given id. + + **Parameters:** + - id - the id of the desired component region + + **Returns:** + - the region, or null if not found. + + +--- + +### getTypeID() +- getTypeID(): [String](TopLevel.String.md) + - : Returns the type id of this component. + + **Returns:** + - the component type id + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentRenderSettings.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentRenderSettings.md new file mode 100644 index 00000000..73da1f2e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentRenderSettings.md @@ -0,0 +1,130 @@ + +# Class ComponentRenderSettings + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + +A config that drives how the component is rendered. One can basically decide which kind of tag is used as wrapper +element (e.g. `

        ...
        `) and which attributes are to be placed into this wrapper +element (e.g. `class="foo bar"`). In case no attributes are provided then the system default settings will +apply. In case no tag name is provided then the system default one will apply. + +- tag\_name : div +- attributes : {"class":"experience-component experience-\[COMPONENT\_TYPE\_ID\]"} + +As the \[COMPONENT\_TYPE\_ID\] can contain dots due to its package like naming scheme (e.g. assets.image) +any occurrences of these dots will be replaced by dashes (e.g. assets-image) so that CSS selectors +do not have to be escaped. + + +**See Also:** +- [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [attributes](#attributes): [Object](TopLevel.Object.md) | Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.ComponentRenderSettings.md#setattributesobject). | +| [tagName](#tagname): [String](TopLevel.String.md) | Returns the tag name of the component wrapper element. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ComponentRenderSettings](#componentrendersettings)() | Creates region render settings which can then be configured further. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributes](dw.experience.ComponentRenderSettings.md#getattributes)() | Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.ComponentRenderSettings.md#setattributesobject). | +| [getTagName](dw.experience.ComponentRenderSettings.md#gettagname)() | Returns the tag name of the component wrapper element. | +| [setAttributes](dw.experience.ComponentRenderSettings.md#setattributesobject)([Object](TopLevel.Object.md)) | Sets the to be configured attributes of the wrapper element. | +| [setTagName](dw.experience.ComponentRenderSettings.md#settagnamestring)([String](TopLevel.String.md)) | Sets the tag name of the component wrapper element. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### attributes +- attributes: [Object](TopLevel.Object.md) + - : Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.ComponentRenderSettings.md#setattributesobject). + + +--- + +### tagName +- tagName: [String](TopLevel.String.md) + - : Returns the tag name of the component wrapper element. Defaults to 'div'. + + +--- + +## Constructor Details + +### ComponentRenderSettings() +- ComponentRenderSettings() + - : Creates region render settings which can then be configured further. They are to be used for detailed + configuration of a [RegionRenderSettings](dw.experience.RegionRenderSettings.md) which is subsequently used for + [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) calls. + + + **See Also:** + - [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + + +--- + +## Method Details + +### getAttributes() +- getAttributes(): [Object](TopLevel.Object.md) + - : Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.ComponentRenderSettings.md#setattributesobject). + + **Returns:** + - the configured attributes of the wrapper element + + +--- + +### getTagName() +- getTagName(): [String](TopLevel.String.md) + - : Returns the tag name of the component wrapper element. Defaults to 'div'. + + **Returns:** + - the tag name of the component wrapper element + + +--- + +### setAttributes(Object) +- setAttributes(attributes: [Object](TopLevel.Object.md)): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : Sets the to be configured attributes of the wrapper element. Set it to `null` in case + you want to system defaults to be applied. + + + **Parameters:** + - attributes - the to be configured attributes of the wrapper element + + **Returns:** + - this + + +--- + +### setTagName(String) +- setTagName(tagName: [String](TopLevel.String.md)): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : Sets the tag name of the component wrapper element. Must not be empty. + + **Parameters:** + - tagName - the tag name of the component wrapper element + + **Returns:** + - this + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentScriptContext.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentScriptContext.md new file mode 100644 index 00000000..550bfc6d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.ComponentScriptContext.md @@ -0,0 +1,148 @@ + +# Class ComponentScriptContext + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.ComponentScriptContext](dw.experience.ComponentScriptContext.md) + +This is the context that is handed over to the `render` and `serialize` function of the respective component type +script. + +``` + String : render( [ComponentScriptContext](dw.experience.ComponentScriptContext.md) context) + Object : serialize( [ComponentScriptContext](dw.experience.ComponentScriptContext.md) context) +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [component](#component): [Component](dw.experience.Component.md) `(read-only)` | Returns the component for which the corresponding component type script is currently executed. | +| [componentRenderSettings](#componentrendersettings): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) `(read-only)` | As components are implicitly rendered as part of their hosting region via [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) there is the possibility to define render settings for the region itself but also for its contained components. | +| [content](#content): [Map](dw.util.Map.md) `(read-only)` | Returns the processed version of the underlying unprocessed raw values (also see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) of this component's attributes which you can use in your respective component type `render` and `serialize` function implementing your business and rendering/serialization functionality. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getComponent](dw.experience.ComponentScriptContext.md#getcomponent)() | Returns the component for which the corresponding component type script is currently executed. | +| [getComponentRenderSettings](dw.experience.ComponentScriptContext.md#getcomponentrendersettings)() | As components are implicitly rendered as part of their hosting region via [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) there is the possibility to define render settings for the region itself but also for its contained components. | +| [getContent](dw.experience.ComponentScriptContext.md#getcontent)() | Returns the processed version of the underlying unprocessed raw values (also see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) of this component's attributes which you can use in your respective component type `render` and `serialize` function implementing your business and rendering/serialization functionality. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### component +- component: [Component](dw.experience.Component.md) `(read-only)` + - : Returns the component for which the corresponding component type script is currently executed. + + +--- + +### componentRenderSettings +- componentRenderSettings: [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) `(read-only)` + - : As components are implicitly rendered as part of their hosting region via + [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) there is the possibility + to define render settings for the region itself but also for its contained components. + The latter will be provided here so you further set or refine them for your component + as part of the `render` function, i.e. to drive the shape of the + component wrapper element. + + + +--- + +### content +- content: [Map](dw.util.Map.md) `(read-only)` + - : Returns the processed version of the underlying unprocessed raw values (also see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) + of this component's attributes which you can use in your respective component type `render` and `serialize` function + implementing your business and rendering/serialization functionality. Processing the raw value is comprised of **expansion** + and **conversion**, in this order. + + 1. **expansion**- dynamic placeholders are transformed into actual values, for example url/link placeholders in markup text are resolved to real URLs + 2. **conversion**- the raw value (see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) is resolved into an actual DWScript object depending on the type of the attribute as specified in its respective attribute definition + - `boolean`-> boolean + - `category`-> [Category](dw.catalog.Category.md) + - `custom`-> [Map](dw.util.Map.md) + - `cms_record`-> [CMSRecord](dw.experience.cms.CMSRecord.md) + - `enum`-> either string or integer + - `file`-> [MediaFile](dw.content.MediaFile.md) + - `image`-> [Image](dw.experience.image.Image.md) + - `integer`-> integer + - `markup`-> string + - `page`-> string + - `product`-> [Product](dw.catalog.Product.md) + - `string`-> string + - `text`-> string + - `url`-> string + + + +--- + +## Method Details + +### getComponent() +- getComponent(): [Component](dw.experience.Component.md) + - : Returns the component for which the corresponding component type script is currently executed. + + **Returns:** + - the currently rendered component + + +--- + +### getComponentRenderSettings() +- getComponentRenderSettings(): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : As components are implicitly rendered as part of their hosting region via + [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) there is the possibility + to define render settings for the region itself but also for its contained components. + The latter will be provided here so you further set or refine them for your component + as part of the `render` function, i.e. to drive the shape of the + component wrapper element. + + + **Returns:** + - the component render settings + + +--- + +### getContent() +- getContent(): [Map](dw.util.Map.md) + - : Returns the processed version of the underlying unprocessed raw values (also see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) + of this component's attributes which you can use in your respective component type `render` and `serialize` function + implementing your business and rendering/serialization functionality. Processing the raw value is comprised of **expansion** + and **conversion**, in this order. + + 1. **expansion**- dynamic placeholders are transformed into actual values, for example url/link placeholders in markup text are resolved to real URLs + 2. **conversion**- the raw value (see [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)) is resolved into an actual DWScript object depending on the type of the attribute as specified in its respective attribute definition + - `boolean`-> boolean + - `category`-> [Category](dw.catalog.Category.md) + - `custom`-> [Map](dw.util.Map.md) + - `cms_record`-> [CMSRecord](dw.experience.cms.CMSRecord.md) + - `enum`-> either string or integer + - `file`-> [MediaFile](dw.content.MediaFile.md) + - `image`-> [Image](dw.experience.image.Image.md) + - `integer`-> integer + - `markup`-> string + - `page`-> string + - `product`-> [Product](dw.catalog.Product.md) + - `string`-> string + - `text`-> string + - `url`-> string + + + **Returns:** + - processed content attributes of the component + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditor.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditor.md new file mode 100644 index 00000000..d4b27477 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditor.md @@ -0,0 +1,146 @@ + +# Class CustomEditor + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.CustomEditor](dw.experience.CustomEditor.md) + +This class represents a custom editor for component attributes of type `custom`. It is instantiated +by Page Designer and is subsequently used there for editing of such attributes by the merchant in a visual manner. +It therefore serves the Page Designer with all information required by such UI. What exactly +this information will be is up to the developer of the respective custom editor UI, i.e. depends on the respective +json and js files written for both the attribute definition as well as the custom editor type. Currently a configuration can be +served (basically values passed to Page Designer so that it can bootstrap the custom editor UI on the client side). +Furthermore resources can be served, which are URLs to scripts and styles required by the same UI (you will +likely require your own Javascript and CSS there). + + +You can access the aforementioned configuration as provided through the editor definition of the respective attribute +definition, which you can also adjust in the `init` function (see corresponding js file of your custom editor +type) that is called during initialization of the custom editor, i.e. right before it is passed to the Page Designer UI. +The same applies for the script and style resources which you specified as part of your custom editor type and which you +can refine with the `init` function as needed. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [configuration](#configuration): [Map](dw.util.Map.md) `(read-only)` | Returns the configuration of the custom editor. | +| [dependencies](#dependencies): [Map](dw.util.Map.md) `(read-only)` |

        Returns the dependencies to other custom editors, e.g. | +| [resources](#resources): [CustomEditorResources](dw.experience.CustomEditorResources.md) `(read-only)` | Returns the resources of the custom editor. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getConfiguration](dw.experience.CustomEditor.md#getconfiguration)() | Returns the configuration of the custom editor. | +| [getDependencies](dw.experience.CustomEditor.md#getdependencies)() |

        Returns the dependencies to other custom editors, e.g. | +| [getResources](dw.experience.CustomEditor.md#getresources)() | Returns the resources of the custom editor. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### configuration +- configuration: [Map](dw.util.Map.md) `(read-only)` + - : Returns the configuration of the custom editor. This is initialized with the values as provided + through the editor definition of the respective attribute definition of type `custom`. + Be aware that this configuration will have to be serializable to JSON itself as it will be passed + to Page Designer for processing in the UI. So you must not add any values in this map that are not + properly serializable. Do not use complex DWScript classes that do not support JSON serialization + like for instance [Product](dw.catalog.Product.md). + + + +--- + +### dependencies +- dependencies: [Map](dw.util.Map.md) `(read-only)` + - : + + Returns the dependencies to other custom editors, e.g. used as breakout elements. You can use + this mapping to add more custom editor dependencies as needed. For this purpose you want to create + a [CustomEditor](dw.experience.CustomEditor.md) instance via [PageMgr.getCustomEditor(String, Map)](dw.experience.PageMgr.md#getcustomeditorstring-map)) and then add it + to the dependencies mapping with an ID of your choice. In the client side logic of Page Designer + you will then be able to access these dependencies again by using the corresponding ID. + + + + + This is especially helpful if your custom editor for an attribute requires to open a breakout panel, + e.g. for a separate picker required by your custom editor. This picker could be another custom editor, + i.e. the one you declare as dependency here. + + + +--- + +### resources +- resources: [CustomEditorResources](dw.experience.CustomEditorResources.md) `(read-only)` + - : Returns the resources of the custom editor. This is initialized with the values as specified + by the custom editor type json (see the respective styles and scripts section). + + + +--- + +## Method Details + +### getConfiguration() +- getConfiguration(): [Map](dw.util.Map.md) + - : Returns the configuration of the custom editor. This is initialized with the values as provided + through the editor definition of the respective attribute definition of type `custom`. + Be aware that this configuration will have to be serializable to JSON itself as it will be passed + to Page Designer for processing in the UI. So you must not add any values in this map that are not + properly serializable. Do not use complex DWScript classes that do not support JSON serialization + like for instance [Product](dw.catalog.Product.md). + + + **Returns:** + - the configuration of the custom editor + + +--- + +### getDependencies() +- getDependencies(): [Map](dw.util.Map.md) + - : + + Returns the dependencies to other custom editors, e.g. used as breakout elements. You can use + this mapping to add more custom editor dependencies as needed. For this purpose you want to create + a [CustomEditor](dw.experience.CustomEditor.md) instance via [PageMgr.getCustomEditor(String, Map)](dw.experience.PageMgr.md#getcustomeditorstring-map)) and then add it + to the dependencies mapping with an ID of your choice. In the client side logic of Page Designer + you will then be able to access these dependencies again by using the corresponding ID. + + + + + This is especially helpful if your custom editor for an attribute requires to open a breakout panel, + e.g. for a separate picker required by your custom editor. This picker could be another custom editor, + i.e. the one you declare as dependency here. + + + **Returns:** + - an ID to [CustomEditor](dw.experience.CustomEditor.md) mapping + + +--- + +### getResources() +- getResources(): [CustomEditorResources](dw.experience.CustomEditorResources.md) + - : Returns the resources of the custom editor. This is initialized with the values as specified + by the custom editor type json (see the respective styles and scripts section). + + + **Returns:** + - the custom editor resources, will never be `null` + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditorResources.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditorResources.md new file mode 100644 index 00000000..7cc63997 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.CustomEditorResources.md @@ -0,0 +1,100 @@ + +# Class CustomEditorResources + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.CustomEditorResources](dw.experience.CustomEditorResources.md) + +This class represents the resources of a custom editor, i.e. URLs to scripts and styles which are required for +client side functionality in Page Designer in context of the corresponding custom attribute UI. These resources +are initially specified as part of your custom editor type (i.e. the respective json file). If needed you can +revise and refine them as part of the `init` function that is called during initialization of the +[CustomEditor](dw.experience.CustomEditor.md), i.e. is subject to your implementation of the respective custom editor type js file. + + +**See Also:** +- [CustomEditor](dw.experience.CustomEditor.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [scripts](#scripts): [List](dw.util.List.md) `(read-only)` | Returns the specified script resource URLs. | +| [styles](#styles): [List](dw.util.List.md) `(read-only)` | Returns the specified style URLs. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getScripts](dw.experience.CustomEditorResources.md#getscripts)() | Returns the specified script resource URLs. | +| [getStyles](dw.experience.CustomEditorResources.md#getstyles)() | Returns the specified style URLs. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### scripts +- scripts: [List](dw.util.List.md) `(read-only)` + - : Returns the specified script resource URLs. You can further modify this list + at runtime of your `init` function to add more required scripts. + Absolute URLs will be retained, relative paths will be resolved to absolute + ones based on the cartridge path for static resources (e.g. similar to + what [URLUtils.httpStatic(String)](dw.web.URLUtils.md#httpstaticstring) or + [URLUtils.httpsStatic(String)](dw.web.URLUtils.md#httpsstaticstring)) does. + + + +--- + +### styles +- styles: [List](dw.util.List.md) `(read-only)` + - : Returns the specified style URLs. You can further modify this list + at runtime of your `init` function to add more required styles. + Absolute URLs will be retained, relative paths will be resolved to absolute + ones based on the cartridge path for static resources (e.g. similar to + what [URLUtils.httpStatic(String)](dw.web.URLUtils.md#httpstaticstring) or + [URLUtils.httpsStatic(String)](dw.web.URLUtils.md#httpsstaticstring)) does. + + + +--- + +## Method Details + +### getScripts() +- getScripts(): [List](dw.util.List.md) + - : Returns the specified script resource URLs. You can further modify this list + at runtime of your `init` function to add more required scripts. + Absolute URLs will be retained, relative paths will be resolved to absolute + ones based on the cartridge path for static resources (e.g. similar to + what [URLUtils.httpStatic(String)](dw.web.URLUtils.md#httpstaticstring) or + [URLUtils.httpsStatic(String)](dw.web.URLUtils.md#httpsstaticstring)) does. + + + **Returns:** + - the script resources, will never be `null` + + +--- + +### getStyles() +- getStyles(): [List](dw.util.List.md) + - : Returns the specified style URLs. You can further modify this list + at runtime of your `init` function to add more required styles. + Absolute URLs will be retained, relative paths will be resolved to absolute + ones based on the cartridge path for static resources (e.g. similar to + what [URLUtils.httpStatic(String)](dw.web.URLUtils.md#httpstaticstring) or + [URLUtils.httpsStatic(String)](dw.web.URLUtils.md#httpsstaticstring)) does. + + + **Returns:** + - the style resources, will never be `null` + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.Page.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Page.md new file mode 100644 index 00000000..4bb7480d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Page.md @@ -0,0 +1,467 @@ + +# Class Page + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.Page](dw.experience.Page.md) + + + +This class represents a page designer managed page. A page comprises of +multiple regions that hold components, which themselves again can have +regions holding components, i.e. spanning a hierarchical tree of components. + + + + +Using + +- [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) +- [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + +a page can be rendered. As such page implements a render function for creating +render output the render function of the page itself will also want to access +its various properties like the SEO title etc. + + + + +Apart from rendering to markup a page can also be serialized, i.e. transformed +into a json string using + +- [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) +- [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + +**See Also:** +- [Region](dw.experience.Region.md) +- [Component](dw.experience.Component.md) +- [PageMgr](dw.experience.PageMgr.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the id of this page. | +| [aspectTypeID](#aspecttypeid): [String](TopLevel.String.md) `(read-only)` | Get the aspect type of the page. | +| [classificationFolder](#classificationfolder): [Folder](dw.content.Folder.md) `(read-only)` | Returns the classification [Folder](dw.content.Folder.md) associated with this page. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of this page. | +| [folders](#folders): [Collection](dw.util.Collection.md) `(read-only)` | Returns all folders to which this page is assigned. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of this page. | +| [pageDescription](#pagedescription): [String](TopLevel.String.md) `(read-only)` | Returns the SEO description of this page. | +| [pageKeywords](#pagekeywords): [String](TopLevel.String.md) `(read-only)` | Returns the SEO keywords of this page. | +| [pageTitle](#pagetitle): [String](TopLevel.String.md) `(read-only)` | Returns the SEO title of this page. | +| [searchWords](#searchwords): [String](TopLevel.String.md) `(read-only)` | Returns the search words of the page used for the search index. | +| [typeID](#typeid): [String](TopLevel.String.md) `(read-only)` | Returns the type id of this page. | +| [visible](#visible): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if the page is currently visible which is the case if:

        • page is published
        • the page is set to visible in the current locale
        • all visibility rules apply, requiring that
          • schedule matches
          • customer group matches
          • aspect attribute qualifiers match
          • campaign and promotion qualifiers match
        If any of these is not the case then `false` will be returned. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAspectTypeID](dw.experience.Page.md#getaspecttypeid)() | Get the aspect type of the page. | +| [getAttribute](dw.experience.Page.md#getattributestring)([String](TopLevel.String.md)) |

        Returns the raw attribute value identified by the specified attribute id. | +| [getClassificationFolder](dw.experience.Page.md#getclassificationfolder)() | Returns the classification [Folder](dw.content.Folder.md) associated with this page. | +| [getDescription](dw.experience.Page.md#getdescription)() | Returns the description of this page. | +| [getFolders](dw.experience.Page.md#getfolders)() | Returns all folders to which this page is assigned. | +| [getID](dw.experience.Page.md#getid)() | Returns the id of this page. | +| [getName](dw.experience.Page.md#getname)() | Returns the name of this page. | +| [getPageDescription](dw.experience.Page.md#getpagedescription)() | Returns the SEO description of this page. | +| [getPageKeywords](dw.experience.Page.md#getpagekeywords)() | Returns the SEO keywords of this page. | +| [getPageTitle](dw.experience.Page.md#getpagetitle)() | Returns the SEO title of this page. | +| [getRegion](dw.experience.Page.md#getregionstring)([String](TopLevel.String.md)) | Returns the page region that matches the given id. | +| [getSearchWords](dw.experience.Page.md#getsearchwords)() | Returns the search words of the page used for the search index. | +| [getTypeID](dw.experience.Page.md#gettypeid)() | Returns the type id of this page. | +| [hasVisibilityRules](dw.experience.Page.md#hasvisibilityrules)() | Returns `true` if the page has visibility rules (scheduling, customer groups, aspect attribute qualifiers, campaign and promotion qualifiers) applied, otherwise `false`. | +| [isVisible](dw.experience.Page.md#isvisible)() | Returns `true` if the page is currently visible which is the case if:

        • page is published
        • the page is set to visible in the current locale
        • all visibility rules apply, requiring that
          • schedule matches
          • customer group matches
          • aspect attribute qualifiers match
          • campaign and promotion qualifiers match
        If any of these is not the case then `false` will be returned. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the id of this page. + + +--- + +### aspectTypeID +- aspectTypeID: [String](TopLevel.String.md) `(read-only)` + - : Get the aspect type of the page. + If an aspect type is set for this page (and is found in the deployed code version), then the page is treated as dynamic page during + rendering and serialization. + + + **See Also:** + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + +--- + +### classificationFolder +- classificationFolder: [Folder](dw.content.Folder.md) `(read-only)` + - : Returns the classification [Folder](dw.content.Folder.md) associated with this page. + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of this page. + + +--- + +### folders +- folders: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all folders to which this page is assigned. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of this page. + + +--- + +### pageDescription +- pageDescription: [String](TopLevel.String.md) `(read-only)` + - : Returns the SEO description of this page. + + +--- + +### pageKeywords +- pageKeywords: [String](TopLevel.String.md) `(read-only)` + - : Returns the SEO keywords of this page. + + +--- + +### pageTitle +- pageTitle: [String](TopLevel.String.md) `(read-only)` + - : Returns the SEO title of this page. + + +--- + +### searchWords +- searchWords: [String](TopLevel.String.md) `(read-only)` + - : Returns the search words of the page used for the search index. + + +--- + +### typeID +- typeID: [String](TopLevel.String.md) `(read-only)` + - : Returns the type id of this page. + + +--- + +### visible +- visible: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if the page is currently visible which is the case if: + + - page is published + - the page is set to visible in the current locale + - all visibility rules apply, requiring that + - schedule matches + - customer group matches + - aspect attribute qualifiers match + - campaign and promotion qualifiers match + + + If any of these is not the case then `false` will be returned. + + + As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this + call should NOT happen in a pagecached context outside of the processing induced by rendering/serialization (see the corresponding + methods in [PageMgr](dw.experience.PageMgr.md)). + + Use [hasVisibilityRules()](dw.experience.Page.md#hasvisibilityrules) prior to calling this method in order to check for the existence of visibility rules. If there are + visibility rules then do not apply pagecaching. Otherwise the visibility decision making would end up in the pagecache and any subsequent + call would just return from the pagecache instead of performing the [isVisible()](dw.experience.Page.md#isvisible) check again as desired. + + ``` + ... + var page = PageMgr.getPage(pageID); + if (page.hasVisibilityRules()) + { + // pagecaching is NOT ok here + if (page.isVisible()) + { + response.writer.print(PageMgr.renderPage(pageID, {}); + } + } + else + { + // pagecaching is ok here, but requires a pagecache refresh if merchants start adding visibility rules to the page + } + ... + ``` + + + **See Also:** + - [isVisible()](dw.experience.Page.md#isvisible) + + +--- + +## Method Details + +### getAspectTypeID() +- getAspectTypeID(): [String](TopLevel.String.md) + - : Get the aspect type of the page. + If an aspect type is set for this page (and is found in the deployed code version), then the page is treated as dynamic page during + rendering and serialization. + + + **Returns:** + - the ID of the page's aspect type + + **See Also:** + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + +--- + +### getAttribute(String) +- getAttribute(attributeID: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : + Returns the raw attribute value identified by the specified attribute id. + By raw attribute value we denote the unprocessed value as provided for the attribute + driven by the type of the respective attribute definition: + + - `boolean`-> boolean + - `category`-> string representing a catalog category ID + - `custom`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object + - `cms_record`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object whose entries must adhere to the `cmsrecord.json`schema + - `enum`-> either string or integer + - `file`-> string representing a file path within a library + - `image`-> [Map](dw.util.Map.md)that originates from a stringified curly brackets {} JSON object whose entries must adhere to the `content/schema/image.json`schema + - `integer`-> integer + - `markup`-> string representing HTML markup + - `page`-> string representing a page ID + - `product`-> string representing a product SKU + - `string`-> string + - `text`-> string + - `url`-> string representing a URL + + + + + + There is two places an attribute value can come from - either it was persisted at design time (e.g. + by the merchant by editing a component in Page Designer) or it was injected in shape of an aspect attribute at rendering time + through the execution of code. The persistent value, if existing, takes precedence over the injected aspect + attribute one. Injection of a value through an aspect attribute will only occur if the page attribute's + attribute definition was declared using the `"dynamic_lookup"` property and its aspect attribute alias matches + the ID of the respective aspect attribute. + + + + Accessing the raw value can be helpful if render and serialization logic of the + page needs to operate on these unprocessed values. An unprocessed value + might be fundamentally different from its processed counterpart, the latter being + provided through the content dictionary (see [PageScriptContext.getContent()](dw.experience.PageScriptContext.md#getcontent)) + when the render/serialize function of the page is invoked. + + + **Parameters:** + - attributeID - the id of the desired attribute + + **Returns:** + - the unprocessed raw value of the desired attribute, or null if not found + + +--- + +### getClassificationFolder() +- getClassificationFolder(): [Folder](dw.content.Folder.md) + - : Returns the classification [Folder](dw.content.Folder.md) associated with this page. + + **Returns:** + - the classification [Folder](dw.content.Folder.md) if one is assigned, `null` otherwise. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of this page. + + **Returns:** + - the page description + + +--- + +### getFolders() +- getFolders(): [Collection](dw.util.Collection.md) + - : Returns all folders to which this page is assigned. + + **Returns:** + - Collection of [Folder](dw.content.Folder.md) objects. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the id of this page. + + **Returns:** + - the page id + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of this page. + + **Returns:** + - the page name + + +--- + +### getPageDescription() +- getPageDescription(): [String](TopLevel.String.md) + - : Returns the SEO description of this page. + + **Returns:** + - the page SEO description + + +--- + +### getPageKeywords() +- getPageKeywords(): [String](TopLevel.String.md) + - : Returns the SEO keywords of this page. + + **Returns:** + - the page SEO keywords + + +--- + +### getPageTitle() +- getPageTitle(): [String](TopLevel.String.md) + - : Returns the SEO title of this page. + + **Returns:** + - the page SEO title + + +--- + +### getRegion(String) +- getRegion(id: [String](TopLevel.String.md)): [Region](dw.experience.Region.md) + - : Returns the page region that matches the given id. + + **Parameters:** + - id - the id of the desired page region + + **Returns:** + - the region, or null if not found. + + +--- + +### getSearchWords() +- getSearchWords(): [String](TopLevel.String.md) + - : Returns the search words of the page used for the search index. + + **Returns:** + - the page search words + + +--- + +### getTypeID() +- getTypeID(): [String](TopLevel.String.md) + - : Returns the type id of this page. + + **Returns:** + - the page type id + + +--- + +### hasVisibilityRules() +- hasVisibilityRules(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the page has visibility rules (scheduling, customer groups, aspect attribute qualifiers, + campaign and promotion qualifiers) applied, otherwise `false`. Use this + method prior to [isVisible()](dw.experience.Page.md#isvisible), so you do not call the latter in a pagecached context. + + + **Returns:** + - `true` if the page has visibility rules applied, otherwise `false`. + + +--- + +### isVisible() +- isVisible(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the page is currently visible which is the case if: + + - page is published + - the page is set to visible in the current locale + - all visibility rules apply, requiring that + - schedule matches + - customer group matches + - aspect attribute qualifiers match + - campaign and promotion qualifiers match + + + If any of these is not the case then `false` will be returned. + + + As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this + call should NOT happen in a pagecached context outside of the processing induced by rendering/serialization (see the corresponding + methods in [PageMgr](dw.experience.PageMgr.md)). + + Use [hasVisibilityRules()](dw.experience.Page.md#hasvisibilityrules) prior to calling this method in order to check for the existence of visibility rules. If there are + visibility rules then do not apply pagecaching. Otherwise the visibility decision making would end up in the pagecache and any subsequent + call would just return from the pagecache instead of performing the [isVisible()](dw.experience.Page.md#isvisible) check again as desired. + + ``` + ... + var page = PageMgr.getPage(pageID); + if (page.hasVisibilityRules()) + { + // pagecaching is NOT ok here + if (page.isVisible()) + { + response.writer.print(PageMgr.renderPage(pageID, {}); + } + } + else + { + // pagecaching is ok here, but requires a pagecache refresh if merchants start adding visibility rules to the page + } + ... + ``` + + + **Returns:** + - `true` if the page is currently visible (published, visible in the current locale, and visibility rules apply), otherwise `false` (unpublished and/or visibility rules don't apply) + + **See Also:** + - [isVisible()](dw.experience.Page.md#isvisible) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageMgr.md new file mode 100644 index 00000000..94a3c9f2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageMgr.md @@ -0,0 +1,549 @@ + +# Class PageMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.PageMgr](dw.experience.PageMgr.md) + +Provides functionality for getting, rendering and serializing page designer managed pages. + + +The basic flow is to determine a page by either id, category or product + +- [getPage(String)](dw.experience.PageMgr.md#getpagestring) +- [getPageByCategory(Category, Boolean, String)](dw.experience.PageMgr.md#getpagebycategorycategory-boolean-string) +- [getPageByProduct(Product, Boolean, String)](dw.experience.PageMgr.md#getpagebyproductproduct-boolean-string) + +and then to initiate rendering of this page via + +- [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) +- [renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + +This will trigger page rendering from a top level perspective, i.e. the page serves as entry point and root container of components. + + + +As a related page or component template will likely want to trigger rendering of nested components +within its regions it can do this by first fetching the desired region by ID via +[Page.getRegion(String)](dw.experience.Page.md#getregionstring) or [Component.getRegion(String)](dw.experience.Component.md#getregionstring) and then call to [renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) +with the recently retrieved region (and optionally provide [RegionRenderSettings](dw.experience.RegionRenderSettings.md) for customized +rendering of region and component wrapper elements). + + + + +Similar to the rendering you can also serialize such page to json via + +- [serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) +- [serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + +This will trigger page serialization from a top level perspective, i.e. the page serves as entry point and root container of components, +which will automatically traverse all visible components and attach their serialization result to the emitted json. + + + + +Various attributes required for rendering and serialization in the corresponding template can be accessed with the +accordant methods of [Page](dw.experience.Page.md) and [Component](dw.experience.Component.md). + + +**See Also:** +- [Page](dw.experience.Page.md) +- [Region](dw.experience.Region.md) +- [Component](dw.experience.Component.md) + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [getCustomEditor](dw.experience.PageMgr.md#getcustomeditorstring-map)([String](TopLevel.String.md), [Map](dw.util.Map.md)) |

        Initialize the custom editor of given type id using the passed configuration. | +| ~~static [getPage](dw.experience.PageMgr.md#getpagecategory-boolean-string)([Category](dw.catalog.Category.md), [Boolean](TopLevel.Boolean.md), [String](TopLevel.String.md))~~ | Get the dynamic page for the given category (including bottom up traversal of the category tree) and aspect type. | +| static [getPage](dw.experience.PageMgr.md#getpagestring)([String](TopLevel.String.md)) | Returns the page identified by the specified id. | +| static [getPageByCategory](dw.experience.PageMgr.md#getpagebycategorycategory-boolean-string)([Category](dw.catalog.Category.md), [Boolean](TopLevel.Boolean.md), [String](TopLevel.String.md)) | Get the dynamic page for the given category (including bottom up traversal of the category tree) and aspect type. | +| static [getPageByProduct](dw.experience.PageMgr.md#getpagebyproductproduct-boolean-string)([Product](dw.catalog.Product.md), [Boolean](TopLevel.Boolean.md), [String](TopLevel.String.md)) | Get the dynamic page for the given product and aspect type. | +| static [renderPage](dw.experience.PageMgr.md#renderpagestring-map-string)([String](TopLevel.String.md), [Map](dw.util.Map.md), [String](TopLevel.String.md)) | Render a page. | +| static [renderPage](dw.experience.PageMgr.md#renderpagestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Render a page. | +| static [renderRegion](dw.experience.PageMgr.md#renderregionregion)([Region](dw.experience.Region.md)) |

        Renders a region by triggering rendering of all visible components within this region. | +| static [renderRegion](dw.experience.PageMgr.md#renderregionregion-regionrendersettings)([Region](dw.experience.Region.md), [RegionRenderSettings](dw.experience.RegionRenderSettings.md)) |

        Renders a region by triggering rendering of all visible components within this region. | +| static [serializePage](dw.experience.PageMgr.md#serializepagestring-map-string)([String](TopLevel.String.md), [Map](dw.util.Map.md), [String](TopLevel.String.md)) | Serialize a page as json string. | +| static [serializePage](dw.experience.PageMgr.md#serializepagestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Serialize a page as json string with the following properties:

        • `String id` - the id of the page
        • `String type_id` - the id of the page type
        • `Map data` - the content attribute key value pairs
        • `Map custom` - the custom key value pairs as produced by the optional page type `serialize` function
        • `List regions` - the regions of this page. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### getCustomEditor(String, Map) +- static getCustomEditor(customEditorTypeID: [String](TopLevel.String.md), configuration: [Map](dw.util.Map.md)): [CustomEditor](dw.experience.CustomEditor.md) + - : + + Initialize the custom editor of given type id using the passed configuration. The initialization + will trigger the `init` function of the respective custom editor type for which the passed + custom editor object is being preinitialized with the given configuration (similar to what would + happen through the `editor_definition` reference by any component type attribute definition). + + + + + This method is useful to obtain any custom editor instance you want to reuse within the `init` + method of another custom editor, e.g. as dependent breakout element. + + + **Parameters:** + - customEditorTypeID - the reference to a custom editor type, e.g. 'com.foo.bar' + - configuration - the data structure used for preinitialization of the custom editor (also see [CustomEditor.getConfiguration()](dw.experience.CustomEditor.md#getconfiguration)). Be aware that this configuration will have to be serializable to JSON itself as it will be passed to Page Designer for processing in the UI. So you must not add any values in this map that are not properly serializable. Do not use complex DWScript classes that do not support JSON serialization like for instance [Product](dw.catalog.Product.md). + + **Returns:** + - the initialized custom editor instance + + +--- + +### getPage(Category, Boolean, String) +- ~~static getPage(category: [Category](dw.catalog.Category.md), pageMustBeVisible: [Boolean](TopLevel.Boolean.md), aspectTypeID: [String](TopLevel.String.md)): [Page](dw.experience.Page.md)~~ + - : Get the dynamic page for the given category (including bottom up traversal of the category tree) and aspect type. + + **Parameters:** + - category - category to find the page for, i.e. starting point (inclusive) for the bottom up traversal + - pageMustBeVisible - while doing the bottom up traversal any attached page whose [Page.isVisible()](dw.experience.Page.md#isvisible) does not yield true will be bypassed in the search + - aspectTypeID - id of the page-category-assignment aspect type + + **Returns:** + - the page assigned to the given category. If none is found then the path upwards in the + category tree is traversed until a category is found that has an implicit (but not explicit) page assignment. + If category assignments are not supported by the given aspect type or none is found within the + aforementioned path of categories then `null` is returned. + + + **Deprecated:** +:::warning +Please use [getPageByCategory(Category, Boolean, String)](dw.experience.PageMgr.md#getpagebycategorycategory-boolean-string) instead. +::: + +--- + +### getPage(String) +- static getPage(pageID: [String](TopLevel.String.md)): [Page](dw.experience.Page.md) + - : Returns the page identified by the specified id. + + **Parameters:** + - pageID - the id of the page + + **Returns:** + - the page, or null if not found. + + +--- + +### getPageByCategory(Category, Boolean, String) +- static getPageByCategory(category: [Category](dw.catalog.Category.md), pageMustBeVisible: [Boolean](TopLevel.Boolean.md), aspectTypeID: [String](TopLevel.String.md)): [Page](dw.experience.Page.md) + - : Get the dynamic page for the given category (including bottom up traversal of the category tree) and aspect type. + + **Parameters:** + - category - category to find the page for, i.e. starting point (inclusive) for the bottom up traversal + - pageMustBeVisible - while doing the bottom up traversal any attached page whose [Page.isVisible()](dw.experience.Page.md#isvisible) does not yield true will be bypassed in the search + - aspectTypeID - id of the page-category-assignment aspect type + + **Returns:** + - the page assigned to the given category. If none is found then the path upwards in the + category tree is traversed until a category is found that has an implicit (but not explicit) page assignment. + If category assignments are not supported by the given aspect type or none is found within the + aforementioned path of categories then `null` is returned. + + + +--- + +### getPageByProduct(Product, Boolean, String) +- static getPageByProduct(product: [Product](dw.catalog.Product.md), pageMustBeVisible: [Boolean](TopLevel.Boolean.md), aspectTypeID: [String](TopLevel.String.md)): [Page](dw.experience.Page.md) + - : Get the dynamic page for the given product and aspect type. + + + No bottom up traversal of the product's category tree is performed. If you require this then a + separate call to [getPageByCategory(Category, Boolean, String)](dw.experience.PageMgr.md#getpagebycategorycategory-boolean-string) (with the category of your choice, e.g. the default + category of the product) needs to be made. + + + **Parameters:** + - product - product to find the page for + - pageMustBeVisible - an attached page whose [Page.isVisible()](dw.experience.Page.md#isvisible) does not yield true will be bypassed in the search + - aspectTypeID - id of the page-product-assignment aspect type + + **Returns:** + - the page assigned to the given product. If product assignments are not supported by the given + aspect type then `null` is returned. + + + +--- + +### renderPage(String, Map, String) +- static renderPage(pageID: [String](TopLevel.String.md), aspectAttributes: [Map](dw.util.Map.md), parameters: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Render a page. This is an extension of [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) for the purpose of rendering a + page that needs to determine pieces of its content at rendering time instead of design time only. Therefore it + is possible to pass aspect attributes in case the given page is subject to an aspect type. The latter specifies the + eligible aspect attribute definitions which the passed in aspect attributes will be validated against. + If the validation fails for any of the following reasons an [AspectAttributeValidationException](dw.experience.AspectAttributeValidationException.md) + will be thrown: + + - any aspect attribute value violates the value domain of the corresponding attribute definition + - any required aspect attribute value is `null` + + Aspect attributes without corresponding attribute definition will be omitted. Once they made it into the rendering + they will apply if no persistent attribute value exists (taking precedence over default attribute values + as coming from the attribute definition json) and the attribute has the `dynamic_lookup` + property defined which contains the aspect attribute alias. The aspect attribute value lookup then happens by taking + this aspect attribute alias and using it as attribute identifier within the given map of aspect attributes. + + + Due to the nature of using remote includes, also see [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string), this comes with the url length + restriction as you already know it from remote includes you implement by hand within your templates. Thus the size of both the + `aspectAttributes` (keys and values) as well as the `parameters` parameter of this method + are subject to a length limitation accordingly because they just translate into url parameters of the aforementioned remote includes. + As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs). + + + **Parameters:** + - pageID - the aspect driven page that will be rendered + - aspectAttributes - the values for the aspect attributes, with the key being the id of the respective attribute definition and the value adhering to the type of this attribute definition + - parameters - the optional parameters passed to page rendering + + **Returns:** + - the remote include that will yield the markup as produced by page rendering + + **Throws:** + - dw.experience.AspectAttributeValidationException - if any given aspect attribute value does fulfill its respective attribute definition + + **See Also:** + - [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) + + +--- + +### renderPage(String, String) +- static renderPage(pageID: [String](TopLevel.String.md), parameters: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Render a page. All of this is going to happen in two layers of remote includes, therefore pagecaching of page rendering + is separated from the pagecache lifecycle of the caller. The first one is going to be returned by this method. + + - layer 1 - determines visibility fingerprint for the page and all its nested components driven by its visibility rules. This remote include will only be pagecached for a fixed duration if neither the page nor any of its nested components carries a visibility rule (configurable in Business Manager via the site's page caching settings). It will then delegate to layer 2. + - layer 2 - does the actual rendering of the page by invoking its render function. This remote include will factor the previously determined visibility fingerprint in to the pagecache key, in case you decide to use pagecaching. + + + + The layer 1 remote include is what is returned when calling this method. + + + + + The provided `parameters` argument is passed through till the layer 2 remote include which does the actual rendering so that it will be available + for the `render` function of the invoked page as part of [PageScriptContext.getRuntimeParameters()](dw.experience.PageScriptContext.md#getruntimeparameters). You probably want to + provide caller parameters from the outside in shape of a json String to the inside of the page rendering, e.g. to loop through query parameters. + + + + + The layer 2 remote include performs the rendering of the page and all its nested components within one request. Thus data sharing between + the page and its nested components can happen in scope of this request. + + + + + The rendering of a page invokes the `render` function of the respective page type. + + ``` + String : render( PageScriptContext context) + ``` + + The return value of the `render` function finally represents the markup produced by this page type. + + + + + + Nested page rendering, i.e. rendering a page within a page (or respectively its components), is not a supported use case. + + + + + Due to the nature of the remote includes mentioned above this comes with the url length restriction as you already know it from + remote includes you implement by hand within your templates. Thus the size of the `parameters` parameter of this + method has a length limitation accordingly because it just translates into a url parameter of the aforementioned remote includes. + As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs). + + + **Parameters:** + - pageID - the ID of the page that will be rendered + - parameters - the optional parameters passed to page rendering + + **Returns:** + - the remote include that will yield the markup as produced by page rendering + + **See Also:** + - [renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + + +--- + +### renderRegion(Region) +- static renderRegion(region: [Region](dw.experience.Region.md)): [String](TopLevel.String.md) + - : + Renders a region by triggering rendering of all visible components within + this region. For each of these components the render function of the respective component + type is invoked. + + ``` + String : render( ComponentScriptContext params) + ``` + + The return value of the `render` function will be wrapped by an HTML element - this + finally represents the markup produced by this component type. The markup of the region + accordingly represents the concatenation of all the components markup within an + own wrapper element. + + The following sample shows how this would look like for a 'pictures' region + that contains two components of type 'assets.image'. + + + ``` +
          +
          + ... +
          +
          + .. +
          +
          + ``` + + + + The system default for region render settings are: + + - tag\_name : div + - attributes : {"class":"experience-region experience-\[REGION\_ID\]"} + + + + + + The system default for component render settings are: + + - tag name : div + - attributes : {"class":"experience-component experience-\[COMPONENT\_TYPE\_ID\]"} + + As the \[COMPONENT\_TYPE\_ID\] can contain dots due to its package like naming scheme (e.g. assets.image) + any occurrences of these dots will be replaced by dashes (e.g. assets-image) so that CSS selectors + do not have to be escaped. + + + + + In order to provide your own settings for the wrapper elements see + [renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). + + + + You must NOT call this method outside of the processing induced by [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string). + + + **Parameters:** + - region - the region that will be rendered + + **Returns:** + - the markup as produced by region rendering + + +--- + +### renderRegion(Region, RegionRenderSettings) +- static renderRegion(region: [Region](dw.experience.Region.md), regionRenderSettings: [RegionRenderSettings](dw.experience.RegionRenderSettings.md)): [String](TopLevel.String.md) + - : + Renders a region by triggering rendering of all visible components within + this region. For each of these components the render function of the respective component + type is invoked. + + ``` + String : render( ComponentScriptContext context) + ``` + + The return value of the `render` function will be wrapped by an HTML element - this + finally represents the markup produced by this component type. The markup of the region + accordingly represents the concatenation of all the components markup within an + own wrapper element. + + In order to provide styling for these wrapper + elements of the components and the region some render settings can optionally be provided, + which basically allows to configure which kind of tag is used for the wrapper element and + which attributes the wrapper element contains. A sample output could look like this if + [RegionRenderSettings](dw.experience.RegionRenderSettings.md) are applied with customized tag names and attributes + for the region and component wrapper elements. + + + ``` +

          + + ... + + + ... + +

          + ``` + + + + In order to go with the default settings for the wrapper elements see + [renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion). + + + + + You must NOT call this method outside of the processing induced by [renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string). + + + **Parameters:** + - region - the region that will be rendered + - regionRenderSettings - the render settings that drive how the region and its components is rendered + + **Returns:** + - the markup as produced by region rendering + + **See Also:** + - [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + + +--- + +### serializePage(String, Map, String) +- static serializePage(pageID: [String](TopLevel.String.md), aspectAttributes: [Map](dw.util.Map.md), parameters: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Serialize a page as json string. This is an extension of [serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) for the purpose of serializing a + page that needs to determine pieces of its content at serialization time instead of design time only. Therefore it + is possible to pass aspect attributes in case the given page is subject to an aspect type. The latter specifies the + eligible aspect attribute definitions which the passed in aspect attributes will be validated against. + If the validation fails for any of the following reasons an [AspectAttributeValidationException](dw.experience.AspectAttributeValidationException.md) + will be thrown: + + - any aspect attribute value violates the value domain of the corresponding attribute definition + - any required aspect attribute value is `null` + + Aspect attributes without corresponding attribute definition will be omitted. Once they made it into the serialization + they will apply if no persistent attribute value exists (taking precedence over default attribute values + as coming from the attribute definition json) and the attribute has the `dynamic_lookup` + property defined which contains the aspect attribute alias. The aspect attribute value lookup then happens by taking + this aspect attribute alias and using it as attribute identifier within the given map of aspect attributes. + + + Due to the nature of using remote includes, also see [serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string), this comes with the url length + restriction as you already know it from remote includes you implement by hand within your templates. Thus the size of both the + `aspectAttributes` (keys and values) as well as the `parameters` parameter of this method + are subject to a length limitation accordingly because they just translate into url parameters of the aforementioned remote includes. + As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs). + + + **Parameters:** + - pageID - the aspect driven page that will be serialized + - aspectAttributes - the values for the aspect attributes, with the key being the id of the respective attribute definition and the value adhering to the type of this attribute definition + - parameters - the optional parameters passed to page serialization + + **Returns:** + - the remote include that will yield the json string as produced by page serialization + + **Throws:** + - dw.experience.AspectAttributeValidationException - if any given aspect attribute value doesn't fulfill its respective attribute definition + + **See Also:** + - [serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) + + +--- + +### serializePage(String, String) +- static serializePage(pageID: [String](TopLevel.String.md), parameters: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Serialize a page as json string with the following properties: + + - `String id`- the id of the page + - `String type_id`- the id of the page type + - `Mapdata`- the content attribute key value pairs + - `Mapcustom`- the custom key value pairs as produced by the optional page type `serialize`function + - `Listregions`- the regions of this page. A region consists of the following properties + - `String id`- the id of the region + - `Listcomponents`- the components of this region. A component consists of the following properties + - `String id`- the id of the component + - `String type_id`- the id of the component type + - `Mapdata`- the content attribute key value pairs + - `Mapcustom`- the custom key value pairs as produced by the optional component type `serialize`function + - `Listregions`- the regions of this component + + + + + + All of this is going to happen in two layers of remote includes, therefore pagecaching of page serialization + is separated from the pagecache lifecycle of the caller. The first one is going to be returned by this method. + + - layer 1 - determines visibility fingerprint for the page and all its nested components driven by its visibility rules. This remote include will only be pagecached for a fixed duration if neither the page nor any of its nested components carries a visibility rule (configurable in Business Manager via the site's page caching settings). It will then delegate to layer 2. + - layer 2 - does the actual rendering of the page by invoking its render function. This remote include will factor the previously determined visibility fingerprint in to the pagecache key, in case you decide to use pagecaching. + + + + + + The layer 1 remote include is what is returned when calling this method. + + + + + The provided `parameters` argument is passed through till the layer 2 remote include which does the actual serialization so that it will be available + for the `serialize` function of the invoked page as part of [PageScriptContext.getRuntimeParameters()](dw.experience.PageScriptContext.md#getruntimeparameters). You probably want to + provide caller parameters from the outside in shape of a json String to the inside of the page serialization, e.g. to loop through query parameters. + + + + + The layer 2 remote include performs the serialization of the page and all its nested components within one request. Thus data sharing between + the page and its nested components can happen in scope of this request. + + + + + The serialization of a page also invokes the `serialize` function of the respective page type. + + ``` + Object : serialize( PageScriptContext context) + ``` + + The return value of the `serialize` function will be injected as property `custom` + into the json string produced as serialization result for this page type. + + + + + + Nested page serialization, i.e. serializing a page within a page (or respectively its components), is not a supported use case. + + + + + Due to the nature of the remote includes mentioned above this comes with the url length restriction as you already know it from + remote includes you implement by hand within your templates. Thus the size of the `parameters` parameter of this + method has a length limitation accordingly because it just translates into a url parameter of the aforementioned remote includes. + As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs). + + + **Parameters:** + - pageID - the ID of the page that will be serialized + - parameters - the optional parameters passed to page serialization + + **Returns:** + - the remote include that will yield the json string as produced by page serialization + + **See Also:** + - [serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageScriptContext.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageScriptContext.md new file mode 100644 index 00000000..e9340bc1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.PageScriptContext.md @@ -0,0 +1,200 @@ + +# Class PageScriptContext + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.PageScriptContext](dw.experience.PageScriptContext.md) + +This is the context that is handed over to the `render` and `serialize` function of the respective page type +script. + + +``` + String : render( [PageScriptContext](dw.experience.PageScriptContext.md) context) + Object : serialize( [PageScriptContext](dw.experience.PageScriptContext.md) context) +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [content](#content): [Map](dw.util.Map.md) `(read-only)` | Returns the processed version of the underlying unprocessed raw values (also see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) of this page's attributes which you can use in your respective page type `render` and `serialize` function implementing your business and rendering/serialization functionality. | +| [page](#page): [Page](dw.experience.Page.md) `(read-only)` | Returns the page for which the corresponding page type script is currently executed. | +| ~~[renderParameters](#renderparameters): [String](TopLevel.String.md)~~ `(read-only)` | Returns the `parameters` argument as passed when kicking off page rendering via
          • [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string)
          • [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string)
          and serialization
          • [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string)
          • [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string)
          | +| [runtimeParameters](#runtimeparameters): [String](TopLevel.String.md) `(read-only)` | Returns the `parameters` argument as passed when kicking off page rendering via
          • [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string)
          • [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string)
          and page serialization via
          • [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string)
          • [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string)
          | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getContent](dw.experience.PageScriptContext.md#getcontent)() | Returns the processed version of the underlying unprocessed raw values (also see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) of this page's attributes which you can use in your respective page type `render` and `serialize` function implementing your business and rendering/serialization functionality. | +| [getPage](dw.experience.PageScriptContext.md#getpage)() | Returns the page for which the corresponding page type script is currently executed. | +| ~~[getRenderParameters](dw.experience.PageScriptContext.md#getrenderparameters)()~~ | Returns the `parameters` argument as passed when kicking off page rendering via
          • [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string)
          • [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string)
          and serialization
          • [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string)
          • [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string)
          | +| [getRuntimeParameters](dw.experience.PageScriptContext.md#getruntimeparameters)() | Returns the `parameters` argument as passed when kicking off page rendering via
          • [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string)
          • [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string)
          and page serialization via
          • [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string)
          • [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string)
          | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### content +- content: [Map](dw.util.Map.md) `(read-only)` + - : Returns the processed version of the underlying unprocessed raw values (also see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) + of this page's attributes which you can use in your respective page type `render` and `serialize` function + implementing your business and rendering/serialization functionality. Processing the raw value is comprised of **expansion** + and **conversion**, in this order. + + 1. **expansion**- dynamic placeholders are transformed into actual values, for example url/link placeholders in markup text are resolved to real URLs + 2. **conversion**- the raw value (see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) is resolved into an actual DWScript object depending on the type of the attribute as specified in its respective attribute definition + - `boolean`-> boolean + - `category`-> [Category](dw.catalog.Category.md) + - `custom`-> [Map](dw.util.Map.md) + - `cms_record`-> [CMSRecord](dw.experience.cms.CMSRecord.md) + - `enum`-> either string or integer + - `file`-> [MediaFile](dw.content.MediaFile.md) + - `image`-> [Image](dw.experience.image.Image.md) + - `integer`-> integer + - `markup`-> string + - `page`-> string + - `product`-> [Product](dw.catalog.Product.md) + - `string`-> string + - `text`-> string + - `url`-> string + + + +--- + +### page +- page: [Page](dw.experience.Page.md) `(read-only)` + - : Returns the page for which the corresponding page type script is currently executed. + + +--- + +### renderParameters +- ~~renderParameters: [String](TopLevel.String.md)~~ `(read-only)` + - : Returns the `parameters` argument as passed when kicking off page rendering via + + - [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + + and serialization + + - [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + + **Deprecated:** +:::warning +Please use [getRuntimeParameters()](dw.experience.PageScriptContext.md#getruntimeparameters) instead. +::: + +--- + +### runtimeParameters +- runtimeParameters: [String](TopLevel.String.md) `(read-only)` + - : Returns the `parameters` argument as passed when kicking off page rendering via + + - [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + + and page serialization via + + - [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + + +--- + +## Method Details + +### getContent() +- getContent(): [Map](dw.util.Map.md) + - : Returns the processed version of the underlying unprocessed raw values (also see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) + of this page's attributes which you can use in your respective page type `render` and `serialize` function + implementing your business and rendering/serialization functionality. Processing the raw value is comprised of **expansion** + and **conversion**, in this order. + + 1. **expansion**- dynamic placeholders are transformed into actual values, for example url/link placeholders in markup text are resolved to real URLs + 2. **conversion**- the raw value (see [Page.getAttribute(String)](dw.experience.Page.md#getattributestring)) is resolved into an actual DWScript object depending on the type of the attribute as specified in its respective attribute definition + - `boolean`-> boolean + - `category`-> [Category](dw.catalog.Category.md) + - `custom`-> [Map](dw.util.Map.md) + - `cms_record`-> [CMSRecord](dw.experience.cms.CMSRecord.md) + - `enum`-> either string or integer + - `file`-> [MediaFile](dw.content.MediaFile.md) + - `image`-> [Image](dw.experience.image.Image.md) + - `integer`-> integer + - `markup`-> string + - `page`-> string + - `product`-> [Product](dw.catalog.Product.md) + - `string`-> string + - `text`-> string + - `url`-> string + + + **Returns:** + - processed content attributes of the page + + +--- + +### getPage() +- getPage(): [Page](dw.experience.Page.md) + - : Returns the page for which the corresponding page type script is currently executed. + + **Returns:** + - the currently rendered page + + +--- + +### getRenderParameters() +- ~~getRenderParameters(): [String](TopLevel.String.md)~~ + - : Returns the `parameters` argument as passed when kicking off page rendering via + + - [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + + and serialization + + - [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + + **Returns:** + - the parameters passed to page rendering and serialization + + **Deprecated:** +:::warning +Please use [getRuntimeParameters()](dw.experience.PageScriptContext.md#getruntimeparameters) instead. +::: + +--- + +### getRuntimeParameters() +- getRuntimeParameters(): [String](TopLevel.String.md) + - : Returns the `parameters` argument as passed when kicking off page rendering via + + - [PageMgr.renderPage(String, String)](dw.experience.PageMgr.md#renderpagestring-string) + - [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) + + and page serialization via + + - [PageMgr.serializePage(String, String)](dw.experience.PageMgr.md#serializepagestring-string) + - [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) + + + **Returns:** + - the parameters passed to page rendering and serialization + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.Region.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Region.md new file mode 100644 index 00000000..bcc318ee --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.Region.md @@ -0,0 +1,119 @@ + +# Class Region + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.Region](dw.experience.Region.md) + +This class represents a region which serves as container of components. +Using the [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) +a region can be rendered. + + +**See Also:** +- [Page](dw.experience.Page.md) +- [Component](dw.experience.Component.md) +- [PageMgr](dw.experience.PageMgr.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the id of this region. | +| [size](#size): [Number](TopLevel.Number.md) `(read-only)` | Returns the number of components that would be rendered by this region when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). | +| [visibleComponents](#visiblecomponents): [Collection](dw.util.Collection.md) `(read-only)` | Returns the components that would be rendered by this region when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.experience.Region.md#getid)() | Returns the id of this region. | +| [getSize](dw.experience.Region.md#getsize)() | Returns the number of components that would be rendered by this region when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). | +| [getVisibleComponents](dw.experience.Region.md#getvisiblecomponents)() | Returns the components that would be rendered by this region when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the id of this region. + + +--- + +### size +- size: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the number of components that would be rendered by this region + when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). + + + Due to its time and customer group depending nature this call should NOT happen in a pagecached context + outside of the processing induced by the above mentioned render methods. + + + +--- + +### visibleComponents +- visibleComponents: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the components that would be rendered by this region + when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). + + + As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this + call should NOT happen in a pagecached context outside of the processing induced by the above mentioned render methods. + + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the id of this region. + + **Returns:** + - the region id + + +--- + +### getSize() +- getSize(): [Number](TopLevel.Number.md) + - : Returns the number of components that would be rendered by this region + when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). + + + Due to its time and customer group depending nature this call should NOT happen in a pagecached context + outside of the processing induced by the above mentioned render methods. + + + **Returns:** + - the number of visible (i.e. renderable or serializable) components in this region + + +--- + +### getVisibleComponents() +- getVisibleComponents(): [Collection](dw.util.Collection.md) + - : Returns the components that would be rendered by this region + when calling [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) or [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings). + + + As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this + call should NOT happen in a pagecached context outside of the processing induced by the above mentioned render methods. + + + **Returns:** + - the visible (i.e. renderable or serializable) components in this region + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.RegionRenderSettings.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.RegionRenderSettings.md new file mode 100644 index 00000000..f42e9f07 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.RegionRenderSettings.md @@ -0,0 +1,207 @@ + +# Class RegionRenderSettings + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.RegionRenderSettings](dw.experience.RegionRenderSettings.md) + +A config that drives how the region is rendered. One can basically decide which kind of tag is used as wrapper +element (e.g. `
          ...
          `) and which attributes are to be placed into this wrapper +element (e.g. `class="foo bar"`). + + +If no attributes are provided for the region render settings then the system default ones will apply. Also if no tag +name is provided then the system default one will apply. + +- tag\_name : div +- attributes : {"class":"experience-region experience-\[REGION\_ID\]"} + +Furthermore the render settings for components in this region can be specified - in case nothing is set per component +then the default component render setting will be applied during rendering. If also no default component render +setting is provided then the system default one will apply (see [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md)). + + +**See Also:** +- [PageMgr.renderRegion(Region)](dw.experience.PageMgr.md#renderregionregion) +- [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [attributes](#attributes): [Object](TopLevel.Object.md) | Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.RegionRenderSettings.md#setattributesobject). | +| [defaultComponentRenderSettings](#defaultcomponentrendersettings): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) | Returns the default component render settings. | +| [tagName](#tagname): [String](TopLevel.String.md) | Returns the tag name of the region wrapper element. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [RegionRenderSettings](#regionrendersettings)() | Creates region render settings which can then be configured further. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributes](dw.experience.RegionRenderSettings.md#getattributes)() | Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.RegionRenderSettings.md#setattributesobject). | +| [getComponentRenderSettings](dw.experience.RegionRenderSettings.md#getcomponentrendersettingscomponent)([Component](dw.experience.Component.md)) | Returns the component render settings for the given component. | +| [getDefaultComponentRenderSettings](dw.experience.RegionRenderSettings.md#getdefaultcomponentrendersettings)() | Returns the default component render settings. | +| [getTagName](dw.experience.RegionRenderSettings.md#gettagname)() | Returns the tag name of the region wrapper element. | +| [setAttributes](dw.experience.RegionRenderSettings.md#setattributesobject)([Object](TopLevel.Object.md)) | Sets the to be configured attributes of the wrapper element. | +| [setComponentRenderSettings](dw.experience.RegionRenderSettings.md#setcomponentrendersettingscomponent-componentrendersettings)([Component](dw.experience.Component.md), [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md)) | Sets the component render settings for the given component. | +| [setDefaultComponentRenderSettings](dw.experience.RegionRenderSettings.md#setdefaultcomponentrendersettingscomponentrendersettings)([ComponentRenderSettings](dw.experience.ComponentRenderSettings.md)) | Sets the default component render settings. | +| [setTagName](dw.experience.RegionRenderSettings.md#settagnamestring)([String](TopLevel.String.md)) | Sets the tag name of the region wrapper element. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### attributes +- attributes: [Object](TopLevel.Object.md) + - : Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.RegionRenderSettings.md#setattributesobject). + + +--- + +### defaultComponentRenderSettings +- defaultComponentRenderSettings: [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : Returns the default component render settings. These will be used during rendering of the components contained in + the region in case no dedicated component render settings were provided per component. If also no default is + supplied then the system default will be used during rendering. + + + +--- + +### tagName +- tagName: [String](TopLevel.String.md) + - : Returns the tag name of the region wrapper element. Defaults to 'div'. + + +--- + +## Constructor Details + +### RegionRenderSettings() +- RegionRenderSettings() + - : Creates region render settings which can then be configured further. They are to be used for + [PageMgr.renderRegion(Region, RegionRenderSettings)](dw.experience.PageMgr.md#renderregionregion-regionrendersettings) calls. + + + **See Also:** + - [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + + +--- + +## Method Details + +### getAttributes() +- getAttributes(): [Object](TopLevel.Object.md) + - : Returns the configured attributes of the wrapper element as set by [setAttributes(Object)](dw.experience.RegionRenderSettings.md#setattributesobject). + + **Returns:** + - the configured attributes of the wrapper element + + +--- + +### getComponentRenderSettings(Component) +- getComponentRenderSettings(component: [Component](dw.experience.Component.md)): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : Returns the component render settings for the given component. In case no explicitly specified settings are found + for this component then the default one will be provided. + + + **Parameters:** + - component - the component to retrieve the render settings for + + **Returns:** + - the component render settings or default component render settings if none were found for the given + component + + + +--- + +### getDefaultComponentRenderSettings() +- getDefaultComponentRenderSettings(): [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) + - : Returns the default component render settings. These will be used during rendering of the components contained in + the region in case no dedicated component render settings were provided per component. If also no default is + supplied then the system default will be used during rendering. + + + **Returns:** + - the default component render settings + + +--- + +### getTagName() +- getTagName(): [String](TopLevel.String.md) + - : Returns the tag name of the region wrapper element. Defaults to 'div'. + + **Returns:** + - the tag name of the region wrapper element + + +--- + +### setAttributes(Object) +- setAttributes(attributes: [Object](TopLevel.Object.md)): [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + - : Sets the to be configured attributes of the wrapper element. Set to `null` in case you + want to system defaults to be applied. + + + **Parameters:** + - attributes - the to be configured attributes of the wrapper element + + **Returns:** + - this + + +--- + +### setComponentRenderSettings(Component, ComponentRenderSettings) +- setComponentRenderSettings(component: [Component](dw.experience.Component.md), componentRenderSettings: [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md)): [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + - : Sets the component render settings for the given component. + + **Parameters:** + - component - the component to set the render settings for + - componentRenderSettings - the desired render settings + + **Returns:** + - this + + +--- + +### setDefaultComponentRenderSettings(ComponentRenderSettings) +- setDefaultComponentRenderSettings(defaultComponentRenderSettings: [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md)): [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + - : Sets the default component render settings. These will be used during rendering of the components contained in + the region in case no dedicated component render settings were provided per component. + + + **Parameters:** + - defaultComponentRenderSettings - the default component render settings + + **Returns:** + - this + + +--- + +### setTagName(String) +- setTagName(tagName: [String](TopLevel.String.md)): [RegionRenderSettings](dw.experience.RegionRenderSettings.md) + - : Sets the tag name of the region wrapper element. Must not be empty. + + **Parameters:** + - tagName - the tag name of the region wrapper element + + **Returns:** + - this + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.CMSRecord.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.CMSRecord.md new file mode 100644 index 00000000..abb614d1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.CMSRecord.md @@ -0,0 +1,125 @@ + +# Class CMSRecord + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.cms.CMSRecord](dw.experience.cms.CMSRecord.md) + +This class represents a Salesforce CMS record, exposing its: + +- `id`, see [getID()](dw.experience.cms.CMSRecord.md#getid) +- `type`, see [getType()](dw.experience.cms.CMSRecord.md#gettype) +- `attributes`, see [getAttributes()](dw.experience.cms.CMSRecord.md#getattributes) + +The `attributes` are key value pairs: + +- the key being the attribute id as given in the `type.attribute_definitions`entries +- the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `type.attribute_definitions`entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent)exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)in shape of a DWScript API object based on the attribute type) + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Return the id of the Salesforce CMS record. | +| [attributes](#attributes): [Map](dw.util.Map.md) `(read-only)` | Return the Salesforce CMS record attributes as key value pairs:
          • the key being the attribute id as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions` entries
          • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions` entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent) exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring) in shape of a DWScript API object based on the attribute type)
          The attributes are also conveniently accessible through named property support. | +| [type](#type): [Map](dw.util.Map.md) `(read-only)` | Return the type of the Salesforce CMS record sufficing the `content/schema/cmsrecord.json#/definitions/cms_content_type` schema. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributes](dw.experience.cms.CMSRecord.md#getattributes)() | Return the Salesforce CMS record attributes as key value pairs:
          • the key being the attribute id as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions` entries
          • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions` entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent) exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring) in shape of a DWScript API object based on the attribute type)
          The attributes are also conveniently accessible through named property support. | +| [getID](dw.experience.cms.CMSRecord.md#getid)() | Return the id of the Salesforce CMS record. | +| [getType](dw.experience.cms.CMSRecord.md#gettype)() | Return the type of the Salesforce CMS record sufficing the `content/schema/cmsrecord.json#/definitions/cms_content_type` schema. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Return the id of the Salesforce CMS record. + + +--- + +### attributes +- attributes: [Map](dw.util.Map.md) `(read-only)` + - : Return the Salesforce CMS record attributes as key value pairs: + + - the key being the attribute id as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions`entries + - the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions`entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent)exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)in shape of a DWScript API object based on the attribute type) + + + The attributes are also conveniently accessible through named property support. That means if `myCmsRecord.getAttributes().get('foo')` yields value `'bar'`, + then `myCmsRecord.foo` will give the same results. + + + +--- + +### type +- type: [Map](dw.util.Map.md) `(read-only)` + - : Return the type of the Salesforce CMS record sufficing the `content/schema/cmsrecord.json#/definitions/cms_content_type` schema. Properties + can be accessed accordingly: + + - `getType().id : string` + - `getType().name : string` + - `getType().attribute_definitions : Map`(see `content/schema/attributedefinition.json`) + + + +--- + +## Method Details + +### getAttributes() +- getAttributes(): [Map](dw.util.Map.md) + - : Return the Salesforce CMS record attributes as key value pairs: + + - the key being the attribute id as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions`entries + - the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions`entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent)exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring)in shape of a DWScript API object based on the attribute type) + + + The attributes are also conveniently accessible through named property support. That means if `myCmsRecord.getAttributes().get('foo')` yields value `'bar'`, + then `myCmsRecord.foo` will give the same results. + + + **Returns:** + - the cms record attributes + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Return the id of the Salesforce CMS record. + + **Returns:** + - the id of the Salesforce CMS record + + +--- + +### getType() +- getType(): [Map](dw.util.Map.md) + - : Return the type of the Salesforce CMS record sufficing the `content/schema/cmsrecord.json#/definitions/cms_content_type` schema. Properties + can be accessed accordingly: + + - `getType().id : string` + - `getType().name : string` + - `getType().attribute_definitions : Map`(see `content/schema/attributedefinition.json`) + + + **Returns:** + - the type of the cms record + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.md new file mode 100644 index 00000000..73e4aeff --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.cms.md @@ -0,0 +1,6 @@ +# Package dw.experience.cms + +## Classes +| Class | Description | +| --- | --- | +| [CMSRecord](dw.experience.cms.CMSRecord.md) | This class represents a Salesforce CMS record, exposing its:
          • `id`, see [getID()](dw.experience.cms.CMSRecord.md#getid)
          • `type`, see [getType()](dw.experience.cms.CMSRecord.md#gettype)
          • `attributes`, see [getAttributes()](dw.experience.cms.CMSRecord.md#getattributes)
          The `attributes` are key value pairs:
          • the key being the attribute id as given in the `type.attribute_definitions` entries
          • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the `type.attribute_definitions` entries (similar to how [ComponentScriptContext.getContent()](dw.experience.ComponentScriptContext.md#getcontent) exposes the raw attribute value of a [Component.getAttribute(String)](dw.experience.Component.md#getattributestring) in shape of a DWScript API object based on the attribute type)
          | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.FocalPoint.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.FocalPoint.md new file mode 100644 index 00000000..6d41ca01 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.FocalPoint.md @@ -0,0 +1,71 @@ + +# Class FocalPoint + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.image.FocalPoint](dw.experience.image.FocalPoint.md) + +This class represents an image focal point. + +**See Also:** +- [Image](dw.experience.image.Image.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [x](#x): [Number](TopLevel.Number.md) `(read-only)` | Returns the focal point abscissa. | +| [y](#y): [Number](TopLevel.Number.md) `(read-only)` | Returns the focal point ordinate. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getX](dw.experience.image.FocalPoint.md#getx)() | Returns the focal point abscissa. | +| [getY](dw.experience.image.FocalPoint.md#gety)() | Returns the focal point ordinate. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### x +- x: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the focal point abscissa. + + +--- + +### y +- y: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the focal point ordinate. + + +--- + +## Method Details + +### getX() +- getX(): [Number](TopLevel.Number.md) + - : Returns the focal point abscissa. + + **Returns:** + - the focal point abscissa + + +--- + +### getY() +- getY(): [Number](TopLevel.Number.md) + - : Returns the focal point ordinate. + + **Returns:** + - the focal point ordinate + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.Image.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.Image.md new file mode 100644 index 00000000..9259a7c4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.Image.md @@ -0,0 +1,101 @@ + +# Class Image + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.image.Image](dw.experience.image.Image.md) + +This class represents an image with additional configuration capabilities (e.g. optional focal point). +Furthermore it provides access to meta data of the referenced image file. + + +**See Also:** +- [FocalPoint](dw.experience.image.FocalPoint.md) +- [ImageMetaData](dw.experience.image.ImageMetaData.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [file](#file): [MediaFile](dw.content.MediaFile.md) `(read-only)` | Returns the image media file from the current site's library. | +| [focalPoint](#focalpoint): [FocalPoint](dw.experience.image.FocalPoint.md) `(read-only)` | Returns the focal point of the image. | +| [metaData](#metadata): [ImageMetaData](dw.experience.image.ImageMetaData.md) `(read-only)` | Returns the meta data of the physical image file. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getFile](dw.experience.image.Image.md#getfile)() | Returns the image media file from the current site's library. | +| [getFocalPoint](dw.experience.image.Image.md#getfocalpoint)() | Returns the focal point of the image. | +| [getMetaData](dw.experience.image.Image.md#getmetadata)() | Returns the meta data of the physical image file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### file +- file: [MediaFile](dw.content.MediaFile.md) `(read-only)` + - : Returns the image media file from the current site's library. + + +--- + +### focalPoint +- focalPoint: [FocalPoint](dw.experience.image.FocalPoint.md) `(read-only)` + - : Returns the focal point of the image. + + +--- + +### metaData +- metaData: [ImageMetaData](dw.experience.image.ImageMetaData.md) `(read-only)` + - : Returns the meta data of the physical image file. This meta data is obtained when + the respective component attribute was saved from Page Designer, i.e. the underlying + image is not queried for the meta data every time [getMetaData()](dw.experience.image.Image.md#getmetadata) is called + but only on store of the related component attribute. + + + +--- + +## Method Details + +### getFile() +- getFile(): [MediaFile](dw.content.MediaFile.md) + - : Returns the image media file from the current site's library. + + **Returns:** + - the image media file, or null if not found + + +--- + +### getFocalPoint() +- getFocalPoint(): [FocalPoint](dw.experience.image.FocalPoint.md) + - : Returns the focal point of the image. + + **Returns:** + - the focal point, or null if not found + + +--- + +### getMetaData() +- getMetaData(): [ImageMetaData](dw.experience.image.ImageMetaData.md) + - : Returns the meta data of the physical image file. This meta data is obtained when + the respective component attribute was saved from Page Designer, i.e. the underlying + image is not queried for the meta data every time [getMetaData()](dw.experience.image.Image.md#getmetadata) is called + but only on store of the related component attribute. + + + **Returns:** + - the meta data of the image, or null if no meta data was provided with the respective component attribute + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.ImageMetaData.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.ImageMetaData.md new file mode 100644 index 00000000..3abf9ce3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.ImageMetaData.md @@ -0,0 +1,71 @@ + +# Class ImageMetaData + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.experience.image.ImageMetaData](dw.experience.image.ImageMetaData.md) + +This class represents the image meta data, e.g. width and height. + +**See Also:** +- [Image](dw.experience.image.Image.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [height](#height): [Number](TopLevel.Number.md) `(read-only)` | Returns the image height. | +| [width](#width): [Number](TopLevel.Number.md) `(read-only)` | Returns the image width. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getHeight](dw.experience.image.ImageMetaData.md#getheight)() | Returns the image height. | +| [getWidth](dw.experience.image.ImageMetaData.md#getwidth)() | Returns the image width. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### height +- height: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the image height. + + +--- + +### width +- width: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the image width. + + +--- + +## Method Details + +### getHeight() +- getHeight(): [Number](TopLevel.Number.md) + - : Returns the image height. + + **Returns:** + - the image height in pixel + + +--- + +### getWidth() +- getWidth(): [Number](TopLevel.Number.md) + - : Returns the image width. + + **Returns:** + - the image width in pixel + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.md new file mode 100644 index 00000000..d42e52a7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.image.md @@ -0,0 +1,8 @@ +# Package dw.experience.image + +## Classes +| Class | Description | +| --- | --- | +| [FocalPoint](dw.experience.image.FocalPoint.md) | This class represents an image focal point. | +| [Image](dw.experience.image.Image.md) | This class represents an image with additional configuration capabilities (e.g. | +| [ImageMetaData](dw.experience.image.ImageMetaData.md) | This class represents the image meta data, e.g. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.experience.md b/packages/b2c-tooling-sdk/data/script-api/dw.experience.md new file mode 100644 index 00000000..cba2d0b3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.experience.md @@ -0,0 +1,16 @@ +# Package dw.experience + +## Classes +| Class | Description | +| --- | --- | +| [AspectAttributeValidationException](dw.experience.AspectAttributeValidationException.md) | This APIException is thrown by method [PageMgr.renderPage(String, Map, String)](dw.experience.PageMgr.md#renderpagestring-map-string) and [PageMgr.serializePage(String, Map, String)](dw.experience.PageMgr.md#serializepagestring-map-string) to indicate that the passed aspect attributes failed during validation against the definition provided through the aspect type of the page. | +| [Component](dw.experience.Component.md) | This class represents a page designer managed component as part of a page. | +| [ComponentRenderSettings](dw.experience.ComponentRenderSettings.md) | A config that drives how the component is rendered. | +| [ComponentScriptContext](dw.experience.ComponentScriptContext.md) | This is the context that is handed over to the `render` and `serialize` function of the respective component type script. | +| [CustomEditor](dw.experience.CustomEditor.md) | This class represents a custom editor for component attributes of type `custom`. | +| [CustomEditorResources](dw.experience.CustomEditorResources.md) | This class represents the resources of a custom editor, i.e. | +| [Page](dw.experience.Page.md) |

          This class represents a page designer managed page. | +| [PageMgr](dw.experience.PageMgr.md) | Provides functionality for getting, rendering and serializing page designer managed pages. | +| [PageScriptContext](dw.experience.PageScriptContext.md) | This is the context that is handed over to the `render` and `serialize` function of the respective page type script. | +| [Region](dw.experience.Region.md) | This class represents a region which serves as container of components. | +| [RegionRenderSettings](dw.experience.RegionRenderSettings.md) | A config that drives how the region is rendered. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHookResult.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHookResult.md new file mode 100644 index 00000000..228f5f97 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHookResult.md @@ -0,0 +1,254 @@ + +# Class ApplePayHookResult + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.applepay.ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + + + +Result of a hook handling an Apple Pay request. + + + + + +Use the constants in this type to indicate specific error reasons to be provided +to Apple Pay JS. For example, the following code creates a [Status](dw.system.Status.md) +that indicates the shipping contact information provided by Apple Pay is invalid: + + + + +``` +var ApplePayHookResult = require('dw/extensions/applepay/ApplePayHookResult'); +var Status = require('dw/system/Status'); + +var error = new Status(Status.ERROR); +error.addDetail(ApplePayHookResult.STATUS_REASON_DETAIL_KEY, ApplePayHookResult.REASON_SHIPPING_CONTACT); +``` + + + + +If a specific error reason is not provided, the generic Apple Pay `STATUS_FAILURE` +reason will be used when necessary. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [REASON_BILLING_ADDRESS](#reason_billing_address): [String](TopLevel.String.md) = "InvalidBillingPostalAddress" | Error reason code representing an invalid billing address. | +| [REASON_FAILURE](#reason_failure): [String](TopLevel.String.md) = "Failure" | Error reason code representing an error or failure not otherwise specified. | +| [REASON_PIN_INCORRECT](#reason_pin_incorrect): [String](TopLevel.String.md) = "PINIncorrect" | Error reason code representing the PIN is incorrect. | +| [REASON_PIN_LOCKOUT](#reason_pin_lockout): [String](TopLevel.String.md) = "PINLockout" | Error reason code representing a PIN lockout. | +| [REASON_PIN_REQUIRED](#reason_pin_required): [String](TopLevel.String.md) = "PINRequired" | Error reason code representing a PIN is required. | +| [REASON_SHIPPING_ADDRESS](#reason_shipping_address): [String](TopLevel.String.md) = "InvalidShippingPostalAddress" | Error reason code representing an invalid shipping address. | +| [REASON_SHIPPING_CONTACT](#reason_shipping_contact): [String](TopLevel.String.md) = "InvalidShippingContact" | Error reason code representing invalid shipping contact information. | +| [STATUS_REASON_DETAIL_KEY](#status_reason_detail_key): [String](TopLevel.String.md) = "reason" | Key for the detail to be used in [Status](dw.system.Status.md) objects to indicate the reason to communicate to Apple Pay for errors. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [eventDetail](#eventdetail): [Object](TopLevel.Object.md) `(read-only)` | Detail to the JS custom event to dispatch in response to this result. | +| [eventName](#eventname): [String](TopLevel.String.md) `(read-only)` | Name of the JS custom event to dispatch in response to this result. | +| [redirect](#redirect): [URL](dw.web.URL.md) `(read-only)` | URL to navigate to in response to this result. | +| [status](#status): [Status](dw.system.Status.md) `(read-only)` | Status describing the outcome of this result. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [ApplePayHookResult](#applepayhookresultstatus-url)([Status](dw.system.Status.md), [URL](dw.web.URL.md)) | Constructs a result with the given outcome information. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getEventDetail](dw.extensions.applepay.ApplePayHookResult.md#geteventdetail)() | Detail to the JS custom event to dispatch in response to this result. | +| [getEventName](dw.extensions.applepay.ApplePayHookResult.md#geteventname)() | Name of the JS custom event to dispatch in response to this result. | +| [getRedirect](dw.extensions.applepay.ApplePayHookResult.md#getredirect)() | URL to navigate to in response to this result. | +| [getStatus](dw.extensions.applepay.ApplePayHookResult.md#getstatus)() | Status describing the outcome of this result. | +| [setEvent](dw.extensions.applepay.ApplePayHookResult.md#seteventstring)([String](TopLevel.String.md)) | Sets the name of the JS custom event to dispatch in response to this result. | +| [setEvent](dw.extensions.applepay.ApplePayHookResult.md#seteventstring-object)([String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Sets the name and detail of the JS custom event to dispatch in response to this result. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### REASON_BILLING_ADDRESS + +- REASON_BILLING_ADDRESS: [String](TopLevel.String.md) = "InvalidBillingPostalAddress" + - : Error reason code representing an invalid billing address. + + +--- + +### REASON_FAILURE + +- REASON_FAILURE: [String](TopLevel.String.md) = "Failure" + - : Error reason code representing an error or failure not otherwise specified. + + +--- + +### REASON_PIN_INCORRECT + +- REASON_PIN_INCORRECT: [String](TopLevel.String.md) = "PINIncorrect" + - : Error reason code representing the PIN is incorrect. + + +--- + +### REASON_PIN_LOCKOUT + +- REASON_PIN_LOCKOUT: [String](TopLevel.String.md) = "PINLockout" + - : Error reason code representing a PIN lockout. + + +--- + +### REASON_PIN_REQUIRED + +- REASON_PIN_REQUIRED: [String](TopLevel.String.md) = "PINRequired" + - : Error reason code representing a PIN is required. + + +--- + +### REASON_SHIPPING_ADDRESS + +- REASON_SHIPPING_ADDRESS: [String](TopLevel.String.md) = "InvalidShippingPostalAddress" + - : Error reason code representing an invalid shipping address. + + +--- + +### REASON_SHIPPING_CONTACT + +- REASON_SHIPPING_CONTACT: [String](TopLevel.String.md) = "InvalidShippingContact" + - : Error reason code representing invalid shipping contact information. + + +--- + +### STATUS_REASON_DETAIL_KEY + +- STATUS_REASON_DETAIL_KEY: [String](TopLevel.String.md) = "reason" + - : Key for the detail to be used in [Status](dw.system.Status.md) objects to indicate + the reason to communicate to Apple Pay for errors. + + + +--- + +## Property Details + +### eventDetail +- eventDetail: [Object](TopLevel.Object.md) `(read-only)` + - : Detail to the JS custom event to dispatch in response to this result. + + +--- + +### eventName +- eventName: [String](TopLevel.String.md) `(read-only)` + - : Name of the JS custom event to dispatch in response to this result. + + +--- + +### redirect +- redirect: [URL](dw.web.URL.md) `(read-only)` + - : URL to navigate to in response to this result. + + +--- + +### status +- status: [Status](dw.system.Status.md) `(read-only)` + - : Status describing the outcome of this result. + + +--- + +## Constructor Details + +### ApplePayHookResult(Status, URL) +- ApplePayHookResult(status: [Status](dw.system.Status.md), redirect: [URL](dw.web.URL.md)) + - : Constructs a result with the given outcome information. + + **Parameters:** + - status - status of the result + - redirect - optional URL to which to navigate to in response to this outcome + + +--- + +## Method Details + +### getEventDetail() +- getEventDetail(): [Object](TopLevel.Object.md) + - : Detail to the JS custom event to dispatch in response to this result. + + **Returns:** + - event detail + + +--- + +### getEventName() +- getEventName(): [String](TopLevel.String.md) + - : Name of the JS custom event to dispatch in response to this result. + + **Returns:** + - event name + + +--- + +### getRedirect() +- getRedirect(): [URL](dw.web.URL.md) + - : URL to navigate to in response to this result. + + **Returns:** + - redirect URL + + +--- + +### getStatus() +- getStatus(): [Status](dw.system.Status.md) + - : Status describing the outcome of this result. + + **Returns:** + - status of this result + + +--- + +### setEvent(String) +- setEvent(name: [String](TopLevel.String.md)): void + - : Sets the name of the JS custom event to dispatch in response to this result. + + **Parameters:** + - name - JS custom event name + + +--- + +### setEvent(String, Object) +- setEvent(name: [String](TopLevel.String.md), detail: [Object](TopLevel.Object.md)): void + - : Sets the name and detail of the JS custom event to dispatch in response to this result. + + **Parameters:** + - name - JS custom event name + - detail - JS custom event detail + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHooks.md new file mode 100644 index 00000000..410ed60a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.ApplePayHooks.md @@ -0,0 +1,572 @@ + +# Class ApplePayHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.applepay.ApplePayHooks](dw.extensions.applepay.ApplePayHooks.md) + +ApplePayHooks interface containing extension points for customizing Apple Pay. + + +These hooks are 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.applepay.getRequest", "script": "./applepay.ds"} + {"name": "dw.extensions.applepay.shippingContactSelected", "script": "./applepay.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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointCancel](#extensionpointcancel): [String](TopLevel.String.md) = "dw.extensions.applepay.cancel" | The extension point name dw.extensions.applepay.cancel. | +| [extensionPointGetRequest](#extensionpointgetrequest): [String](TopLevel.String.md) = "dw.extensions.applepay.getRequest" | The extension point name dw.extensions.applepay.getRequest. | +| [extensionPointPaymentAuthorizedAuthorizeOrderPayment](#extensionpointpaymentauthorizedauthorizeorderpayment): [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.authorizeOrderPayment" | The extension point name dw.extensions.applepay.paymentAuthorized.authorizeOrderPayment. | +| [extensionPointPaymentAuthorizedCreateOrder](#extensionpointpaymentauthorizedcreateorder): [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.createOrder" | The extension point name dw.extensions.applepay.paymentAuthorized.createOrder. | +| [extensionPointPaymentAuthorizedFailOrder](#extensionpointpaymentauthorizedfailorder): [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.failOrder" | The extension point name dw.extensions.applepay.paymentAuthorized.failOrder. | +| [extensionPointPaymentAuthorizedPlaceOrder](#extensionpointpaymentauthorizedplaceorder): [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.placeOrder" | The extension point name dw.extensions.applepay.paymentAuthorized.placeOrder. | +| [extensionPointPaymentMethodSelected](#extensionpointpaymentmethodselected): [String](TopLevel.String.md) = "dw.extensions.applepay.paymentMethodSelected" | The extension point name dw.extensions.applepay.paymentMethodSelected. | +| [extensionPointPrepareBasket](#extensionpointpreparebasket): [String](TopLevel.String.md) = "dw.extensions.applepay.prepareBasket" | The extension point name dw.extensions.applepay.prepareBasket. | +| [extensionPointShippingContactSelected](#extensionpointshippingcontactselected): [String](TopLevel.String.md) = "dw.extensions.applepay.shippingContactSelected" | The extension point name dw.extensions.applepay.shippingContactSelected. | +| [extensionPointShippingMethodSelected](#extensionpointshippingmethodselected): [String](TopLevel.String.md) = "dw.extensions.applepay.shippingMethodSelected" | The extension point name dw.extensions.applepay.shippingMethodSelected. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [authorizeOrderPayment](dw.extensions.applepay.ApplePayHooks.md#authorizeorderpaymentorder-object)([Order](dw.order.Order.md), [Object](TopLevel.Object.md)) |

          Called to authorize the Apple Pay payment for the order. | +| [cancel](dw.extensions.applepay.ApplePayHooks.md#cancelbasket)([Basket](dw.order.Basket.md)) |

          Called after the Apple Pay payment sheet was canceled. | +| [createOrder](dw.extensions.applepay.ApplePayHooks.md#createorderbasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Called after handling the given `ApplePayPaymentAuthorizedEvent` for the given basket. | +| [failOrder](dw.extensions.applepay.ApplePayHooks.md#failorderorder-status)([Order](dw.order.Order.md), [Status](dw.system.Status.md)) |

          Called after payment authorization is unsuccessful and the given Apple Pay order must be failed. | +| [getRequest](dw.extensions.applepay.ApplePayHooks.md#getrequestbasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Called to get the Apple Pay JS `PaymentRequest` for the given basket. | +| [paymentMethodSelected](dw.extensions.applepay.ApplePayHooks.md#paymentmethodselectedbasket-object-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) |

          Called after handling the given `ApplePayPaymentMethodSelectedEvent` for the given basket. | +| [placeOrder](dw.extensions.applepay.ApplePayHooks.md#placeorderorder)([Order](dw.order.Order.md)) |

          Called after payment has been authorized and the given Apple Pay order is ready to be placed. | +| [prepareBasket](dw.extensions.applepay.ApplePayHooks.md#preparebasketbasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Called to prepare the given basket for an Apple Pay checkout. | +| [shippingContactSelected](dw.extensions.applepay.ApplePayHooks.md#shippingcontactselectedbasket-object-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) |

          Called after handling the given `ApplePayShippingContactSelectedEvent` for the given basket. | +| [shippingMethodSelected](dw.extensions.applepay.ApplePayHooks.md#shippingmethodselectedbasket-shippingmethod-object-object)([Basket](dw.order.Basket.md), [ShippingMethod](dw.order.ShippingMethod.md), [Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) |

          Called after handling the given `ApplePayShippingMethodSelectedEvent` for the given basket. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointCancel + +- extensionPointCancel: [String](TopLevel.String.md) = "dw.extensions.applepay.cancel" + - : The extension point name dw.extensions.applepay.cancel. + + +--- + +### extensionPointGetRequest + +- extensionPointGetRequest: [String](TopLevel.String.md) = "dw.extensions.applepay.getRequest" + - : The extension point name dw.extensions.applepay.getRequest. + + +--- + +### extensionPointPaymentAuthorizedAuthorizeOrderPayment + +- extensionPointPaymentAuthorizedAuthorizeOrderPayment: [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.authorizeOrderPayment" + - : The extension point name dw.extensions.applepay.paymentAuthorized.authorizeOrderPayment. + + +--- + +### extensionPointPaymentAuthorizedCreateOrder + +- extensionPointPaymentAuthorizedCreateOrder: [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.createOrder" + - : The extension point name dw.extensions.applepay.paymentAuthorized.createOrder. + + +--- + +### extensionPointPaymentAuthorizedFailOrder + +- extensionPointPaymentAuthorizedFailOrder: [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.failOrder" + - : The extension point name dw.extensions.applepay.paymentAuthorized.failOrder. + + +--- + +### extensionPointPaymentAuthorizedPlaceOrder + +- extensionPointPaymentAuthorizedPlaceOrder: [String](TopLevel.String.md) = "dw.extensions.applepay.paymentAuthorized.placeOrder" + - : The extension point name dw.extensions.applepay.paymentAuthorized.placeOrder. + + +--- + +### extensionPointPaymentMethodSelected + +- extensionPointPaymentMethodSelected: [String](TopLevel.String.md) = "dw.extensions.applepay.paymentMethodSelected" + - : The extension point name dw.extensions.applepay.paymentMethodSelected. + + +--- + +### extensionPointPrepareBasket + +- extensionPointPrepareBasket: [String](TopLevel.String.md) = "dw.extensions.applepay.prepareBasket" + - : The extension point name dw.extensions.applepay.prepareBasket. + + +--- + +### extensionPointShippingContactSelected + +- extensionPointShippingContactSelected: [String](TopLevel.String.md) = "dw.extensions.applepay.shippingContactSelected" + - : The extension point name dw.extensions.applepay.shippingContactSelected. + + +--- + +### extensionPointShippingMethodSelected + +- extensionPointShippingMethodSelected: [String](TopLevel.String.md) = "dw.extensions.applepay.shippingMethodSelected" + - : The extension point name dw.extensions.applepay.shippingMethodSelected. + + +--- + +## Method Details + +### authorizeOrderPayment(Order, Object) +- authorizeOrderPayment(order: [Order](dw.order.Order.md), event: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Called to authorize the Apple Pay payment for the order. The given order will have been created by the + [extensionPointPaymentAuthorizedCreateOrder](dw.extensions.applepay.ApplePayHooks.md#extensionpointpaymentauthorizedcreateorder) hook, after the basket was populated with data from + the `ApplePayPaymentAuthorizedEvent`. + + + + + Return a non-error status if you have successfully authorized the payment with your payment service provider. + Your hook implementation must set the necessary payment status and transaction identifier data on the order as + returned by the provider. + + + + + Return an error status to indicate a problem, including unsuccessful authorization. See + [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) for how to indicate error statuses with detail information to + be provided to Apple Pay. + + + + + See the [Apple Pay JS API Reference](https://developer.apple.com/reference/applepayjs) for more information. + + + **Parameters:** + - order - the order paid using Apple Pay + - event - `ApplePayPaymentAuthorizedEvent` object + + **Returns:** + - a non-null status ends the hook execution + + +--- + +### cancel(Basket) +- cancel(basket: [Basket](dw.order.Basket.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after the Apple Pay payment sheet was canceled. There is no Apple Pay JS event object for this case. The + given basket is the one that was passed to other hooks earlier in the Apple Pay checkout process. + + + + + It is not guaranteed that this hook will be executed for all Apple Pay payment sheets canceled by shoppers or + otherwise ended without a successful order. Calls to this hook are provided on a best-effort basis. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if possible. It + is not guaranteed that the response with the hook result will be handled in the shopper browser in all cases. + + + **Parameters:** + - basket - the basket that was being checked out using Apple Pay + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### createOrder(Basket, Object) +- createOrder(basket: [Basket](dw.order.Basket.md), event: [Object](TopLevel.Object.md)): [Order](dw.order.Order.md) + - : + + Called after handling the given `ApplePayPaymentAuthorizedEvent` for the given basket. Customer + information, billing address, and/or shipping address for the default shipment will have already been updated to + reflect the available contact information provided by Apple Pay based on the Apple Pay configuration for your + site. Any preexisting payment instruments on the basket will have been removed, and a single + `DW_APPLE_PAY` payment instrument added for the total amount. + + + + + The purpose of this hook is to populate the created order with any necessary information from the basket + or the Apple Pay event. Do not use this hook for address verification, or any other validation. Instead + use the [extensionPointPaymentAuthorizedAuthorizeOrderPayment](dw.extensions.applepay.ApplePayHooks.md#extensionpointpaymentauthorizedauthorizeorderpayment) hook which allows you to return + an `ApplePayHookResult` with error status information. + + + + + The default implementation of this hook simply calls `OrderMgr.createOrder` and returns the created + order. + + + + + Throw an error to indicate a problem creating the order. + + + **Parameters:** + - basket - the basket being checked out using Apple Pay + - event - `ApplePayPaymentAuthorizedEvent` object + + **Returns:** + - a non-null order ends the hook execution + + +--- + +### failOrder(Order, Status) +- failOrder(order: [Order](dw.order.Order.md), status: [Status](dw.system.Status.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after payment authorization is unsuccessful and the given Apple Pay order must be failed. The purpose + of this hook is to fail the order, or return a redirect URL that results in the order being failed when the shopper + browser is navigated to it. The given status object is the result of calling the + [extensionPointPaymentAuthorizedAuthorizeOrderPayment](dw.extensions.applepay.ApplePayHooks.md#extensionpointpaymentauthorizedauthorizeorderpayment) hook. + + + + + The default implementation of this hook simply calls `OrderMgr.failOrder`, and returns a result + with the given status and no redirect URL. + + + + + Return a result with an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + for how to indicate error statuses with detail information to be provided to Apple Pay. If the returned result includes + a redirect URL, the shopper browser will be navigated to that URL if the Apple Pay payment sheet is canceled. + + + **Parameters:** + - order - the order created for a failed Apple Pay checkout + - status - status code returned by the [extensionPointPaymentAuthorizedAuthorizeOrderPayment](dw.extensions.applepay.ApplePayHooks.md#extensionpointpaymentauthorizedauthorizeorderpayment) hook + + **Returns:** + - ApplePayHookResult containing a status code to be provided to Apple Pay. A non-null result ends the hook execution + + +--- + +### getRequest(Basket, Object) +- getRequest(basket: [Basket](dw.order.Basket.md), request: [Object](TopLevel.Object.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called to get the Apple Pay JS `PaymentRequest` for the given basket. You can set properties in the + given request object to extend or override default properties set automatically based on the Apple Pay + configuration for your site. + + + + + Return a result with an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + for how to indicate error statuses with detail information to be provided to Apple Pay. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Apple + Pay payment sheet is canceled. + + + + + See the [Apple Pay JS API Reference](https://developer.apple.com/reference/applepayjs) for more information. + + + **Parameters:** + - basket - the basket for the Apple Pay request + - request - the Apple Pay payment request object + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### paymentMethodSelected(Basket, Object, Object) +- paymentMethodSelected(basket: [Basket](dw.order.Basket.md), event: [Object](TopLevel.Object.md), response: [Object](TopLevel.Object.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after handling the given `ApplePayPaymentMethodSelectedEvent` for the given basket. This Apple + Pay event does not contain payment card or device information. + + + + + The given response object will contain properties whose values are to be passed as parameters to the + `ApplePaySession.completePaymentMethodSelection` event callback: + + + + - total - Updated total line item object + - lineItems - Array of updated line item objects + + + + Return a result with an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + for how to indicate error statuses with detail information to be provided to Apple Pay. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Apple + Pay payment sheet is canceled. + + + + + See the [Apple Pay JS API Reference](https://developer.apple.com/reference/applepayjs) for more information. + + + **Parameters:** + - basket - the basket being checked out using Apple Pay + - event - `ApplePayPaymentMethodSelectedEvent` object + - response - JS object containing Apple Pay event callback parameters + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### placeOrder(Order) +- placeOrder(order: [Order](dw.order.Order.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after payment has been authorized and the given Apple Pay order is ready to be placed. The purpose of this + hook is to place the order, or return a redirect URL that results in the order being placed when the shopper + browser is navigated to it. + + + + + The default implementation of this hook returns a redirect to `COPlaceOrder-Submit` with URL + parameters `order_id` set to [Order.getOrderNo()](dw.order.Order.md#getorderno) and `order_token` set to + [Order.getOrderToken()](dw.order.Order.md#getordertoken) which corresponds to SiteGenesis-based implementations. Your hook + implementation should return a result with a different redirect URL as necessary to place the order and show an + order confirmation. + + + + + Alternatively, your hook implementation itself can place the order and return a result with a redirect URL to an + order confirmation page that does not place the order. This is inconsistent with SiteGenesis-based + implementations so is not the default. + + + + + Return an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) for how to + indicate error statuses with detail information to be provided to Apple Pay. If the returned result includes a + redirect URL, the shopper browser will be navigated to that URL if the Apple Pay payment sheet is canceled. + + + **Parameters:** + - order - the order paid using Apple Pay + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### prepareBasket(Basket, Object) +- prepareBasket(basket: [Basket](dw.order.Basket.md), parameters: [Object](TopLevel.Object.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called to prepare the given basket for an Apple Pay checkout. This hook will be executed after the user + clicks the Apple Pay button. + + + + + The default implementation of this hook calculates the basket. A custom hook implementation that returns a + non-null result must calculate the basket. + + + + + The given parameters object will contain properties whose values are passed from the + `` tag: + + + + - sku - SKU of product to checkout exclusively + + + + Return a result with an error status to indicate a problem. For this hook there is no opportunity to provide user + feedback, so if any error status is returned, the Apple Pay payment sheet will be aborted. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL after the Apple + Pay payment sheet is aborted. + + + **Parameters:** + - basket - the basket for the Apple Pay request + - parameters - parameters from the `` tag + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### shippingContactSelected(Basket, Object, Object) +- shippingContactSelected(basket: [Basket](dw.order.Basket.md), event: [Object](TopLevel.Object.md), response: [Object](TopLevel.Object.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after handling the given `ApplePayShippingContactSelectedEvent` for the given basket. Basket + customer information and/or shipping address for the default shipment will have already been updated to reflect + the available shipping contact information provided by Apple Pay based on the Apple Pay configuration for your + site. The basket will have already been calculated before this hook is called. + + + + + The given response object will contain properties whose values are to be passed as parameters to the + `ApplePaySession.completeShippingContactSelection` event callback: + + + + - shippingMethods - Array of applicable shipping method JS objects + - total - Updated total line item object + - lineItems - Array of updated line item objects + + + + Return a result with an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + for how to indicate error statuses with detail information to be provided to Apple Pay. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Apple + Pay payment sheet is canceled. + + + + + See the [Apple Pay JS API Reference](https://developer.apple.com/reference/applepayjs) for more information. + + + **Parameters:** + - basket - the basket being checked out using Apple Pay + - event - `ApplePayShippingContactSelectedEvent` object + - response - JS object containing Apple Pay event callback parameters + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### shippingMethodSelected(Basket, ShippingMethod, Object, Object) +- shippingMethodSelected(basket: [Basket](dw.order.Basket.md), shippingMethod: [ShippingMethod](dw.order.ShippingMethod.md), event: [Object](TopLevel.Object.md), response: [Object](TopLevel.Object.md)): [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + - : + + Called after handling the given `ApplePayShippingMethodSelectedEvent` for the given basket. The given + shipping method will have already been set on the basket. The basket will have already been calculated before + this hook is called. + + + + + The given response object will contain properties whose values are to be passed as parameters to the + `ApplePaySession.completeShippingMethodSelection` event callback: + + + + - total - Updated total line item object + - lineItems - Array of updated line item objects + + + + Return a result with an error status to indicate a problem. See [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) + for how to indicate error statuses with detail information to be provided to Apple Pay. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Apple + Pay payment sheet is canceled. + + + + + See the [Apple Pay JS API Reference](https://developer.apple.com/reference/applepayjs) for more information. + + + **Parameters:** + - basket - the basket being checked out using Apple Pay + - shippingMethod - the shipping method that was selected + - event - `ApplePayShippingMethodSelectedEvent` object + - response - JS object containing Apple Pay event callback parameters + + **Returns:** + - a non-null result ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.md new file mode 100644 index 00000000..ad031559 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.applepay.md @@ -0,0 +1,7 @@ +# Package dw.extensions.applepay + +## Classes +| Class | Description | +| --- | --- | +| [ApplePayHookResult](dw.extensions.applepay.ApplePayHookResult.md) |

          Result of a hook handling an Apple Pay request. | +| [ApplePayHooks](dw.extensions.applepay.ApplePayHooks.md) | ApplePayHooks interface containing extension points for customizing Apple Pay. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookFeedHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookFeedHooks.md new file mode 100644 index 00000000..f854e705 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookFeedHooks.md @@ -0,0 +1,102 @@ + +# Class FacebookFeedHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.facebook.FacebookFeedHooks](dw.extensions.facebook.FacebookFeedHooks.md) + +FacebookFeedHooks interface containing extension points for customizing Facebook export feeds. + + +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.facebook.feed.transformProduct", "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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointTransformProduct](#extensionpointtransformproduct): [String](TopLevel.String.md) = "dw.extensions.facebook.feed.transformProduct" | The extension point name dw.extensions.facebook.feed.transformProduct. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [transformProduct](dw.extensions.facebook.FacebookFeedHooks.md#transformproductproduct-facebookproduct-string)([Product](dw.catalog.Product.md), [FacebookProduct](dw.extensions.facebook.FacebookProduct.md), [String](TopLevel.String.md)) |

          Called after default transformation of given Demandware product to Facebook product as part of the catalog feed export. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointTransformProduct + +- extensionPointTransformProduct: [String](TopLevel.String.md) = "dw.extensions.facebook.feed.transformProduct" + - : The extension point name dw.extensions.facebook.feed.transformProduct. + + +--- + +## Method Details + +### transformProduct(Product, FacebookProduct, String) +- transformProduct(product: [Product](dw.catalog.Product.md), facebookProduct: [FacebookProduct](dw.extensions.facebook.FacebookProduct.md), feedId: [String](TopLevel.String.md)): [Status](dw.system.Status.md) + - : + + Called after default transformation of given Demandware product to Facebook product as part of the catalog feed + export. + + + + + To customize multiple feeds differently, for example if one is for Facebook Dynamic Ads and the other is for + Instagram Commerce, use the `feedId` parameter to determine which feed is being exported. If the same + customization should apply to all feeds, ignore the parameter. + + + **Parameters:** + - product - the Demandware product + - facebookProduct - the Facebook representation of the product + - feedId - the merchant-selected ID for the feed being exported + + **Returns:** + - a non-null Status ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookProduct.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookProduct.md new file mode 100644 index 00000000..a35f5628 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.FacebookProduct.md @@ -0,0 +1,1343 @@ + +# Class FacebookProduct + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.facebook.FacebookProduct](dw.extensions.facebook.FacebookProduct.md) + +Represents a row in the Facebook catalog feed export. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [AGE_GROUP_ADULT](#age_group_adult): [String](TopLevel.String.md) = "adult" | Indicates that the product is for adults. | +| [AGE_GROUP_INFANT](#age_group_infant): [String](TopLevel.String.md) = "infant" | Indicates that the product is for infant children. | +| [AGE_GROUP_KIDS](#age_group_kids): [String](TopLevel.String.md) = "kids" | Indicates that the product is for children. | +| [AGE_GROUP_NEWBORN](#age_group_newborn): [String](TopLevel.String.md) = "newborn" | Indicates that the product is for newborn children. | +| [AGE_GROUP_TODDLER](#age_group_toddler): [String](TopLevel.String.md) = "toddler" | Indicates that the product is for toddler children. | +| [AVAILABILITY_AVAILABLE_FOR_ORDER](#availability_available_for_order): [String](TopLevel.String.md) = "available for order" | Indicates that the product can be ordered for later shipment. | +| [AVAILABILITY_IN_STOCK](#availability_in_stock): [String](TopLevel.String.md) = "in stock" | Indicates that the product is available to ship immediately. | +| [AVAILABILITY_OUT_OF_STOCK](#availability_out_of_stock): [String](TopLevel.String.md) = "out of stock" | Indicates that the product is out of stock. | +| [AVAILABILITY_PREORDER](#availability_preorder): [String](TopLevel.String.md) = "preorder" | Indicates that the product will be available in the future. | +| [CONDITION_NEW](#condition_new): [String](TopLevel.String.md) = "new" | Indicates that the product is new. | +| [CONDITION_REFURBISHED](#condition_refurbished): [String](TopLevel.String.md) = "refurbished" | Indicates that the product is used but has been refurbished. | +| [CONDITION_USED](#condition_used): [String](TopLevel.String.md) = "used" | Indicates that the product has been used. | +| [GENDER_FEMALE](#gender_female): [String](TopLevel.String.md) = "female" | Indicates that the product is for females. | +| [GENDER_MALE](#gender_male): [String](TopLevel.String.md) = "male" | Indicates that the product is for males. | +| [GENDER_UNISEX](#gender_unisex): [String](TopLevel.String.md) = "unisex" | Indicates that the product is for both males and females. | +| [SHIPPING_SIZE_UNIT_CM](#shipping_size_unit_cm): [String](TopLevel.String.md) = "cm" | Indicates that the product is measured in centimeters. | +| [SHIPPING_SIZE_UNIT_FT](#shipping_size_unit_ft): [String](TopLevel.String.md) = "ft" | Indicates that the product is measured in feet. | +| [SHIPPING_SIZE_UNIT_IN](#shipping_size_unit_in): [String](TopLevel.String.md) = "in" | Indicates that the product is measured in inches. | +| [SHIPPING_SIZE_UNIT_M](#shipping_size_unit_m): [String](TopLevel.String.md) = "m" | Indicates that the product is measured in meters. | +| [SHIPPING_WEIGHT_UNIT_G](#shipping_weight_unit_g): [String](TopLevel.String.md) = "g" | Indicates that the product is weighed in grams. | +| [SHIPPING_WEIGHT_UNIT_KG](#shipping_weight_unit_kg): [String](TopLevel.String.md) = "kg" | Indicates that the product is weighed in kilograms. | +| [SHIPPING_WEIGHT_UNIT_LB](#shipping_weight_unit_lb): [String](TopLevel.String.md) = "lb" | Indicates that the product is weighed in pounds. | +| [SHIPPING_WEIGHT_UNIT_OZ](#shipping_weight_unit_oz): [String](TopLevel.String.md) = "oz" | Indicates that the product is weighed in ounces. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the Facebook product. | +| [ageGroup](#agegroup): [String](TopLevel.String.md) | Returns the age group for the Facebook product. | +| [availability](#availability): [String](TopLevel.String.md) | Returns the availability of the Facebook product. | +| [brand](#brand): [String](TopLevel.String.md) | Returns the Facebook brand of the product. | +| [color](#color): [String](TopLevel.String.md) | Returns the Facebook color value label of the product. | +| [condition](#condition): [String](TopLevel.String.md) | Returns the condition of the Facebook product. | +| [customLabel0](#customlabel0): [String](TopLevel.String.md) | Returns the Facebook custom label 0 value of the product. | +| [customLabel1](#customlabel1): [String](TopLevel.String.md) | Returns the Facebook custom label 1 value of the product. | +| [customLabel2](#customlabel2): [String](TopLevel.String.md) | Returns the Facebook custom label 2 value of the product. | +| [customLabel3](#customlabel3): [String](TopLevel.String.md) | Returns the Facebook custom label 3 value of the product. | +| [customLabel4](#customlabel4): [String](TopLevel.String.md) | Returns the Facebook custom label 4 value of the product. | +| [description](#description): [String](TopLevel.String.md) | Returns the description of the Facebook product. | +| [expirationDate](#expirationdate): [Date](TopLevel.Date.md) | Returns the Facebook expiration date of the product. | +| [gender](#gender): [String](TopLevel.String.md) | Returns the gender for the Facebook product. | +| [googleProductCategory](#googleproductcategory): [String](TopLevel.String.md) | Returns the category of this product in the Google category taxonomy. | +| [gtin](#gtin): [String](TopLevel.String.md) | Returns the Facebook GTIN of the product. | +| [imageLinks](#imagelinks): [List](dw.util.List.md) | Returns a list containing the URLs of the images to show in Facebook for the product. | +| [itemGroupID](#itemgroupid): [String](TopLevel.String.md) | Returns the ID of the Facebook item group for the product, that is, its master product. | +| [link](#link): [URL](dw.web.URL.md) | Returns the URL of the Demandware storefront link to the product. | +| [material](#material): [String](TopLevel.String.md) | Returns the Facebook material value label of the product. | +| [mpn](#mpn): [String](TopLevel.String.md) | Returns the Facebook MPN of the product. | +| [pattern](#pattern): [String](TopLevel.String.md) | Returns the Facebook pattern value label of the product. | +| [price](#price): [Money](dw.value.Money.md) | Returns the price to show in Facebook for the product. | +| [productType](#producttype): [String](TopLevel.String.md) | Returns the Facebook product type. | +| [salePrice](#saleprice): [Money](dw.value.Money.md) | Returns the sale price to show in Facebook for the product. | +| [salePriceEffectiveDateEnd](#salepriceeffectivedateend): [Date](TopLevel.Date.md) | Returns the end date of the Facebook sale price of the product. | +| [salePriceEffectiveDateStart](#salepriceeffectivedatestart): [Date](TopLevel.Date.md) | Returns the start date of the Facebook sale price of the product. | +| [shippingHeight](#shippingheight): [Number](TopLevel.Number.md) | Returns the shipping height of the product. | +| [shippingLength](#shippinglength): [Number](TopLevel.Number.md) | Returns the shipping length of the product. | +| [shippingSizeUnit](#shippingsizeunit): [String](TopLevel.String.md) | Returns the shipping size unit of the product. | +| [shippingWeight](#shippingweight): [Quantity](dw.value.Quantity.md) | Returns the shipping weight for the product. | +| [shippingWidth](#shippingwidth): [Number](TopLevel.Number.md) | Returns the shipping width of the product. | +| [size](#size): [String](TopLevel.String.md) | Returns the Facebook size value label of the product. | +| [title](#title): [String](TopLevel.String.md) | Returns the title of the Facebook product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAgeGroup](dw.extensions.facebook.FacebookProduct.md#getagegroup)() | Returns the age group for the Facebook product. | +| [getAvailability](dw.extensions.facebook.FacebookProduct.md#getavailability)() | Returns the availability of the Facebook product. | +| [getBrand](dw.extensions.facebook.FacebookProduct.md#getbrand)() | Returns the Facebook brand of the product. | +| [getColor](dw.extensions.facebook.FacebookProduct.md#getcolor)() | Returns the Facebook color value label of the product. | +| [getCondition](dw.extensions.facebook.FacebookProduct.md#getcondition)() | Returns the condition of the Facebook product. | +| [getCustomLabel0](dw.extensions.facebook.FacebookProduct.md#getcustomlabel0)() | Returns the Facebook custom label 0 value of the product. | +| [getCustomLabel1](dw.extensions.facebook.FacebookProduct.md#getcustomlabel1)() | Returns the Facebook custom label 1 value of the product. | +| [getCustomLabel2](dw.extensions.facebook.FacebookProduct.md#getcustomlabel2)() | Returns the Facebook custom label 2 value of the product. | +| [getCustomLabel3](dw.extensions.facebook.FacebookProduct.md#getcustomlabel3)() | Returns the Facebook custom label 3 value of the product. | +| [getCustomLabel4](dw.extensions.facebook.FacebookProduct.md#getcustomlabel4)() | Returns the Facebook custom label 4 value of the product. | +| [getDescription](dw.extensions.facebook.FacebookProduct.md#getdescription)() | Returns the description of the Facebook product. | +| [getExpirationDate](dw.extensions.facebook.FacebookProduct.md#getexpirationdate)() | Returns the Facebook expiration date of the product. | +| [getGender](dw.extensions.facebook.FacebookProduct.md#getgender)() | Returns the gender for the Facebook product. | +| [getGoogleProductCategory](dw.extensions.facebook.FacebookProduct.md#getgoogleproductcategory)() | Returns the category of this product in the Google category taxonomy. | +| [getGtin](dw.extensions.facebook.FacebookProduct.md#getgtin)() | Returns the Facebook GTIN of the product. | +| [getID](dw.extensions.facebook.FacebookProduct.md#getid)() | Returns the ID of the Facebook product. | +| [getImageLinks](dw.extensions.facebook.FacebookProduct.md#getimagelinks)() | Returns a list containing the URLs of the images to show in Facebook for the product. | +| [getItemGroupID](dw.extensions.facebook.FacebookProduct.md#getitemgroupid)() | Returns the ID of the Facebook item group for the product, that is, its master product. | +| [getLink](dw.extensions.facebook.FacebookProduct.md#getlink)() | Returns the URL of the Demandware storefront link to the product. | +| [getMaterial](dw.extensions.facebook.FacebookProduct.md#getmaterial)() | Returns the Facebook material value label of the product. | +| [getMpn](dw.extensions.facebook.FacebookProduct.md#getmpn)() | Returns the Facebook MPN of the product. | +| [getPattern](dw.extensions.facebook.FacebookProduct.md#getpattern)() | Returns the Facebook pattern value label of the product. | +| [getPrice](dw.extensions.facebook.FacebookProduct.md#getprice)() | Returns the price to show in Facebook for the product. | +| [getProductType](dw.extensions.facebook.FacebookProduct.md#getproducttype)() | Returns the Facebook product type. | +| [getSalePrice](dw.extensions.facebook.FacebookProduct.md#getsaleprice)() | Returns the sale price to show in Facebook for the product. | +| [getSalePriceEffectiveDateEnd](dw.extensions.facebook.FacebookProduct.md#getsalepriceeffectivedateend)() | Returns the end date of the Facebook sale price of the product. | +| [getSalePriceEffectiveDateStart](dw.extensions.facebook.FacebookProduct.md#getsalepriceeffectivedatestart)() | Returns the start date of the Facebook sale price of the product. | +| [getShippingHeight](dw.extensions.facebook.FacebookProduct.md#getshippingheight)() | Returns the shipping height of the product. | +| [getShippingLength](dw.extensions.facebook.FacebookProduct.md#getshippinglength)() | Returns the shipping length of the product. | +| [getShippingSizeUnit](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit)() | Returns the shipping size unit of the product. | +| [getShippingWeight](dw.extensions.facebook.FacebookProduct.md#getshippingweight)() | Returns the shipping weight for the product. | +| [getShippingWidth](dw.extensions.facebook.FacebookProduct.md#getshippingwidth)() | Returns the shipping width of the product. | +| [getSize](dw.extensions.facebook.FacebookProduct.md#getsize)() | Returns the Facebook size value label of the product. | +| [getTitle](dw.extensions.facebook.FacebookProduct.md#gettitle)() | Returns the title of the Facebook product. | +| [setAgeGroup](dw.extensions.facebook.FacebookProduct.md#setagegroupstring)([String](TopLevel.String.md)) | Sets the age group for the Facebook product. | +| [setAvailability](dw.extensions.facebook.FacebookProduct.md#setavailabilitystring)([String](TopLevel.String.md)) | Sets the availability of the Facebook product. | +| [setBrand](dw.extensions.facebook.FacebookProduct.md#setbrandstring)([String](TopLevel.String.md)) | Sets the Facebook brand of the product. | +| [setColor](dw.extensions.facebook.FacebookProduct.md#setcolorstring)([String](TopLevel.String.md)) | Sets the Facebook color value label of the product. | +| [setCondition](dw.extensions.facebook.FacebookProduct.md#setconditionstring)([String](TopLevel.String.md)) | Sets the condition of the Facebook product. | +| [setCustomLabel0](dw.extensions.facebook.FacebookProduct.md#setcustomlabel0string)([String](TopLevel.String.md)) | Sets the Facebook custom label 0 value of the product. | +| [setCustomLabel1](dw.extensions.facebook.FacebookProduct.md#setcustomlabel1string)([String](TopLevel.String.md)) | Sets the Facebook custom label 1 value of the product. | +| [setCustomLabel2](dw.extensions.facebook.FacebookProduct.md#setcustomlabel2string)([String](TopLevel.String.md)) | Sets the Facebook custom label 2 value of the product. | +| [setCustomLabel3](dw.extensions.facebook.FacebookProduct.md#setcustomlabel3string)([String](TopLevel.String.md)) | Sets the Facebook custom label 3 value of the product. | +| [setCustomLabel4](dw.extensions.facebook.FacebookProduct.md#setcustomlabel4string)([String](TopLevel.String.md)) | Sets the Facebook custom label 4 value of the product. | +| [setDescription](dw.extensions.facebook.FacebookProduct.md#setdescriptionstring)([String](TopLevel.String.md)) | Sets the description of the Facebook product. | +| [setExpirationDate](dw.extensions.facebook.FacebookProduct.md#setexpirationdatedate)([Date](TopLevel.Date.md)) | Sets the Facebook expiration date of the product. | +| [setGender](dw.extensions.facebook.FacebookProduct.md#setgenderstring)([String](TopLevel.String.md)) | Sets the gender for the Facebook product. | +| [setGoogleProductCategory](dw.extensions.facebook.FacebookProduct.md#setgoogleproductcategorystring)([String](TopLevel.String.md)) | Sets the category of this product in the Google category taxonomy. | +| [setGtin](dw.extensions.facebook.FacebookProduct.md#setgtinstring)([String](TopLevel.String.md)) | Sets the Facebook GTIN of the product. | +| [setImageLinks](dw.extensions.facebook.FacebookProduct.md#setimagelinkslist)([List](dw.util.List.md)) | Sets the list of URLs of images to show in Facebook for the product. | +| [setItemGroupID](dw.extensions.facebook.FacebookProduct.md#setitemgroupidstring)([String](TopLevel.String.md)) | Sets the ID of the Facebook item group for the product, that is, its master product. | +| [setLink](dw.extensions.facebook.FacebookProduct.md#setlinkurl)([URL](dw.web.URL.md)) | Sets the URL of the Demandware storefront link to the product. | +| [setMaterial](dw.extensions.facebook.FacebookProduct.md#setmaterialstring)([String](TopLevel.String.md)) | Sets the Facebook material value label of the product. | +| [setMpn](dw.extensions.facebook.FacebookProduct.md#setmpnstring)([String](TopLevel.String.md)) | Sets the Facebook MPN of the product. | +| [setPattern](dw.extensions.facebook.FacebookProduct.md#setpatternstring)([String](TopLevel.String.md)) | Sets the Facebook pattern value label of the product. | +| [setPrice](dw.extensions.facebook.FacebookProduct.md#setpricemoney)([Money](dw.value.Money.md)) | Sets the price to show in Facebook for the product. | +| [setProductType](dw.extensions.facebook.FacebookProduct.md#setproducttypestring)([String](TopLevel.String.md)) | Sets the Facebook product type. | +| [setSalePrice](dw.extensions.facebook.FacebookProduct.md#setsalepricemoney)([Money](dw.value.Money.md)) | Sets the sale price to show in Facebook for the product. | +| [setSalePriceEffectiveDateEnd](dw.extensions.facebook.FacebookProduct.md#setsalepriceeffectivedateenddate)([Date](TopLevel.Date.md)) | Sets the end date of the Facebook sale price of the product. | +| [setSalePriceEffectiveDateStart](dw.extensions.facebook.FacebookProduct.md#setsalepriceeffectivedatestartdate)([Date](TopLevel.Date.md)) | Sets the start date of the Facebook sale price of the product. | +| [setShippingHeight](dw.extensions.facebook.FacebookProduct.md#setshippingheightnumber)([Number](TopLevel.Number.md)) | Sets the shipping height of the product. | +| [setShippingLength](dw.extensions.facebook.FacebookProduct.md#setshippinglengthnumber)([Number](TopLevel.Number.md)) | Sets the shipping length of the product. | +| [setShippingSizeUnit](dw.extensions.facebook.FacebookProduct.md#setshippingsizeunitstring)([String](TopLevel.String.md)) | Sets the shipping size unit of the product. | +| [setShippingWeight](dw.extensions.facebook.FacebookProduct.md#setshippingweightquantity)([Quantity](dw.value.Quantity.md)) | Sets the shipping weight for the product. | +| [setShippingWidth](dw.extensions.facebook.FacebookProduct.md#setshippingwidthnumber)([Number](TopLevel.Number.md)) | Sets the shipping width of the product. | +| [setSize](dw.extensions.facebook.FacebookProduct.md#setsizestring)([String](TopLevel.String.md)) | Sets the Facebook size value label of the product. | +| [setTitle](dw.extensions.facebook.FacebookProduct.md#settitlestring)([String](TopLevel.String.md)) | Sets the title of the Facebook product. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### AGE_GROUP_ADULT + +- AGE_GROUP_ADULT: [String](TopLevel.String.md) = "adult" + - : Indicates that the product is for adults. + + +--- + +### AGE_GROUP_INFANT + +- AGE_GROUP_INFANT: [String](TopLevel.String.md) = "infant" + - : Indicates that the product is for infant children. + + +--- + +### AGE_GROUP_KIDS + +- AGE_GROUP_KIDS: [String](TopLevel.String.md) = "kids" + - : Indicates that the product is for children. + + +--- + +### AGE_GROUP_NEWBORN + +- AGE_GROUP_NEWBORN: [String](TopLevel.String.md) = "newborn" + - : Indicates that the product is for newborn children. + + +--- + +### AGE_GROUP_TODDLER + +- AGE_GROUP_TODDLER: [String](TopLevel.String.md) = "toddler" + - : Indicates that the product is for toddler children. + + +--- + +### AVAILABILITY_AVAILABLE_FOR_ORDER + +- AVAILABILITY_AVAILABLE_FOR_ORDER: [String](TopLevel.String.md) = "available for order" + - : Indicates that the product can be ordered for later shipment. + + +--- + +### AVAILABILITY_IN_STOCK + +- AVAILABILITY_IN_STOCK: [String](TopLevel.String.md) = "in stock" + - : Indicates that the product is available to ship immediately. + + +--- + +### AVAILABILITY_OUT_OF_STOCK + +- AVAILABILITY_OUT_OF_STOCK: [String](TopLevel.String.md) = "out of stock" + - : Indicates that the product is out of stock. + + +--- + +### AVAILABILITY_PREORDER + +- AVAILABILITY_PREORDER: [String](TopLevel.String.md) = "preorder" + - : Indicates that the product will be available in the future. + + +--- + +### CONDITION_NEW + +- CONDITION_NEW: [String](TopLevel.String.md) = "new" + - : Indicates that the product is new. + + +--- + +### CONDITION_REFURBISHED + +- CONDITION_REFURBISHED: [String](TopLevel.String.md) = "refurbished" + - : Indicates that the product is used but has been refurbished. + + +--- + +### CONDITION_USED + +- CONDITION_USED: [String](TopLevel.String.md) = "used" + - : Indicates that the product has been used. + + +--- + +### GENDER_FEMALE + +- GENDER_FEMALE: [String](TopLevel.String.md) = "female" + - : Indicates that the product is for females. + + +--- + +### GENDER_MALE + +- GENDER_MALE: [String](TopLevel.String.md) = "male" + - : Indicates that the product is for males. + + +--- + +### GENDER_UNISEX + +- GENDER_UNISEX: [String](TopLevel.String.md) = "unisex" + - : Indicates that the product is for both males and females. + + +--- + +### SHIPPING_SIZE_UNIT_CM + +- SHIPPING_SIZE_UNIT_CM: [String](TopLevel.String.md) = "cm" + - : Indicates that the product is measured in centimeters. + + +--- + +### SHIPPING_SIZE_UNIT_FT + +- SHIPPING_SIZE_UNIT_FT: [String](TopLevel.String.md) = "ft" + - : Indicates that the product is measured in feet. + + +--- + +### SHIPPING_SIZE_UNIT_IN + +- SHIPPING_SIZE_UNIT_IN: [String](TopLevel.String.md) = "in" + - : Indicates that the product is measured in inches. + + +--- + +### SHIPPING_SIZE_UNIT_M + +- SHIPPING_SIZE_UNIT_M: [String](TopLevel.String.md) = "m" + - : Indicates that the product is measured in meters. + + +--- + +### SHIPPING_WEIGHT_UNIT_G + +- SHIPPING_WEIGHT_UNIT_G: [String](TopLevel.String.md) = "g" + - : Indicates that the product is weighed in grams. + + +--- + +### SHIPPING_WEIGHT_UNIT_KG + +- SHIPPING_WEIGHT_UNIT_KG: [String](TopLevel.String.md) = "kg" + - : Indicates that the product is weighed in kilograms. + + +--- + +### SHIPPING_WEIGHT_UNIT_LB + +- SHIPPING_WEIGHT_UNIT_LB: [String](TopLevel.String.md) = "lb" + - : Indicates that the product is weighed in pounds. + + +--- + +### SHIPPING_WEIGHT_UNIT_OZ + +- SHIPPING_WEIGHT_UNIT_OZ: [String](TopLevel.String.md) = "oz" + - : Indicates that the product is weighed in ounces. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the Facebook product. This is the same as the ID of the Demandware product. + + +--- + +### ageGroup +- ageGroup: [String](TopLevel.String.md) + - : Returns the age group for the Facebook product. + + +--- + +### availability +- availability: [String](TopLevel.String.md) + - : Returns the availability of the Facebook product. + + +--- + +### brand +- brand: [String](TopLevel.String.md) + - : Returns the Facebook brand of the product. + + +--- + +### color +- color: [String](TopLevel.String.md) + - : Returns the Facebook color value label of the product. + + +--- + +### condition +- condition: [String](TopLevel.String.md) + - : Returns the condition of the Facebook product. + + +--- + +### customLabel0 +- customLabel0: [String](TopLevel.String.md) + - : Returns the Facebook custom label 0 value of the product. + + +--- + +### customLabel1 +- customLabel1: [String](TopLevel.String.md) + - : Returns the Facebook custom label 1 value of the product. + + +--- + +### customLabel2 +- customLabel2: [String](TopLevel.String.md) + - : Returns the Facebook custom label 2 value of the product. + + +--- + +### customLabel3 +- customLabel3: [String](TopLevel.String.md) + - : Returns the Facebook custom label 3 value of the product. + + +--- + +### customLabel4 +- customLabel4: [String](TopLevel.String.md) + - : Returns the Facebook custom label 4 value of the product. + + +--- + +### description +- description: [String](TopLevel.String.md) + - : Returns the description of the Facebook product. + + +--- + +### expirationDate +- expirationDate: [Date](TopLevel.Date.md) + - : Returns the Facebook expiration date of the product. If the product is expired it will not be shown. + + +--- + +### gender +- gender: [String](TopLevel.String.md) + - : Returns the gender for the Facebook product. + + +--- + +### googleProductCategory +- googleProductCategory: [String](TopLevel.String.md) + - : Returns the category of this product in the Google category taxonomy. If the value is longer than 250 characters + it is truncated. + + + +--- + +### gtin +- gtin: [String](TopLevel.String.md) + - : Returns the Facebook GTIN of the product. + + +--- + +### imageLinks +- imageLinks: [List](dw.util.List.md) + - : Returns a list containing the URLs of the images to show in Facebook for the product. + + +--- + +### itemGroupID +- itemGroupID: [String](TopLevel.String.md) + - : Returns the ID of the Facebook item group for the product, that is, its master product. + + +--- + +### link +- link: [URL](dw.web.URL.md) + - : Returns the URL of the Demandware storefront link to the product. + + +--- + +### material +- material: [String](TopLevel.String.md) + - : Returns the Facebook material value label of the product. + + +--- + +### mpn +- mpn: [String](TopLevel.String.md) + - : Returns the Facebook MPN of the product. + + +--- + +### pattern +- pattern: [String](TopLevel.String.md) + - : Returns the Facebook pattern value label of the product. + + +--- + +### price +- price: [Money](dw.value.Money.md) + - : Returns the price to show in Facebook for the product. + + +--- + +### productType +- productType: [String](TopLevel.String.md) + - : Returns the Facebook product type. This is the retailer-defined category of the item. + + +--- + +### salePrice +- salePrice: [Money](dw.value.Money.md) + - : Returns the sale price to show in Facebook for the product. + + +--- + +### salePriceEffectiveDateEnd +- salePriceEffectiveDateEnd: [Date](TopLevel.Date.md) + - : Returns the end date of the Facebook sale price of the product. + + +--- + +### salePriceEffectiveDateStart +- salePriceEffectiveDateStart: [Date](TopLevel.Date.md) + - : Returns the start date of the Facebook sale price of the product. + + +--- + +### shippingHeight +- shippingHeight: [Number](TopLevel.Number.md) + - : Returns the shipping height of the product. + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### shippingLength +- shippingLength: [Number](TopLevel.Number.md) + - : Returns the shipping length of the product. + + **See Also:** + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### shippingSizeUnit +- shippingSizeUnit: [String](TopLevel.String.md) + - : Returns the shipping size unit of the product. + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + + +--- + +### shippingWeight +- shippingWeight: [Quantity](dw.value.Quantity.md) + - : Returns the shipping weight for the product. + + +--- + +### shippingWidth +- shippingWidth: [Number](TopLevel.Number.md) + - : Returns the shipping width of the product. + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### size +- size: [String](TopLevel.String.md) + - : Returns the Facebook size value label of the product. + + +--- + +### title +- title: [String](TopLevel.String.md) + - : Returns the title of the Facebook product. + + +--- + +## Method Details + +### getAgeGroup() +- getAgeGroup(): [String](TopLevel.String.md) + - : Returns the age group for the Facebook product. + + **Returns:** + - product age group + + +--- + +### getAvailability() +- getAvailability(): [String](TopLevel.String.md) + - : Returns the availability of the Facebook product. + + **Returns:** + - product availability + + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the Facebook brand of the product. + + **Returns:** + - the brand + + +--- + +### getColor() +- getColor(): [String](TopLevel.String.md) + - : Returns the Facebook color value label of the product. + + **Returns:** + - the color value label + + +--- + +### getCondition() +- getCondition(): [String](TopLevel.String.md) + - : Returns the condition of the Facebook product. + + **Returns:** + - product condition + + +--- + +### getCustomLabel0() +- getCustomLabel0(): [String](TopLevel.String.md) + - : Returns the Facebook custom label 0 value of the product. + + **Returns:** + - the custom label 0 value + + +--- + +### getCustomLabel1() +- getCustomLabel1(): [String](TopLevel.String.md) + - : Returns the Facebook custom label 1 value of the product. + + **Returns:** + - the custom label 1 value + + +--- + +### getCustomLabel2() +- getCustomLabel2(): [String](TopLevel.String.md) + - : Returns the Facebook custom label 2 value of the product. + + **Returns:** + - the custom label 2 value + + +--- + +### getCustomLabel3() +- getCustomLabel3(): [String](TopLevel.String.md) + - : Returns the Facebook custom label 3 value of the product. + + **Returns:** + - the custom label 3 value + + +--- + +### getCustomLabel4() +- getCustomLabel4(): [String](TopLevel.String.md) + - : Returns the Facebook custom label 4 value of the product. + + **Returns:** + - the custom label 4 value + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of the Facebook product. + + **Returns:** + - product description + + +--- + +### getExpirationDate() +- getExpirationDate(): [Date](TopLevel.Date.md) + - : Returns the Facebook expiration date of the product. If the product is expired it will not be shown. + + **Returns:** + - the expiration date + + +--- + +### getGender() +- getGender(): [String](TopLevel.String.md) + - : Returns the gender for the Facebook product. + + **Returns:** + - product gender + + +--- + +### getGoogleProductCategory() +- getGoogleProductCategory(): [String](TopLevel.String.md) + - : Returns the category of this product in the Google category taxonomy. If the value is longer than 250 characters + it is truncated. + + + **Returns:** + - the category of this product in the Google category taxonomy + + +--- + +### getGtin() +- getGtin(): [String](TopLevel.String.md) + - : Returns the Facebook GTIN of the product. + + **Returns:** + - the GTIN + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the Facebook product. This is the same as the ID of the Demandware product. + + **Returns:** + - product ID + + +--- + +### getImageLinks() +- getImageLinks(): [List](dw.util.List.md) + - : Returns a list containing the URLs of the images to show in Facebook for the product. + + **Returns:** + - the URLs of the images + + +--- + +### getItemGroupID() +- getItemGroupID(): [String](TopLevel.String.md) + - : Returns the ID of the Facebook item group for the product, that is, its master product. + + **Returns:** + - the ID of the Facebook item group + + +--- + +### getLink() +- getLink(): [URL](dw.web.URL.md) + - : Returns the URL of the Demandware storefront link to the product. + + **Returns:** + - the URL of the storefront link + + +--- + +### getMaterial() +- getMaterial(): [String](TopLevel.String.md) + - : Returns the Facebook material value label of the product. + + **Returns:** + - the material value label + + +--- + +### getMpn() +- getMpn(): [String](TopLevel.String.md) + - : Returns the Facebook MPN of the product. + + **Returns:** + - the MPN + + +--- + +### getPattern() +- getPattern(): [String](TopLevel.String.md) + - : Returns the Facebook pattern value label of the product. + + **Returns:** + - the pattern value label + + +--- + +### getPrice() +- getPrice(): [Money](dw.value.Money.md) + - : Returns the price to show in Facebook for the product. + + **Returns:** + - the price to show in Facebook + + +--- + +### getProductType() +- getProductType(): [String](TopLevel.String.md) + - : Returns the Facebook product type. This is the retailer-defined category of the item. + + **Returns:** + - the Facebook product type + + +--- + +### getSalePrice() +- getSalePrice(): [Money](dw.value.Money.md) + - : Returns the sale price to show in Facebook for the product. + + **Returns:** + - the sale price to show in Facebook + + +--- + +### getSalePriceEffectiveDateEnd() +- getSalePriceEffectiveDateEnd(): [Date](TopLevel.Date.md) + - : Returns the end date of the Facebook sale price of the product. + + **Returns:** + - the end date of the Facebook sale price + + +--- + +### getSalePriceEffectiveDateStart() +- getSalePriceEffectiveDateStart(): [Date](TopLevel.Date.md) + - : Returns the start date of the Facebook sale price of the product. + + **Returns:** + - the start date of the Facebook sale price + + +--- + +### getShippingHeight() +- getShippingHeight(): [Number](TopLevel.Number.md) + - : Returns the shipping height of the product. + + **Returns:** + - the shipping height + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### getShippingLength() +- getShippingLength(): [Number](TopLevel.Number.md) + - : Returns the shipping length of the product. + + **Returns:** + - the shipping length + + **See Also:** + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### getShippingSizeUnit() +- getShippingSizeUnit(): [String](TopLevel.String.md) + - : Returns the shipping size unit of the product. + + **Returns:** + - the shipping size unit + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingWidth()](dw.extensions.facebook.FacebookProduct.md#getshippingwidth) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + + +--- + +### getShippingWeight() +- getShippingWeight(): [Quantity](dw.value.Quantity.md) + - : Returns the shipping weight for the product. + + **Returns:** + - the shipping weight + + +--- + +### getShippingWidth() +- getShippingWidth(): [Number](TopLevel.Number.md) + - : Returns the shipping width of the product. + + **Returns:** + - the shipping width + + **See Also:** + - [getShippingLength()](dw.extensions.facebook.FacebookProduct.md#getshippinglength) + - [getShippingHeight()](dw.extensions.facebook.FacebookProduct.md#getshippingheight) + - [getShippingSizeUnit()](dw.extensions.facebook.FacebookProduct.md#getshippingsizeunit) + + +--- + +### getSize() +- getSize(): [String](TopLevel.String.md) + - : Returns the Facebook size value label of the product. + + **Returns:** + - the size value label + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the title of the Facebook product. + + **Returns:** + - product title + + +--- + +### setAgeGroup(String) +- setAgeGroup(ageGroup: [String](TopLevel.String.md)): void + - : Sets the age group for the Facebook product. Possible values are + [AGE_GROUP_ADULT](dw.extensions.facebook.FacebookProduct.md#age_group_adult), + [AGE_GROUP_INFANT](dw.extensions.facebook.FacebookProduct.md#age_group_infant), + [AGE_GROUP_KIDS](dw.extensions.facebook.FacebookProduct.md#age_group_kids), + [AGE_GROUP_NEWBORN](dw.extensions.facebook.FacebookProduct.md#age_group_newborn), + [AGE_GROUP_TODDLER](dw.extensions.facebook.FacebookProduct.md#age_group_toddler), or `null`. + + + **Parameters:** + - ageGroup - the ageGroup to set for this product + + +--- + +### setAvailability(String) +- setAvailability(availability: [String](TopLevel.String.md)): void + - : Sets the availability of the Facebook product. Possible values are + [AVAILABILITY_AVAILABLE_FOR_ORDER](dw.extensions.facebook.FacebookProduct.md#availability_available_for_order), + [AVAILABILITY_IN_STOCK](dw.extensions.facebook.FacebookProduct.md#availability_in_stock), + [AVAILABILITY_OUT_OF_STOCK](dw.extensions.facebook.FacebookProduct.md#availability_out_of_stock), or + [AVAILABILITY_PREORDER](dw.extensions.facebook.FacebookProduct.md#availability_preorder) + + + **Parameters:** + - availability - the availability status to set for this product + + +--- + +### setBrand(String) +- setBrand(brand: [String](TopLevel.String.md)): void + - : Sets the Facebook brand of the product. If the value is longer than 70 characters it is truncated. + + **Parameters:** + - brand - Facebook brand, up to 70 characters + + +--- + +### setColor(String) +- setColor(color: [String](TopLevel.String.md)): void + - : Sets the Facebook color value label of the product. If the value is longer than 100 characters it is truncated. + + **Parameters:** + - color - Facebook color value label, up to 100 characters + + +--- + +### setCondition(String) +- setCondition(condition: [String](TopLevel.String.md)): void + - : Sets the condition of the Facebook product. Possible values are + [CONDITION_NEW](dw.extensions.facebook.FacebookProduct.md#condition_new), + [CONDITION_REFURBISHED](dw.extensions.facebook.FacebookProduct.md#condition_refurbished), or + [CONDITION_USED](dw.extensions.facebook.FacebookProduct.md#condition_used). + + + **Parameters:** + - condition - the condition status to set for this product + + +--- + +### setCustomLabel0(String) +- setCustomLabel0(customLabel0: [String](TopLevel.String.md)): void + - : Sets the Facebook custom label 0 value of the product. + + **Parameters:** + - customLabel0 - custom label 0 value + + +--- + +### setCustomLabel1(String) +- setCustomLabel1(customLabel1: [String](TopLevel.String.md)): void + - : Sets the Facebook custom label 1 value of the product. + + **Parameters:** + - customLabel1 - custom label 1 value + + +--- + +### setCustomLabel2(String) +- setCustomLabel2(customLabel2: [String](TopLevel.String.md)): void + - : Sets the Facebook custom label 2 value of the product. + + **Parameters:** + - customLabel2 - custom label 2 value + + +--- + +### setCustomLabel3(String) +- setCustomLabel3(customLabel3: [String](TopLevel.String.md)): void + - : Sets the Facebook custom label 3 value of the product. + + **Parameters:** + - customLabel3 - custom label 3 value + + +--- + +### setCustomLabel4(String) +- setCustomLabel4(customLabel4: [String](TopLevel.String.md)): void + - : Sets the Facebook custom label 4 value of the product. + + **Parameters:** + - customLabel4 - custom label 4 value + + +--- + +### setDescription(String) +- setDescription(description: [String](TopLevel.String.md)): void + - : Sets the description of the Facebook product. If the value is longer than 5000 characters it is truncated. + + **Parameters:** + - description - product description, up to 5000 characters + + +--- + +### setExpirationDate(Date) +- setExpirationDate(expirationDate: [Date](TopLevel.Date.md)): void + - : Sets the Facebook expiration date of the product. + + **Parameters:** + - expirationDate - Facebook expiration date + + +--- + +### setGender(String) +- setGender(gender: [String](TopLevel.String.md)): void + - : Sets the gender for the Facebook product. Possible values are + [GENDER_MALE](dw.extensions.facebook.FacebookProduct.md#gender_male), + [GENDER_FEMALE](dw.extensions.facebook.FacebookProduct.md#gender_female), + [GENDER_UNISEX](dw.extensions.facebook.FacebookProduct.md#gender_unisex), or `null`. + + + **Parameters:** + - gender - the gender to set for this product + + +--- + +### setGoogleProductCategory(String) +- setGoogleProductCategory(googleProductCategory: [String](TopLevel.String.md)): void + - : Sets the category of this product in the Google category taxonomy. + + **Parameters:** + - googleProductCategory - Google product category + + +--- + +### setGtin(String) +- setGtin(gtin: [String](TopLevel.String.md)): void + - : Sets the Facebook GTIN of the product. If the value is longer than 70 characters it is truncated. + + **Parameters:** + - gtin - Facebook GTIN, up to 70 characters + + +--- + +### setImageLinks(List) +- setImageLinks(imageLinks: [List](dw.util.List.md)): void + - : Sets the list of URLs of images to show in Facebook for the product. + + **Parameters:** + - imageLinks - links to the product images + + +--- + +### setItemGroupID(String) +- setItemGroupID(itemGroupID: [String](TopLevel.String.md)): void + - : Sets the ID of the Facebook item group for the product, that is, its master product. + + **Parameters:** + - itemGroupID - ID of Facebook item group + + +--- + +### setLink(URL) +- setLink(link: [URL](dw.web.URL.md)): void + - : Sets the URL of the Demandware storefront link to the product. + + **Parameters:** + - link - Demandware storefront link to the product + + +--- + +### setMaterial(String) +- setMaterial(material: [String](TopLevel.String.md)): void + - : Sets the Facebook material value label of the product. If the value is longer than 200 characters it is + truncated. + + + **Parameters:** + - material - Facebook material value label, up to 200 characters + + +--- + +### setMpn(String) +- setMpn(mpn: [String](TopLevel.String.md)): void + - : Sets the Facebook MPN of the product. If the value is longer than 70 characters it is truncated. + + **Parameters:** + - mpn - Facebook MPN, up to 70 characters + + +--- + +### setPattern(String) +- setPattern(pattern: [String](TopLevel.String.md)): void + - : Sets the Facebook pattern value label of the product. If the value is longer than 100 characters it is truncated. + + **Parameters:** + - pattern - Facebook pattern value label, up to 100 characters + + +--- + +### setPrice(Money) +- setPrice(price: [Money](dw.value.Money.md)): void + - : Sets the price to show in Facebook for the product. + + **Parameters:** + - price - Facebook price + + +--- + +### setProductType(String) +- setProductType(productType: [String](TopLevel.String.md)): void + - : Sets the Facebook product type. If the value is longer than 750 characters it is truncated. + + **Parameters:** + - productType - Facebook product type, up to 750 characters + + +--- + +### setSalePrice(Money) +- setSalePrice(salePrice: [Money](dw.value.Money.md)): void + - : Sets the sale price to show in Facebook for the product. + + **Parameters:** + - salePrice - Facebook sale price + + +--- + +### setSalePriceEffectiveDateEnd(Date) +- setSalePriceEffectiveDateEnd(salePriceEffectiveDateEnd: [Date](TopLevel.Date.md)): void + - : Sets the end date of the Facebook sale price of the product. + + **Parameters:** + - salePriceEffectiveDateEnd - end date of Facebook sale price + + +--- + +### setSalePriceEffectiveDateStart(Date) +- setSalePriceEffectiveDateStart(salePriceEffectiveDateStart: [Date](TopLevel.Date.md)): void + - : Sets the start date of the Facebook sale price of the product. + + **Parameters:** + - salePriceEffectiveDateStart - start date of Facebook sale price + + +--- + +### setShippingHeight(Number) +- setShippingHeight(shippingHeight: [Number](TopLevel.Number.md)): void + - : Sets the shipping height of the product. If the value is negative it is truncated to 0. + + **Parameters:** + - shippingHeight - shipping height, may not be negative + + **See Also:** + - [setShippingLength(Number)](dw.extensions.facebook.FacebookProduct.md#setshippinglengthnumber) + - [setShippingWidth(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingwidthnumber) + - [setShippingSizeUnit(String)](dw.extensions.facebook.FacebookProduct.md#setshippingsizeunitstring) + + +--- + +### setShippingLength(Number) +- setShippingLength(shippingLength: [Number](TopLevel.Number.md)): void + - : Sets the shipping length of the product. If the value is negative it is truncated to 0. + + **Parameters:** + - shippingLength - shipping length, may not be negative + + **See Also:** + - [setShippingWidth(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingwidthnumber) + - [setShippingHeight(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingheightnumber) + - [setShippingSizeUnit(String)](dw.extensions.facebook.FacebookProduct.md#setshippingsizeunitstring) + + +--- + +### setShippingSizeUnit(String) +- setShippingSizeUnit(shippingSizeUnit: [String](TopLevel.String.md)): void + - : Sets the shipping size unit of the product. + + **Parameters:** + - shippingSizeUnit - shipping size unit + + **See Also:** + - [setShippingLength(Number)](dw.extensions.facebook.FacebookProduct.md#setshippinglengthnumber) + - [setShippingWidth(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingwidthnumber) + - [setShippingHeight(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingheightnumber) + + +--- + +### setShippingWeight(Quantity) +- setShippingWeight(shippingWeight: [Quantity](dw.value.Quantity.md)): void + - : Sets the shipping weight for the product. Possible unit values are + [SHIPPING_WEIGHT_UNIT_LB](dw.extensions.facebook.FacebookProduct.md#shipping_weight_unit_lb), + [SHIPPING_WEIGHT_UNIT_OZ](dw.extensions.facebook.FacebookProduct.md#shipping_weight_unit_oz), + [SHIPPING_WEIGHT_UNIT_G](dw.extensions.facebook.FacebookProduct.md#shipping_weight_unit_g), or + [SHIPPING_WEIGHT_UNIT_KG](dw.extensions.facebook.FacebookProduct.md#shipping_weight_unit_kg). + + + **Parameters:** + - shippingWeight - product shipping weight + + +--- + +### setShippingWidth(Number) +- setShippingWidth(shippingWidth: [Number](TopLevel.Number.md)): void + - : Sets the shipping width of the product. If the value is negative it is truncated to 0. + + **Parameters:** + - shippingWidth - shipping width, may not be negative + + **See Also:** + - [setShippingLength(Number)](dw.extensions.facebook.FacebookProduct.md#setshippinglengthnumber) + - [setShippingHeight(Number)](dw.extensions.facebook.FacebookProduct.md#setshippingheightnumber) + - [setShippingSizeUnit(String)](dw.extensions.facebook.FacebookProduct.md#setshippingsizeunitstring) + + +--- + +### setSize(String) +- setSize(size: [String](TopLevel.String.md)): void + - : Sets the Facebook size value label of the product. If the value is longer than 100 characters it is truncated. + + **Parameters:** + - size - Facebook size value label, up to 100 characters + + +--- + +### setTitle(String) +- setTitle(title: [String](TopLevel.String.md)): void + - : Sets the title of the Facebook product. If the value is longer than 100 characters it is truncated. + + **Parameters:** + - title - product title, up to 100 characters + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.md new file mode 100644 index 00000000..1ab828a8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.facebook.md @@ -0,0 +1,7 @@ +# Package dw.extensions.facebook + +## Classes +| Class | Description | +| --- | --- | +| [FacebookFeedHooks](dw.extensions.facebook.FacebookFeedHooks.md) | FacebookFeedHooks interface containing extension points for customizing Facebook export feeds. | +| [FacebookProduct](dw.extensions.facebook.FacebookProduct.md) | Represents a row in the Facebook catalog feed export. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.PaymentApiHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.PaymentApiHooks.md new file mode 100644 index 00000000..7d2b6634 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.PaymentApiHooks.md @@ -0,0 +1,136 @@ + +# Class PaymentApiHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.paymentapi.PaymentApiHooks](dw.extensions.paymentapi.PaymentApiHooks.md) + +PaymentApiHooks interface containing extension points for customizing Payment API requests for authorization, +and their responses. + + +These hooks are 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.paymentapi.beforeAuthorization", "script": "./payment.ds"} + {"name": "dw.extensions.paymentapi.afterAuthorization", "script": "./payment.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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointAfterAuthorization](#extensionpointafterauthorization): [String](TopLevel.String.md) = "dw.extensions.paymentapi.afterAuthorization" | The extension point name dw.extensions.paymentapi.afterAuthorization. | +| [extensionPointBeforeAuthorization](#extensionpointbeforeauthorization): [String](TopLevel.String.md) = "dw.extensions.paymentapi.beforeAuthorization" | The extension point name dw.extensions.paymentapi.beforeAuthorization. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [afterAuthorization](dw.extensions.paymentapi.PaymentApiHooks.md#afterauthorizationorder-orderpaymentinstrument-object-status)([Order](dw.order.Order.md), [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Object](TopLevel.Object.md), [Status](dw.system.Status.md)) |

          Called after the response has been handled for a request to authorize payment for the given order. | +| [beforeAuthorization](dw.extensions.paymentapi.PaymentApiHooks.md#beforeauthorizationorder-orderpaymentinstrument-object)([Order](dw.order.Order.md), [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Object](TopLevel.Object.md)) |

          Called when a request is to be made to authorize payment for the given order. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointAfterAuthorization + +- extensionPointAfterAuthorization: [String](TopLevel.String.md) = "dw.extensions.paymentapi.afterAuthorization" + - : The extension point name dw.extensions.paymentapi.afterAuthorization. + + +--- + +### extensionPointBeforeAuthorization + +- extensionPointBeforeAuthorization: [String](TopLevel.String.md) = "dw.extensions.paymentapi.beforeAuthorization" + - : The extension point name dw.extensions.paymentapi.beforeAuthorization. + + +--- + +## Method Details + +### afterAuthorization(Order, OrderPaymentInstrument, Object, Status) +- afterAuthorization(order: [Order](dw.order.Order.md), payment: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), custom: [Object](TopLevel.Object.md), status: [Status](dw.system.Status.md)): [Status](dw.system.Status.md) + - : + + Called after the response has been handled for a request to authorize payment for the given order. + + + + + The given status is the result of handling the response without customization. That status will be + used unless an implementation of this hook returns an alternative status. + + + **Parameters:** + - order - the order whose payment to authorize + - payment - the payment instrument to authorize + - custom - container of custom properties included in the PSP response + - status - the result of handling the response without customization + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### beforeAuthorization(Order, OrderPaymentInstrument, Object) +- beforeAuthorization(order: [Order](dw.order.Order.md), payment: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), custom: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Called when a request is to be made to authorize payment for the given order. + + + + + Return an error status to indicate a problem. The request will not be made to the payment provider. + + + **Parameters:** + - order - the order whose payment to authorize + - payment - the payment instrument to authorize + - custom - container for custom properties to include in request + + **Returns:** + - a non-null result ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.md new file mode 100644 index 00000000..8f35d15a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentapi.md @@ -0,0 +1,6 @@ +# Package dw.extensions.paymentapi + +## Classes +| Class | Description | +| --- | --- | +| [PaymentApiHooks](dw.extensions.paymentapi.PaymentApiHooks.md) | PaymentApiHooks interface containing extension points for customizing Payment API requests for authorization, and their responses. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHookResult.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHookResult.md new file mode 100644 index 00000000..aa4ea6b1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHookResult.md @@ -0,0 +1,149 @@ + +# Class PaymentRequestHookResult + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.paymentrequest.PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + +Result of a hook handling a Payment Request request + +**Deprecated:** +:::warning +Salesforce Payments includes support for Google Pay +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [eventDetail](#eventdetail): [Object](TopLevel.Object.md) `(read-only)` | Detail to the JS custom event to dispatch in response to this result. | +| [eventName](#eventname): [String](TopLevel.String.md) `(read-only)` | Name of the JS custom event to dispatch in response to this result. | +| [redirect](#redirect): [URL](dw.web.URL.md) `(read-only)` | URL to navigate to in response to this result. | +| [status](#status): [Status](dw.system.Status.md) `(read-only)` | Status describing the outcome of this result. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [PaymentRequestHookResult](#paymentrequesthookresultstatus-url)([Status](dw.system.Status.md), [URL](dw.web.URL.md)) | Constructs a result with the given outcome information. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getEventDetail](dw.extensions.paymentrequest.PaymentRequestHookResult.md#geteventdetail)() | Detail to the JS custom event to dispatch in response to this result. | +| [getEventName](dw.extensions.paymentrequest.PaymentRequestHookResult.md#geteventname)() | Name of the JS custom event to dispatch in response to this result. | +| [getRedirect](dw.extensions.paymentrequest.PaymentRequestHookResult.md#getredirect)() | URL to navigate to in response to this result. | +| [getStatus](dw.extensions.paymentrequest.PaymentRequestHookResult.md#getstatus)() | Status describing the outcome of this result. | +| [setEvent](dw.extensions.paymentrequest.PaymentRequestHookResult.md#seteventstring)([String](TopLevel.String.md)) | Sets the name of the JS custom event to dispatch in response to this result. | +| [setEvent](dw.extensions.paymentrequest.PaymentRequestHookResult.md#seteventstring-object)([String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Sets the name and detail of the JS custom event to dispatch in response to this result. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### eventDetail +- eventDetail: [Object](TopLevel.Object.md) `(read-only)` + - : Detail to the JS custom event to dispatch in response to this result. + + +--- + +### eventName +- eventName: [String](TopLevel.String.md) `(read-only)` + - : Name of the JS custom event to dispatch in response to this result. + + +--- + +### redirect +- redirect: [URL](dw.web.URL.md) `(read-only)` + - : URL to navigate to in response to this result. + + +--- + +### status +- status: [Status](dw.system.Status.md) `(read-only)` + - : Status describing the outcome of this result. + + +--- + +## Constructor Details + +### PaymentRequestHookResult(Status, URL) +- PaymentRequestHookResult(status: [Status](dw.system.Status.md), redirect: [URL](dw.web.URL.md)) + - : Constructs a result with the given outcome information. + + **Parameters:** + - status - status of the result + - redirect - optional URL to which to navigate to in response to this outcome + + +--- + +## Method Details + +### getEventDetail() +- getEventDetail(): [Object](TopLevel.Object.md) + - : Detail to the JS custom event to dispatch in response to this result. + + **Returns:** + - event detail + + +--- + +### getEventName() +- getEventName(): [String](TopLevel.String.md) + - : Name of the JS custom event to dispatch in response to this result. + + **Returns:** + - event name + + +--- + +### getRedirect() +- getRedirect(): [URL](dw.web.URL.md) + - : URL to navigate to in response to this result. + + **Returns:** + - redirect URL + + +--- + +### getStatus() +- getStatus(): [Status](dw.system.Status.md) + - : Status describing the outcome of this result. + + **Returns:** + - status of this result + + +--- + +### setEvent(String) +- setEvent(name: [String](TopLevel.String.md)): void + - : Sets the name of the JS custom event to dispatch in response to this result. + + **Parameters:** + - name - JS custom event name + + +--- + +### setEvent(String, Object) +- setEvent(name: [String](TopLevel.String.md), detail: [Object](TopLevel.Object.md)): void + - : Sets the name and detail of the JS custom event to dispatch in response to this result. + + **Parameters:** + - name - JS custom event name + - detail - JS custom event detail + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHooks.md new file mode 100644 index 00000000..4c3798e3 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.PaymentRequestHooks.md @@ -0,0 +1,356 @@ + +# Class PaymentRequestHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.paymentrequest.PaymentRequestHooks](dw.extensions.paymentrequest.PaymentRequestHooks.md) + +PaymentRequestHooks interface containing extension points for customizing Payment Requests. + + +These hooks are 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.paymentrequest.getPaymentRequest", "script": "./paymentrequest.ds"} + {"name": "dw.extensions.paymentrequest.shippingAddressChange", "script": "./paymentrequest.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. + + +**Deprecated:** +:::warning +Salesforce Payments includes support for Google Pay +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointAbort](#extensionpointabort): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.abort" | The extension point name dw.extensions.paymentrequest.abort. | +| [extensionPointGetPaymentRequest](#extensionpointgetpaymentrequest): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.getPaymentRequest" | The extension point name dw.extensions.paymentrequest.getPaymentRequest. | +| [extensionPointPaymentAcceptedAuthorizeOrderPayment](#extensionpointpaymentacceptedauthorizeorderpayment): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.paymentAccepted.authorizeOrderPayment" | The extension point name dw.extensions.paymentrequest.paymentAccepted.authorizeOrderPayment. | +| [extensionPointPaymentAcceptedPlaceOrder](#extensionpointpaymentacceptedplaceorder): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.paymentAccepted.placeOrder" | The extension point name dw.extensions.paymentrequest.paymentAccepted.placeOrder. | +| [extensionPointShippingAddressChange](#extensionpointshippingaddresschange): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.shippingAddressChange" | The extension point name dw.extensions.paymentrequest.shippingAddressChange. | +| [extensionPointShippingOptionChange](#extensionpointshippingoptionchange): [String](TopLevel.String.md) = "dw.extensions.paymentrequest.shippingOptionChange" | The extension point name dw.extensions.paymentrequest.shippingOptionChange. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [abort](dw.extensions.paymentrequest.PaymentRequestHooks.md#abortbasket)([Basket](dw.order.Basket.md)) |

          Called after the Payment Request user interface was canceled. | +| [authorizeOrderPayment](dw.extensions.paymentrequest.PaymentRequestHooks.md#authorizeorderpaymentorder-object)([Order](dw.order.Order.md), [Object](TopLevel.Object.md)) |

          Called after the shopper accepts the Payment Request payment for the given order. | +| [getPaymentRequest](dw.extensions.paymentrequest.PaymentRequestHooks.md#getpaymentrequestbasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Called to get the `PaymentRequest` constructor parameters for the given basket. | +| [placeOrder](dw.extensions.paymentrequest.PaymentRequestHooks.md#placeorderorder)([Order](dw.order.Order.md)) |

          Called after payment has been authorized and the given Payment Request order is ready to be placed. | +| [shippingAddressChange](dw.extensions.paymentrequest.PaymentRequestHooks.md#shippingaddresschangebasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Called after handling the Payment Request `shippingaddresschange` event for the given basket. | +| [shippingOptionChange](dw.extensions.paymentrequest.PaymentRequestHooks.md#shippingoptionchangebasket-shippingmethod-object)([Basket](dw.order.Basket.md), [ShippingMethod](dw.order.ShippingMethod.md), [Object](TopLevel.Object.md)) |

          Called after handling the Payment Request `shippingoptionchange` event for the given basket. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointAbort + +- extensionPointAbort: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.abort" + - : The extension point name dw.extensions.paymentrequest.abort. + + +--- + +### extensionPointGetPaymentRequest + +- extensionPointGetPaymentRequest: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.getPaymentRequest" + - : The extension point name dw.extensions.paymentrequest.getPaymentRequest. + + +--- + +### extensionPointPaymentAcceptedAuthorizeOrderPayment + +- extensionPointPaymentAcceptedAuthorizeOrderPayment: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.paymentAccepted.authorizeOrderPayment" + - : The extension point name dw.extensions.paymentrequest.paymentAccepted.authorizeOrderPayment. + + +--- + +### extensionPointPaymentAcceptedPlaceOrder + +- extensionPointPaymentAcceptedPlaceOrder: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.paymentAccepted.placeOrder" + - : The extension point name dw.extensions.paymentrequest.paymentAccepted.placeOrder. + + +--- + +### extensionPointShippingAddressChange + +- extensionPointShippingAddressChange: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.shippingAddressChange" + - : The extension point name dw.extensions.paymentrequest.shippingAddressChange. + + +--- + +### extensionPointShippingOptionChange + +- extensionPointShippingOptionChange: [String](TopLevel.String.md) = "dw.extensions.paymentrequest.shippingOptionChange" + - : The extension point name dw.extensions.paymentrequest.shippingOptionChange. + + +--- + +## Method Details + +### abort(Basket) +- abort(basket: [Basket](dw.order.Basket.md)): [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + - : + + Called after the Payment Request user interface was canceled. The given basket is the one that was passed to other + hooks earlier in the Payment Request checkout process. + + + + + It is not guaranteed that this hook will be executed for all Payment Request user interfaces canceled by shoppers or + otherwise ended without a successful order. Calls to this hook are provided on a best-effort basis. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if possible. It + is not guaranteed that the response with the hook result will be handled in the shopper browser in all cases. + + + **Parameters:** + - basket - the basket that was being checked out using Payment Request + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### authorizeOrderPayment(Order, Object) +- authorizeOrderPayment(order: [Order](dw.order.Order.md), response: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Called after the shopper accepts the Payment Request payment for the given order. Basket customer information, + billing address, and/or shipping address for the default shipment will have already been updated to reflect the + available contact information provided by Payment Request. Any preexisting payment instruments on the basket will + have been removed, and a single `DW_ANDROID_PAY` payment instrument added for the total amount. The + given order will have been created from this updated basket. + + + + + The purpose of this hook is to authorize the Payment Request payment for the order. If a non-error status is returned + that means that you have successfully authorized the payment with your payment service provider. Your hook + implementation must set the necessary payment status and transaction identifier data on the order as returned by + the provider. + + + + + Return an error status to indicate a problem, including unsuccessful authorization. + + + + + See the [Payment Request API](https://www.w3.org/TR/payment-request) for more information. + + + **Parameters:** + - order - the order paid using Payment Request + - response - response to the accepted `PaymentRequest` + + **Returns:** + - a non-null status ends the hook execution + + +--- + +### getPaymentRequest(Basket, Object) +- getPaymentRequest(basket: [Basket](dw.order.Basket.md), parameters: [Object](TopLevel.Object.md)): [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + - : + + Called to get the `PaymentRequest` constructor parameters for the given basket. You can + set properties in the given `parameters` object to extend or override default properties set + automatically based on the Google Pay configuration for your site. + + + + + The `parameters` object will contain the following properties by default: + + - `methodData`- array containing payment methods the web site accepts + - `details`- information about the transaction that the user is being asked to complete + - `options`- information about what options the web page wishes to use from the payment request system + + + + + + Return a result with an error status to indicate a problem. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Payment + Request user interaction is canceled. + + + + + See the [Payment Request API](https://www.w3.org/TR/payment-request) for more information. + + + **Parameters:** + - basket - the basket for the Payment Request request + - parameters - object containing `PaymentRequest` constructor parameters + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### placeOrder(Order) +- placeOrder(order: [Order](dw.order.Order.md)): [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + - : + + Called after payment has been authorized and the given Payment Request order is ready to be placed. The purpose of + this hook is to place the order, or return a redirect URL that results in the order being placed when the shopper + browser is navigated to it. + + + + + The default implementation of this hook returns a redirect to `COPlaceOrder-Submit` with URL + parameters `order_id` set to [Order.getOrderNo()](dw.order.Order.md#getorderno) and `order_token` set to + [Order.getOrderToken()](dw.order.Order.md#getordertoken) which corresponds to SiteGenesis-based implementations. Your hook + implementation should return a result with a different redirect URL as necessary to place the order and show an + order confirmation. + + + + + Alternatively, your hook implementation itself can place the order and return a result with a redirect URL to an + order confirmation page that does not place the order. This is inconsistent with SiteGenesis-based + implementations so is not the default. + + + + + Return an error status to indicate a problem. If the returned result includes a redirect URL, the shopper browser + will be navigated to that URL if the Payment Request user interface is canceled. + + + **Parameters:** + - order - the order paid using PaymentRequest + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### shippingAddressChange(Basket, Object) +- shippingAddressChange(basket: [Basket](dw.order.Basket.md), details: [Object](TopLevel.Object.md)): [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + - : + + Called after handling the Payment Request `shippingaddresschange` event for the given basket. Basket + customer information and/or shipping address for the default shipment will have already been updated to reflect + the available shipping address information provided by Payment Request. The basket will have already been + calculated before this hook is called. + + + + + Return a result with an error status to indicate a problem. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the Payment + Request user interface is canceled. + + + + + See the [Payment Request API](https://www.w3.org/TR/payment-request) for more information. + + + **Parameters:** + - basket - the basket being checked out using Payment Request + - details - updated `PaymentRequest` object details + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### shippingOptionChange(Basket, ShippingMethod, Object) +- shippingOptionChange(basket: [Basket](dw.order.Basket.md), shippingMethod: [ShippingMethod](dw.order.ShippingMethod.md), details: [Object](TopLevel.Object.md)): [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) + - : + + Called after handling the Payment Request `shippingoptionchange` event for the given basket. The given + shipping method will have already been set on the basket. The basket will have already been calculated before + this hook is called. + + + + + Return a result with an error status to indicate a problem. + + + + + If the returned result includes a redirect URL, the shopper browser will be navigated to that URL if the + Payment Request user interface is canceled. + + + + + See the [Payment Request API](https://www.w3.org/TR/payment-request) for more information. + + + **Parameters:** + - basket - the basket being checked out using Payment Request + - shippingMethod - the shipping method that was selected + - details - updated `PaymentRequest` object details + + **Returns:** + - a non-null result ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.md new file mode 100644 index 00000000..4a53fade --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.paymentrequest.md @@ -0,0 +1,7 @@ +# Package dw.extensions.paymentrequest + +## Classes +| Class | Description | +| --- | --- | +| [PaymentRequestHookResult](dw.extensions.paymentrequest.PaymentRequestHookResult.md) | Result of a hook handling a Payment Request request | +| [PaymentRequestHooks](dw.extensions.paymentrequest.PaymentRequestHooks.md) | PaymentRequestHooks interface containing extension points for customizing Payment Requests. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenPaymentIntent.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenPaymentIntent.md new file mode 100644 index 00000000..6db1bf47 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenPaymentIntent.md @@ -0,0 +1,134 @@ + +# Class SalesforceAdyenPaymentIntent + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforceAdyenPaymentIntent](dw.extensions.payments.SalesforceAdyenPaymentIntent.md) + + + +Salesforce Payments representation of an Adyen payment intent object. See Salesforce Payments documentation for how +to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this payment intent. | +| [action](#action): [Object](TopLevel.Object.md) `(read-only)` | Returns the payment action for this payment intent. | +| [resultCode](#resultcode): [String](TopLevel.String.md) `(read-only)` | Returns the Adyen result code for this payment intent. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAction](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#getaction)() | Returns the payment action for this payment intent. | +| [getID](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#getid)() | Returns the identifier of this payment intent. | +| [getPaymentInstrument](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#getpaymentinstrumentbasket)([Basket](dw.order.Basket.md)) | Returns the payment instrument for this payment intent in the given basket, or `null` if the given basket has none. | +| [getPaymentInstrument](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#getpaymentinstrumentorder)([Order](dw.order.Order.md)) | Returns the payment instrument for this payment intent in the given order, or `null` if the given order has none. | +| [getResultCode](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#getresultcode)() | Returns the Adyen result code for this payment intent. | +| [hasAction](dw.extensions.payments.SalesforceAdyenPaymentIntent.md#hasaction)() | Returns `true` if this payment intent has an action, or `false` if not. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this payment intent. + + +--- + +### action +- action: [Object](TopLevel.Object.md) `(read-only)` + - : Returns the payment action for this payment intent. + + +--- + +### resultCode +- resultCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the Adyen result code for this payment intent. + + +--- + +## Method Details + +### getAction() +- getAction(): [Object](TopLevel.Object.md) + - : Returns the payment action for this payment intent. + + **Returns:** + - payment action + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this payment intent. + + **Returns:** + - payment intent identifier + + +--- + +### getPaymentInstrument(Basket) +- getPaymentInstrument(basket: [Basket](dw.order.Basket.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this payment intent in the given basket, or `null` if the given + basket has none. + + + **Parameters:** + - basket - basket + + **Returns:** + - basket payment instrument + + +--- + +### getPaymentInstrument(Order) +- getPaymentInstrument(order: [Order](dw.order.Order.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this payment intent in the given order, or `null` if the given + order has none. + + + **Parameters:** + - order - order + + **Returns:** + - order payment instrument + + +--- + +### getResultCode() +- getResultCode(): [String](TopLevel.String.md) + - : Returns the Adyen result code for this payment intent. + + **Returns:** + - Adyen result code + + +--- + +### hasAction() +- hasAction(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if this payment intent has an action, or `false` if not. + + **Returns:** + - `true` if this payment intent has an action + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md new file mode 100644 index 00000000..0808c19f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md @@ -0,0 +1,283 @@ + +# Class SalesforceAdyenSavedPaymentMethod + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforceAdyenSavedPaymentMethod](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md) + + + +Salesforce Payments representation of an Adyen saved payment method object. See Salesforce Payments documentation for +how to gain access and configure it for use on your sites. + + + + +An Adyen saved payment method contains information about a credential used by a shopper to attempt payment, such as a +payment card or bank account. The available information differs for each type of payment method. It includes only +limited information that can be safely presented to a shopper to remind them what credential they used, and +specifically not complete card, account, or other numbers that could be used to make future payments. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [TYPE_BANCONTACT](#type_bancontact): [String](TopLevel.String.md) = "bancontact" | Represents the Bancontact payment method. | +| [TYPE_CARD](#type_card): [String](TopLevel.String.md) = "card" | Represents a credit card type of payment method. | +| [TYPE_IDEAL](#type_ideal): [String](TopLevel.String.md) = "ideal" | Represents the iDEAL payment method. | +| [TYPE_SEPA_DEBIT](#type_sepa_debit): [String](TopLevel.String.md) = "sepa_debit" | Represents the SEPA Debit payment method. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this payment method. | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the brand of this payment method, or `null` if none is available. | +| [expiryMonth](#expirymonth): [String](TopLevel.String.md) `(read-only)` | Returns the expiry month of the card for this payment method, or `null` if none is available. | +| [expiryYear](#expiryyear): [String](TopLevel.String.md) `(read-only)` | Returns the expiry year of the card for this payment method, or `null` if none is available. | +| [holderName](#holdername): [String](TopLevel.String.md) `(read-only)` | Returns the cardholder name for this payment method, or `null` if none is available. | +| [last4](#last4): [String](TopLevel.String.md) `(read-only)` | Returns the last 4 digits of the credential for this payment method, or `null` if none is available. | +| [ownerName](#ownername): [String](TopLevel.String.md) `(read-only)` | Returns the back account owner name for this payment method, or `null` if none is available. | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the type of this payment method. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBrand](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getbrand)() | Returns the brand of this payment method, or `null` if none is available. | +| [getExpiryMonth](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getexpirymonth)() | Returns the expiry month of the card for this payment method, or `null` if none is available. | +| [getExpiryYear](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getexpiryyear)() | Returns the expiry year of the card for this payment method, or `null` if none is available. | +| [getHolderName](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getholdername)() | Returns the cardholder name for this payment method, or `null` if none is available. | +| [getID](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getid)() | Returns the identifier of this payment method. | +| [getLast4](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getlast4)() | Returns the last 4 digits of the credential for this payment method, or `null` if none is available. | +| [getOwnerName](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#getownername)() | Returns the back account owner name for this payment method, or `null` if none is available. | +| [getType](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#gettype)() | Returns the type of this payment method. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### TYPE_BANCONTACT + +- TYPE_BANCONTACT: [String](TopLevel.String.md) = "bancontact" + - : Represents the Bancontact payment method. + + +--- + +### TYPE_CARD + +- TYPE_CARD: [String](TopLevel.String.md) = "card" + - : Represents a credit card type of payment method. + + +--- + +### TYPE_IDEAL + +- TYPE_IDEAL: [String](TopLevel.String.md) = "ideal" + - : Represents the iDEAL payment method. + + +--- + +### TYPE_SEPA_DEBIT + +- TYPE_SEPA_DEBIT: [String](TopLevel.String.md) = "sepa_debit" + - : Represents the SEPA Debit payment method. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this payment method. + + +--- + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the brand of this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) type methods. + + + +--- + +### expiryMonth +- expiryMonth: [String](TopLevel.String.md) `(read-only)` + - : Returns the expiry month of the card for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + +--- + +### expiryYear +- expiryYear: [String](TopLevel.String.md) `(read-only)` + - : Returns the expiry year of the card for this payment method, or `null` if none is available. Available + on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + +--- + +### holderName +- holderName: [String](TopLevel.String.md) `(read-only)` + - : Returns the cardholder name for this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) + type methods. + + + +--- + +### last4 +- last4: [String](TopLevel.String.md) `(read-only)` + - : Returns the last 4 digits of the credential for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + +--- + +### ownerName +- ownerName: [String](TopLevel.String.md) `(read-only)` + - : Returns the back account owner name for this payment method, or `null` if none is available. Available + on [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_sepa_debit) and + [TYPE_IDEAL](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_ideal) type method. + + + +--- + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of this payment method. + + **See Also:** + - [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) + - [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) + - [TYPE_IDEAL](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_ideal) + - [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_sepa_debit) + + +--- + +## Method Details + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the brand of this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) type methods. + + + **Returns:** + - payment method brand + + +--- + +### getExpiryMonth() +- getExpiryMonth(): [String](TopLevel.String.md) + - : Returns the expiry month of the card for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method credential expiry month + + +--- + +### getExpiryYear() +- getExpiryYear(): [String](TopLevel.String.md) + - : Returns the expiry year of the card for this payment method, or `null` if none is available. Available + on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method credential expiry year + + +--- + +### getHolderName() +- getHolderName(): [String](TopLevel.String.md) + - : Returns the cardholder name for this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) + type methods. + + + **Returns:** + - payment method credential cardholder name + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this payment method. + + **Returns:** + - payment method identifier + + +--- + +### getLast4() +- getLast4(): [String](TopLevel.String.md) + - : Returns the last 4 digits of the credential for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method credential last 4 digits + + +--- + +### getOwnerName() +- getOwnerName(): [String](TopLevel.String.md) + - : Returns the back account owner name for this payment method, or `null` if none is available. Available + on [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_sepa_debit) and + [TYPE_IDEAL](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_ideal) type method. + + + **Returns:** + - payment method credential back account owner name + + +--- + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the type of this payment method. + + **Returns:** + - payment method type + + **See Also:** + - [TYPE_BANCONTACT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_bancontact) + - [TYPE_CARD](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_card) + - [TYPE_IDEAL](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_ideal) + - [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md#type_sepa_debit) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceBancontactPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceBancontactPaymentDetails.md new file mode 100644 index 00000000..28015c06 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceBancontactPaymentDetails.md @@ -0,0 +1,88 @@ + +# Class SalesforceBancontactPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceBancontactPaymentDetails](dw.extensions.payments.SalesforceBancontactPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bankName](#bankname): [String](TopLevel.String.md) `(read-only)` | Returns the bank name, or `null` if not known. | +| [last4](#last4): [String](TopLevel.String.md) `(read-only)` | Returns the last 4 digits of the account number, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBankName](dw.extensions.payments.SalesforceBancontactPaymentDetails.md#getbankname)() | Returns the bank name, or `null` if not known. | +| [getLast4](dw.extensions.payments.SalesforceBancontactPaymentDetails.md#getlast4)() | Returns the last 4 digits of the account number, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bankName +- bankName: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank name, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getBankName()](dw.extensions.payments.SalesforcePaymentMethod.md#getbankname) + + +--- + +### last4 +- last4: [String](TopLevel.String.md) `(read-only)` + - : Returns the last 4 digits of the account number, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + +## Method Details + +### getBankName() +- getBankName(): [String](TopLevel.String.md) + - : Returns the bank name, or `null` if not known. + + **Returns:** + - bank name + + **See Also:** + - [SalesforcePaymentMethod.getBankName()](dw.extensions.payments.SalesforcePaymentMethod.md#getbankname) + + +--- + +### getLast4() +- getLast4(): [String](TopLevel.String.md) + - : Returns the last 4 digits of the account number, or `null` if not known. + + **Returns:** + - last 4 digits of the account number + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceCardPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceCardPaymentDetails.md new file mode 100644 index 00000000..90b53e90 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceCardPaymentDetails.md @@ -0,0 +1,107 @@ + +# Class SalesforceCardPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceCardPaymentDetails](dw.extensions.payments.SalesforceCardPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the card brand, or `null` if not known. | +| [last4](#last4): [String](TopLevel.String.md) `(read-only)` | Returns the last 4 digits of the card number, or `null` if not known. | +| [walletType](#wallettype): [String](TopLevel.String.md) `(read-only)` | Returns the type of wallet used to make the card payment, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBrand](dw.extensions.payments.SalesforceCardPaymentDetails.md#getbrand)() | Returns the card brand, or `null` if not known. | +| [getLast4](dw.extensions.payments.SalesforceCardPaymentDetails.md#getlast4)() | Returns the last 4 digits of the card number, or `null` if not known. | +| [getWalletType](dw.extensions.payments.SalesforceCardPaymentDetails.md#getwallettype)() | Returns the type of wallet used to make the card payment, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the card brand, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getBrand()](dw.extensions.payments.SalesforcePaymentMethod.md#getbrand) + + +--- + +### last4 +- last4: [String](TopLevel.String.md) `(read-only)` + - : Returns the last 4 digits of the card number, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + +### walletType +- walletType: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of wallet used to make the card payment, or `null` if not known. + + +--- + +## Method Details + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the card brand, or `null` if not known. + + **Returns:** + - card brand + + **See Also:** + - [SalesforcePaymentMethod.getBrand()](dw.extensions.payments.SalesforcePaymentMethod.md#getbrand) + + +--- + +### getLast4() +- getLast4(): [String](TopLevel.String.md) + - : Returns the last 4 digits of the card number, or `null` if not known. + + **Returns:** + - last 4 digits of the card number + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + +### getWalletType() +- getWalletType(): [String](TopLevel.String.md) + - : Returns the type of wallet used to make the card payment, or `null` if not known. + + **Returns:** + - wallet type + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceEpsPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceEpsPaymentDetails.md new file mode 100644 index 00000000..d9350f82 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceEpsPaymentDetails.md @@ -0,0 +1,63 @@ + +# Class SalesforceEpsPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceEpsPaymentDetails](dw.extensions.payments.SalesforceEpsPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bank](#bank): [String](TopLevel.String.md) `(read-only)` | Returns the bank used for the payment, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBank](dw.extensions.payments.SalesforceEpsPaymentDetails.md#getbank)() | Returns the bank used for the payment, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bank +- bank: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank used for the payment, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getBank()](dw.extensions.payments.SalesforcePaymentMethod.md#getbank) + + +--- + +## Method Details + +### getBank() +- getBank(): [String](TopLevel.String.md) + - : Returns the bank used for the payment, or `null` if not known. + + **Returns:** + - bank + + **See Also:** + - [SalesforcePaymentMethod.getBank()](dw.extensions.payments.SalesforcePaymentMethod.md#getbank) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceIdealPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceIdealPaymentDetails.md new file mode 100644 index 00000000..56502354 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceIdealPaymentDetails.md @@ -0,0 +1,63 @@ + +# Class SalesforceIdealPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceIdealPaymentDetails](dw.extensions.payments.SalesforceIdealPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bank](#bank): [String](TopLevel.String.md) `(read-only)` | Returns the bank used for the payment, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBank](dw.extensions.payments.SalesforceIdealPaymentDetails.md#getbank)() | Returns the bank used for the payment, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bank +- bank: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank used for the payment, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getBank()](dw.extensions.payments.SalesforcePaymentMethod.md#getbank) + + +--- + +## Method Details + +### getBank() +- getBank(): [String](TopLevel.String.md) + - : Returns the bank used for the payment, or `null` if not known. + + **Returns:** + - bank + + **See Also:** + - [SalesforcePaymentMethod.getBank()](dw.extensions.payments.SalesforcePaymentMethod.md#getbank) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceKlarnaPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceKlarnaPaymentDetails.md new file mode 100644 index 00000000..3a596232 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceKlarnaPaymentDetails.md @@ -0,0 +1,63 @@ + +# Class SalesforceKlarnaPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceKlarnaPaymentDetails](dw.extensions.payments.SalesforceKlarnaPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [paymentMethodCategory](#paymentmethodcategory): [String](TopLevel.String.md) `(read-only)` | Returns the payment method category used for the payment, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getPaymentMethodCategory](dw.extensions.payments.SalesforceKlarnaPaymentDetails.md#getpaymentmethodcategory)() | Returns the payment method category used for the payment, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### paymentMethodCategory +- paymentMethodCategory: [String](TopLevel.String.md) `(read-only)` + - : Returns the payment method category used for the payment, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getPaymentMethodCategory()](dw.extensions.payments.SalesforcePaymentMethod.md#getpaymentmethodcategory) + + +--- + +## Method Details + +### getPaymentMethodCategory() +- getPaymentMethodCategory(): [String](TopLevel.String.md) + - : Returns the payment method category used for the payment, or `null` if not known. + + **Returns:** + - payment method category + + **See Also:** + - [SalesforcePaymentMethod.getPaymentMethodCategory()](dw.extensions.payments.SalesforcePaymentMethod.md#getpaymentmethodcategory) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrder.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrder.md new file mode 100644 index 00000000..2de4fac8 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrder.md @@ -0,0 +1,263 @@ + +# Class SalesforcePayPalOrder + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md) + + + +Salesforce Payments representation of a PayPal order object. See Salesforce Payments documentation for how +to gain access and configure it for use on your sites. + + + + +A PayPal order is automatically created when a shopper is ready to pay for items in their basket. It becomes +completed when the shopper provides information to the payment provider that is acceptable to authorize payment for a +given amount. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [INTENT_AUTHORIZE](#intent_authorize): [String](TopLevel.String.md) = "AUTHORIZE" | Represents the `"AUTHORIZE"` intent, meaning manual capture. | +| [INTENT_CAPTURE](#intent_capture): [String](TopLevel.String.md) = "CAPTURE" | Represents the `"CAPTURE"` intent, meaning automatic capture. | +| [TYPE_PAYPAL](#type_paypal): [String](TopLevel.String.md) = "paypal" | Represents the PayPal funding source. | +| [TYPE_VENMO](#type_venmo): [String](TopLevel.String.md) = "venmo" | Represents the Venmo funding source. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this PayPal order. | +| [amount](#amount): [Money](dw.value.Money.md) `(read-only)` | Returns the amount of this PayPal order. | +| [authorizationID](#authorizationid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the authorization against this order, or `null` if not available. | +| [captureID](#captureid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the capture against this order, or `null` if not available. | +| [completed](#completed): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if this PayPal order has been completed, or `false` if not. | +| [payer](#payer): [SalesforcePayPalOrderPayer](dw.extensions.payments.SalesforcePayPalOrderPayer.md) `(read-only)` | Returns the payer information for this PayPal order, or `null` if not known. | +| [shipping](#shipping): [SalesforcePayPalOrderAddress](dw.extensions.payments.SalesforcePayPalOrderAddress.md) `(read-only)` | Returns the shipping address for this PayPal order, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAmount](dw.extensions.payments.SalesforcePayPalOrder.md#getamount)() | Returns the amount of this PayPal order. | +| [getAuthorizationID](dw.extensions.payments.SalesforcePayPalOrder.md#getauthorizationid)() | Returns the ID of the authorization against this order, or `null` if not available. | +| [getCaptureID](dw.extensions.payments.SalesforcePayPalOrder.md#getcaptureid)() | Returns the ID of the capture against this order, or `null` if not available. | +| [getID](dw.extensions.payments.SalesforcePayPalOrder.md#getid)() | Returns the identifier of this PayPal order. | +| [getPayer](dw.extensions.payments.SalesforcePayPalOrder.md#getpayer)() | Returns the payer information for this PayPal order, or `null` if not known. | +| [getPaymentDetails](dw.extensions.payments.SalesforcePayPalOrder.md#getpaymentdetailsorderpaymentinstrument)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)) | Returns the details to the Salesforce Payments payment for this PayPal order, using the given payment instrument. | +| [getPaymentInstrument](dw.extensions.payments.SalesforcePayPalOrder.md#getpaymentinstrumentbasket)([Basket](dw.order.Basket.md)) | Returns the payment instrument for this PayPal order in the given basket, or `null` if the given basket has none. | +| [getPaymentInstrument](dw.extensions.payments.SalesforcePayPalOrder.md#getpaymentinstrumentorder)([Order](dw.order.Order.md)) | Returns the payment instrument for this PayPal order in the given order, or `null` if the given order has none. | +| [getShipping](dw.extensions.payments.SalesforcePayPalOrder.md#getshipping)() | Returns the shipping address for this PayPal order, or `null` if not known. | +| [isCompleted](dw.extensions.payments.SalesforcePayPalOrder.md#iscompleted)() | Returns `true` if this PayPal order has been completed, or `false` if not. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### INTENT_AUTHORIZE + +- INTENT_AUTHORIZE: [String](TopLevel.String.md) = "AUTHORIZE" + - : Represents the `"AUTHORIZE"` intent, meaning manual capture. + + +--- + +### INTENT_CAPTURE + +- INTENT_CAPTURE: [String](TopLevel.String.md) = "CAPTURE" + - : Represents the `"CAPTURE"` intent, meaning automatic capture. + + +--- + +### TYPE_PAYPAL + +- TYPE_PAYPAL: [String](TopLevel.String.md) = "paypal" + - : Represents the PayPal funding source. + + +--- + +### TYPE_VENMO + +- TYPE_VENMO: [String](TopLevel.String.md) = "venmo" + - : Represents the Venmo funding source. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this PayPal order. + + +--- + +### amount +- amount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the amount of this PayPal order. + + +--- + +### authorizationID +- authorizationID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the authorization against this order, or `null` if not available. + + +--- + +### captureID +- captureID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the capture against this order, or `null` if not available. + + +--- + +### completed +- completed: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if this PayPal order has been completed, or `false` if not. + + +--- + +### payer +- payer: [SalesforcePayPalOrderPayer](dw.extensions.payments.SalesforcePayPalOrderPayer.md) `(read-only)` + - : Returns the payer information for this PayPal order, or `null` if not known. + + +--- + +### shipping +- shipping: [SalesforcePayPalOrderAddress](dw.extensions.payments.SalesforcePayPalOrderAddress.md) `(read-only)` + - : Returns the shipping address for this PayPal order, or `null` if not known. + + +--- + +## Method Details + +### getAmount() +- getAmount(): [Money](dw.value.Money.md) + - : Returns the amount of this PayPal order. + + **Returns:** + - PayPal order amount + + +--- + +### getAuthorizationID() +- getAuthorizationID(): [String](TopLevel.String.md) + - : Returns the ID of the authorization against this order, or `null` if not available. + + **Returns:** + - PayPal order authorization identifier + + +--- + +### getCaptureID() +- getCaptureID(): [String](TopLevel.String.md) + - : Returns the ID of the capture against this order, or `null` if not available. + + **Returns:** + - PayPal order capture identifier + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this PayPal order. + + **Returns:** + - PayPal order identifier + + +--- + +### getPayer() +- getPayer(): [SalesforcePayPalOrderPayer](dw.extensions.payments.SalesforcePayPalOrderPayer.md) + - : Returns the payer information for this PayPal order, or `null` if not known. + + **Returns:** + - order payer information + + +--- + +### getPaymentDetails(OrderPaymentInstrument) +- getPaymentDetails(paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)): [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - : Returns the details to the Salesforce Payments payment for this PayPal order, using the given payment instrument. + + **Parameters:** + - paymentInstrument - payment instrument + + **Returns:** + - The payment details + + +--- + +### getPaymentInstrument(Basket) +- getPaymentInstrument(basket: [Basket](dw.order.Basket.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this PayPal order in the given basket, or `null` if the given + basket has none. + + + **Parameters:** + - basket - basket + + **Returns:** + - basket payment instrument + + +--- + +### getPaymentInstrument(Order) +- getPaymentInstrument(order: [Order](dw.order.Order.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this PayPal order in the given order, or `null` if the given + order has none. + + + **Parameters:** + - order - order + + **Returns:** + - order payment instrument + + +--- + +### getShipping() +- getShipping(): [SalesforcePayPalOrderAddress](dw.extensions.payments.SalesforcePayPalOrderAddress.md) + - : Returns the shipping address for this PayPal order, or `null` if not known. + + **Returns:** + - order shipping address + + +--- + +### isCompleted() +- isCompleted(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if this PayPal order has been completed, or `false` if not. + + **Returns:** + - `true` if this PayPal order has been completed + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderAddress.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderAddress.md new file mode 100644 index 00000000..5b4258df --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderAddress.md @@ -0,0 +1,171 @@ + +# Class SalesforcePayPalOrderAddress + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePayPalOrderAddress](dw.extensions.payments.SalesforcePayPalOrderAddress.md) + + + +Salesforce Payments representation of a PayPal order address object. See Salesforce Payments documentation +for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [addressLine1](#addressline1): [String](TopLevel.String.md) `(read-only)` | Returns the address line 1. | +| [addressLine2](#addressline2): [String](TopLevel.String.md) `(read-only)` | Returns the address line 2. | +| [adminArea1](#adminarea1): [String](TopLevel.String.md) `(read-only)` | Returns the address highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. | +| [adminArea2](#adminarea2): [String](TopLevel.String.md) `(read-only)` | Returns the address city, town, or village. | +| [countryCode](#countrycode): [String](TopLevel.String.md) `(read-only)` | Returns the address two-character ISO 3166-1 code that identifies the country or region. | +| [fullName](#fullname): [String](TopLevel.String.md) `(read-only)` | Returns the address full name. | +| [postalCode](#postalcode): [String](TopLevel.String.md) `(read-only)` | Returns the address postal code. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAddressLine1](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getaddressline1)() | Returns the address line 1. | +| [getAddressLine2](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getaddressline2)() | Returns the address line 2. | +| [getAdminArea1](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getadminarea1)() | Returns the address highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. | +| [getAdminArea2](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getadminarea2)() | Returns the address city, town, or village. | +| [getCountryCode](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getcountrycode)() | Returns the address two-character ISO 3166-1 code that identifies the country or region. | +| [getFullName](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getfullname)() | Returns the address full name. | +| [getPostalCode](dw.extensions.payments.SalesforcePayPalOrderAddress.md#getpostalcode)() | Returns the address postal code. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### addressLine1 +- addressLine1: [String](TopLevel.String.md) `(read-only)` + - : Returns the address line 1. + + +--- + +### addressLine2 +- addressLine2: [String](TopLevel.String.md) `(read-only)` + - : Returns the address line 2. + + +--- + +### adminArea1 +- adminArea1: [String](TopLevel.String.md) `(read-only)` + - : Returns the address highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 + subdivision. + + + +--- + +### adminArea2 +- adminArea2: [String](TopLevel.String.md) `(read-only)` + - : Returns the address city, town, or village. + + +--- + +### countryCode +- countryCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the address two-character ISO 3166-1 code that identifies the country or region. + + +--- + +### fullName +- fullName: [String](TopLevel.String.md) `(read-only)` + - : Returns the address full name. + + +--- + +### postalCode +- postalCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the address postal code. + + +--- + +## Method Details + +### getAddressLine1() +- getAddressLine1(): [String](TopLevel.String.md) + - : Returns the address line 1. + + **Returns:** + - address line 1 + + +--- + +### getAddressLine2() +- getAddressLine2(): [String](TopLevel.String.md) + - : Returns the address line 2. + + **Returns:** + - address line 2 + + +--- + +### getAdminArea1() +- getAdminArea1(): [String](TopLevel.String.md) + - : Returns the address highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 + subdivision. + + + **Returns:** + - address highest level sub-division in a country, such as a state + + +--- + +### getAdminArea2() +- getAdminArea2(): [String](TopLevel.String.md) + - : Returns the address city, town, or village. + + **Returns:** + - address city, town, or village + + +--- + +### getCountryCode() +- getCountryCode(): [String](TopLevel.String.md) + - : Returns the address two-character ISO 3166-1 code that identifies the country or region. + + **Returns:** + - address country code + + +--- + +### getFullName() +- getFullName(): [String](TopLevel.String.md) + - : Returns the address full name. + + **Returns:** + - address full name + + +--- + +### getPostalCode() +- getPostalCode(): [String](TopLevel.String.md) + - : Returns the address postal code. + + **Returns:** + - address postal code + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderPayer.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderPayer.md new file mode 100644 index 00000000..cedba323 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalOrderPayer.md @@ -0,0 +1,110 @@ + +# Class SalesforcePayPalOrderPayer + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePayPalOrderPayer](dw.extensions.payments.SalesforcePayPalOrderPayer.md) + + + +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. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [emailAddress](#emailaddress): [String](TopLevel.String.md) `(read-only)` | Returns the payer's email address. | +| [givenName](#givenname): [String](TopLevel.String.md) `(read-only)` | Returns the payer's given name. | +| [phone](#phone): [String](TopLevel.String.md) `(read-only)` | Returns the payer's national phone number. | +| [surname](#surname): [String](TopLevel.String.md) `(read-only)` | Returns the payer's surname. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getEmailAddress](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getemailaddress)() | Returns the payer's email address. | +| [getGivenName](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getgivenname)() | Returns the payer's given name. | +| [getPhone](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getphone)() | Returns the payer's national phone number. | +| [getSurname](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getsurname)() | Returns the payer's surname. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### emailAddress +- emailAddress: [String](TopLevel.String.md) `(read-only)` + - : Returns the payer's email address. + + +--- + +### givenName +- givenName: [String](TopLevel.String.md) `(read-only)` + - : Returns the payer's given name. + + +--- + +### phone +- phone: [String](TopLevel.String.md) `(read-only)` + - : Returns the payer's national phone number. + + +--- + +### surname +- surname: [String](TopLevel.String.md) `(read-only)` + - : Returns the payer's surname. + + +--- + +## Method Details + +### getEmailAddress() +- getEmailAddress(): [String](TopLevel.String.md) + - : Returns the payer's email address. + + **Returns:** + - payer's email address + + +--- + +### getGivenName() +- getGivenName(): [String](TopLevel.String.md) + - : Returns the payer's given name. + + **Returns:** + - payer's given name + + +--- + +### getPhone() +- getPhone(): [String](TopLevel.String.md) + - : Returns the payer's national phone number. + + **Returns:** + - payer's national phone number + + +--- + +### getSurname() +- getSurname(): [String](TopLevel.String.md) + - : Returns the payer's surname. + + **Returns:** + - payer's surname + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalPaymentDetails.md new file mode 100644 index 00000000..78d4a007 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePayPalPaymentDetails.md @@ -0,0 +1,88 @@ + +# Class SalesforcePayPalPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforcePayPalPaymentDetails](dw.extensions.payments.SalesforcePayPalPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePayPalOrder.TYPE_PAYPAL](dw.extensions.payments.SalesforcePayPalOrder.md#type_paypal). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [captureID](#captureid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the capture against the PayPal order, or `null` if not known. | +| [payerEmailAddress](#payeremailaddress): [String](TopLevel.String.md) `(read-only)` | Returns the email address of the payer for the PayPal order, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCaptureID](dw.extensions.payments.SalesforcePayPalPaymentDetails.md#getcaptureid)() | Returns the ID of the capture against the PayPal order, or `null` if not known. | +| [getPayerEmailAddress](dw.extensions.payments.SalesforcePayPalPaymentDetails.md#getpayeremailaddress)() | Returns the email address of the payer for the PayPal order, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### captureID +- captureID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the capture against the PayPal order, or `null` if not known. + + **See Also:** + - [SalesforcePayPalOrder.getCaptureID()](dw.extensions.payments.SalesforcePayPalOrder.md#getcaptureid) + + +--- + +### payerEmailAddress +- payerEmailAddress: [String](TopLevel.String.md) `(read-only)` + - : Returns the email address of the payer for the PayPal order, or `null` if not known. + + **See Also:** + - [SalesforcePayPalOrderPayer.getEmailAddress()](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getemailaddress) + + +--- + +## Method Details + +### getCaptureID() +- getCaptureID(): [String](TopLevel.String.md) + - : Returns the ID of the capture against the PayPal order, or `null` if not known. + + **Returns:** + - PayPal order capture ID + + **See Also:** + - [SalesforcePayPalOrder.getCaptureID()](dw.extensions.payments.SalesforcePayPalOrder.md#getcaptureid) + + +--- + +### getPayerEmailAddress() +- getPayerEmailAddress(): [String](TopLevel.String.md) + - : Returns the email address of the payer for the PayPal order, or `null` if not known. + + **Returns:** + - payer email address + + **See Also:** + - [SalesforcePayPalOrderPayer.getEmailAddress()](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getemailaddress) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentDetails.md new file mode 100644 index 00000000..e47bed0f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentDetails.md @@ -0,0 +1,83 @@ + +# Class SalesforcePaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + + + +Base class details to a Salesforce Payments payment. See Salesforce Payments documentation for how to gain access and +configure it for use on your sites. + + + + +Some payment types like [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) contain additional details like the card brand, or +the last 4 digits of the card number. Details to those payments will be of a specific subclass of this class like +[SalesforceCardPaymentDetails](dw.extensions.payments.SalesforceCardPaymentDetails.md). Other payment types have no additional information so their details are +represented by an object of this base type. + + + +## All Known Subclasses +[SalesforceBancontactPaymentDetails](dw.extensions.payments.SalesforceBancontactPaymentDetails.md), [SalesforceCardPaymentDetails](dw.extensions.payments.SalesforceCardPaymentDetails.md), [SalesforceEpsPaymentDetails](dw.extensions.payments.SalesforceEpsPaymentDetails.md), [SalesforceIdealPaymentDetails](dw.extensions.payments.SalesforceIdealPaymentDetails.md), [SalesforceKlarnaPaymentDetails](dw.extensions.payments.SalesforceKlarnaPaymentDetails.md), [SalesforcePayPalPaymentDetails](dw.extensions.payments.SalesforcePayPalPaymentDetails.md), [SalesforceSepaDebitPaymentDetails](dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md), [SalesforceVenmoPaymentDetails](dw.extensions.payments.SalesforceVenmoPaymentDetails.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the payment type. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype)() | Returns the payment type. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the payment type. + + **See Also:** + - [SalesforcePaymentMethod.TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) + - [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) + - [SalesforcePaymentMethod.TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) + - [SalesforcePaymentMethod.TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) + - [SalesforcePaymentMethod.TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna) + - [SalesforcePaymentMethod.TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) + - [SalesforcePayPalOrder.TYPE_PAYPAL](dw.extensions.payments.SalesforcePayPalOrder.md#type_paypal) + - [SalesforcePayPalOrder.TYPE_VENMO](dw.extensions.payments.SalesforcePayPalOrder.md#type_venmo) + + +--- + +## Method Details + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the payment type. + + **Returns:** + - payment type + + **See Also:** + - [SalesforcePaymentMethod.TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) + - [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) + - [SalesforcePaymentMethod.TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) + - [SalesforcePaymentMethod.TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) + - [SalesforcePaymentMethod.TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna) + - [SalesforcePaymentMethod.TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) + - [SalesforcePayPalOrder.TYPE_PAYPAL](dw.extensions.payments.SalesforcePayPalOrder.md#type_paypal) + - [SalesforcePayPalOrder.TYPE_VENMO](dw.extensions.payments.SalesforcePayPalOrder.md#type_venmo) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentIntent.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentIntent.md new file mode 100644 index 00000000..3990d737 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentIntent.md @@ -0,0 +1,273 @@ + +# Class SalesforcePaymentIntent + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md) + + + +Salesforce Payments representation of a Stripe payment intent object. See Salesforce Payments documentation for how +to gain access and configure it for use on your sites. + + + + +A payment intent is automatically created when a shopper is ready to pay for items in their basket. It becomes +confirmed when the shopper provides information to the payment provider that is acceptable to authorize payment for a +given amount. Once that information has been provided it becomes available as the payment method associated with the +payment intent. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [SETUP_FUTURE_USAGE_OFF_SESSION](#setup_future_usage_off_session): [String](TopLevel.String.md) = "off_session" | Represents the payment method setup future usage is off session. | +| [SETUP_FUTURE_USAGE_ON_SESSION](#setup_future_usage_on_session): [String](TopLevel.String.md) = "on_session" | Represents the payment method setup future usage is on session. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this payment intent. | +| [amount](#amount): [Money](dw.value.Money.md) `(read-only)` | Returns the amount of this payment intent. | +| [cancelable](#cancelable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if this payment intent has a status which indicates it can be canceled, or `false` if its status does not indicate it can be canceled. | +| [clientSecret](#clientsecret): [String](TopLevel.String.md) `(read-only)` | Returns the client secret of this payment intent. | +| [confirmed](#confirmed): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if this payment intent has been confirmed, or `false` if not. | +| [paymentMethod](#paymentmethod): [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md) `(read-only)` | Returns the payment method for this payment intent, or `null` if none has been established. | +| [refundable](#refundable): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if this payment intent has a status and other state which indicate it can be refunded, or `false` if it cannot be refunded. | +| [setupFutureUsage](#setupfutureusage): [String](TopLevel.String.md) `(read-only)` | Returns [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) or [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) to indicate how the payment intent can be used in the future or returns `null` if future usage is not set up. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAmount](dw.extensions.payments.SalesforcePaymentIntent.md#getamount)() | Returns the amount of this payment intent. | +| [getClientSecret](dw.extensions.payments.SalesforcePaymentIntent.md#getclientsecret)() | Returns the client secret of this payment intent. | +| [getID](dw.extensions.payments.SalesforcePaymentIntent.md#getid)() | Returns the identifier of this payment intent. | +| [getPaymentInstrument](dw.extensions.payments.SalesforcePaymentIntent.md#getpaymentinstrumentbasket)([Basket](dw.order.Basket.md)) | Returns the payment instrument for this payment intent in the given basket, or `null` if the given basket has none. | +| [getPaymentInstrument](dw.extensions.payments.SalesforcePaymentIntent.md#getpaymentinstrumentorder)([Order](dw.order.Order.md)) | Returns the payment instrument for this payment intent in the given order, or `null` if the given order has none. | +| [getPaymentMethod](dw.extensions.payments.SalesforcePaymentIntent.md#getpaymentmethod)() | Returns the payment method for this payment intent, or `null` if none has been established. | +| [getSetupFutureUsage](dw.extensions.payments.SalesforcePaymentIntent.md#getsetupfutureusage)() | Returns [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) or [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) to indicate how the payment intent can be used in the future or returns `null` if future usage is not set up. | +| [isCancelable](dw.extensions.payments.SalesforcePaymentIntent.md#iscancelable)() | Returns `true` if this payment intent has a status which indicates it can be canceled, or `false` if its status does not indicate it can be canceled. | +| [isConfirmed](dw.extensions.payments.SalesforcePaymentIntent.md#isconfirmed)() | Returns `true` if this payment intent has been confirmed, or `false` if not. | +| [isRefundable](dw.extensions.payments.SalesforcePaymentIntent.md#isrefundable)() | Returns `true` if this payment intent has a status and other state which indicate it can be refunded, or `false` if it cannot be refunded. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### SETUP_FUTURE_USAGE_OFF_SESSION + +- SETUP_FUTURE_USAGE_OFF_SESSION: [String](TopLevel.String.md) = "off_session" + - : Represents the payment method setup future usage is off session. + + +--- + +### SETUP_FUTURE_USAGE_ON_SESSION + +- SETUP_FUTURE_USAGE_ON_SESSION: [String](TopLevel.String.md) = "on_session" + - : Represents the payment method setup future usage is on session. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this payment intent. + + +--- + +### amount +- amount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the amount of this payment intent. + + +--- + +### cancelable +- cancelable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if this payment intent has a status which indicates it can be canceled, + or `false` if its status does not indicate it can be canceled. + + + +--- + +### clientSecret +- clientSecret: [String](TopLevel.String.md) `(read-only)` + - : Returns the client secret of this payment intent. + + +--- + +### confirmed +- confirmed: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if this payment intent has been confirmed, or `false` if not. + + +--- + +### paymentMethod +- paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md) `(read-only)` + - : Returns the payment method for this payment intent, or `null` if none has been established. + + +--- + +### refundable +- refundable: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if this payment intent has a status and other state which indicate it can be refunded, + or `false` if it cannot be refunded. + + + +--- + +### setupFutureUsage +- setupFutureUsage: [String](TopLevel.String.md) `(read-only)` + - : Returns [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) or [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) to indicate how the payment + intent can be used in the future or returns `null` if future usage is not set up. + + + **See Also:** + - [SalesforcePaymentRequest.setSetupFutureUsage(Boolean)](dw.extensions.payments.SalesforcePaymentRequest.md#setsetupfutureusageboolean) + - [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) + - [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) + + +--- + +## Method Details + +### getAmount() +- getAmount(): [Money](dw.value.Money.md) + - : Returns the amount of this payment intent. + + **Returns:** + - payment intent amount + + +--- + +### getClientSecret() +- getClientSecret(): [String](TopLevel.String.md) + - : Returns the client secret of this payment intent. + + **Returns:** + - payment intent client secret + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this payment intent. + + **Returns:** + - payment intent identifier + + +--- + +### getPaymentInstrument(Basket) +- getPaymentInstrument(basket: [Basket](dw.order.Basket.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this payment intent in the given basket, or `null` if the given + basket has none. + + + **Parameters:** + - basket - basket + + **Returns:** + - basket payment instrument + + +--- + +### getPaymentInstrument(Order) +- getPaymentInstrument(order: [Order](dw.order.Order.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Returns the payment instrument for this payment intent in the given order, or `null` if the given + order has none. + + + **Parameters:** + - order - order + + **Returns:** + - order payment instrument + + +--- + +### getPaymentMethod() +- getPaymentMethod(): [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md) + - : Returns the payment method for this payment intent, or `null` if none has been established. + + **Returns:** + - payment method + + +--- + +### getSetupFutureUsage() +- getSetupFutureUsage(): [String](TopLevel.String.md) + - : Returns [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) or [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) to indicate how the payment + intent can be used in the future or returns `null` if future usage is not set up. + + + **Returns:** + - setup future usage or `null` if future usage is not set up + + **See Also:** + - [SalesforcePaymentRequest.setSetupFutureUsage(Boolean)](dw.extensions.payments.SalesforcePaymentRequest.md#setsetupfutureusageboolean) + - [SETUP_FUTURE_USAGE_OFF_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_off_session) + - [SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) + + +--- + +### isCancelable() +- isCancelable(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if this payment intent has a status which indicates it can be canceled, + or `false` if its status does not indicate it can be canceled. + + + **Returns:** + - `true` if this payment intent has a status which indicates it can be canceled + + +--- + +### isConfirmed() +- isConfirmed(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if this payment intent has been confirmed, or `false` if not. + + **Returns:** + - `true` if this payment intent has been confirmed + + +--- + +### isRefundable() +- isRefundable(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if this payment intent has a status and other state which indicate it can be refunded, + or `false` if it cannot be refunded. + + + **Returns:** + - `true` if this payment intent has a status and other state which indicate it can be refunded + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentMethod.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentMethod.md new file mode 100644 index 00000000..84612533 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentMethod.md @@ -0,0 +1,368 @@ + +# Class SalesforcePaymentMethod + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md) + + + +Salesforce Payments representation of a payment method object. See Salesforce Payments documentation for how +to gain access and configure it for use on your sites. + + + + +A payment method contains information about a credential used by a shopper to attempt payment, such as a payment card +or bank account. The available information differs for each type of payment method. It includes only limited +information that can be safely presented to a shopper to remind them what credential they used, and specifically not +complete card, account, or other numbers that could be used to make future payments. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [TYPE_AFTERPAY_CLEARPAY](#type_afterpay_clearpay): [String](TopLevel.String.md) = "afterpay_clearpay" | Represents the Afterpay Clearpay payment method. | +| [TYPE_BANCONTACT](#type_bancontact): [String](TopLevel.String.md) = "bancontact" | Represents the Bancontact payment method. | +| [TYPE_CARD](#type_card): [String](TopLevel.String.md) = "card" | Represents a credit card type of payment method. | +| [TYPE_EPS](#type_eps): [String](TopLevel.String.md) = "eps" | Represents the EPS (Electronic Payment Standard) payment method. | +| [TYPE_IDEAL](#type_ideal): [String](TopLevel.String.md) = "ideal" | Represents the iDEAL payment method. | +| [TYPE_KLARNA](#type_klarna): [String](TopLevel.String.md) = "klarna" | Represents the Klarna payment method. | +| [TYPE_SEPA_DEBIT](#type_sepa_debit): [String](TopLevel.String.md) = "sepa_debit" | Represents the SEPA Debit payment method. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this payment method. | +| [bank](#bank): [String](TopLevel.String.md) `(read-only)` | Returns the bank of this payment method, or `null` if none is available. | +| [bankCode](#bankcode): [String](TopLevel.String.md) `(read-only)` | Returns the bank code of this payment method, or `null` if none is available. | +| [bankName](#bankname): [String](TopLevel.String.md) `(read-only)` | Returns the bank name of this payment method, or `null` if none is available. | +| [branchCode](#branchcode): [String](TopLevel.String.md) `(read-only)` | Returns the bank branch code of this payment method, or `null` if none is available. | +| [brand](#brand): [String](TopLevel.String.md) `(read-only)` | Returns the brand of this payment method, or `null` if none is available. | +| [country](#country): [String](TopLevel.String.md) `(read-only)` | Returns the country of this payment method, or `null` if none is available. | +| [last4](#last4): [String](TopLevel.String.md) `(read-only)` | Returns the last 4 digits of the credential for this payment method, or `null` if none is available. | +| [paymentMethodCategory](#paymentmethodcategory): [String](TopLevel.String.md) `(read-only)` | Returns the payment method category of this payment method, or `null` if none is available. | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the type of this payment method. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBank](dw.extensions.payments.SalesforcePaymentMethod.md#getbank)() | Returns the bank of this payment method, or `null` if none is available. | +| [getBankCode](dw.extensions.payments.SalesforcePaymentMethod.md#getbankcode)() | Returns the bank code of this payment method, or `null` if none is available. | +| [getBankName](dw.extensions.payments.SalesforcePaymentMethod.md#getbankname)() | Returns the bank name of this payment method, or `null` if none is available. | +| [getBranchCode](dw.extensions.payments.SalesforcePaymentMethod.md#getbranchcode)() | Returns the bank branch code of this payment method, or `null` if none is available. | +| [getBrand](dw.extensions.payments.SalesforcePaymentMethod.md#getbrand)() | Returns the brand of this payment method, or `null` if none is available. | +| [getCountry](dw.extensions.payments.SalesforcePaymentMethod.md#getcountry)() | Returns the country of this payment method, or `null` if none is available. | +| [getID](dw.extensions.payments.SalesforcePaymentMethod.md#getid)() | Returns the identifier of this payment method. | +| [getLast4](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4)() | Returns the last 4 digits of the credential for this payment method, or `null` if none is available. | +| [getPaymentDetails](dw.extensions.payments.SalesforcePaymentMethod.md#getpaymentdetailsorderpaymentinstrument)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)) | Returns the details to the Salesforce Payments payment for this payment method, using the given payment instrument. | +| [getPaymentMethodCategory](dw.extensions.payments.SalesforcePaymentMethod.md#getpaymentmethodcategory)() | Returns the payment method category of this payment method, or `null` if none is available. | +| [getType](dw.extensions.payments.SalesforcePaymentMethod.md#gettype)() | Returns the type of this payment method. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### TYPE_AFTERPAY_CLEARPAY + +- TYPE_AFTERPAY_CLEARPAY: [String](TopLevel.String.md) = "afterpay_clearpay" + - : Represents the Afterpay Clearpay payment method. + + +--- + +### TYPE_BANCONTACT + +- TYPE_BANCONTACT: [String](TopLevel.String.md) = "bancontact" + - : Represents the Bancontact payment method. + + +--- + +### TYPE_CARD + +- TYPE_CARD: [String](TopLevel.String.md) = "card" + - : Represents a credit card type of payment method. + + +--- + +### TYPE_EPS + +- TYPE_EPS: [String](TopLevel.String.md) = "eps" + - : Represents the EPS (Electronic Payment Standard) payment method. + + +--- + +### TYPE_IDEAL + +- TYPE_IDEAL: [String](TopLevel.String.md) = "ideal" + - : Represents the iDEAL payment method. + + +--- + +### TYPE_KLARNA + +- TYPE_KLARNA: [String](TopLevel.String.md) = "klarna" + - : Represents the Klarna payment method. + + +--- + +### TYPE_SEPA_DEBIT + +- TYPE_SEPA_DEBIT: [String](TopLevel.String.md) = "sepa_debit" + - : Represents the SEPA Debit payment method. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this payment method. + + +--- + +### bank +- bank: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank of this payment method, or `null` if none is available. Available on + [TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) and [TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) type methods. + + + +--- + +### bankCode +- bankCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank code of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) and [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + +--- + +### bankName +- bankName: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank name of this payment method, or `null` if none is available. Available on + [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + +--- + +### branchCode +- branchCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the bank branch code of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) type methods. + + + +--- + +### brand +- brand: [String](TopLevel.String.md) `(read-only)` + - : Returns the brand of this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) type methods. + + + +--- + +### country +- country: [String](TopLevel.String.md) `(read-only)` + - : Returns the country of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) type methods. + + + +--- + +### last4 +- last4: [String](TopLevel.String.md) `(read-only)` + - : Returns the last 4 digits of the credential for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card), [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit), and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + +--- + +### paymentMethodCategory +- paymentMethodCategory: [String](TopLevel.String.md) `(read-only)` + - : Returns the payment method category of this payment method, or `null` if none is available. Available + on [TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna) type methods. + + + +--- + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of this payment method. + + **See Also:** + - [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) + - [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) + - [TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) + - [TYPE_AFTERPAY_CLEARPAY](dw.extensions.payments.SalesforcePaymentMethod.md#type_afterpay_clearpay) + - [TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) + - [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) + + +--- + +## Method Details + +### getBank() +- getBank(): [String](TopLevel.String.md) + - : Returns the bank of this payment method, or `null` if none is available. Available on + [TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) and [TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) type methods. + + + **Returns:** + - payment method bank + + +--- + +### getBankCode() +- getBankCode(): [String](TopLevel.String.md) + - : Returns the bank code of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) and [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method bank code + + +--- + +### getBankName() +- getBankName(): [String](TopLevel.String.md) + - : Returns the bank name of this payment method, or `null` if none is available. Available on + [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method bank name + + +--- + +### getBranchCode() +- getBranchCode(): [String](TopLevel.String.md) + - : Returns the bank branch code of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) type methods. + + + **Returns:** + - payment method bank branch code + + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the brand of this payment method, or `null` if none is available. Available on + [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) type methods. + + + **Returns:** + - payment method brand + + +--- + +### getCountry() +- getCountry(): [String](TopLevel.String.md) + - : Returns the country of this payment method, or `null` if none is available. Available on + [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) type methods. + + + **Returns:** + - payment method country + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this payment method. + + **Returns:** + - payment method identifier + + +--- + +### getLast4() +- getLast4(): [String](TopLevel.String.md) + - : Returns the last 4 digits of the credential for this payment method, or `null` if none is available. + Available on [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card), [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit), and + [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) type methods. + + + **Returns:** + - payment method credential last 4 digits + + +--- + +### getPaymentDetails(OrderPaymentInstrument) +- getPaymentDetails(paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)): [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - : Returns the details to the Salesforce Payments payment for this payment method, using the given payment + instrument. + + + **Parameters:** + - paymentInstrument - payment instrument + + **Returns:** + - The payment details + + +--- + +### getPaymentMethodCategory() +- getPaymentMethodCategory(): [String](TopLevel.String.md) + - : Returns the payment method category of this payment method, or `null` if none is available. Available + on [TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna) type methods. + + + **Returns:** + - payment method category + + +--- + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the type of this payment method. + + **Returns:** + - payment method type + + **See Also:** + - [TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact) + - [TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) + - [TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps) + - [TYPE_AFTERPAY_CLEARPAY](dw.extensions.payments.SalesforcePaymentMethod.md#type_afterpay_clearpay) + - [TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal) + - [TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentRequest.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentRequest.md new file mode 100644 index 00000000..45e3a6bc --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentRequest.md @@ -0,0 +1,1077 @@ + +# Class SalesforcePaymentRequest + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentRequest](dw.extensions.payments.SalesforcePaymentRequest.md) + + + +Salesforce Payments request for a shopper to make payment. See Salesforce Payments documentation for how to +gain access and configure it for use on your sites. + + + + +A request is required to render payment methods and/or express checkout buttons using `` +or ``. You can call methods on the payment request to configure which payment methods +and/or express checkout buttons may be presented, and customize their visual presentation. + + + + +When used with `` you must provide the necessary data to prepare the shopper basket to buy +the product, and the necessary payment request options for the browser payment app. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ELEMENT_AFTERPAY_CLEARPAY_MESSAGE](#element_afterpay_clearpay_message): [String](TopLevel.String.md) = "afterpayClearpayMessage" | Element for the Stripe Afterpay/Clearpay message `"afterpayClearpayMessage"`. | +| [ELEMENT_CARD_CVC](#element_card_cvc): [String](TopLevel.String.md) = "cardCvc" | Element for the Stripe credit card CVC field `"cardCvc"`. | +| [ELEMENT_CARD_EXPIRY](#element_card_expiry): [String](TopLevel.String.md) = "cardExpiry" | Element for the Stripe credit card expiration date field `"cardExpiry"`. | +| [ELEMENT_CARD_NUMBER](#element_card_number): [String](TopLevel.String.md) = "cardNumber" | Element for the Stripe credit card number field `"cardNumber"`. | +| [ELEMENT_EPS_BANK](#element_eps_bank): [String](TopLevel.String.md) = "epsBank" | Element for the Stripe EPS bank selection field `"epsBank"`. | +| [ELEMENT_IBAN](#element_iban): [String](TopLevel.String.md) = "iban" | Element for the Stripe IBAN field `"iban"`. | +| [ELEMENT_IDEAL_BANK](#element_ideal_bank): [String](TopLevel.String.md) = "idealBank" | Element for the Stripe iDEAL bank selection field `"idealBank"`. | +| [ELEMENT_PAYMENT_REQUEST_BUTTON](#element_payment_request_button): [String](TopLevel.String.md) = "paymentRequestButton" | Element for the Stripe payment request button `"paymentRequestButton"`. | +| [ELEMENT_TYPE_AFTERPAY_CLEARPAY](#element_type_afterpay_clearpay): [String](TopLevel.String.md) = "afterpay_clearpay" | Element type name for Afterpay. | +| [ELEMENT_TYPE_AFTERPAY_CLEARPAY_MESSAGE](#element_type_afterpay_clearpay_message): [String](TopLevel.String.md) = "afterpayclearpaymessage" | Element type name for Afterpay/Clearpay message. | +| [ELEMENT_TYPE_APPLEPAY](#element_type_applepay): [String](TopLevel.String.md) = "applepay" | Element type name for Apple Pay payment request buttons. | +| [ELEMENT_TYPE_BANCONTACT](#element_type_bancontact): [String](TopLevel.String.md) = "bancontact" | Element type name for Bancontact. | +| [ELEMENT_TYPE_CARD](#element_type_card): [String](TopLevel.String.md) = "card" | Element type name for credit cards. | +| [ELEMENT_TYPE_EPS](#element_type_eps): [String](TopLevel.String.md) = "eps" | Element type name for EPS. | +| [ELEMENT_TYPE_IDEAL](#element_type_ideal): [String](TopLevel.String.md) = "ideal" | Element type name for iDEAL. | +| [ELEMENT_TYPE_PAYMENTREQUEST](#element_type_paymentrequest): [String](TopLevel.String.md) = "paymentrequest" | Element type name for other payment request buttons besides Apple Pay, like Google Pay. | +| [ELEMENT_TYPE_PAYPAL](#element_type_paypal): [String](TopLevel.String.md) = "paypal" | Element type name for PayPal in multi-step checkout. | +| [ELEMENT_TYPE_PAYPAL_EXPRESS](#element_type_paypal_express): [String](TopLevel.String.md) = "paypalexpress" | Element type name for PayPal in express checkout. | +| [ELEMENT_TYPE_PAYPAL_MESSAGE](#element_type_paypal_message): [String](TopLevel.String.md) = "paypalmessage" | Element type name for the PayPal messages component. | +| [ELEMENT_TYPE_SEPA_DEBIT](#element_type_sepa_debit): [String](TopLevel.String.md) = "sepa_debit" | Element type name for SEPA debit. | +| [ELEMENT_TYPE_VENMO](#element_type_venmo): [String](TopLevel.String.md) = "venmo" | Element type name for Venmo in multi-step checkout. | +| [ELEMENT_TYPE_VENMO_EXPRESS](#element_type_venmo_express): [String](TopLevel.String.md) = "venmoexpress" | Element type name for Venmo in express checkout. | +| [PAYPAL_SHIPPING_PREFERENCE_GET_FROM_FILE](#paypal_shipping_preference_get_from_file): [String](TopLevel.String.md) = "GET_FROM_FILE" | PayPal application context `shipping_preference` value `"GET_FROM_FILE"`, to use the customer-provided shipping address on the PayPal site. | +| [PAYPAL_SHIPPING_PREFERENCE_NO_SHIPPING](#paypal_shipping_preference_no_shipping): [String](TopLevel.String.md) = "NO_SHIPPING" | PayPal application context `shipping_preference` value `"NO_SHIPPING"`, to redact the shipping address from the PayPal site. | +| [PAYPAL_SHIPPING_PREFERENCE_SET_PROVIDED_ADDRESS](#paypal_shipping_preference_set_provided_address): [String](TopLevel.String.md) = "SET_PROVIDED_ADDRESS" | PayPal application context `shipping_preference` value `"SET_PROVIDED_ADDRESS"`, to use the merchant-provided address. | +| [PAYPAL_USER_ACTION_CONTINUE](#paypal_user_action_continue): [String](TopLevel.String.md) = "CONTINUE" | PayPal application context `user_action` value `"CONTINUE"`. | +| [PAYPAL_USER_ACTION_PAY_NOW](#paypal_user_action_pay_now): [String](TopLevel.String.md) = "PAY_NOW" | PayPal application context `user_action` value `"PAY_NOW"`. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the identifier of this payment request. | +| [basketData](#basketdata): [Object](TopLevel.Object.md) | Returns a JS object containing the data used to prepare the shopper basket when a Buy Now button is tapped. | +| [billingDetails](#billingdetails): [Object](TopLevel.Object.md) | Returns a JS object containing the billing details to use when a Stripe PaymentMethod is created. | +| [cardCaptureAutomatic](#cardcaptureautomatic): [Boolean](TopLevel.Boolean.md) | Returns `true` if the credit card payment should be automatically captured at the time of the sale, or `false` if the credit card payment should be captured later. | +| [exclude](#exclude): [Set](dw.util.Set.md) `(read-only)` |

          Returns a set containing the element types to be explicitly excluded from mounted components. | +| [include](#include): [Set](dw.util.Set.md) `(read-only)` |

          Returns a set containing the specific element types to include in mounted components. | +| [selector](#selector): [String](TopLevel.String.md) `(read-only)` | Returns the DOM element selector where to mount payment methods and/or express checkout buttons. | +| [setupFutureUsage](#setupfutureusage): [Boolean](TopLevel.Boolean.md) | Returns `true` if the payment method should be always saved for future use off session, or `false` if the payment method should be only saved for future use on session when appropriate. | +| [statementDescriptor](#statementdescriptor): [String](TopLevel.String.md) | Returns the complete description that appears on your customers' statements for payments made by this request, or `null` if the default statement descriptor for your account will be used. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SalesforcePaymentRequest](#salesforcepaymentrequeststring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Constructs a payment request using the given identifiers. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addExclude](dw.extensions.payments.SalesforcePaymentRequest.md#addexcludestring)([String](TopLevel.String.md)) |

          Adds the given element type to explicitly exclude from mounted components. | +| [addInclude](dw.extensions.payments.SalesforcePaymentRequest.md#addincludestring)([String](TopLevel.String.md)) |

          Adds the given element type to include in mounted components. | +| static [calculatePaymentRequestOptions](dw.extensions.payments.SalesforcePaymentRequest.md#calculatepaymentrequestoptionsbasket-object)([Basket](dw.order.Basket.md), [Object](TopLevel.Object.md)) |

          Returns a JS object containing the payment request options to use when a Pay Now button is tapped, in the appropriate format for use in client side JavaScript, with data calculated from the given basket. | +| static [format](dw.extensions.payments.SalesforcePaymentRequest.md#formatobject)([Object](TopLevel.Object.md)) |

          Returns a JS object containing the payment request options to use when a Buy Now button is tapped, in the appropriate format for use in client side JavaScript. | +| [getBasketData](dw.extensions.payments.SalesforcePaymentRequest.md#getbasketdata)() | Returns a JS object containing the data used to prepare the shopper basket when a Buy Now button is tapped. | +| [getBillingDetails](dw.extensions.payments.SalesforcePaymentRequest.md#getbillingdetails)() | Returns a JS object containing the billing details to use when a Stripe PaymentMethod is created. | +| [getCardCaptureAutomatic](dw.extensions.payments.SalesforcePaymentRequest.md#getcardcaptureautomatic)() | Returns `true` if the credit card payment should be automatically captured at the time of the sale, or `false` if the credit card payment should be captured later. | +| [getExclude](dw.extensions.payments.SalesforcePaymentRequest.md#getexclude)() |

          Returns a set containing the element types to be explicitly excluded from mounted components. | +| [getID](dw.extensions.payments.SalesforcePaymentRequest.md#getid)() | Returns the identifier of this payment request. | +| [getInclude](dw.extensions.payments.SalesforcePaymentRequest.md#getinclude)() |

          Returns a set containing the specific element types to include in mounted components. | +| [getSelector](dw.extensions.payments.SalesforcePaymentRequest.md#getselector)() | Returns the DOM element selector where to mount payment methods and/or express checkout buttons. | +| [getSetupFutureUsage](dw.extensions.payments.SalesforcePaymentRequest.md#getsetupfutureusage)() | Returns `true` if the payment method should be always saved for future use off session, or `false` if the payment method should be only saved for future use on session when appropriate. | +| [getStatementDescriptor](dw.extensions.payments.SalesforcePaymentRequest.md#getstatementdescriptor)() | Returns the complete description that appears on your customers' statements for payments made by this request, or `null` if the default statement descriptor for your account will be used. | +| [setBasketData](dw.extensions.payments.SalesforcePaymentRequest.md#setbasketdataobject)([Object](TopLevel.Object.md)) |

          Sets the data used to prepare the shopper basket when a Buy Now button is tapped. | +| [setBillingDetails](dw.extensions.payments.SalesforcePaymentRequest.md#setbillingdetailsobject)([Object](TopLevel.Object.md)) | Sets the billing details to use when a Stripe PaymentMethod is created. | +| [setCardCaptureAutomatic](dw.extensions.payments.SalesforcePaymentRequest.md#setcardcaptureautomaticboolean)([Boolean](TopLevel.Boolean.md)) | Sets if the credit card payment should be automatically captured at the time of the sale. | +| [setOptions](dw.extensions.payments.SalesforcePaymentRequest.md#setoptionsobject)([Object](TopLevel.Object.md)) |

          Sets the payment request options to use when a Buy Now button is tapped. | +| [setPayPalButtonsOptions](dw.extensions.payments.SalesforcePaymentRequest.md#setpaypalbuttonsoptionsobject)([Object](TopLevel.Object.md)) | Sets the the options to pass into the `paypal.Buttons` call. | +| [setPayPalShippingPreference](dw.extensions.payments.SalesforcePaymentRequest.md#setpaypalshippingpreferencestring)([String](TopLevel.String.md)) | Sets the PayPal order application context `shipping_preference` value. | +| [setPayPalUserAction](dw.extensions.payments.SalesforcePaymentRequest.md#setpaypaluseractionstring)([String](TopLevel.String.md)) | Sets the PayPal order application context `user_action` value. | +| [setReturnController](dw.extensions.payments.SalesforcePaymentRequest.md#setreturncontrollerstring)([String](TopLevel.String.md)) | Sets the controller to which to redirect when the shopper returns from a 3rd party payment website. | +| [setSavePaymentMethodEnabled](dw.extensions.payments.SalesforcePaymentRequest.md#setsavepaymentmethodenabledboolean)([Boolean](TopLevel.Boolean.md)) | Sets if mounted components may provide a control for the shopper to save their payment method for later use. | +| [setSetupFutureUsage](dw.extensions.payments.SalesforcePaymentRequest.md#setsetupfutureusageboolean)([Boolean](TopLevel.Boolean.md)) | Sets if the payment method should be always saved for future use off session. | +| [setStatementDescriptor](dw.extensions.payments.SalesforcePaymentRequest.md#setstatementdescriptorstring)([String](TopLevel.String.md)) | Sets the complete description that appears on your customers' statements for payments made by this request. | +| [setStripeCreateElementOptions](dw.extensions.payments.SalesforcePaymentRequest.md#setstripecreateelementoptionsstring-object)([String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Sets the the options to pass into the Stripe `elements.create` call for the given element type. | +| [setStripeElementsOptions](dw.extensions.payments.SalesforcePaymentRequest.md#setstripeelementsoptionsobject)([Object](TopLevel.Object.md)) | Sets the the options to pass into the `stripe.elements` call. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ELEMENT_AFTERPAY_CLEARPAY_MESSAGE + +- ELEMENT_AFTERPAY_CLEARPAY_MESSAGE: [String](TopLevel.String.md) = "afterpayClearpayMessage" + - : Element for the Stripe Afterpay/Clearpay message `"afterpayClearpayMessage"`. + + +--- + +### ELEMENT_CARD_CVC + +- ELEMENT_CARD_CVC: [String](TopLevel.String.md) = "cardCvc" + - : Element for the Stripe credit card CVC field `"cardCvc"`. + + +--- + +### ELEMENT_CARD_EXPIRY + +- ELEMENT_CARD_EXPIRY: [String](TopLevel.String.md) = "cardExpiry" + - : Element for the Stripe credit card expiration date field `"cardExpiry"`. + + +--- + +### ELEMENT_CARD_NUMBER + +- ELEMENT_CARD_NUMBER: [String](TopLevel.String.md) = "cardNumber" + - : Element for the Stripe credit card number field `"cardNumber"`. + + +--- + +### ELEMENT_EPS_BANK + +- ELEMENT_EPS_BANK: [String](TopLevel.String.md) = "epsBank" + - : Element for the Stripe EPS bank selection field `"epsBank"`. + + +--- + +### ELEMENT_IBAN + +- ELEMENT_IBAN: [String](TopLevel.String.md) = "iban" + - : Element for the Stripe IBAN field `"iban"`. + + +--- + +### ELEMENT_IDEAL_BANK + +- ELEMENT_IDEAL_BANK: [String](TopLevel.String.md) = "idealBank" + - : Element for the Stripe iDEAL bank selection field `"idealBank"`. + + +--- + +### ELEMENT_PAYMENT_REQUEST_BUTTON + +- ELEMENT_PAYMENT_REQUEST_BUTTON: [String](TopLevel.String.md) = "paymentRequestButton" + - : Element for the Stripe payment request button `"paymentRequestButton"`. + + +--- + +### ELEMENT_TYPE_AFTERPAY_CLEARPAY + +- ELEMENT_TYPE_AFTERPAY_CLEARPAY: [String](TopLevel.String.md) = "afterpay_clearpay" + - : Element type name for Afterpay. + + +--- + +### ELEMENT_TYPE_AFTERPAY_CLEARPAY_MESSAGE + +- ELEMENT_TYPE_AFTERPAY_CLEARPAY_MESSAGE: [String](TopLevel.String.md) = "afterpayclearpaymessage" + - : Element type name for Afterpay/Clearpay message. + + +--- + +### ELEMENT_TYPE_APPLEPAY + +- ELEMENT_TYPE_APPLEPAY: [String](TopLevel.String.md) = "applepay" + - : Element type name for Apple Pay payment request buttons. + + +--- + +### ELEMENT_TYPE_BANCONTACT + +- ELEMENT_TYPE_BANCONTACT: [String](TopLevel.String.md) = "bancontact" + - : Element type name for Bancontact. + + +--- + +### ELEMENT_TYPE_CARD + +- ELEMENT_TYPE_CARD: [String](TopLevel.String.md) = "card" + - : Element type name for credit cards. + + +--- + +### ELEMENT_TYPE_EPS + +- ELEMENT_TYPE_EPS: [String](TopLevel.String.md) = "eps" + - : Element type name for EPS. + + +--- + +### ELEMENT_TYPE_IDEAL + +- ELEMENT_TYPE_IDEAL: [String](TopLevel.String.md) = "ideal" + - : Element type name for iDEAL. + + +--- + +### ELEMENT_TYPE_PAYMENTREQUEST + +- ELEMENT_TYPE_PAYMENTREQUEST: [String](TopLevel.String.md) = "paymentrequest" + - : Element type name for other payment request buttons besides Apple Pay, like Google Pay. + + +--- + +### ELEMENT_TYPE_PAYPAL + +- ELEMENT_TYPE_PAYPAL: [String](TopLevel.String.md) = "paypal" + - : Element type name for PayPal in multi-step checkout. + + +--- + +### ELEMENT_TYPE_PAYPAL_EXPRESS + +- ELEMENT_TYPE_PAYPAL_EXPRESS: [String](TopLevel.String.md) = "paypalexpress" + - : Element type name for PayPal in express checkout. + + +--- + +### ELEMENT_TYPE_PAYPAL_MESSAGE + +- ELEMENT_TYPE_PAYPAL_MESSAGE: [String](TopLevel.String.md) = "paypalmessage" + - : Element type name for the PayPal messages component. + + +--- + +### ELEMENT_TYPE_SEPA_DEBIT + +- ELEMENT_TYPE_SEPA_DEBIT: [String](TopLevel.String.md) = "sepa_debit" + - : Element type name for SEPA debit. + + +--- + +### ELEMENT_TYPE_VENMO + +- ELEMENT_TYPE_VENMO: [String](TopLevel.String.md) = "venmo" + - : Element type name for Venmo in multi-step checkout. + + +--- + +### ELEMENT_TYPE_VENMO_EXPRESS + +- ELEMENT_TYPE_VENMO_EXPRESS: [String](TopLevel.String.md) = "venmoexpress" + - : Element type name for Venmo in express checkout. + + +--- + +### PAYPAL_SHIPPING_PREFERENCE_GET_FROM_FILE + +- PAYPAL_SHIPPING_PREFERENCE_GET_FROM_FILE: [String](TopLevel.String.md) = "GET_FROM_FILE" + - : PayPal application context `shipping_preference` value `"GET_FROM_FILE"`, to use the + customer-provided shipping address on the PayPal site. + + + +--- + +### PAYPAL_SHIPPING_PREFERENCE_NO_SHIPPING + +- PAYPAL_SHIPPING_PREFERENCE_NO_SHIPPING: [String](TopLevel.String.md) = "NO_SHIPPING" + - : PayPal application context `shipping_preference` value `"NO_SHIPPING"`, to redact the + shipping address from the PayPal site. Recommended for digital goods. + + + +--- + +### PAYPAL_SHIPPING_PREFERENCE_SET_PROVIDED_ADDRESS + +- PAYPAL_SHIPPING_PREFERENCE_SET_PROVIDED_ADDRESS: [String](TopLevel.String.md) = "SET_PROVIDED_ADDRESS" + - : PayPal application context `shipping_preference` value `"SET_PROVIDED_ADDRESS"`, to use the + merchant-provided address. The customer cannot change this address on the PayPal site. + + + +--- + +### PAYPAL_USER_ACTION_CONTINUE + +- PAYPAL_USER_ACTION_CONTINUE: [String](TopLevel.String.md) = "CONTINUE" + - : PayPal application context `user_action` value `"CONTINUE"`. Use this option when the final + amount is not known when the checkout flow is initiated and you want to redirect the customer to the merchant + page without processing the payment. + + + +--- + +### PAYPAL_USER_ACTION_PAY_NOW + +- PAYPAL_USER_ACTION_PAY_NOW: [String](TopLevel.String.md) = "PAY_NOW" + - : PayPal application context `user_action` value `"PAY_NOW"`. Use this option when the final + amount is known when the checkout is initiated and you want to process the payment immediately when the customer + clicks Pay Now. + + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the identifier of this payment request. + + +--- + +### basketData +- basketData: [Object](TopLevel.Object.md) + - : Returns a JS object containing the data used to prepare the shopper basket when a Buy Now button is tapped. + + **See Also:** + - [setBasketData(Object)](dw.extensions.payments.SalesforcePaymentRequest.md#setbasketdataobject) + + +--- + +### billingDetails +- billingDetails: [Object](TopLevel.Object.md) + - : Returns a JS object containing the billing details to use when a Stripe PaymentMethod is created. + + **See Also:** + - [setBillingDetails(Object)](dw.extensions.payments.SalesforcePaymentRequest.md#setbillingdetailsobject) + + +--- + +### cardCaptureAutomatic +- cardCaptureAutomatic: [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the credit card payment should be automatically captured at the time of the sale, or + `false` if the credit card payment should be captured later. + + + +--- + +### exclude +- exclude: [Set](dw.util.Set.md) `(read-only)` + - : + + Returns a set containing the element types to be explicitly excluded from mounted components. See the element + type constants in this class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **See Also:** + - [addExclude(String)](dw.extensions.payments.SalesforcePaymentRequest.md#addexcludestring) + + +--- + +### include +- include: [Set](dw.util.Set.md) `(read-only)` + - : + + Returns a set containing the specific element types to include in mounted components. If the set is + empty then all applicable and enabled element types will be included by default. See the element type constants + in this class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **See Also:** + - [addInclude(String)](dw.extensions.payments.SalesforcePaymentRequest.md#addincludestring) + + +--- + +### selector +- selector: [String](TopLevel.String.md) `(read-only)` + - : Returns the DOM element selector where to mount payment methods and/or express checkout buttons. + + +--- + +### setupFutureUsage +- setupFutureUsage: [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the payment method should be always saved for future use off session, or + `false` if the payment method should be only saved for future use on session when appropriate. + + + +--- + +### statementDescriptor +- statementDescriptor: [String](TopLevel.String.md) + - : Returns the complete description that appears on your customers' statements for payments made by this request, or + `null` if the default statement descriptor for your account will be used. + + + +--- + +## Constructor Details + +### SalesforcePaymentRequest(String, String) +- SalesforcePaymentRequest(id: [String](TopLevel.String.md), selector: [String](TopLevel.String.md)) + - : Constructs a payment request using the given identifiers. + + **Parameters:** + - id - identifier for payment request + - selector - DOM element selector where to mount payment methods and/or express checkout buttons + + **Throws:** + - Exception - if id or selector is null + + +--- + +## Method Details + +### addExclude(String) +- addExclude(elementType: [String](TopLevel.String.md)): void + - : + + Adds the given element type to explicitly exclude from mounted components. It is not necessary to explicitly + exclude element types that are not enabled for the site, or are not applicable for the current shopper and/or + their basket. See the element type constants in this class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **Parameters:** + - elementType - element type + + **See Also:** + - [getExclude()](dw.extensions.payments.SalesforcePaymentRequest.md#getexclude) + + +--- + +### addInclude(String) +- addInclude(elementType: [String](TopLevel.String.md)): void + - : + + Adds the given element type to include in mounted components. Call this method to include only a specific list of + element types to be presented when applicable and enabled for the site. See the element type constants in this + class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **Parameters:** + - elementType - element type + + **See Also:** + - [getInclude()](dw.extensions.payments.SalesforcePaymentRequest.md#getinclude) + + +--- + +### calculatePaymentRequestOptions(Basket, Object) +- static calculatePaymentRequestOptions(basket: [Basket](dw.order.Basket.md), options: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : + + Returns a JS object containing the payment request options to use when a Pay Now button is tapped, in the + appropriate format for use in client side JavaScript, with data calculated from the given basket. This method is + provided as a convenience to calculate updated payment request options when the shopper basket has changed. Data + in the given `options` object like `total`, `displayItems`, and + `shippingOptions` will be replaced in the returned object by values recalculated from the given + `basket` and applicable shipping methods. + + + + + The following example shows the resulting output for a basket and sample options. + + + + ``` + SalesforcePaymentRequest.calculatePaymentRequestOptions(basket, { + requestPayerName: true, + requestPayerEmail: true, + requestPayerPhone: false, + requestShipping: true + }); + ``` + + + + returns + + + + ``` + { + currency: 'gbp', + total: { + label: 'Total', + amount: '2644' + }, + displayItems: [{ + label: 'Subtotal', + amount: '1919' + }, { + label: 'Tax', + amount: '126' + }, { + label: 'Ground', + amount: '599' + }], + requestPayerName: true, + requestPayerEmail: true, + requestPayerPhone: false, + requestShipping: true, + shippingOptions: [{ + id: 'GBP001', + label: 'Ground', + detail: 'Order received within 7-10 business days', + amount: '599' + },{ + id: 'GBP002', + label: 'Express', + detail: 'Order received within 2-4 business days', + amount: '999' + }] + } + ``` + + + **Parameters:** + - options - JS object containing payment request options in B2C Commerce API standard format + + **Returns:** + - JS object containing equivalent payment request options in Stripe JS API format + + +--- + +### format(Object) +- static format(options: [Object](TopLevel.Object.md)): [Object](TopLevel.Object.md) + - : + + Returns a JS object containing the payment request options to use when a Buy Now button is tapped, in the + appropriate format for use in client side JavaScript. This method is provided as a convenience to adjust values + in B2C Commerce API standard formats to their equivalents as expected by Stripe JS APIs. The following example + shows options set in B2C Commerce API format, and the resulting output. + + + + ``` + SalesforcePaymentRequest.format({ + currency: 'GBP', + total: { + label: 'Total', + amount: '26.44' + }, + displayItems: [{ + label: 'Subtotal', + amount: '19.19' + }, { + label: 'Tax', + amount: '1.26' + }, { + label: 'Ground', + amount: '5.99' + }], + requestPayerPhone: false, + shippingOptions: [{ + id: 'GBP001', + label: 'Ground', + detail: 'Order received within 7-10 business days', + amount: '5.99' + }] + }); + ``` + + + + returns + + + + ``` + { + currency: 'gbp', + total: { + label: 'Total', + amount: '2644' + }, + displayItems: [{ + label: 'Subtotal', + amount: '1919' + }, { + label: 'Tax', + amount: '126' + }, { + label: 'Ground', + amount: '599' + }], + requestPayerPhone: false, + shippingOptions: [{ + id: 'GBP001', + label: 'Ground', + detail: 'Order received within 7-10 business days', + amount: '599' + }] + } + ``` + + + **Parameters:** + - options - JS object containing payment request options in B2C Commerce API standard format + + **Returns:** + - JS object containing equivalent payment request options in Stripe JS API format + + +--- + +### getBasketData() +- getBasketData(): [Object](TopLevel.Object.md) + - : Returns a JS object containing the data used to prepare the shopper basket when a Buy Now button is tapped. + + **Returns:** + - JS object containing the basket data + + **See Also:** + - [setBasketData(Object)](dw.extensions.payments.SalesforcePaymentRequest.md#setbasketdataobject) + + +--- + +### getBillingDetails() +- getBillingDetails(): [Object](TopLevel.Object.md) + - : Returns a JS object containing the billing details to use when a Stripe PaymentMethod is created. + + **Returns:** + - JS object containing the billing details + + **See Also:** + - [setBillingDetails(Object)](dw.extensions.payments.SalesforcePaymentRequest.md#setbillingdetailsobject) + + +--- + +### getCardCaptureAutomatic() +- getCardCaptureAutomatic(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the credit card payment should be automatically captured at the time of the sale, or + `false` if the credit card payment should be captured later. + + + **Returns:** + - `true` if the credit card payment should be automatically captured at the time of the sale, + `false` if the credit card payment should be captured later. + + + +--- + +### getExclude() +- getExclude(): [Set](dw.util.Set.md) + - : + + Returns a set containing the element types to be explicitly excluded from mounted components. See the element + type constants in this class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **Returns:** + - set of element types + + **See Also:** + - [addExclude(String)](dw.extensions.payments.SalesforcePaymentRequest.md#addexcludestring) + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the identifier of this payment request. + + **Returns:** + - payment request identifier + + +--- + +### getInclude() +- getInclude(): [Set](dw.util.Set.md) + - : + + Returns a set containing the specific element types to include in mounted components. If the set is + empty then all applicable and enabled element types will be included by default. See the element type constants + in this class for the full list of supported element types. + + + + + Note: if an element type is both explicitly included and excluded, it will not be presented. + + + **Returns:** + - set of element types + + **See Also:** + - [addInclude(String)](dw.extensions.payments.SalesforcePaymentRequest.md#addincludestring) + + +--- + +### getSelector() +- getSelector(): [String](TopLevel.String.md) + - : Returns the DOM element selector where to mount payment methods and/or express checkout buttons. + + **Returns:** + - DOM element selector + + +--- + +### getSetupFutureUsage() +- getSetupFutureUsage(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the payment method should be always saved for future use off session, or + `false` if the payment method should be only saved for future use on session when appropriate. + + + **Returns:** + - `true` if the payment method should be always saved for future use off session, + `false` if the payment method should be only saved for future use on session when appropriate. + + + +--- + +### getStatementDescriptor() +- getStatementDescriptor(): [String](TopLevel.String.md) + - : Returns the complete description that appears on your customers' statements for payments made by this request, or + `null` if the default statement descriptor for your account will be used. + + + **Returns:** + - statement descriptor for payments made by this request, or `null` if the account default will + be used + + + +--- + +### setBasketData(Object) +- setBasketData(basketData: [Object](TopLevel.Object.md)): void + - : + + Sets the data used to prepare the shopper basket when a Buy Now button is tapped. For convenience this method + accepts a JS object to set all of the following properties at once: + + + + - `sku`- SKU of the product to add exclusively to the basket (required) + - `quantity`- integer quantity of the product, default is 1 + - `shippingMethod`- ID of the shipping method to set on the shipment, default is the site default shipping method for the basket currency + - `options`- JS array containing one JS object per selected product option, default is no selected options + - `id`- product option ID + - `valueId`- product option value ID + + + + The following example shows how to set all of the supported basket data. + + + + ``` + request.setBasketData({ + sku: 'tv-pdp-6010fdM', + quantity: 1, + shippingMethod: '001', + options: [{ + id: 'tvWarranty', + valueId: '000' + }] + }); + ``` + + + **Parameters:** + - basketData - JS object containing the basket data + + **See Also:** + - [getBasketData()](dw.extensions.payments.SalesforcePaymentRequest.md#getbasketdata) + + +--- + +### setBillingDetails(Object) +- setBillingDetails(billingDetails: [Object](TopLevel.Object.md)): void + - : Sets the billing details to use when a Stripe PaymentMethod is created. For convenience this method accepts a + JS object to set all details at once. The following example shows how to set details including address. + + + + ``` + request.setBillingDetails({ + address: { + city: 'Wien', + country: 'AT', + line1: 'Opernring 2', + postal_code: '1010' + }, + email: 'jhummel@salesforce.com', + name: 'Johann Hummel' + }); + ``` + + + + For more information on the available billing details see the Stripe create PaymentMethod API + documentation. + + + **Parameters:** + - billingDetails - JS object containing the billing details + + +--- + +### setCardCaptureAutomatic(Boolean) +- setCardCaptureAutomatic(cardCaptureAutomatic: [Boolean](TopLevel.Boolean.md)): void + - : Sets if the credit card payment should be automatically captured at the time of the sale. + + **Parameters:** + - cardCaptureAutomatic - `true` if the credit card payment should be automatically captured at the time of the sale, or `false` if the credit card payment should be captured later. + + +--- + +### setOptions(Object) +- setOptions(options: [Object](TopLevel.Object.md)): void + - : + + Sets the payment request options to use when a Buy Now button is tapped. For convenience this method accepts a + JS object to set all options at once. The following example shows how to set options including currency, + labels, and amounts, in B2C Commerce API format. + + + + ``` + request.setOptions({ + currency: 'GBP', + total: { + label: 'Total', + amount: '26.44' + }, + displayItems: [{ + label: 'Subtotal', + amount: '19.19' + }, { + label: 'Tax', + amount: '1.26' + }, { + label: 'Ground', + amount: '5.99' + }], + requestPayerPhone: false, + shippingOptions: [{ + id: 'GBP001', + label: 'Ground', + detail: 'Order received within 7-10 business days', + amount: '5.99' + }] + }); + ``` + + + + The `total` option must match the total that will result from preparing the shopper basket using the + data provided to [setBasketData(Object)](dw.extensions.payments.SalesforcePaymentRequest.md#setbasketdataobject) in this request. The `id` of each JS object in the + `shippingOptions` array must equal the ID of the corresponding site shipping method that the shopper + may select in the browser payment app. + + + + + For more information on the available payment request options see the Stripe Payment Request object API + documentation. + + + + + Note: The Stripe Payment Request `country` option will be set automatically to the country of the + Salesforce Payments account associated with the Commerce Cloud instance and is not included here. + + + **Parameters:** + - options - JS object containing the payment request options + + +--- + +### setPayPalButtonsOptions(Object) +- setPayPalButtonsOptions(options: [Object](TopLevel.Object.md)): void + - : Sets the the options to pass into the `paypal.Buttons` call. For more information see the PayPal + Buttons API documentation. + + + **Parameters:** + - options - JS object containing the options + + +--- + +### setPayPalShippingPreference(String) +- setPayPalShippingPreference(shippingPreference: [String](TopLevel.String.md)): void + - : Sets the PayPal order application context `shipping_preference` value. For more information see the + PayPal Orders API documentation. + + + **Parameters:** + - shippingPreference - constant indicating the shipping preference + + **See Also:** + - [PAYPAL_SHIPPING_PREFERENCE_GET_FROM_FILE](dw.extensions.payments.SalesforcePaymentRequest.md#paypal_shipping_preference_get_from_file) + - [PAYPAL_SHIPPING_PREFERENCE_NO_SHIPPING](dw.extensions.payments.SalesforcePaymentRequest.md#paypal_shipping_preference_no_shipping) + - [PAYPAL_SHIPPING_PREFERENCE_SET_PROVIDED_ADDRESS](dw.extensions.payments.SalesforcePaymentRequest.md#paypal_shipping_preference_set_provided_address) + + +--- + +### setPayPalUserAction(String) +- setPayPalUserAction(userAction: [String](TopLevel.String.md)): void + - : Sets the PayPal order application context `user_action` value. For more information see the PayPal + Orders API documentation. + + + **Parameters:** + - userAction - constant indicating the user action + + **See Also:** + - [PAYPAL_USER_ACTION_CONTINUE](dw.extensions.payments.SalesforcePaymentRequest.md#paypal_user_action_continue) + - [PAYPAL_USER_ACTION_PAY_NOW](dw.extensions.payments.SalesforcePaymentRequest.md#paypal_user_action_pay_now) + + +--- + +### setReturnController(String) +- setReturnController(returnController: [String](TopLevel.String.md)): void + - : Sets the controller to which to redirect when the shopper returns from a 3rd party payment website. Default is + the controller for the current page. + + + **Parameters:** + - returnController - return controller, such as `"Cart-Show"` + + +--- + +### setSavePaymentMethodEnabled(Boolean) +- setSavePaymentMethodEnabled(savePaymentMethodEnabled: [Boolean](TopLevel.Boolean.md)): void + - : Sets if mounted components may provide a control for the shopper to save their payment method for later use. When + set to `false` no control will be provided. When set to `true` a control may be provided, + if applicable for the shopper and presented payment method, but is not guaranteed. + + + **Parameters:** + - savePaymentMethodEnabled - if mounted components may provide a control for the shopper to save their payment method + + +--- + +### setSetupFutureUsage(Boolean) +- setSetupFutureUsage(setupFutureUsage: [Boolean](TopLevel.Boolean.md)): void + - : Sets if the payment method should be always saved for future use off session. + + **Parameters:** + - setupFutureUsage - `true` if the payment method should be always saved for future use off session, or `false` if the payment method should be only saved for future use on session when appropriate. + + +--- + +### setStatementDescriptor(String) +- setStatementDescriptor(statementDescriptor: [String](TopLevel.String.md)): void + - : Sets the complete description that appears on your customers' statements for payments made by this request. Set + this to `null` to use the default statement descriptor for your account. + + + **Parameters:** + - statementDescriptor - statement descriptor for payments made by this request, or `null` to use the account default + + +--- + +### setStripeCreateElementOptions(String, Object) +- setStripeCreateElementOptions(element: [String](TopLevel.String.md), options: [Object](TopLevel.Object.md)): void + - : Sets the the options to pass into the Stripe `elements.create` call for the given element type. For + more information see the Stripe Elements API documentation. + + + **Parameters:** + - element - name of the Stripe element whose creation to configure + - options - JS object containing the options + + **See Also:** + - [ELEMENT_AFTERPAY_CLEARPAY_MESSAGE](dw.extensions.payments.SalesforcePaymentRequest.md#element_afterpay_clearpay_message) + - [ELEMENT_CARD_CVC](dw.extensions.payments.SalesforcePaymentRequest.md#element_card_cvc) + - [ELEMENT_CARD_EXPIRY](dw.extensions.payments.SalesforcePaymentRequest.md#element_card_expiry) + - [ELEMENT_CARD_NUMBER](dw.extensions.payments.SalesforcePaymentRequest.md#element_card_number) + - [ELEMENT_EPS_BANK](dw.extensions.payments.SalesforcePaymentRequest.md#element_eps_bank) + - [ELEMENT_IBAN](dw.extensions.payments.SalesforcePaymentRequest.md#element_iban) + - [ELEMENT_IDEAL_BANK](dw.extensions.payments.SalesforcePaymentRequest.md#element_ideal_bank) + - [ELEMENT_PAYMENT_REQUEST_BUTTON](dw.extensions.payments.SalesforcePaymentRequest.md#element_payment_request_button) + + +--- + +### setStripeElementsOptions(Object) +- setStripeElementsOptions(options: [Object](TopLevel.Object.md)): void + - : Sets the the options to pass into the `stripe.elements` call. For more information see the Stripe + Elements API documentation. + + + **Parameters:** + - options - JS object containing the options + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsHooks.md new file mode 100644 index 00000000..fbdcda93 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsHooks.md @@ -0,0 +1,166 @@ + +# Class SalesforcePaymentsHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsHooks](dw.extensions.payments.SalesforcePaymentsHooks.md) + + + +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"}, + {"name": "dw.extensions.payments.adyenNotification", "script": "./payments.js"}, + {"name": "dw.extensions.payments.sendOrderConfirmationEmail", "script": "./emails.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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointAdyenNotification](#extensionpointadyennotification): [String](TopLevel.String.md) = "dw.extensions.payments.adyenNotification" | The extension point name dw.extensions.payments.adyenNotification. | +| [extensionPointAsyncPaymentSucceeded](#extensionpointasyncpaymentsucceeded): [String](TopLevel.String.md) = "dw.extensions.payments.asyncPaymentSucceeded" | The extension point name dw.extensions.payments.asyncPaymentSucceeded. | +| [extensionPointSendOrderConfirmationEmail](#extensionpointsendorderconfirmationemail): [String](TopLevel.String.md) = "dw.extensions.payments.sendOrderConfirmationEmail" | The extension point name dw.extensions.payments.sendOrderConfirmationEmail. | +| [extensionPointStripePaymentEvent](#extensionpointstripepaymentevent): [String](TopLevel.String.md) = "dw.extensions.payments.stripePaymentEvent" | The extension point name dw.extensions.payments.stripePaymentEvent. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [adyenNotification](dw.extensions.payments.SalesforcePaymentsHooks.md#adyennotificationorder)([Order](dw.order.Order.md)) | Called when an Adyen webhook notification is received for the given order. | +| [asyncPaymentSucceeded](dw.extensions.payments.SalesforcePaymentsHooks.md#asyncpaymentsucceededorder)([Order](dw.order.Order.md)) | Called when asynchronous payment succeeded for the given order. | +| [sendOrderConfirmationEmail](dw.extensions.payments.SalesforcePaymentsHooks.md#sendorderconfirmationemailorder)([Order](dw.order.Order.md)) | Called to send order confirmation email after successful payment processing. | +| [stripePaymentEvent](dw.extensions.payments.SalesforcePaymentsHooks.md#stripepaymenteventstring-order)([String](TopLevel.String.md), [Order](dw.order.Order.md)) | Called when a Stripe payment event is received for the given order. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointAdyenNotification + +- extensionPointAdyenNotification: [String](TopLevel.String.md) = "dw.extensions.payments.adyenNotification" + - : The extension point name dw.extensions.payments.adyenNotification. + + +--- + +### extensionPointAsyncPaymentSucceeded + +- extensionPointAsyncPaymentSucceeded: [String](TopLevel.String.md) = "dw.extensions.payments.asyncPaymentSucceeded" + - : The extension point name dw.extensions.payments.asyncPaymentSucceeded. + + +--- + +### extensionPointSendOrderConfirmationEmail + +- extensionPointSendOrderConfirmationEmail: [String](TopLevel.String.md) = "dw.extensions.payments.sendOrderConfirmationEmail" + - : The extension point name dw.extensions.payments.sendOrderConfirmationEmail. + + +--- + +### extensionPointStripePaymentEvent + +- extensionPointStripePaymentEvent: [String](TopLevel.String.md) = "dw.extensions.payments.stripePaymentEvent" + - : The extension point name dw.extensions.payments.stripePaymentEvent. + + +--- + +## Method Details + +### adyenNotification(Order) +- adyenNotification(order: [Order](dw.order.Order.md)): [Status](dw.system.Status.md) + - : Called when an Adyen webhook notification is received for the given order. + + **Parameters:** + - order - the order for which the notification was received + + **Returns:** + - a non-null result ends the hook execution, and is ignored + + +--- + +### asyncPaymentSucceeded(Order) +- asyncPaymentSucceeded(order: [Order](dw.order.Order.md)): [Status](dw.system.Status.md) + - : Called when asynchronous payment succeeded for the given order. + + **Parameters:** + - order - the order whose asynchronous payment succeeded + + **Returns:** + - a non-null result ends the hook execution, and is ignored + + +--- + +### sendOrderConfirmationEmail(Order) +- sendOrderConfirmationEmail(order: [Order](dw.order.Order.md)): [Status](dw.system.Status.md) + - : Called to send order confirmation email after successful payment processing. + + **Parameters:** + - order - the order for which to send confirmation email + + **Returns:** + - a non-null result ends the hook execution + + +--- + +### stripePaymentEvent(String, Order) +- stripePaymentEvent(eventName: [String](TopLevel.String.md), order: [Order](dw.order.Order.md)): [Status](dw.system.Status.md) + - : Called when a Stripe payment event is received for the given order. + + **Parameters:** + - eventName - the Stripe event name, such as `"payment_intent.succeeded"` + - order - the order for which the event was received + + **Returns:** + - a non-null result ends the hook execution, and is ignored + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccount.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccount.md new file mode 100644 index 00000000..2ae3c653 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccount.md @@ -0,0 +1,151 @@ + +# Class SalesforcePaymentsMerchantAccount + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md) + +Contains information about a merchant account configured for use with Salesforce Payments. See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [accountId](#accountid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the Salesforce Payments merchant account. | +| [accountType](#accounttype): [String](TopLevel.String.md) `(read-only)` | Returns the type of the Salesforce Payments merchant account and environment, such as `"STRIPE_TEST"` or `"ADYEN_LIVE"`. | +| [config](#config): [Object](TopLevel.Object.md) `(read-only)` | Returns an opaque configuration object containing gateway-specific information. | +| [live](#live): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if the account takes live payments, or `false` if it takes test payments. | +| [vendor](#vendor): [String](TopLevel.String.md) `(read-only)` | Returns the name of the gateway vendor, such as `"Stripe"` or `"Adyen"`. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAccountId](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md#getaccountid)() | Returns the ID of the Salesforce Payments merchant account. | +| [getAccountType](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md#getaccounttype)() | Returns the type of the Salesforce Payments merchant account and environment, such as `"STRIPE_TEST"` or `"ADYEN_LIVE"`. | +| [getConfig](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md#getconfig)() | Returns an opaque configuration object containing gateway-specific information. | +| [getVendor](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md#getvendor)() | Returns the name of the gateway vendor, such as `"Stripe"` or `"Adyen"`. | +| [isLive](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md#islive)() | Returns `true` if the account takes live payments, or `false` if it takes test payments. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### accountId +- accountId: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the Salesforce Payments merchant account. + + **See Also:** + - [PaymentTransaction.setAccountID(String)](dw.order.PaymentTransaction.md#setaccountidstring) + - [PaymentTransaction.getAccountID()](dw.order.PaymentTransaction.md#getaccountid) + + +--- + +### accountType +- accountType: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of the Salesforce Payments merchant account and environment, such as `"STRIPE_TEST"` + or `"ADYEN_LIVE"`. + + + **See Also:** + - [PaymentTransaction.setAccountType(String)](dw.order.PaymentTransaction.md#setaccounttypestring) + - [PaymentTransaction.getAccountType()](dw.order.PaymentTransaction.md#getaccounttype) + + +--- + +### config +- config: [Object](TopLevel.Object.md) `(read-only)` + - : Returns an opaque configuration object containing gateway-specific information. Do not depend on the structure or + contents of this object as they may change at any time. + + + +--- + +### live +- live: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if the account takes live payments, or `false` if it takes test payments. + + +--- + +### vendor +- vendor: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the gateway vendor, such as `"Stripe"` or `"Adyen"`. + + +--- + +## Method Details + +### getAccountId() +- getAccountId(): [String](TopLevel.String.md) + - : Returns the ID of the Salesforce Payments merchant account. + + **Returns:** + - merchant account ID + + **See Also:** + - [PaymentTransaction.setAccountID(String)](dw.order.PaymentTransaction.md#setaccountidstring) + - [PaymentTransaction.getAccountID()](dw.order.PaymentTransaction.md#getaccountid) + + +--- + +### getAccountType() +- getAccountType(): [String](TopLevel.String.md) + - : Returns the type of the Salesforce Payments merchant account and environment, such as `"STRIPE_TEST"` + or `"ADYEN_LIVE"`. + + + **Returns:** + - merchant account type + + **See Also:** + - [PaymentTransaction.setAccountType(String)](dw.order.PaymentTransaction.md#setaccounttypestring) + - [PaymentTransaction.getAccountType()](dw.order.PaymentTransaction.md#getaccounttype) + + +--- + +### getConfig() +- getConfig(): [Object](TopLevel.Object.md) + - : Returns an opaque configuration object containing gateway-specific information. Do not depend on the structure or + contents of this object as they may change at any time. + + + **Returns:** + - opaque configuration object + + +--- + +### getVendor() +- getVendor(): [String](TopLevel.String.md) + - : Returns the name of the gateway vendor, such as `"Stripe"` or `"Adyen"`. + + **Returns:** + - gateway vendor name + + +--- + +### isLive() +- isLive(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if the account takes live payments, or `false` if it takes test payments. + + **Returns:** + - `true` if the account takes live payments + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md new file mode 100644 index 00000000..4f9fe677 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md @@ -0,0 +1,98 @@ + +# Class SalesforcePaymentsMerchantAccountPaymentMethod + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod](dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md) + +Contains information about a payment method to be presented to a payer, as configured for a Salesforce Payments +merchant account. See Salesforce Payments documentation for how to gain access and configure it for use on your +sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [merchantAccount](#merchantaccount): [SalesforcePaymentsMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md) `(read-only)` | Returns the merchant account configured for this payment method. | +| [paymentMethodType](#paymentmethodtype): [String](TopLevel.String.md) `(read-only)` | Returns the constant indicating the type of payment method to be presented, such as [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). | +| [paymentModes](#paymentmodes): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection containing the payment modes for which this payment method is to be presented, such as `"Express"`. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md#getmerchantaccount)() | Returns the merchant account configured for this payment method. | +| [getPaymentMethodType](dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md#getpaymentmethodtype)() | Returns the constant indicating the type of payment method to be presented, such as [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). | +| [getPaymentModes](dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md#getpaymentmodes)() | Returns a collection containing the payment modes for which this payment method is to be presented, such as `"Express"`. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### merchantAccount +- merchantAccount: [SalesforcePaymentsMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md) `(read-only)` + - : Returns the merchant account configured for this payment method. + + +--- + +### paymentMethodType +- paymentMethodType: [String](TopLevel.String.md) `(read-only)` + - : Returns the constant indicating the type of payment method to be presented, such as + [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). + + + +--- + +### paymentModes +- paymentModes: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection containing the payment modes for which this payment method is to be presented, such as + `"Express"`. + + + +--- + +## Method Details + +### getMerchantAccount() +- getMerchantAccount(): [SalesforcePaymentsMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md) + - : Returns the merchant account configured for this payment method. + + **Returns:** + - merchant account + + +--- + +### getPaymentMethodType() +- getPaymentMethodType(): [String](TopLevel.String.md) + - : Returns the constant indicating the type of payment method to be presented, such as + [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). + + + **Returns:** + - payment method type + + +--- + +### getPaymentModes() +- getPaymentModes(): [Collection](dw.util.Collection.md) + - : Returns a collection containing the payment modes for which this payment method is to be presented, such as + `"Express"`. + + + **Returns:** + - collection of payment modes + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMgr.md new file mode 100644 index 00000000..0e28fabe --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMgr.md @@ -0,0 +1,941 @@ + +# Class SalesforcePaymentsMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsMgr](dw.extensions.payments.SalesforcePaymentsMgr.md) + +Contains functionality for use with Salesforce Payments. See Salesforce Payments documentation for how to gain access +and configure it for use on your sites. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CANCELLATION_REASON_ABANDONED](#cancellation_reason_abandoned): [String](TopLevel.String.md) = "abandoned" | Cancellation reason indicating customer abandoned payment. | +| [CANCELLATION_REASON_DUPLICATE](#cancellation_reason_duplicate): [String](TopLevel.String.md) = "duplicate" | Cancellation reason indicating payment intent was a duplicate. | +| [CANCELLATION_REASON_FRAUDULENT](#cancellation_reason_fraudulent): [String](TopLevel.String.md) = "fraudulent" | Cancellation reason indicating payment was fraudulent. | +| [CANCELLATION_REASON_REQUESTED_BY_CUSTOMER](#cancellation_reason_requested_by_customer): [String](TopLevel.String.md) = "requested_by_customer" | Cancellation reason indicating customer action or request. | +| [REFUND_REASON_DUPLICATE](#refund_reason_duplicate): [String](TopLevel.String.md) = "duplicate" | Refund reason indicating payment intent was a duplicate. | +| [REFUND_REASON_FRAUDULENT](#refund_reason_fraudulent): [String](TopLevel.String.md) = "fraudulent" | Refund reason indicating payment was fraudulent. | +| [REFUND_REASON_REQUESTED_BY_CUSTOMER](#refund_reason_requested_by_customer): [String](TopLevel.String.md) = "requested_by_customer" | Refund reason indicating customer action or request. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [paymentsSiteConfig](#paymentssiteconfig): [SalesforcePaymentsSiteConfiguration](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md) `(read-only)` | Returns a payments site configuration object for the current site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| ~~static [attachPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#attachpaymentmethodsalesforcepaymentmethod-customer)([SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md), [Customer](dw.customer.Customer.md))~~ | Attaches the given payment method to the given customer. | +| static [authorizePayPalOrder](dw.extensions.payments.SalesforcePaymentsMgr.md#authorizepaypalordersalesforcepaypalorder)([SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)) | Authorizes the given PayPal order. | +| static [cancelPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#cancelpaymentintentsalesforcepaymentintent-object)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Object](TopLevel.Object.md)) | Cancels the given payment intent. | +| static [captureAdyenPayment](dw.extensions.payments.SalesforcePaymentsMgr.md#captureadyenpaymentorderpaymentinstrument-money-object)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) | Captures funds for the given order payment instrument. | +| static [capturePayPalOrder](dw.extensions.payments.SalesforcePaymentsMgr.md#capturepaypalordersalesforcepaypalorder)([SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)) | Captures funds for the given PayPal order. | +| static [capturePaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#capturepaymentintentsalesforcepaymentintent-money)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Money](dw.value.Money.md)) | Captures funds for the given payment intent. | +| static [confirmPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#confirmpaymentintentorder-salesforcepaymentmethod-object)([Order](dw.order.Order.md), [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md), [Object](TopLevel.Object.md)) |

          Confirms a new payment intent using the given payment method, and associates it with the given order. | +| static [createAdyenPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#createadyenpaymentintentorder-shipment-string-money-boolean-object-object)([Order](dw.order.Order.md), [Shipment](dw.order.Shipment.md), [String](TopLevel.String.md), [Money](dw.value.Money.md), [Boolean](TopLevel.Boolean.md), [Object](TopLevel.Object.md), [Object](TopLevel.Object.md)) |

          Creates an Adyen payment intent using the given information, and associates it with the given order. | +| static [createPayPalOrder](dw.extensions.payments.SalesforcePaymentsMgr.md#createpaypalorderbasket-shipment-string-money-object)([Basket](dw.order.Basket.md), [Shipment](dw.order.Shipment.md), [String](TopLevel.String.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) |

          Creates a PayPal order using the given information, and associates it with the given basket. | +| static [createPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#createpaymentintentbasket-shipment-string-money-boolean-object)([Basket](dw.order.Basket.md), [Shipment](dw.order.Shipment.md), [String](TopLevel.String.md), [Money](dw.value.Money.md), [Boolean](TopLevel.Boolean.md), [Object](TopLevel.Object.md)) |

          Creates a payment intent using the given information, and associates it with the given basket. | +| ~~static [detachPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#detachpaymentmethodsalesforcepaymentmethod)([SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md))~~ | Detaches the given payment method from its associated customer. | +| static [getAdyenSavedPaymentMethods](dw.extensions.payments.SalesforcePaymentsMgr.md#getadyensavedpaymentmethodscustomer)([Customer](dw.customer.Customer.md)) | Returns a collection containing the Adyen payment methods saved to be presented to the given customer for reuse in checkouts. | +| ~~static [getAttachedPaymentMethods](dw.extensions.payments.SalesforcePaymentsMgr.md#getattachedpaymentmethodscustomer)([Customer](dw.customer.Customer.md))~~ | Returns a collection containing the payment methods attached to the given customer. | +| static [getOffSessionPaymentMethods](dw.extensions.payments.SalesforcePaymentsMgr.md#getoffsessionpaymentmethodscustomer)([Customer](dw.customer.Customer.md)) | Returns a collection containing the payment methods for the given customer set up for future off session reuse. | +| static [getPayPalOrder](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaypalorderbasket)([Basket](dw.order.Basket.md)) | Returns the PayPal order for the given basket, or `null` if the given basket has none. | +| static [getPayPalOrder](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaypalorderorder)([Order](dw.order.Order.md)) | Returns the PayPal order for the given order, or `null` if the given order has none. | +| static [getPaymentDetails](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaymentdetailsorderpaymentinstrument)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)) | Returns the details to the Salesforce Payments payment associated with the given payment instrument, or `null` if the given payment instrument has none. | +| static [getPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaymentintentbasket)([Basket](dw.order.Basket.md)) | Returns the payment intent for the given basket, or `null` if the given basket has none. | +| static [getPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaymentintentorder)([Order](dw.order.Order.md)) | Returns the payment intent for the given order, or `null` if the given order has none. | +| static [getPaymentsSiteConfig](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaymentssiteconfig)() | Returns a payments site configuration object for the current site. | +| static [getPaymentsZone](dw.extensions.payments.SalesforcePaymentsMgr.md#getpaymentszonestring)([String](TopLevel.String.md)) | Returns a payments zone object for the passed in payments zone ID. | +| static [getSavedPaymentMethods](dw.extensions.payments.SalesforcePaymentsMgr.md#getsavedpaymentmethodscustomer)([Customer](dw.customer.Customer.md)) | Returns a collection containing the payment methods saved to be presented to the given customer for reuse in checkouts. | +| static [handleAdyenAdditionalDetails](dw.extensions.payments.SalesforcePaymentsMgr.md#handleadyenadditionaldetailsorder-string-object)([Order](dw.order.Order.md), [String](TopLevel.String.md), [Object](TopLevel.Object.md)) |

          Handles the given additional Adyen payment details and associates the associated payment with the given order, if applicable. | +| static [onCustomerRegistered](dw.extensions.payments.SalesforcePaymentsMgr.md#oncustomerregisteredorder)([Order](dw.order.Order.md)) | Handles the account registration of the shopper who placed the given order. | +| static [refundAdyenPayment](dw.extensions.payments.SalesforcePaymentsMgr.md#refundadyenpaymentorderpaymentinstrument-money-object)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) | Refunds previously captured funds for the given order payment instrument. | +| static [refundPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#refundpaymentintentsalesforcepaymentintent-money-object)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) | Refunds previously captured funds for the given payment intent. | +| static [removeAdyenSavedPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#removeadyensavedpaymentmethodsalesforceadyensavedpaymentmethod)([SalesforceAdyenSavedPaymentMethod](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md)) | Deletes an Adyen saved payment method. | +| static [removeSavedPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#removesavedpaymentmethodsalesforcepaymentmethod)([SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)) | Removes the given saved payment method so that it is no longer presented to the given customer for reuse in checkouts. | +| static [resolvePaymentsZone](dw.extensions.payments.SalesforcePaymentsMgr.md#resolvepaymentszoneobject)([Object](TopLevel.Object.md)) | Resolves and returns the payments zone object for the passed in payments zone properties object. | +| static [reverseAdyenPayment](dw.extensions.payments.SalesforcePaymentsMgr.md#reverseadyenpaymentorderpaymentinstrument-object)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Object](TopLevel.Object.md)) | Reverses the authorisation for the given order payment instrument. | +| static [savePaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#savepaymentmethodcustomer-salesforcepaymentmethod)([Customer](dw.customer.Customer.md), [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)) | Saves the given payment method to be presented to the given customer for reuse in subsequent checkouts. | +| static [setPaymentDetails](dw.extensions.payments.SalesforcePaymentsMgr.md#setpaymentdetailsorderpaymentinstrument-salesforcepaymentdetails)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md)) | Sets the details to the Salesforce Payments payment associated with the given payment instrument. | +| static [updatePaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#updatepaymentintentsalesforcepaymentintent-shipment-money-string-object)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Shipment](dw.order.Shipment.md), [Money](dw.value.Money.md), [String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Updates the provided information in the given payment intent. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CANCELLATION_REASON_ABANDONED + +- CANCELLATION_REASON_ABANDONED: [String](TopLevel.String.md) = "abandoned" + - : Cancellation reason indicating customer abandoned payment. + + +--- + +### CANCELLATION_REASON_DUPLICATE + +- CANCELLATION_REASON_DUPLICATE: [String](TopLevel.String.md) = "duplicate" + - : Cancellation reason indicating payment intent was a duplicate. + + +--- + +### CANCELLATION_REASON_FRAUDULENT + +- CANCELLATION_REASON_FRAUDULENT: [String](TopLevel.String.md) = "fraudulent" + - : Cancellation reason indicating payment was fraudulent. + + +--- + +### CANCELLATION_REASON_REQUESTED_BY_CUSTOMER + +- CANCELLATION_REASON_REQUESTED_BY_CUSTOMER: [String](TopLevel.String.md) = "requested_by_customer" + - : Cancellation reason indicating customer action or request. + + +--- + +### REFUND_REASON_DUPLICATE + +- REFUND_REASON_DUPLICATE: [String](TopLevel.String.md) = "duplicate" + - : Refund reason indicating payment intent was a duplicate. + + +--- + +### REFUND_REASON_FRAUDULENT + +- REFUND_REASON_FRAUDULENT: [String](TopLevel.String.md) = "fraudulent" + - : Refund reason indicating payment was fraudulent. + + +--- + +### REFUND_REASON_REQUESTED_BY_CUSTOMER + +- REFUND_REASON_REQUESTED_BY_CUSTOMER: [String](TopLevel.String.md) = "requested_by_customer" + - : Refund reason indicating customer action or request. + + +--- + +## Property Details + +### paymentsSiteConfig +- paymentsSiteConfig: [SalesforcePaymentsSiteConfiguration](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md) `(read-only)` + - : Returns a payments site configuration object for the current site. + + +--- + +## Method Details + +### attachPaymentMethod(SalesforcePaymentMethod, Customer) +- ~~static attachPaymentMethod(paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md), customer: [Customer](dw.customer.Customer.md)): void~~ + - : Attaches the given payment method to the given customer. Use this method to attach a payment method of type + [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) to a shopper who registers as a customer after placing an order, and + has affirmatively elected to save their card as part of the registration process. This method will throw an error + if passed incompatible payment method and/or customer objects. + + + **Parameters:** + - paymentMethod - payment method to attach to customer + - customer - customer whose payment method to attach + + **Throws:** + - Exception - if there was an error attaching the payment method to the customer + + **Deprecated:** +:::warning +use [onCustomerRegistered(Order)](dw.extensions.payments.SalesforcePaymentsMgr.md#oncustomerregisteredorder) and + [savePaymentMethod(Customer, SalesforcePaymentMethod)](dw.extensions.payments.SalesforcePaymentsMgr.md#savepaymentmethodcustomer-salesforcepaymentmethod) + +::: + +--- + +### authorizePayPalOrder(SalesforcePayPalOrder) +- static authorizePayPalOrder(paypalOrder: [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)): [Status](dw.system.Status.md) + - : Authorizes the given PayPal order. + + + The PayPal order must be in a status that supports authorization. See the PayPal documentation for more details. + + + **Parameters:** + - paypalOrder - PayPal order to authorize + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'error'` contains the PayPal error information, if it + is available in the response. + + + **Throws:** + - Exception - if there was an error authorizing the PayPal order + + +--- + +### cancelPaymentIntent(SalesforcePaymentIntent, Object) +- static cancelPaymentIntent(paymentIntent: [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), paymentIntentProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Cancels the given payment intent. If a payment authorization has been made for the payment intent, the + authorization is removed. + + + The payment intent must be in a status that supports cancel. See the Stripe documentation for more details. + + + + + The following Payment Intent property is supported: + + - `cancellationReason`- optional payment intent cancellation reason + + + **Parameters:** + - paymentIntent - payment intent to capture + - paymentIntentProperties - additional properties to pass to the create Payment Intent API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paymentintent'` contains the payment intent, if it is + available in the Stripe response. Status detail `'error'` contains the Stripe error + information, if it is available in the response. + + + **Throws:** + - Exception - if there was an error canceling the payment intent + + **See Also:** + - [CANCELLATION_REASON_ABANDONED](dw.extensions.payments.SalesforcePaymentsMgr.md#cancellation_reason_abandoned) + - [CANCELLATION_REASON_DUPLICATE](dw.extensions.payments.SalesforcePaymentsMgr.md#cancellation_reason_duplicate) + - [CANCELLATION_REASON_FRAUDULENT](dw.extensions.payments.SalesforcePaymentsMgr.md#cancellation_reason_fraudulent) + - [CANCELLATION_REASON_REQUESTED_BY_CUSTOMER](dw.extensions.payments.SalesforcePaymentsMgr.md#cancellation_reason_requested_by_customer) + + +--- + +### captureAdyenPayment(OrderPaymentInstrument, Money, Object) +- static captureAdyenPayment(orderPaymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), amount: [Money](dw.value.Money.md), transactionProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Captures funds for the given order payment instrument. + + + The order payment instrument must be in a state that supports capture. + + + + + The `amount` must be less than or equal to the amount available to capture. + + + + + The following Transaction properties are supported: + + - `reference`- optional reference for the transaction, for example order number + + + **Parameters:** + - orderPaymentInstrument - payment instrument to capture + - amount - amount to capture + - transactionProperties - properties to pass to the capture Adyen Payment API + + **Returns:** + - Status 'OK' or 'ERROR'. + + **Throws:** + - Exception - if there was an error capturing the payment instrument + + +--- + +### capturePayPalOrder(SalesforcePayPalOrder) +- static capturePayPalOrder(paypalOrder: [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)): [Status](dw.system.Status.md) + - : Captures funds for the given PayPal order. + + + The PayPal order must be in a status that supports capture. See the PayPal documentation for more details. + + + **Parameters:** + - paypalOrder - PayPal order to capture + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'error'` contains the PayPal error information, if it + is available in the response. + + + **Throws:** + - Exception - if there was an error capturing the PayPal order + + +--- + +### capturePaymentIntent(SalesforcePaymentIntent, Money) +- static capturePaymentIntent(paymentIntent: [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), amount: [Money](dw.value.Money.md)): [Status](dw.system.Status.md) + - : Captures funds for the given payment intent. + + + The payment intent must be in a status that supports capture. See the Stripe documentation for more details. + + + + + If `amount` is not specified, the default is the full amount available to capture. If specified, the + amount must be less than or equal to the amount available to capture. + + + **Parameters:** + - paymentIntent - payment intent to capture + - amount - optional amount to capture, defaults to amount available to capture + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'error'` contains the Stripe error information, if it + is available in the response. + + + **Throws:** + - Exception - if there was an error capturing the payment intent + + +--- + +### confirmPaymentIntent(Order, SalesforcePaymentMethod, Object) +- static confirmPaymentIntent(order: [Order](dw.order.Order.md), paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md), paymentIntentProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Confirms a new payment intent using the given payment method, and associates it with the given order. + + + + + The order must be prepared to contain products, shipments, and any other necessary data, and must be calculated + to reflect the correct total amounts. If the order is not for the same [Customer](dw.customer.Customer.md) as the given + payment method, an error is thrown. + + + + + The specified payment method must be set up for off session future use or an error is thrown. iDeal and + Bancontact implement reuse differently than other payment methods, but they can't be reused themselves. + + + + + The following Payment Intent properties are supported: + + - `statementDescriptor`- optional statement descriptor - `cardCaptureAutomatic`- optional `true`if the credit card payment should be automatically captured at the time of the sale, or `false`if the credit card payment should be captured later + + If `cardCaptureAutomatic`is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. + + If `statementDescriptor`is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply. + + + **Parameters:** + - order - order to pay using Salesforce Payments + - paymentMethod - payment method to use to pay + - paymentIntentProperties - additional properties to pass to the create Payment Intent API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paymentintent'` contains the payment intent, if it is + available in the Stripe response. Status detail `'error'` contains the Stripe error + information, if it is available in the response. + + + **Throws:** + - Exception - if the parameter validation failed or there's an error confirming the payment intent + + +--- + +### createAdyenPaymentIntent(Order, Shipment, String, Money, Boolean, Object, Object) +- static createAdyenPaymentIntent(order: [Order](dw.order.Order.md), shipment: [Shipment](dw.order.Shipment.md), zoneId: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md), customerRequired: [Boolean](TopLevel.Boolean.md), paymentData: [Object](TopLevel.Object.md), paymentIntentProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Creates an Adyen payment intent using the given information, and associates it with the given order. + + + + + The following Payment Intent properties are supported: + + - `type`- required payment method type, such as [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) - `cardCaptureAutomatic`- optional `true`if the credit card payment should be automatically captured at the time of the sale, or `false`if the credit card payment should be captured later - `storePaymentMethod`- optional `true`if the payment method should be stored for future usage, or `false`if not + + If `cardCaptureAutomatic`is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. + + + **Parameters:** + - order - order to checkout and pay using Salesforce Payments + - shipment - shipment to use for shipping information in the payment intent + - zoneId - id of the payment zone + - amount - payment amount + - customerRequired - `true` if an Adyen shopper reference must be associated with the transaction and needs to be created if it does not already exist for the given ecom customer or `false` a shopper reference does not have to be associated with the transaction. A customer is required if storing a payment method for future usage or using an existing stored payment method. + - paymentData - Adyen specific payment data passed directly from the client as-is + - paymentIntentProperties - properties to pass to the create Payment Intent API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paymentintent'` contains the payment intent, if it is + available in the Adyen response. Status detail `'error'` contains the Adyen error information, + if it is available in the response. + + + +--- + +### createPayPalOrder(Basket, Shipment, String, Money, Object) +- static createPayPalOrder(basket: [Basket](dw.order.Basket.md), shipment: [Shipment](dw.order.Shipment.md), zoneId: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md), paypalOrderProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Creates a PayPal order using the given information, and associates it with the given basket. + + + + + The following PayPal order properties are supported: + + - `fundingSource`- required funding source, such as [SalesforcePayPalOrder.TYPE_PAYPAL](dw.extensions.payments.SalesforcePayPalOrder.md#type_paypal) - `intent`- optional order capture timing intent, such as [SalesforcePayPalOrder.INTENT_AUTHORIZE](dw.extensions.payments.SalesforcePayPalOrder.md#intent_authorize)or [SalesforcePayPalOrder.INTENT_CAPTURE](dw.extensions.payments.SalesforcePayPalOrder.md#intent_capture) - `shippingPreference`- optional shipping preference, such as `"GET_FROM_FILE"` - `userAction`- optional user action, such as `"PAY_NOW"` + + If `intent`is provided it is used to determine manual or automatic capture, and otherwise the default card capture timing set for the site is used. + + + **Parameters:** + - basket - basket to checkout and pay using Salesforce Payments + - shipment - shipment to use for shipping information in the payment intent + - zoneId - id of the payment zone + - amount - payment amount + - paypalOrderProperties - properties to pass to the create PayPal order API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paypalorder'` contains the PayPal order, if it is + available in the PayPal response. Status detail `'error'` contains the PayPal error + information, if it is available in the response. + + + +--- + +### createPaymentIntent(Basket, Shipment, String, Money, Boolean, Object) +- static createPaymentIntent(basket: [Basket](dw.order.Basket.md), shipment: [Shipment](dw.order.Shipment.md), zoneId: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md), stripeCustomerRequired: [Boolean](TopLevel.Boolean.md), paymentIntentProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Creates a payment intent using the given information, and associates it with the given basket. + + + + + The following Payment Intent properties are supported: + + - `type`- required payment method type, such as [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card) - `statementDescriptor`- optional statement descriptor - `cardCaptureAutomatic`- optional `true`if the credit card payment should be automatically captured at the time of the sale, or `false`if the credit card payment should be captured later - `setupFutureUsage`- optional future usage setup value, such as [SalesforcePaymentIntent.SETUP_FUTURE_USAGE_ON_SESSION](dw.extensions.payments.SalesforcePaymentIntent.md#setup_future_usage_on_session) + + The `stripeCustomerRequired`must be set to `true`if the payment will be set up for future usage, whether on session or off session. If `true`then if a Stripe Customer is associated with the shopper then it will be used, and otherwise a new Stripe Customer will be created. The new Stripe Customer will be associated with the shopper if logged into a registered customer account for the site. + + If `cardCaptureAutomatic`is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. + + If `statementDescriptor`is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply. + + If `setupFutureUsage`is provided it will be used to prepare the payment to be set up for future usage at confirmation time. When set, this future usage setup value must match the value used at confirmation time. + + + **Parameters:** + - basket - basket to checkout and pay using Salesforce Payments + - shipment - shipment to use for shipping information in the payment intent + - zoneId - id of the payment zone + - amount - payment amount + - stripeCustomerRequired - `true` if a Stripe Customer must be associated with the payment intent, and would be created if it doesn't already exist, or `false` if a Stripe Customer does not have to be associated with the payment intent + - paymentIntentProperties - properties to pass to the create Payment Intent API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paymentintent'` contains the payment intent, if it is + available in the Stripe response. Status detail `'error'` contains the Stripe error + information, if it is available in the response. + + + +--- + +### detachPaymentMethod(SalesforcePaymentMethod) +- ~~static detachPaymentMethod(paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)): void~~ + - : Detaches the given payment method from its associated customer. Once detached the payment method remains + associated with payment intents in the payment account, but is no longer saved for use by the customer in future + orders. + + + **Parameters:** + - paymentMethod - payment method to detach from customer + + **Throws:** + - Exception - if there was an error detaching the payment method from its customer + + **Deprecated:** +:::warning +use [removeSavedPaymentMethod(SalesforcePaymentMethod)](dw.extensions.payments.SalesforcePaymentsMgr.md#removesavedpaymentmethodsalesforcepaymentmethod) +::: + +--- + +### getAdyenSavedPaymentMethods(Customer) +- static getAdyenSavedPaymentMethods(customer: [Customer](dw.customer.Customer.md)): [Collection](dw.util.Collection.md) + - : Returns a collection containing the Adyen payment methods saved to be presented to the given customer for reuse + in checkouts. The collection will be empty if there are no payment methods saved for the customer, or there was + an error retrieving the saved payment methods. + + + **Parameters:** + - customer - customer whose saved payment methods to get + + **Returns:** + - collection of saved payment methods + + **Throws:** + - Exception - if the given customer is `null` or `undefined`, or there is configuration missing that is required to retrieve the saved payment methods + + +--- + +### getAttachedPaymentMethods(Customer) +- ~~static getAttachedPaymentMethods(customer: [Customer](dw.customer.Customer.md)): [Collection](dw.util.Collection.md)~~ + - : Returns a collection containing the payment methods attached to the given customer. The collection will be empty + if there are no payment methods attached to the customer, or there was an error retrieving the attached payment + methods. + + + **Parameters:** + - customer - customer whose payment methods to get + + **Returns:** + - collection of attached payment methods + + **Throws:** + - Exception - if the given customer is `null` or `undefined` + + **Deprecated:** +:::warning +use [getSavedPaymentMethods(Customer)](dw.extensions.payments.SalesforcePaymentsMgr.md#getsavedpaymentmethodscustomer) +::: + +--- + +### getOffSessionPaymentMethods(Customer) +- static getOffSessionPaymentMethods(customer: [Customer](dw.customer.Customer.md)): [Collection](dw.util.Collection.md) + - : Returns a collection containing the payment methods for the given customer set up for future off session reuse. + The collection will be empty if there are no off session payment methods for the customer, or there was an error + retrieving the off session payment methods. + + + **Parameters:** + - customer - customer whose off session payment methods to get + + **Returns:** + - collection of off session payment methods + + **Throws:** + - Exception - if the given customer is `null` or `undefined`, or there is an error getting the off session payment methods + + +--- + +### getPayPalOrder(Basket) +- static getPayPalOrder(basket: [Basket](dw.order.Basket.md)): [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md) + - : Returns the PayPal order for the given basket, or `null` if the given basket has none. + + **Parameters:** + - basket - basket to checkout and pay using Salesforce Payments + + **Returns:** + - The PayPal order + + **Throws:** + - Exception - if there was an error retrieving the PayPal order for the basket + + +--- + +### getPayPalOrder(Order) +- static getPayPalOrder(order: [Order](dw.order.Order.md)): [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md) + - : Returns the PayPal order for the given order, or `null` if the given order has none. + + **Parameters:** + - order - order paid using Salesforce Payments + + **Returns:** + - The PayPal order + + **Throws:** + - Exception - if there was an error retrieving the PayPal order for the order + + +--- + +### getPaymentDetails(OrderPaymentInstrument) +- static getPaymentDetails(paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)): [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - : Returns the details to the Salesforce Payments payment associated with the given payment instrument, or + `null` if the given payment instrument has none. + + + **Parameters:** + - paymentInstrument - payment instrument + + **Returns:** + - The payment details + + **Throws:** + - Exception - if paymentInstrument is null + + +--- + +### getPaymentIntent(Basket) +- static getPaymentIntent(basket: [Basket](dw.order.Basket.md)): [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md) + - : Returns the payment intent for the given basket, or `null` if the given basket has none. + + **Parameters:** + - basket - basket to checkout and pay using Salesforce Payments + + **Returns:** + - The payment intent + + **Throws:** + - Exception - if there was an error retrieving the payment intent for the basket + + +--- + +### getPaymentIntent(Order) +- static getPaymentIntent(order: [Order](dw.order.Order.md)): [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md) + - : Returns the payment intent for the given order, or `null` if the given order has none. + + **Parameters:** + - order - order paid using Salesforce Payments + + **Returns:** + - The payment intent + + **Throws:** + - Exception - if there was an error retrieving the payment intent for the order + + +--- + +### getPaymentsSiteConfig() +- static getPaymentsSiteConfig(): [SalesforcePaymentsSiteConfiguration](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md) + - : Returns a payments site configuration object for the current site. + + **Returns:** + - a payments site configuration or null if no payments site configuration found + + **Throws:** + - Exception - if there is no current site + + +--- + +### getPaymentsZone(String) +- static getPaymentsZone(zoneId: [String](TopLevel.String.md)): [SalesforcePaymentsZone](dw.extensions.payments.SalesforcePaymentsZone.md) + - : Returns a payments zone object for the passed in payments zone ID. + + **Parameters:** + - zoneId - ID of the payments zone to retrieve and use to checkout and pay using Salesforce Payments + + **Returns:** + - a payments zone or null if no payments zone with the given ID exists + + +--- + +### getSavedPaymentMethods(Customer) +- static getSavedPaymentMethods(customer: [Customer](dw.customer.Customer.md)): [Collection](dw.util.Collection.md) + - : Returns a collection containing the payment methods saved to be presented to the given customer for reuse in + checkouts. The collection will be empty if there are no payment methods saved for the customer, or there was an + error retrieving the saved payment methods. + + + **Parameters:** + - customer - customer whose saved payment methods to get + + **Returns:** + - collection of saved payment methods + + **Throws:** + - Exception - if the given customer is `null` or `undefined`, or there is configuration missing that is required to retrieve the saved payment methods + + +--- + +### handleAdyenAdditionalDetails(Order, String, Object) +- static handleAdyenAdditionalDetails(order: [Order](dw.order.Order.md), zoneId: [String](TopLevel.String.md), data: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : + + Handles the given additional Adyen payment details and associates the associated payment with the given order, if + applicable. + + + + + Pass the state data from the Adyen `onAdditionalDetails` event as-is, without any encoding or other + changes to the data or its structure. See the Adyen documentation for more information. + + + **Parameters:** + - order - order to checkout and pay using Salesforce Payments + - zoneId - id of the payment zone + - data - additional details state data + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'adyenpayment'` contains the payment details, if it is + available in the Adyen response and the response resultCode is 'Authorised'. Status detail + `'error'` contains the Adyen error information, if it is available in the response. + + + +--- + +### onCustomerRegistered(Order) +- static onCustomerRegistered(order: [Order](dw.order.Order.md)): void + - : Handles the account registration of the shopper who placed the given order. Use this method to ensure the + registered customer profile is associated with the order in Salesforce Payments. + + + **Parameters:** + - order - order paid using Salesforce Payments + + **Throws:** + - Exception - if there was an error attaching the payment method to the customer + + +--- + +### refundAdyenPayment(OrderPaymentInstrument, Money, Object) +- static refundAdyenPayment(orderPaymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), amount: [Money](dw.value.Money.md), transactionProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Refunds previously captured funds for the given order payment instrument. + + + The order payment instrument must be in a state that supports refund. + + + + + The `amount` must be less than or equal to the amount available to refund. + + + + + The following Transaction properties are supported: + + - `reference`- optional reference for the transaction, for example order number + + + **Parameters:** + - orderPaymentInstrument - payment instrument to refund + - amount - amount to refund + - transactionProperties - properties to pass to the refund Adyen Payment API + + **Returns:** + - Status 'OK' or 'ERROR'. + + **Throws:** + - Exception - if there was an error refunding the payment instrument + + +--- + +### refundPaymentIntent(SalesforcePaymentIntent, Money, Object) +- static refundPaymentIntent(paymentIntent: [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), amount: [Money](dw.value.Money.md), refundProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Refunds previously captured funds for the given payment intent. + + + The payment intent must be in a state that supports refund. This includes its status as well as any previous + refunds. See the Stripe documentation for more details. + + + + + The following Payment Intent property is supported: + + - `reason`- optional payment intent refund reason + + If `amount`is not specified, the default is the full amount available to refund. If specified, the amount must be less than or equal to the amount available to refund. + + + **Parameters:** + - paymentIntent - payment intent to refund + - amount - optional amount to refund, defaults to amount previously captured + - refundProperties - additional properties to pass to the refund API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'error'` contains the Stripe error information, if it + is available in the response. + + + **Throws:** + - Exception - if there was an error refunding the payment intent + + **See Also:** + - [REFUND_REASON_DUPLICATE](dw.extensions.payments.SalesforcePaymentsMgr.md#refund_reason_duplicate) + - [REFUND_REASON_FRAUDULENT](dw.extensions.payments.SalesforcePaymentsMgr.md#refund_reason_fraudulent) + - [REFUND_REASON_REQUESTED_BY_CUSTOMER](dw.extensions.payments.SalesforcePaymentsMgr.md#refund_reason_requested_by_customer) + + +--- + +### removeAdyenSavedPaymentMethod(SalesforceAdyenSavedPaymentMethod) +- static removeAdyenSavedPaymentMethod(savedPaymentMethod: [SalesforceAdyenSavedPaymentMethod](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md)): void + - : Deletes an Adyen saved payment method. + + **Parameters:** + - savedPaymentMethod - the saved payment method to delete + + **Throws:** + - Exception - if the saved payment method is `null` or `undefined`, or there is configuration missing that is required to delete the saved payment method + + +--- + +### removeSavedPaymentMethod(SalesforcePaymentMethod) +- static removeSavedPaymentMethod(paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)): void + - : Removes the given saved payment method so that it is no longer presented to the given customer for reuse in + checkouts. The payment method remains in the payment account, but is no longer saved for use by the customer. + + + **Parameters:** + - paymentMethod - payment method to detach from customer + + **Throws:** + - Exception - if there was an error removing the saved payment method from its customer + + +--- + +### resolvePaymentsZone(Object) +- static resolvePaymentsZone(paymentsZoneProperties: [Object](TopLevel.Object.md)): [SalesforcePaymentsZone](dw.extensions.payments.SalesforcePaymentsZone.md) + - : Resolves and returns the payments zone object for the passed in payments zone properties object. If an empty + object is provided, the default payments zone will be returned if it exists. + + + The following payments zone properties are supported: + + - `countryCode`- optional country code of the shopper, or `null`if not known + - `currency`- optional basket currency, or `null`if not known + + + **Parameters:** + - paymentsZoneProperties - properties to use to retrieve the payments zone for to use to checkout and pay using Salesforce Payments + + **Returns:** + - a payments zone + + **Throws:** + - Exception - if no default payments zone exists + + +--- + +### reverseAdyenPayment(OrderPaymentInstrument, Object) +- static reverseAdyenPayment(orderPaymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), transactionProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Reverses the authorisation for the given order payment instrument. + + + The order payment instrument must be in a state that supports reversal. + + + + + The following Transaction properties are supported: + + - `reference`- optional reference for the transaction, for example order number + + + **Parameters:** + - orderPaymentInstrument - payment instrument to reverse + - transactionProperties - properties to pass to the reverse Adyen Payment API + + **Returns:** + - Status 'OK' or 'ERROR'. + + **Throws:** + - Exception - if there was an error reversing the payment instrument + + +--- + +### savePaymentMethod(Customer, SalesforcePaymentMethod) +- static savePaymentMethod(customer: [Customer](dw.customer.Customer.md), paymentMethod: [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)): void + - : Saves the given payment method to be presented to the given customer for reuse in subsequent checkouts. This + method will throw an error if passed incompatible payment method and/or customer objects. + + + **Parameters:** + - customer - customer for which to save the payment method + - paymentMethod - payment method to save for the customer + + **Throws:** + - Exception - if there was an error saving the payment method for the customer + + +--- + +### setPaymentDetails(OrderPaymentInstrument, SalesforcePaymentDetails) +- static setPaymentDetails(paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), paymentDetails: [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md)): void + - : Sets the details to the Salesforce Payments payment associated with the given payment instrument. + + **Parameters:** + - paymentInstrument - payment instrument + - paymentDetails - payment details + + **Throws:** + - Exception - if either paymentInstrument or paymentDetails is null + + **See Also:** + - [SalesforcePaymentMethod.getPaymentDetails(OrderPaymentInstrument)](dw.extensions.payments.SalesforcePaymentMethod.md#getpaymentdetailsorderpaymentinstrument) + - [SalesforcePayPalOrder.getPaymentDetails(OrderPaymentInstrument)](dw.extensions.payments.SalesforcePayPalOrder.md#getpaymentdetailsorderpaymentinstrument) + + +--- + +### updatePaymentIntent(SalesforcePaymentIntent, Shipment, Money, String, Object) +- static updatePaymentIntent(paymentIntent: [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), shipment: [Shipment](dw.order.Shipment.md), amount: [Money](dw.value.Money.md), orderNo: [String](TopLevel.String.md), paymentIntentProperties: [Object](TopLevel.Object.md)): [Status](dw.system.Status.md) + - : Updates the provided information in the given payment intent. + + + The payment intent must be in a status that supports update. See the Stripe documentation for more details. + + + + + The following Payment Intent properties are supported: + + - `statementDescriptor`- optional statement descriptor - `cardCaptureAutomatic`- optional `true`if the credit card payment should be automatically captured at the time of the sale, or `false`if the credit card payment should be captured later + + If `cardCaptureAutomatic`is provided it is used to determine card capture timing, and otherwise the default card capture timing set for the site is used. + + If `statementDescriptor`is provided it is used as the complete description that appears on your customers' statements for the payment, and if not a default statement descriptor is used. If a default statement descriptor is set for the site it is used as the default, and otherwise the default statement descriptor for the account will apply. + + + **Parameters:** + - paymentIntent - payment intent to update + - shipment - optional shipment to use to update shipping information in the payment intent + - amount - optional new payment amount + - orderNo - optional order no of [Order](dw.order.Order.md) to associate with the payment intent in metadata + - paymentIntentProperties - optional additional properties to pass to the update Payment Intent API + + **Returns:** + - Status 'OK' or 'ERROR'. Status detail `'paymentintent'` contains the payment intent, if it is + available in the Stripe response. Status detail `'error'` contains the Stripe error + information, if it is available in the response. + + + **Throws:** + - Exception - if the parameter validation failed or there's an error updating the payment intent + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md new file mode 100644 index 00000000..da440064 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md @@ -0,0 +1,126 @@ + +# Class SalesforcePaymentsSiteConfiguration + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsSiteConfiguration](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md) + + + +Salesforce Payments representation of a payment site configuration object. See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + + +A payment site configuration contains information about the configuration of the site such as +whether the site is activated with Express Checkout, Multi-Step Checkout or both. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [cardCaptureAutomatic](#cardcaptureautomatic): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if the capture method is set to automatic for credit card Payment Intents created for this site, or false if the capture method is set to manual. | +| [expressCheckoutEnabled](#expresscheckoutenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if Express Checkout is enabled for the site. | +| [futureUsageOffSession](#futureusageoffsession): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if the payment card credential storage is configured to set up all applicable payments for off session reuse, or false if the credential storage is configured to set up for on session reuse only the payments for which the shopper actively confirms use of saved credentials. | +| [multiStepCheckoutEnabled](#multistepcheckoutenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if Multi-Step Checkout is enabled for the site. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [isCardCaptureAutomatic](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md#iscardcaptureautomatic)() | Returns true if the capture method is set to automatic for credit card Payment Intents created for this site, or false if the capture method is set to manual. | +| [isExpressCheckoutEnabled](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md#isexpresscheckoutenabled)() | Returns true if Express Checkout is enabled for the site. | +| [isFutureUsageOffSession](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md#isfutureusageoffsession)() | Returns true if the payment card credential storage is configured to set up all applicable payments for off session reuse, or false if the credential storage is configured to set up for on session reuse only the payments for which the shopper actively confirms use of saved credentials. | +| [isMultiStepCheckoutEnabled](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md#ismultistepcheckoutenabled)() | Returns true if Multi-Step Checkout is enabled for the site. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### cardCaptureAutomatic +- cardCaptureAutomatic: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if the capture method is set to automatic for credit card Payment Intents created for this site, or + false if the capture method is set to manual. + + + +--- + +### expressCheckoutEnabled +- expressCheckoutEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if Express Checkout is enabled for the site. + + +--- + +### futureUsageOffSession +- futureUsageOffSession: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if the payment card credential storage is configured to set up all applicable payments for off + session reuse, or false if the credential storage is configured to set up for on session reuse only the payments + for which the shopper actively confirms use of saved credentials. + + + +--- + +### multiStepCheckoutEnabled +- multiStepCheckoutEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if Multi-Step Checkout is enabled for the site. + + +--- + +## Method Details + +### isCardCaptureAutomatic() +- isCardCaptureAutomatic(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the capture method is set to automatic for credit card Payment Intents created for this site, or + false if the capture method is set to manual. + + + **Returns:** + - true if the credit card capture method is automatic, or false if it is manual + + +--- + +### isExpressCheckoutEnabled() +- isExpressCheckoutEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if Express Checkout is enabled for the site. + + **Returns:** + - true if Express Checkout is enabled for the site, or false if not + + +--- + +### isFutureUsageOffSession() +- isFutureUsageOffSession(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the payment card credential storage is configured to set up all applicable payments for off + session reuse, or false if the credential storage is configured to set up for on session reuse only the payments + for which the shopper actively confirms use of saved credentials. + + + **Returns:** + - true if the future usage is off session, or false if on session + + +--- + +### isMultiStepCheckoutEnabled() +- isMultiStepCheckoutEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if Multi-Step Checkout is enabled for the site. + + **Returns:** + - true if Multi-Step Checkout is enabled for the site, or false if not + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsZone.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsZone.md new file mode 100644 index 00000000..9edb0071 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsZone.md @@ -0,0 +1,393 @@ + +# Class SalesforcePaymentsZone + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentsZone](dw.extensions.payments.SalesforcePaymentsZone.md) + + + +Salesforce Payments representation of a payments zone. See Salesforce Payments documentation for how to gain access +and configure payment zones and assign them to sites. + + + + +A payments zone contains information about the payment zone for a site and country. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [afterpayClearpayEnabled](#afterpayclearpayenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Afterpay Clearpay presentment is enabled, or `false` if not. | +| [applePayEnabled](#applepayenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Apple Pay presentment is enabled, or `false` if not. | +| [bancontactEnabled](#bancontactenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Bancontact presentment is enabled, or `false` if not. | +| [bancontactMobileEnabled](#bancontactmobileenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Bancontact Mobile presentment is enabled, or `false` if not. | +| [cardEnabled](#cardenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if credit card presentment is enabled, or `false` if not. | +| [epsEnabled](#epsenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if EPS presentment is enabled, or `false` if not. | +| [idealEnabled](#idealenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if iDEAL presentment is enabled, or `false` if not. | +| [klarnaEnabled](#klarnaenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Klarna presentment is enabled, or `false` if not. | +| [klarnaPayInInstallmentsEnabled](#klarnapayininstallmentsenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Klarna Pay in Installments presentment is enabled, or `false` if not. | +| [klarnaPayNowEnabled](#klarnapaynowenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Klarna Pay Now presentment is enabled, or `false` if not. | +| [payPalEnabled](#paypalenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if PayPal multi-step checkout presentment is enabled, or `false` if not. | +| [payPalExpressEnabled](#paypalexpressenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if PayPal express checkout presentment is enabled, or `false` if not. | +| [paymentRequestEnabled](#paymentrequestenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if W3C Payment Request API button presentment is enabled, or `false` if not. | +| [sepaDebitEnabled](#sepadebitenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if SEPA Debit presentment is enabled, or `false` if not. | +| [venmoEnabled](#venmoenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Venmo multi-step checkout presentment is enabled, or `false` if not. | +| [venmoExpressEnabled](#venmoexpressenabled): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true` if Venmo express checkout presentment is enabled, or `false` if not. | +| [zoneId](#zoneid): [String](TopLevel.String.md) `(read-only)` | Returns the id of the payments zone. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getPaymentMethods](dw.extensions.payments.SalesforcePaymentsZone.md#getpaymentmethodsstring-money)([String](TopLevel.String.md), [Money](dw.value.Money.md)) | Returns a collection containing the merchant account payment methods to be presented for this payments zone. | +| [getZoneId](dw.extensions.payments.SalesforcePaymentsZone.md#getzoneid)() | Returns the id of the payments zone. | +| [isAfterpayClearpayEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isafterpayclearpayenabled)() | Returns `true` if Afterpay Clearpay presentment is enabled, or `false` if not. | +| [isApplePayEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isapplepayenabled)() | Returns `true` if Apple Pay presentment is enabled, or `false` if not. | +| [isBancontactEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isbancontactenabled)() | Returns `true` if Bancontact presentment is enabled, or `false` if not. | +| [isBancontactMobileEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isbancontactmobileenabled)() | Returns `true` if Bancontact Mobile presentment is enabled, or `false` if not. | +| [isCardEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#iscardenabled)() | Returns `true` if credit card presentment is enabled, or `false` if not. | +| [isEpsEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isepsenabled)() | Returns `true` if EPS presentment is enabled, or `false` if not. | +| [isIdealEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isidealenabled)() | Returns `true` if iDEAL presentment is enabled, or `false` if not. | +| [isKlarnaEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isklarnaenabled)() | Returns `true` if Klarna presentment is enabled, or `false` if not. | +| [isKlarnaPayInInstallmentsEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isklarnapayininstallmentsenabled)() | Returns `true` if Klarna Pay in Installments presentment is enabled, or `false` if not. | +| [isKlarnaPayNowEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isklarnapaynowenabled)() | Returns `true` if Klarna Pay Now presentment is enabled, or `false` if not. | +| [isPayPalEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#ispaypalenabled)() | Returns `true` if PayPal multi-step checkout presentment is enabled, or `false` if not. | +| [isPayPalExpressEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#ispaypalexpressenabled)() | Returns `true` if PayPal express checkout presentment is enabled, or `false` if not. | +| [isPaymentRequestEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#ispaymentrequestenabled)() | Returns `true` if W3C Payment Request API button presentment is enabled, or `false` if not. | +| [isSepaDebitEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#issepadebitenabled)() | Returns `true` if SEPA Debit presentment is enabled, or `false` if not. | +| [isVenmoEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isvenmoenabled)() | Returns `true` if Venmo multi-step checkout presentment is enabled, or `false` if not. | +| [isVenmoExpressEnabled](dw.extensions.payments.SalesforcePaymentsZone.md#isvenmoexpressenabled)() | Returns `true` if Venmo express checkout presentment is enabled, or `false` if not. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### afterpayClearpayEnabled +- afterpayClearpayEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Afterpay Clearpay presentment is enabled, or `false` if not. + + +--- + +### applePayEnabled +- applePayEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Apple Pay presentment is enabled, or `false` if not. + + +--- + +### bancontactEnabled +- bancontactEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Bancontact presentment is enabled, or `false` if not. Note: For Adyen + merchant accounts, this setting refers to the "Bancontact Card" payment method. + + + +--- + +### bancontactMobileEnabled +- bancontactMobileEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Bancontact Mobile presentment is enabled, or `false` if not. Note: This + setting is only applicable for Adyen Merchant Accounts + + + +--- + +### cardEnabled +- cardEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if credit card presentment is enabled, or `false` if not. + + +--- + +### epsEnabled +- epsEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if EPS presentment is enabled, or `false` if not. + + +--- + +### idealEnabled +- idealEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if iDEAL presentment is enabled, or `false` if not. + + +--- + +### klarnaEnabled +- klarnaEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Klarna presentment is enabled, or `false` if not. Note: For Adyen + merchant accounts, this setting applies to the Klarna Pay Later payment method. + + + +--- + +### klarnaPayInInstallmentsEnabled +- klarnaPayInInstallmentsEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Klarna Pay in Installments presentment is enabled, or `false` if not. + Note: This setting is only applicable for Adyen Merchant Accounts. + + + +--- + +### klarnaPayNowEnabled +- klarnaPayNowEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Klarna Pay Now presentment is enabled, or `false` if not. Note: This + setting is only applicable for Adyen Merchant Accounts. + + + +--- + +### payPalEnabled +- payPalEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if PayPal multi-step checkout presentment is enabled, or `false` if not. + + +--- + +### payPalExpressEnabled +- payPalExpressEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if PayPal express checkout presentment is enabled, or `false` if not. + + +--- + +### paymentRequestEnabled +- paymentRequestEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if W3C Payment Request API button presentment is enabled, or `false` if not. + + +--- + +### sepaDebitEnabled +- sepaDebitEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if SEPA Debit presentment is enabled, or `false` if not. + + +--- + +### venmoEnabled +- venmoEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Venmo multi-step checkout presentment is enabled, or `false` if not. + + +--- + +### venmoExpressEnabled +- venmoExpressEnabled: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true` if Venmo express checkout presentment is enabled, or `false` if not. + + +--- + +### zoneId +- zoneId: [String](TopLevel.String.md) `(read-only)` + - : Returns the id of the payments zone. + + +--- + +## Method Details + +### getPaymentMethods(String, Money) +- getPaymentMethods(countryCode: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md)): [Collection](dw.util.Collection.md) + - : Returns a collection containing the merchant account payment methods to be presented for this payments zone. + + **Returns:** + - collection of merchant account payment methods + + +--- + +### getZoneId() +- getZoneId(): [String](TopLevel.String.md) + - : Returns the id of the payments zone. + + **Returns:** + - zone id + + +--- + +### isAfterpayClearpayEnabled() +- isAfterpayClearpayEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Afterpay Clearpay presentment is enabled, or `false` if not. + + **Returns:** + - if Afterpay Clearpay presentment is enabled + + +--- + +### isApplePayEnabled() +- isApplePayEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Apple Pay presentment is enabled, or `false` if not. + + **Returns:** + - if Apple Pay presentment is enabled + + +--- + +### isBancontactEnabled() +- isBancontactEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Bancontact presentment is enabled, or `false` if not. Note: For Adyen + merchant accounts, this setting refers to the "Bancontact Card" payment method. + + + **Returns:** + - if Bancontact presentment is enabled + + +--- + +### isBancontactMobileEnabled() +- isBancontactMobileEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Bancontact Mobile presentment is enabled, or `false` if not. Note: This + setting is only applicable for Adyen Merchant Accounts + + + **Returns:** + - if Bancontact Mobile presentment is enabled + + +--- + +### isCardEnabled() +- isCardEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if credit card presentment is enabled, or `false` if not. + + **Returns:** + - if credit card presentment is enabled + + +--- + +### isEpsEnabled() +- isEpsEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if EPS presentment is enabled, or `false` if not. + + **Returns:** + - if EPS presentment is enabled + + +--- + +### isIdealEnabled() +- isIdealEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if iDEAL presentment is enabled, or `false` if not. + + **Returns:** + - if iDEAL presentment is enabled + + +--- + +### isKlarnaEnabled() +- isKlarnaEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Klarna presentment is enabled, or `false` if not. Note: For Adyen + merchant accounts, this setting applies to the Klarna Pay Later payment method. + + + **Returns:** + - if Klarna presentment is enabled + + +--- + +### isKlarnaPayInInstallmentsEnabled() +- isKlarnaPayInInstallmentsEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Klarna Pay in Installments presentment is enabled, or `false` if not. + Note: This setting is only applicable for Adyen Merchant Accounts. + + + **Returns:** + - if Klarna Pay in Installments presentment is enabled + + +--- + +### isKlarnaPayNowEnabled() +- isKlarnaPayNowEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Klarna Pay Now presentment is enabled, or `false` if not. Note: This + setting is only applicable for Adyen Merchant Accounts. + + + **Returns:** + - if Klarna Pay Now presentment is enabled + + +--- + +### isPayPalEnabled() +- isPayPalEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if PayPal multi-step checkout presentment is enabled, or `false` if not. + + **Returns:** + - if PayPal multi-step checkout presentment is enabled + + +--- + +### isPayPalExpressEnabled() +- isPayPalExpressEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if PayPal express checkout presentment is enabled, or `false` if not. + + **Returns:** + - if PayPal express checkout presentment is enabled + + +--- + +### isPaymentRequestEnabled() +- isPaymentRequestEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if W3C Payment Request API button presentment is enabled, or `false` if not. + + **Returns:** + - if W3C Payment Request API presentment is enabled + + +--- + +### isSepaDebitEnabled() +- isSepaDebitEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if SEPA Debit presentment is enabled, or `false` if not. + + **Returns:** + - if SEPA Debit presentment is enabled + + +--- + +### isVenmoEnabled() +- isVenmoEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Venmo multi-step checkout presentment is enabled, or `false` if not. + + **Returns:** + - if Venmo multi-step checkout presentment is enabled + + +--- + +### isVenmoExpressEnabled() +- isVenmoExpressEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns `true` if Venmo express checkout presentment is enabled, or `false` if not. + + **Returns:** + - if Venmo express checkout presentment is enabled + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md new file mode 100644 index 00000000..c1738f68 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md @@ -0,0 +1,63 @@ + +# Class SalesforceSepaDebitPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceSepaDebitPaymentDetails](dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [last4](#last4): [String](TopLevel.String.md) `(read-only)` | Returns the last 4 digits of the account number, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getLast4](dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md#getlast4)() | Returns the last 4 digits of the account number, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### last4 +- last4: [String](TopLevel.String.md) `(read-only)` + - : Returns the last 4 digits of the account number, or `null` if not known. + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + +## Method Details + +### getLast4() +- getLast4(): [String](TopLevel.String.md) + - : Returns the last 4 digits of the account number, or `null` if not known. + + **Returns:** + - last 4 digits of the account number + + **See Also:** + - [SalesforcePaymentMethod.getLast4()](dw.extensions.payments.SalesforcePaymentMethod.md#getlast4) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceVenmoPaymentDetails.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceVenmoPaymentDetails.md new file mode 100644 index 00000000..a084c84b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforceVenmoPaymentDetails.md @@ -0,0 +1,88 @@ + +# Class SalesforceVenmoPaymentDetails + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.payments.SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) + - [dw.extensions.payments.SalesforceVenmoPaymentDetails](dw.extensions.payments.SalesforceVenmoPaymentDetails.md) + + + +Details to a Salesforce Payments payment of type [SalesforcePayPalOrder.TYPE_VENMO](dw.extensions.payments.SalesforcePayPalOrder.md#type_venmo). See Salesforce Payments +documentation for how to gain access and configure it for use on your sites. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [captureID](#captureid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the capture against the PayPal Venmo order, or `null` if not known. | +| [payerEmailAddress](#payeremailaddress): [String](TopLevel.String.md) `(read-only)` | Returns the email address of the payer for the PayPal Venmo order, or `null` if not known. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCaptureID](dw.extensions.payments.SalesforceVenmoPaymentDetails.md#getcaptureid)() | Returns the ID of the capture against the PayPal Venmo order, or `null` if not known. | +| [getPayerEmailAddress](dw.extensions.payments.SalesforceVenmoPaymentDetails.md#getpayeremailaddress)() | Returns the email address of the payer for the PayPal Venmo order, or `null` if not known. | + +### Methods inherited from class SalesforcePaymentDetails + +[getType](dw.extensions.payments.SalesforcePaymentDetails.md#gettype) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### captureID +- captureID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the capture against the PayPal Venmo order, or `null` if not known. + + **See Also:** + - [SalesforcePayPalOrder.getCaptureID()](dw.extensions.payments.SalesforcePayPalOrder.md#getcaptureid) + + +--- + +### payerEmailAddress +- payerEmailAddress: [String](TopLevel.String.md) `(read-only)` + - : Returns the email address of the payer for the PayPal Venmo order, or `null` if not known. + + **See Also:** + - [SalesforcePayPalOrderPayer.getEmailAddress()](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getemailaddress) + + +--- + +## Method Details + +### getCaptureID() +- getCaptureID(): [String](TopLevel.String.md) + - : Returns the ID of the capture against the PayPal Venmo order, or `null` if not known. + + **Returns:** + - PayPal order capture ID + + **See Also:** + - [SalesforcePayPalOrder.getCaptureID()](dw.extensions.payments.SalesforcePayPalOrder.md#getcaptureid) + + +--- + +### getPayerEmailAddress() +- getPayerEmailAddress(): [String](TopLevel.String.md) + - : Returns the email address of the payer for the PayPal Venmo order, or `null` if not known. + + **Returns:** + - payer email address + + **See Also:** + - [SalesforcePayPalOrderPayer.getEmailAddress()](dw.extensions.payments.SalesforcePayPalOrderPayer.md#getemailaddress) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.md new file mode 100644 index 00000000..c7b085f0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.md @@ -0,0 +1,28 @@ +# Package dw.extensions.payments + +## Classes +| Class | Description | +| --- | --- | +| [SalesforceAdyenPaymentIntent](dw.extensions.payments.SalesforceAdyenPaymentIntent.md) |

          Salesforce Payments representation of an Adyen payment intent object. | +| [SalesforceAdyenSavedPaymentMethod](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md) |

          Salesforce Payments representation of an Adyen saved payment method object. | +| [SalesforceBancontactPaymentDetails](dw.extensions.payments.SalesforceBancontactPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_BANCONTACT](dw.extensions.payments.SalesforcePaymentMethod.md#type_bancontact). | +| [SalesforceCardPaymentDetails](dw.extensions.payments.SalesforceCardPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_CARD](dw.extensions.payments.SalesforcePaymentMethod.md#type_card). | +| [SalesforceEpsPaymentDetails](dw.extensions.payments.SalesforceEpsPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_EPS](dw.extensions.payments.SalesforcePaymentMethod.md#type_eps). | +| [SalesforceIdealPaymentDetails](dw.extensions.payments.SalesforceIdealPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_IDEAL](dw.extensions.payments.SalesforcePaymentMethod.md#type_ideal). | +| [SalesforceKlarnaPaymentDetails](dw.extensions.payments.SalesforceKlarnaPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_KLARNA](dw.extensions.payments.SalesforcePaymentMethod.md#type_klarna). | +| [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md) |

          Base class details to a Salesforce Payments payment. | +| [SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md) |

          Salesforce Payments representation of a Stripe payment intent object. | +| [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md) |

          Salesforce Payments representation of a payment method object. | +| [SalesforcePaymentRequest](dw.extensions.payments.SalesforcePaymentRequest.md) |

          Salesforce Payments request for a shopper to make payment. | +| [SalesforcePaymentsHooks](dw.extensions.payments.SalesforcePaymentsHooks.md) |

          This interface represents all script hooks that can be registered to customize the Salesforce Payments functionality. | +| [SalesforcePaymentsMerchantAccount](dw.extensions.payments.SalesforcePaymentsMerchantAccount.md) | Contains information about a merchant account configured for use with Salesforce Payments. | +| [SalesforcePaymentsMerchantAccountPaymentMethod](dw.extensions.payments.SalesforcePaymentsMerchantAccountPaymentMethod.md) | Contains information about a payment method to be presented to a payer, as configured for a Salesforce Payments merchant account. | +| [SalesforcePaymentsMgr](dw.extensions.payments.SalesforcePaymentsMgr.md) | Contains functionality for use with Salesforce Payments. | +| [SalesforcePaymentsSiteConfiguration](dw.extensions.payments.SalesforcePaymentsSiteConfiguration.md) |

          Salesforce Payments representation of a payment site configuration object. | +| [SalesforcePaymentsZone](dw.extensions.payments.SalesforcePaymentsZone.md) |

          Salesforce Payments representation of a payments zone. | +| [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md) |

          Salesforce Payments representation of a PayPal order object. | +| [SalesforcePayPalOrderAddress](dw.extensions.payments.SalesforcePayPalOrderAddress.md) |

          Salesforce Payments representation of a PayPal order address object. | +| [SalesforcePayPalOrderPayer](dw.extensions.payments.SalesforcePayPalOrderPayer.md) |

          Salesforce Payments representation of a PayPal order's payer object. | +| [SalesforcePayPalPaymentDetails](dw.extensions.payments.SalesforcePayPalPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePayPalOrder.TYPE_PAYPAL](dw.extensions.payments.SalesforcePayPalOrder.md#type_paypal). | +| [SalesforceSepaDebitPaymentDetails](dw.extensions.payments.SalesforceSepaDebitPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePaymentMethod.TYPE_SEPA_DEBIT](dw.extensions.payments.SalesforcePaymentMethod.md#type_sepa_debit). | +| [SalesforceVenmoPaymentDetails](dw.extensions.payments.SalesforceVenmoPaymentDetails.md) |

          Details to a Salesforce Payments payment of type [SalesforcePayPalOrder.TYPE_VENMO](dw.extensions.payments.SalesforcePayPalOrder.md#type_venmo). | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestAvailability.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestAvailability.md new file mode 100644 index 00000000..48f76790 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestAvailability.md @@ -0,0 +1,85 @@ + +# Class PinterestAvailability + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.pinterest.PinterestAvailability](dw.extensions.pinterest.PinterestAvailability.md) + +Represents a row in the Pinterest availability feed export file. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the Pinterest product. | +| [availability](#availability): [String](TopLevel.String.md) | Returns the availability of the Pinterest product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAvailability](dw.extensions.pinterest.PinterestAvailability.md#getavailability)() | Returns the availability of the Pinterest product. | +| [getID](dw.extensions.pinterest.PinterestAvailability.md#getid)() | Returns the ID of the Pinterest product. | +| [setAvailability](dw.extensions.pinterest.PinterestAvailability.md#setavailabilitystring)([String](TopLevel.String.md)) | Sets the availability of the Pinterest product. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the Pinterest product. This is the same as the ID of the Demandware product. + + +--- + +### availability +- availability: [String](TopLevel.String.md) + - : Returns the availability of the Pinterest product. Possible values are + [PinterestProduct.AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [PinterestProduct.AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + +--- + +## Method Details + +### getAvailability() +- getAvailability(): [String](TopLevel.String.md) + - : Returns the availability of the Pinterest product. Possible values are + [PinterestProduct.AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [PinterestProduct.AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the Pinterest product. This is the same as the ID of the Demandware product. + + **Returns:** + - product ID + + +--- + +### setAvailability(String) +- setAvailability(availability: [String](TopLevel.String.md)): void + - : Sets the availability of the Pinterest product. Possible values are + [PinterestProduct.AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [PinterestProduct.AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + **Parameters:** + - availability - the availability status to set for this product + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestFeedHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestFeedHooks.md new file mode 100644 index 00000000..555f9e77 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestFeedHooks.md @@ -0,0 +1,118 @@ + +# Class PinterestFeedHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.pinterest.PinterestFeedHooks](dw.extensions.pinterest.PinterestFeedHooks.md) + +PinterestFeedHooks interface containing extension points for customizing Pinterest export feeds. + + +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.feed.transformProduct", "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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointTransformAvailability](#extensionpointtransformavailability): [String](TopLevel.String.md) = "dw.extensions.pinterest.feed.transformAvailability" | The extension point name dw.extensions.pinterest.feed.transformAvailability. | +| [extensionPointTransformProduct](#extensionpointtransformproduct): [String](TopLevel.String.md) = "dw.extensions.pinterest.feed.transformProduct" | The extension point name dw.extensions.pinterest.feed.transformProduct. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [transformAvailability](dw.extensions.pinterest.PinterestFeedHooks.md#transformavailabilityproduct-pinterestavailability)([Product](dw.catalog.Product.md), [PinterestAvailability](dw.extensions.pinterest.PinterestAvailability.md)) | Called after default transformation of given Demandware product to Pinterest availability as part of the availability feed export. | +| [transformProduct](dw.extensions.pinterest.PinterestFeedHooks.md#transformproductproduct-pinterestproduct)([Product](dw.catalog.Product.md), [PinterestProduct](dw.extensions.pinterest.PinterestProduct.md)) | Called after default transformation of given Demandware product to Pinterest product as part of the catalog feed export. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointTransformAvailability + +- extensionPointTransformAvailability: [String](TopLevel.String.md) = "dw.extensions.pinterest.feed.transformAvailability" + - : The extension point name dw.extensions.pinterest.feed.transformAvailability. + + +--- + +### extensionPointTransformProduct + +- extensionPointTransformProduct: [String](TopLevel.String.md) = "dw.extensions.pinterest.feed.transformProduct" + - : The extension point name dw.extensions.pinterest.feed.transformProduct. + + +--- + +## Method Details + +### transformAvailability(Product, PinterestAvailability) +- transformAvailability(product: [Product](dw.catalog.Product.md), pinterestAvailability: [PinterestAvailability](dw.extensions.pinterest.PinterestAvailability.md)): [Status](dw.system.Status.md) + - : Called after default transformation of given Demandware product to Pinterest availability as part of the + availability feed export. + + + **Parameters:** + - product - the Demandware product + - pinterestAvailability - the Pinterest representation of the product availability + + **Returns:** + - a non-null Status ends the hook execution + + +--- + +### transformProduct(Product, PinterestProduct) +- transformProduct(product: [Product](dw.catalog.Product.md), pinterestProduct: [PinterestProduct](dw.extensions.pinterest.PinterestProduct.md)): [Status](dw.system.Status.md) + - : Called after default transformation of given Demandware product to Pinterest product as part of the catalog feed + export. + + + **Parameters:** + - product - the Demandware product + - pinterestProduct - the Pinterest representation of the product + + **Returns:** + - a non-null Status ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrder.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrder.md new file mode 100644 index 00000000..6d052ae2 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrder.md @@ -0,0 +1,263 @@ + +# Class PinterestOrder + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.pinterest.PinterestOrder](dw.extensions.pinterest.PinterestOrder.md) + +An order that was placed through Pinterest. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [PAYMENT_STATUS_NOT_PAID](#payment_status_not_paid): [String](TopLevel.String.md) = "NOT_PAID" | Indicates that payment has not been made. | +| [PAYMENT_STATUS_PAID](#payment_status_paid): [String](TopLevel.String.md) = "PAID" | Indicates that payment is complete. | +| [PAYMENT_STATUS_PART_PAID](#payment_status_part_paid): [String](TopLevel.String.md) = "PART_PAID" | Indicates that payment is incomplete. | +| [STATUS_BACKORDER](#status_backorder): [String](TopLevel.String.md) = "BACKORDER" | Indicates an order on backorder. | +| [STATUS_CANCELLED](#status_cancelled): [String](TopLevel.String.md) = "CANCELLED" | Indicates an order that has been canceled. | +| [STATUS_DELIVERED](#status_delivered): [String](TopLevel.String.md) = "DELIVERED" | Indicates an order that has been delivered. | +| [STATUS_IN_PROGRESS](#status_in_progress): [String](TopLevel.String.md) = "IN_PROGRESS" | Indicates an order in progress. | +| [STATUS_NEW](#status_new): [String](TopLevel.String.md) = "NEW" | Indicates a new order. | +| [STATUS_RETURNED](#status_returned): [String](TopLevel.String.md) = "RETURNED" | Indicates an order that has been returned. | +| [STATUS_SHIPPED](#status_shipped): [String](TopLevel.String.md) = "SHIPPED" | Indicates an order that has shipped. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [itemId](#itemid): [String](TopLevel.String.md) | Returns the item ID for this Pinterest order. | +| [orderNo](#orderno): [String](TopLevel.String.md) `(read-only)` | Returns the order number for this Pinterest order. | +| [paymentStatus](#paymentstatus): [String](TopLevel.String.md) | Returns the status of this Pinterest order. | +| [status](#status): [String](TopLevel.String.md) | Returns the status of this Pinterest order. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getItemId](dw.extensions.pinterest.PinterestOrder.md#getitemid)() | Returns the item ID for this Pinterest order. | +| [getOrderNo](dw.extensions.pinterest.PinterestOrder.md#getorderno)() | Returns the order number for this Pinterest order. | +| [getPaymentStatus](dw.extensions.pinterest.PinterestOrder.md#getpaymentstatus)() | Returns the status of this Pinterest order. | +| [getStatus](dw.extensions.pinterest.PinterestOrder.md#getstatus)() | Returns the status of this Pinterest order. | +| [setItemId](dw.extensions.pinterest.PinterestOrder.md#setitemidstring)([String](TopLevel.String.md)) | Sets the item ID for this Pinterest order. | +| [setPaymentStatus](dw.extensions.pinterest.PinterestOrder.md#setpaymentstatusstring)([String](TopLevel.String.md)) | Sets the status of this Pinterest order. | +| [setStatus](dw.extensions.pinterest.PinterestOrder.md#setstatusstring)([String](TopLevel.String.md)) | Sets the status of this Pinterest order. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### PAYMENT_STATUS_NOT_PAID + +- PAYMENT_STATUS_NOT_PAID: [String](TopLevel.String.md) = "NOT_PAID" + - : Indicates that payment has not been made. + + +--- + +### PAYMENT_STATUS_PAID + +- PAYMENT_STATUS_PAID: [String](TopLevel.String.md) = "PAID" + - : Indicates that payment is complete. + + +--- + +### PAYMENT_STATUS_PART_PAID + +- PAYMENT_STATUS_PART_PAID: [String](TopLevel.String.md) = "PART_PAID" + - : Indicates that payment is incomplete. + + +--- + +### STATUS_BACKORDER + +- STATUS_BACKORDER: [String](TopLevel.String.md) = "BACKORDER" + - : Indicates an order on backorder. + + +--- + +### STATUS_CANCELLED + +- STATUS_CANCELLED: [String](TopLevel.String.md) = "CANCELLED" + - : Indicates an order that has been canceled. + + +--- + +### STATUS_DELIVERED + +- STATUS_DELIVERED: [String](TopLevel.String.md) = "DELIVERED" + - : Indicates an order that has been delivered. + + +--- + +### STATUS_IN_PROGRESS + +- STATUS_IN_PROGRESS: [String](TopLevel.String.md) = "IN_PROGRESS" + - : Indicates an order in progress. + + +--- + +### STATUS_NEW + +- STATUS_NEW: [String](TopLevel.String.md) = "NEW" + - : Indicates a new order. + + +--- + +### STATUS_RETURNED + +- STATUS_RETURNED: [String](TopLevel.String.md) = "RETURNED" + - : Indicates an order that has been returned. + + +--- + +### STATUS_SHIPPED + +- STATUS_SHIPPED: [String](TopLevel.String.md) = "SHIPPED" + - : Indicates an order that has shipped. + + +--- + +## Property Details + +### itemId +- itemId: [String](TopLevel.String.md) + - : Returns the item ID for this Pinterest order. + + +--- + +### orderNo +- orderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the order number for this Pinterest order. This is the same as the order number of the Demandware order. + + +--- + +### paymentStatus +- paymentStatus: [String](TopLevel.String.md) + - : Returns the status of this Pinterest order. Possible values are + [PAYMENT_STATUS_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_paid), + [PAYMENT_STATUS_NOT_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_not_paid), + or [PAYMENT_STATUS_PART_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_part_paid). + + + +--- + +### status +- status: [String](TopLevel.String.md) + - : Returns the status of this Pinterest order. Possible values are + [STATUS_NEW](dw.extensions.pinterest.PinterestOrder.md#status_new), + [STATUS_IN_PROGRESS](dw.extensions.pinterest.PinterestOrder.md#status_in_progress), + [STATUS_SHIPPED](dw.extensions.pinterest.PinterestOrder.md#status_shipped), + [STATUS_BACKORDER](dw.extensions.pinterest.PinterestOrder.md#status_backorder), + [STATUS_CANCELLED](dw.extensions.pinterest.PinterestOrder.md#status_cancelled), + [STATUS_DELIVERED](dw.extensions.pinterest.PinterestOrder.md#status_delivered), + or [STATUS_RETURNED](dw.extensions.pinterest.PinterestOrder.md#status_returned). + + + +--- + +## Method Details + +### getItemId() +- getItemId(): [String](TopLevel.String.md) + - : Returns the item ID for this Pinterest order. + + +--- + +### getOrderNo() +- getOrderNo(): [String](TopLevel.String.md) + - : Returns the order number for this Pinterest order. This is the same as the order number of the Demandware order. + + **Returns:** + - order number + + +--- + +### getPaymentStatus() +- getPaymentStatus(): [String](TopLevel.String.md) + - : Returns the status of this Pinterest order. Possible values are + [PAYMENT_STATUS_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_paid), + [PAYMENT_STATUS_NOT_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_not_paid), + or [PAYMENT_STATUS_PART_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_part_paid). + + + +--- + +### getStatus() +- getStatus(): [String](TopLevel.String.md) + - : Returns the status of this Pinterest order. Possible values are + [STATUS_NEW](dw.extensions.pinterest.PinterestOrder.md#status_new), + [STATUS_IN_PROGRESS](dw.extensions.pinterest.PinterestOrder.md#status_in_progress), + [STATUS_SHIPPED](dw.extensions.pinterest.PinterestOrder.md#status_shipped), + [STATUS_BACKORDER](dw.extensions.pinterest.PinterestOrder.md#status_backorder), + [STATUS_CANCELLED](dw.extensions.pinterest.PinterestOrder.md#status_cancelled), + [STATUS_DELIVERED](dw.extensions.pinterest.PinterestOrder.md#status_delivered), + or [STATUS_RETURNED](dw.extensions.pinterest.PinterestOrder.md#status_returned). + + + +--- + +### setItemId(String) +- setItemId(itemId: [String](TopLevel.String.md)): void + - : Sets the item ID for this Pinterest order. + + **Parameters:** + - itemId - item ID + + +--- + +### setPaymentStatus(String) +- setPaymentStatus(status: [String](TopLevel.String.md)): void + - : Sets the status of this Pinterest order. Possible values are + [PAYMENT_STATUS_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_paid), + [PAYMENT_STATUS_NOT_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_not_paid), + or [PAYMENT_STATUS_PART_PAID](dw.extensions.pinterest.PinterestOrder.md#payment_status_part_paid). + + + **Parameters:** + - status - the status to set for this order + + +--- + +### setStatus(String) +- setStatus(status: [String](TopLevel.String.md)): void + - : Sets the status of this Pinterest order. Possible values are + [STATUS_NEW](dw.extensions.pinterest.PinterestOrder.md#status_new), + [STATUS_IN_PROGRESS](dw.extensions.pinterest.PinterestOrder.md#status_in_progress), + [STATUS_SHIPPED](dw.extensions.pinterest.PinterestOrder.md#status_shipped), + [STATUS_BACKORDER](dw.extensions.pinterest.PinterestOrder.md#status_backorder), + [STATUS_CANCELLED](dw.extensions.pinterest.PinterestOrder.md#status_cancelled), + [STATUS_DELIVERED](dw.extensions.pinterest.PinterestOrder.md#status_delivered), + or [STATUS_RETURNED](dw.extensions.pinterest.PinterestOrder.md#status_returned). + + + **Parameters:** + - status - the status to set for this order + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrderHooks.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrderHooks.md new file mode 100644 index 00000000..cc7b9b98 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestOrderHooks.md @@ -0,0 +1,89 @@ + +# Class PinterestOrderHooks + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.pinterest.PinterestOrderHooks](dw.extensions.pinterest.PinterestOrderHooks.md) + +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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [extensionPointGetStatus](#extensionpointgetstatus): [String](TopLevel.String.md) = "dw.extensions.pinterest.order.getStatus" | The extension point name dw.extensions.pinterest.order.getStatus. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getStatus](dw.extensions.pinterest.PinterestOrderHooks.md#getstatuspinterestorder)([PinterestOrder](dw.extensions.pinterest.PinterestOrder.md)) | Called to retrieve status for the given order. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### extensionPointGetStatus + +- extensionPointGetStatus: [String](TopLevel.String.md) = "dw.extensions.pinterest.order.getStatus" + - : The extension point name dw.extensions.pinterest.order.getStatus. + + +--- + +## Method Details + +### getStatus(PinterestOrder) +- getStatus(order: [PinterestOrder](dw.extensions.pinterest.PinterestOrder.md)): [Status](dw.system.Status.md) + - : Called to retrieve status for the given order. Return a `null` status for unknown orders. + + **Parameters:** + - order - the Pinterest order + + **Returns:** + - a non-null Status ends the hook execution + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestProduct.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestProduct.md new file mode 100644 index 00000000..da2f6f2f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.PinterestProduct.md @@ -0,0 +1,677 @@ + +# Class PinterestProduct + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.extensions.pinterest.PinterestProduct](dw.extensions.pinterest.PinterestProduct.md) + +Represents a row in the Pinterest catalog feed export. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [AVAILABILITY_IN_STOCK](#availability_in_stock): [String](TopLevel.String.md) = "in stock" | Indicates that the product is in stock. | +| [AVAILABILITY_OUT_OF_STOCK](#availability_out_of_stock): [String](TopLevel.String.md) = "out of stock" | Indicates that the product is not in stock. | +| [AVAILABILITY_PREORDER](#availability_preorder): [String](TopLevel.String.md) = "preorder" | Indicates that the product is availabile in preorder. | +| [CONDITION_NEW](#condition_new): [String](TopLevel.String.md) = "new" | Indicates that the product has never been used. | +| [CONDITION_REFURBISHED](#condition_refurbished): [String](TopLevel.String.md) = "refurbished" | Indicates that the product has been used but refurbished. | +| [CONDITION_USED](#condition_used): [String](TopLevel.String.md) = "used" | Indicates that the product has been used. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the Pinterest product. | +| [availability](#availability): [String](TopLevel.String.md) | Returns the availability of the Pinterest product. | +| [brand](#brand): [String](TopLevel.String.md) | Returns the Pinterest brand of the product. | +| [color](#color): [String](TopLevel.String.md) | Returns the Pinterest color value label of the product. | +| [colorHex](#colorhex): [String](TopLevel.String.md) | Returns the Pinterest color hex value of the product. | +| [colorImage](#colorimage): [URL](dw.web.URL.md) | Returns the URL of the image to show in Pinterest for the product color (swatch). | +| [condition](#condition): [String](TopLevel.String.md) | Returns the condition of the Pinterest product. | +| [description](#description): [String](TopLevel.String.md) | Returns the Pinterest description of the product. | +| [googleProductCategory](#googleproductcategory): [String](TopLevel.String.md) | Returns the category of this product in the Google category taxonomy. | +| [gtin](#gtin): [String](TopLevel.String.md) | Returns the Pinterest GTIN of the product. | +| [imageLinks](#imagelinks): [List](dw.util.List.md) | Returns a list containing the URLs of the image to show in Pinterest for the product. | +| [itemGroupID](#itemgroupid): [String](TopLevel.String.md) | Returns the ID of the Pinterest item group for the product, that is, its master product. | +| [itemGroupLink](#itemgrouplink): [URL](dw.web.URL.md) | Returns the URL of the Pinterest item group for the product, that is, the link to its master product in the Demandware storefront. | +| [link](#link): [URL](dw.web.URL.md) | Returns the URL of the Demandware storefront link to the product. | +| [maxPrice](#maxprice): [Money](dw.value.Money.md) | Returns the maximum price to show in Pinterest for the product. | +| [minPrice](#minprice): [Money](dw.value.Money.md) | Returns the minimum price to show in Pinterest for the product. | +| [price](#price): [Money](dw.value.Money.md) | Returns the price to show in Pinterest for the product. | +| [productCategory](#productcategory): [String](TopLevel.String.md) | Returns the Pinterest category path of the product. | +| [returnPolicy](#returnpolicy): [String](TopLevel.String.md) | Returns the Pinterest return policy of the product. | +| [size](#size): [String](TopLevel.String.md) | Returns the Pinterest size value label of the product. | +| [title](#title): [String](TopLevel.String.md) | Returns the Pinterest title of the product. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAvailability](dw.extensions.pinterest.PinterestProduct.md#getavailability)() | Returns the availability of the Pinterest product. | +| [getBrand](dw.extensions.pinterest.PinterestProduct.md#getbrand)() | Returns the Pinterest brand of the product. | +| [getColor](dw.extensions.pinterest.PinterestProduct.md#getcolor)() | Returns the Pinterest color value label of the product. | +| [getColorHex](dw.extensions.pinterest.PinterestProduct.md#getcolorhex)() | Returns the Pinterest color hex value of the product. | +| [getColorImage](dw.extensions.pinterest.PinterestProduct.md#getcolorimage)() | Returns the URL of the image to show in Pinterest for the product color (swatch). | +| [getCondition](dw.extensions.pinterest.PinterestProduct.md#getcondition)() | Returns the condition of the Pinterest product. | +| [getDescription](dw.extensions.pinterest.PinterestProduct.md#getdescription)() | Returns the Pinterest description of the product. | +| [getGoogleProductCategory](dw.extensions.pinterest.PinterestProduct.md#getgoogleproductcategory)() | Returns the category of this product in the Google category taxonomy. | +| [getGtin](dw.extensions.pinterest.PinterestProduct.md#getgtin)() | Returns the Pinterest GTIN of the product. | +| [getID](dw.extensions.pinterest.PinterestProduct.md#getid)() | Returns the ID of the Pinterest product. | +| [getImageLinks](dw.extensions.pinterest.PinterestProduct.md#getimagelinks)() | Returns a list containing the URLs of the image to show in Pinterest for the product. | +| [getItemGroupID](dw.extensions.pinterest.PinterestProduct.md#getitemgroupid)() | Returns the ID of the Pinterest item group for the product, that is, its master product. | +| [getItemGroupLink](dw.extensions.pinterest.PinterestProduct.md#getitemgrouplink)() | Returns the URL of the Pinterest item group for the product, that is, the link to its master product in the Demandware storefront. | +| [getLink](dw.extensions.pinterest.PinterestProduct.md#getlink)() | Returns the URL of the Demandware storefront link to the product. | +| [getMaxPrice](dw.extensions.pinterest.PinterestProduct.md#getmaxprice)() | Returns the maximum price to show in Pinterest for the product. | +| [getMinPrice](dw.extensions.pinterest.PinterestProduct.md#getminprice)() | Returns the minimum price to show in Pinterest for the product. | +| [getPrice](dw.extensions.pinterest.PinterestProduct.md#getprice)() | Returns the price to show in Pinterest for the product. | +| [getProductCategory](dw.extensions.pinterest.PinterestProduct.md#getproductcategory)() | Returns the Pinterest category path of the product. | +| [getReturnPolicy](dw.extensions.pinterest.PinterestProduct.md#getreturnpolicy)() | Returns the Pinterest return policy of the product. | +| [getSize](dw.extensions.pinterest.PinterestProduct.md#getsize)() | Returns the Pinterest size value label of the product. | +| [getTitle](dw.extensions.pinterest.PinterestProduct.md#gettitle)() | Returns the Pinterest title of the product. | +| [setAvailability](dw.extensions.pinterest.PinterestProduct.md#setavailabilitystring)([String](TopLevel.String.md)) | Sets the availability of the Pinterest product. | +| [setBrand](dw.extensions.pinterest.PinterestProduct.md#setbrandstring)([String](TopLevel.String.md)) | Sets the Pinterest brand of the product. | +| [setColor](dw.extensions.pinterest.PinterestProduct.md#setcolorstring)([String](TopLevel.String.md)) | Sets the Pinterest color value label of the product. | +| [setColorHex](dw.extensions.pinterest.PinterestProduct.md#setcolorhexstring)([String](TopLevel.String.md)) | Sets the Pinterest color hex value of the product. | +| [setColorImage](dw.extensions.pinterest.PinterestProduct.md#setcolorimageurl)([URL](dw.web.URL.md)) | Sets the URL of the image to show in Pinterest for the product color (swatch). | +| [setCondition](dw.extensions.pinterest.PinterestProduct.md#setconditionstring)([String](TopLevel.String.md)) | Sets the condition of the Pinterest product. | +| [setDescription](dw.extensions.pinterest.PinterestProduct.md#setdescriptionstring)([String](TopLevel.String.md)) | Sets the Pinterest description of the product. | +| [setGoogleProductCategory](dw.extensions.pinterest.PinterestProduct.md#setgoogleproductcategorystring)([String](TopLevel.String.md)) | Sets the category of this product in the Google category taxonomy. | +| [setGtin](dw.extensions.pinterest.PinterestProduct.md#setgtinstring)([String](TopLevel.String.md)) | Sets the Pinterest GTIN of the product. | +| [setImageLinks](dw.extensions.pinterest.PinterestProduct.md#setimagelinkslist)([List](dw.util.List.md)) | Sets the list of URLs of images to show in Pinterest for the product. | +| [setItemGroupID](dw.extensions.pinterest.PinterestProduct.md#setitemgroupidstring)([String](TopLevel.String.md)) | Sets the ID of the Pinterest item group for the product, that is, its master product. | +| [setItemGroupLink](dw.extensions.pinterest.PinterestProduct.md#setitemgrouplinkurl)([URL](dw.web.URL.md)) | Sets the URL of the Pinterest item group for the product, that is, the link to its master product in the Demandware storefront. | +| [setLink](dw.extensions.pinterest.PinterestProduct.md#setlinkurl)([URL](dw.web.URL.md)) | Sets the URL of the Demandware storefront link to the product. | +| [setMaxPrice](dw.extensions.pinterest.PinterestProduct.md#setmaxpricemoney)([Money](dw.value.Money.md)) | Sets the maximum price to show in Pinterest for the product. | +| [setMinPrice](dw.extensions.pinterest.PinterestProduct.md#setminpricemoney)([Money](dw.value.Money.md)) | Sets the minimum price to show in Pinterest for the product. | +| [setPrice](dw.extensions.pinterest.PinterestProduct.md#setpricemoney)([Money](dw.value.Money.md)) | Sets the price to show in Pinterest for the product. | +| [setProductCategory](dw.extensions.pinterest.PinterestProduct.md#setproductcategorystring)([String](TopLevel.String.md)) | Sets the Pinterest category path of the product. | +| [setReturnPolicy](dw.extensions.pinterest.PinterestProduct.md#setreturnpolicystring)([String](TopLevel.String.md)) | Sets the Pinterest return policy of the product. | +| [setSize](dw.extensions.pinterest.PinterestProduct.md#setsizestring)([String](TopLevel.String.md)) | Sets the Pinterest size value label of the product. | +| [setTitle](dw.extensions.pinterest.PinterestProduct.md#settitlestring)([String](TopLevel.String.md)) | Sets the Pinterest title of the product. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### AVAILABILITY_IN_STOCK + +- AVAILABILITY_IN_STOCK: [String](TopLevel.String.md) = "in stock" + - : Indicates that the product is in stock. + + +--- + +### AVAILABILITY_OUT_OF_STOCK + +- AVAILABILITY_OUT_OF_STOCK: [String](TopLevel.String.md) = "out of stock" + - : Indicates that the product is not in stock. + + +--- + +### AVAILABILITY_PREORDER + +- AVAILABILITY_PREORDER: [String](TopLevel.String.md) = "preorder" + - : Indicates that the product is availabile in preorder. + + +--- + +### CONDITION_NEW + +- CONDITION_NEW: [String](TopLevel.String.md) = "new" + - : Indicates that the product has never been used. + + +--- + +### CONDITION_REFURBISHED + +- CONDITION_REFURBISHED: [String](TopLevel.String.md) = "refurbished" + - : Indicates that the product has been used but refurbished. + + +--- + +### CONDITION_USED + +- CONDITION_USED: [String](TopLevel.String.md) = "used" + - : Indicates that the product has been used. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the Pinterest product. This is the same as the ID of the Demandware product. + + +--- + +### availability +- availability: [String](TopLevel.String.md) + - : Returns the availability of the Pinterest product. Possible values are + [AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + +--- + +### brand +- brand: [String](TopLevel.String.md) + - : Returns the Pinterest brand of the product. + + +--- + +### color +- color: [String](TopLevel.String.md) + - : Returns the Pinterest color value label of the product. + + +--- + +### colorHex +- colorHex: [String](TopLevel.String.md) + - : Returns the Pinterest color hex value of the product. + + +--- + +### colorImage +- colorImage: [URL](dw.web.URL.md) + - : Returns the URL of the image to show in Pinterest for the product color (swatch). + + +--- + +### condition +- condition: [String](TopLevel.String.md) + - : Returns the condition of the Pinterest product. Possible values are + [CONDITION_NEW](dw.extensions.pinterest.PinterestProduct.md#condition_new), + [CONDITION_REFURBISHED](dw.extensions.pinterest.PinterestProduct.md#condition_refurbished), or + [CONDITION_USED](dw.extensions.pinterest.PinterestProduct.md#condition_used). + + + +--- + +### description +- description: [String](TopLevel.String.md) + - : Returns the Pinterest description of the product. + + +--- + +### googleProductCategory +- googleProductCategory: [String](TopLevel.String.md) + - : Returns the category of this product in the Google category taxonomy. + + +--- + +### gtin +- gtin: [String](TopLevel.String.md) + - : Returns the Pinterest GTIN of the product. + + +--- + +### imageLinks +- imageLinks: [List](dw.util.List.md) + - : Returns a list containing the URLs of the image to show in Pinterest for the product. + + +--- + +### itemGroupID +- itemGroupID: [String](TopLevel.String.md) + - : Returns the ID of the Pinterest item group for the product, that is, its master product. + + +--- + +### itemGroupLink +- itemGroupLink: [URL](dw.web.URL.md) + - : Returns the URL of the Pinterest item group for the product, that is, the link to its master product in the + Demandware storefront. + + + +--- + +### link +- link: [URL](dw.web.URL.md) + - : Returns the URL of the Demandware storefront link to the product. + + +--- + +### maxPrice +- maxPrice: [Money](dw.value.Money.md) + - : Returns the maximum price to show in Pinterest for the product. + + +--- + +### minPrice +- minPrice: [Money](dw.value.Money.md) + - : Returns the minimum price to show in Pinterest for the product. + + +--- + +### price +- price: [Money](dw.value.Money.md) + - : Returns the price to show in Pinterest for the product. + + +--- + +### productCategory +- productCategory: [String](TopLevel.String.md) + - : Returns the Pinterest category path of the product. + + +--- + +### returnPolicy +- returnPolicy: [String](TopLevel.String.md) + - : Returns the Pinterest return policy of the product. + + +--- + +### size +- size: [String](TopLevel.String.md) + - : Returns the Pinterest size value label of the product. + + +--- + +### title +- title: [String](TopLevel.String.md) + - : Returns the Pinterest title of the product. + + +--- + +## Method Details + +### getAvailability() +- getAvailability(): [String](TopLevel.String.md) + - : Returns the availability of the Pinterest product. Possible values are + [AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + +--- + +### getBrand() +- getBrand(): [String](TopLevel.String.md) + - : Returns the Pinterest brand of the product. + + +--- + +### getColor() +- getColor(): [String](TopLevel.String.md) + - : Returns the Pinterest color value label of the product. + + +--- + +### getColorHex() +- getColorHex(): [String](TopLevel.String.md) + - : Returns the Pinterest color hex value of the product. + + +--- + +### getColorImage() +- getColorImage(): [URL](dw.web.URL.md) + - : Returns the URL of the image to show in Pinterest for the product color (swatch). + + +--- + +### getCondition() +- getCondition(): [String](TopLevel.String.md) + - : Returns the condition of the Pinterest product. Possible values are + [CONDITION_NEW](dw.extensions.pinterest.PinterestProduct.md#condition_new), + [CONDITION_REFURBISHED](dw.extensions.pinterest.PinterestProduct.md#condition_refurbished), or + [CONDITION_USED](dw.extensions.pinterest.PinterestProduct.md#condition_used). + + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the Pinterest description of the product. + + +--- + +### getGoogleProductCategory() +- getGoogleProductCategory(): [String](TopLevel.String.md) + - : Returns the category of this product in the Google category taxonomy. + + +--- + +### getGtin() +- getGtin(): [String](TopLevel.String.md) + - : Returns the Pinterest GTIN of the product. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the Pinterest product. This is the same as the ID of the Demandware product. + + **Returns:** + - product ID + + +--- + +### getImageLinks() +- getImageLinks(): [List](dw.util.List.md) + - : Returns a list containing the URLs of the image to show in Pinterest for the product. + + +--- + +### getItemGroupID() +- getItemGroupID(): [String](TopLevel.String.md) + - : Returns the ID of the Pinterest item group for the product, that is, its master product. + + +--- + +### getItemGroupLink() +- getItemGroupLink(): [URL](dw.web.URL.md) + - : Returns the URL of the Pinterest item group for the product, that is, the link to its master product in the + Demandware storefront. + + + +--- + +### getLink() +- getLink(): [URL](dw.web.URL.md) + - : Returns the URL of the Demandware storefront link to the product. + + +--- + +### getMaxPrice() +- getMaxPrice(): [Money](dw.value.Money.md) + - : Returns the maximum price to show in Pinterest for the product. + + +--- + +### getMinPrice() +- getMinPrice(): [Money](dw.value.Money.md) + - : Returns the minimum price to show in Pinterest for the product. + + +--- + +### getPrice() +- getPrice(): [Money](dw.value.Money.md) + - : Returns the price to show in Pinterest for the product. + + +--- + +### getProductCategory() +- getProductCategory(): [String](TopLevel.String.md) + - : Returns the Pinterest category path of the product. + + +--- + +### getReturnPolicy() +- getReturnPolicy(): [String](TopLevel.String.md) + - : Returns the Pinterest return policy of the product. + + +--- + +### getSize() +- getSize(): [String](TopLevel.String.md) + - : Returns the Pinterest size value label of the product. + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the Pinterest title of the product. + + +--- + +### setAvailability(String) +- setAvailability(availability: [String](TopLevel.String.md)): void + - : Sets the availability of the Pinterest product. Possible values are + [AVAILABILITY_IN_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_in_stock) or + [AVAILABILITY_OUT_OF_STOCK](dw.extensions.pinterest.PinterestProduct.md#availability_out_of_stock). + + + **Parameters:** + - availability - the availability status to set for this product + + +--- + +### setBrand(String) +- setBrand(brand: [String](TopLevel.String.md)): void + - : Sets the Pinterest brand of the product. + + **Parameters:** + - brand - Pinterest brand + + +--- + +### setColor(String) +- setColor(color: [String](TopLevel.String.md)): void + - : Sets the Pinterest color value label of the product. + + **Parameters:** + - color - Pinterest color value label + + +--- + +### setColorHex(String) +- setColorHex(colorHex: [String](TopLevel.String.md)): void + - : Sets the Pinterest color hex value of the product. + + **Parameters:** + - colorHex - Pinterest color hex value + + +--- + +### setColorImage(URL) +- setColorImage(colorImage: [URL](dw.web.URL.md)): void + - : Sets the URL of the image to show in Pinterest for the product color (swatch). + + **Parameters:** + - colorImage - link to Pinterest color image + + +--- + +### setCondition(String) +- setCondition(condition: [String](TopLevel.String.md)): void + - : Sets the condition of the Pinterest product. Possible values are + [CONDITION_NEW](dw.extensions.pinterest.PinterestProduct.md#condition_new), + [CONDITION_REFURBISHED](dw.extensions.pinterest.PinterestProduct.md#condition_refurbished), or + [CONDITION_USED](dw.extensions.pinterest.PinterestProduct.md#condition_used). + + + **Parameters:** + - condition - the condition status to set for this product + + +--- + +### setDescription(String) +- setDescription(description: [String](TopLevel.String.md)): void + - : Sets the Pinterest description of the product. + + **Parameters:** + - description - Pinterest description + + +--- + +### setGoogleProductCategory(String) +- setGoogleProductCategory(googleProductCategory: [String](TopLevel.String.md)): void + - : Sets the category of this product in the Google category taxonomy. + + **Parameters:** + - googleProductCategory - Google product category + + +--- + +### setGtin(String) +- setGtin(gtin: [String](TopLevel.String.md)): void + - : Sets the Pinterest GTIN of the product. + + **Parameters:** + - gtin - Pinterest GTIN + + +--- + +### setImageLinks(List) +- setImageLinks(imageLinks: [List](dw.util.List.md)): void + - : Sets the list of URLs of images to show in Pinterest for the product. + + **Parameters:** + - imageLinks - links to the product images + + +--- + +### setItemGroupID(String) +- setItemGroupID(itemGroupID: [String](TopLevel.String.md)): void + - : Sets the ID of the Pinterest item group for the product, that is, its master product. + + **Parameters:** + - itemGroupID - ID of Pinterest item group + + +--- + +### setItemGroupLink(URL) +- setItemGroupLink(itemGroupLink: [URL](dw.web.URL.md)): void + - : Sets the URL of the Pinterest item group for the product, that is, the link to its master product in the + Demandware storefront. + + + **Parameters:** + - itemGroupLink - link to the Pinterest item group + + +--- + +### setLink(URL) +- setLink(link: [URL](dw.web.URL.md)): void + - : Sets the URL of the Demandware storefront link to the product. + + **Parameters:** + - link - Demandware storefront link to the product + + +--- + +### setMaxPrice(Money) +- setMaxPrice(maxPrice: [Money](dw.value.Money.md)): void + - : Sets the maximum price to show in Pinterest for the product. + + **Parameters:** + - maxPrice - Pinterest maximum price + + +--- + +### setMinPrice(Money) +- setMinPrice(minPrice: [Money](dw.value.Money.md)): void + - : Sets the minimum price to show in Pinterest for the product. + + **Parameters:** + - minPrice - Pinterest minimum price + + +--- + +### setPrice(Money) +- setPrice(price: [Money](dw.value.Money.md)): void + - : Sets the price to show in Pinterest for the product. + + **Parameters:** + - price - Pinterest price + + +--- + +### setProductCategory(String) +- setProductCategory(productCategory: [String](TopLevel.String.md)): void + - : Sets the Pinterest category path of the product. + + **Parameters:** + - productCategory - Pinterest category path + + +--- + +### setReturnPolicy(String) +- setReturnPolicy(returnPolicy: [String](TopLevel.String.md)): void + - : Sets the Pinterest return policy of the product. + + **Parameters:** + - returnPolicy - Pinterest return policy + + +--- + +### setSize(String) +- setSize(size: [String](TopLevel.String.md)): void + - : Sets the Pinterest size value label of the product. + + **Parameters:** + - size - Pinterest size value label + + +--- + +### setTitle(String) +- setTitle(title: [String](TopLevel.String.md)): void + - : Sets the Pinterest title of the product. + + **Parameters:** + - title - Pinterest title + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.md b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.md new file mode 100644 index 00000000..7853cdab --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.extensions.pinterest.md @@ -0,0 +1,10 @@ +# Package dw.extensions.pinterest + +## Classes +| Class | Description | +| --- | --- | +| [PinterestAvailability](dw.extensions.pinterest.PinterestAvailability.md) | Represents a row in the Pinterest availability feed export file. | +| [PinterestFeedHooks](dw.extensions.pinterest.PinterestFeedHooks.md) | PinterestFeedHooks interface containing extension points for customizing Pinterest export feeds. | +| [PinterestOrder](dw.extensions.pinterest.PinterestOrder.md) | An order that was placed through Pinterest. | +| [PinterestOrderHooks](dw.extensions.pinterest.PinterestOrderHooks.md) | PinterestOrderHooks interface containing extension points for customizing Pinterest order status. | +| [PinterestProduct](dw.extensions.pinterest.PinterestProduct.md) | Represents a row in the Pinterest catalog feed export. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamReader.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamReader.md new file mode 100644 index 00000000..69305b15 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamReader.md @@ -0,0 +1,128 @@ + +# Class CSVStreamReader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.CSVStreamReader](dw.io.CSVStreamReader.md) + +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. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CSVStreamReader](#csvstreamreaderreader)([Reader](dw.io.Reader.md)) | Creates a new CSVReader with a ',' as separator character and a '"' as quote character. | +| [CSVStreamReader](#csvstreamreaderreader-string)([Reader](dw.io.Reader.md), [String](TopLevel.String.md)) | Creates a new CSVReader with the specified separator character and a '"' as quote character. | +| [CSVStreamReader](#csvstreamreaderreader-string-string)([Reader](dw.io.Reader.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Creates a new CSVReader with the specified separator character and the specified quote character. | +| [CSVStreamReader](#csvstreamreaderreader-string-string-number)([Reader](dw.io.Reader.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Creates a new CSVReader. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.CSVStreamReader.md#close)() | Closes the underlying reader. | +| [readAll](dw.io.CSVStreamReader.md#readall)() | Returns a list of lines representing the entire CSV file. | +| [readNext](dw.io.CSVStreamReader.md#readnext)() | Returns the next line from the input stream. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CSVStreamReader(Reader) +- CSVStreamReader(ioreader: [Reader](dw.io.Reader.md)) + - : Creates a new CSVReader with a ',' as separator character and a '"' as + quote character. The reader doesn't skip any header lines. + + + **Parameters:** + - ioreader - the reader to use. + + +--- + +### CSVStreamReader(Reader, String) +- CSVStreamReader(ioreader: [Reader](dw.io.Reader.md), separator: [String](TopLevel.String.md)) + - : Creates a new CSVReader with the specified separator character and a '"' + as quote character. The reader doesn't skip any header lines. + + + **Parameters:** + - ioreader - the reader to use. + - separator - a string, which represents the separator character. + + +--- + +### CSVStreamReader(Reader, String, String) +- CSVStreamReader(ioreader: [Reader](dw.io.Reader.md), separator: [String](TopLevel.String.md), quote: [String](TopLevel.String.md)) + - : Creates a new CSVReader with the specified separator character and the + specified quote character. The reader doesn't skip any header lines. + + + **Parameters:** + - ioreader - the reader to use. + - separator - a string, which represents the separator character. + - quote - a string, which represents the quote character. + + +--- + +### CSVStreamReader(Reader, String, String, Number) +- CSVStreamReader(ioreader: [Reader](dw.io.Reader.md), separator: [String](TopLevel.String.md), quote: [String](TopLevel.String.md), skip: [Number](TopLevel.Number.md)) + - : Creates a new CSVReader. The separator character, the quote character and + the number of header lines can be specified in the call. + + + **Parameters:** + - ioreader - the reader to use. + - separator - a string, which represents the separator character. + - quote - a string, which represents the quote character. + - skip - the number of lines to skip at the beginning of the file. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the underlying reader. + + +--- + +### readAll() +- readAll(): [List](dw.util.List.md) + - : 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()](dw.io.CSVStreamReader.md#readnext) and + process entries line by line. + + + **Returns:** + - a list of lines representing the entire CSV file. + + +--- + +### readNext() +- readNext(): [String\[\]](TopLevel.String.md) + - : 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. + + + **Returns:** + - the next line from the input stream as an array of strings. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamWriter.md new file mode 100644 index 00000000..7cc47f73 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.CSVStreamWriter.md @@ -0,0 +1,92 @@ + +# Class CSVStreamWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.CSVStreamWriter](dw.io.CSVStreamWriter.md) + +The class writes a CSV file. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CSVStreamWriter](#csvstreamwriterwriter)([Writer](dw.io.Writer.md)) | Create a new CSVStreamWriter with a ',' as separator and '"' as quote character. | +| [CSVStreamWriter](#csvstreamwriterwriter-string)([Writer](dw.io.Writer.md), [String](TopLevel.String.md)) | Create a new CSVStreamWriter with the specified separator and '"' as quote character. | +| [CSVStreamWriter](#csvstreamwriterwriter-string-string)([Writer](dw.io.Writer.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Create a new CSVStreamWriter with the specified separator and the specified quote character. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.CSVStreamWriter.md#close)() | Closes the underlying writer. | +| [writeNext](dw.io.CSVStreamWriter.md#writenextstring)([String...](TopLevel.String.md)) | Write a single line to the CSV file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CSVStreamWriter(Writer) +- CSVStreamWriter(writer: [Writer](dw.io.Writer.md)) + - : Create a new CSVStreamWriter with a ',' as separator and '"' + as quote character. + + + **Parameters:** + - writer - the writer to use. + + +--- + +### CSVStreamWriter(Writer, String) +- CSVStreamWriter(writer: [Writer](dw.io.Writer.md), separator: [String](TopLevel.String.md)) + - : Create a new CSVStreamWriter with the specified separator and '"' + as quote character. + + + **Parameters:** + - writer - the writer to use. + - separator - the separator to use. + + +--- + +### CSVStreamWriter(Writer, String, String) +- CSVStreamWriter(writer: [Writer](dw.io.Writer.md), separator: [String](TopLevel.String.md), quote: [String](TopLevel.String.md)) + - : Create a new CSVStreamWriter with the specified separator and the + specified quote character. + + + **Parameters:** + - writer - the writer to use. + - separator - the separator to use. + - quote - the quote to use. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the underlying writer. + + +--- + +### writeNext(String...) +- writeNext(line: [String...](TopLevel.String.md)): void + - : Write a single line to the CSV file. + + **Parameters:** + - line - an array of strings. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.File.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.File.md new file mode 100644 index 00000000..83a07d6b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.File.md @@ -0,0 +1,729 @@ + +# Class File + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.File](dw.io.File.md) + +Represents a file resource accessible from scripting. As with +`java.io.File`, a `File` is essentially an +"abstract pathname" which may or may not denote an actual file on the file +system. Methods `createNewFile`, +`mkdir`, `mkdirs`, and `remove` are provided +to actually manipulate physical files. + + +File access is limited to certain virtual directories. These directories are +a subset of those accessible through WebDAV. As a result of this +restriction, pathnames must be one of the following forms: + + + +- `/TEMP(/...)` +- `/IMPEX(/...)` +- `/REALMDATA(/...)` +- `/CATALOGS/[Catalog Name](/...)` +- `/LIBRARIES/[Library Name](/...)` + + +Note, that these paths are analogous to the WebDAV URIs used to access the +same directories. + + +The files are stored in a shared file system where multiple processes could +access the same file. The programmer has to make sure no more than one process +writes to a file at a given time. + + + +This class provides other useful methods for listing the +children of a directory and for working with zip files. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information. + + +For performance reasons no more than 100,000 files (regular files and directories) should be stored in a +directory. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CATALOGS](#catalogs): [String](TopLevel.String.md) = "CATALOGS" | Catalogs root directory. | +| [CUSTOMERPI](#customerpi): [String](TopLevel.String.md) = "CUSTOMERPI" | Customer Payment Instrument root directory. | +| [CUSTOMER_SNAPSHOTS](#customer_snapshots): [String](TopLevel.String.md) = "CUSTOMERSNAPSHOTS" | Customer snapshots root directory. | +| [DYNAMIC](#dynamic): [String](TopLevel.String.md) = "DYNAMIC" | Reserved for future use. | +| [IMPEX](#impex): [String](TopLevel.String.md) = "IMPEX" | Import/export root directory. | +| [LIBRARIES](#libraries): [String](TopLevel.String.md) = "LIBRARIES" | Libraries root directory. | +| ~~[REALMDATA](#realmdata): [String](TopLevel.String.md) = "REALMDATA"~~ | RealmData root directory. | +| [SEPARATOR](#separator): [String](TopLevel.String.md) = "/" | The UNIX style '/' path separator, which must be used for files paths. | +| [STATIC](#static): [String](TopLevel.String.md) = "STATIC" | Static content root directory. | +| [TEMP](#temp): [String](TopLevel.String.md) = "TEMP" | Temp root directory. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [directory](#directory): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates that this file is a directory. | +| [file](#file): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates if this file is a file. | +| [fullPath](#fullpath): [String](TopLevel.String.md) `(read-only)` | Return the full file path denoted by this `File`. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the file or directory denoted by this object. | +| ~~[path](#path): [String](TopLevel.String.md)~~ `(read-only)` | Returns the portion of the path relative to the root directory. | +| [rootDirectoryType](#rootdirectorytype): [String](TopLevel.String.md) `(read-only)` | Returns the root directory type, e.g. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [File](#filestring)([String](TopLevel.String.md)) | Creates a `File` from the given absolute file path in the file namespace. | +| [File](#filefile-string)([File](dw.io.File.md), [String](TopLevel.String.md)) | Creates a `File` given a root directory and a relative path. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [copyTo](dw.io.File.md#copytofile)([File](dw.io.File.md)) | Copy a file. | +| [createNewFile](dw.io.File.md#createnewfile)() | Create file. | +| [exists](dw.io.File.md#exists)() | Indicates if the file exists. | +| [getFullPath](dw.io.File.md#getfullpath)() | Return the full file path denoted by this `File`. | +| [getName](dw.io.File.md#getname)() | Returns the name of the file or directory denoted by this object. | +| ~~[getPath](dw.io.File.md#getpath)()~~ | Returns the portion of the path relative to the root directory. | +| static [getRootDirectory](dw.io.File.md#getrootdirectorystring-string)([String](TopLevel.String.md), [String...](TopLevel.String.md)) | Returns a `File` representing a directory for the specified root directory type. | +| [getRootDirectoryType](dw.io.File.md#getrootdirectorytype)() | Returns the root directory type, e.g. | +| [gunzip](dw.io.File.md#gunzipfile)([File](dw.io.File.md)) | Assumes this instance is a gzip file. | +| [gzip](dw.io.File.md#gzipfile)([File](dw.io.File.md)) | GZip this instance into a new gzip file. | +| [isDirectory](dw.io.File.md#isdirectory)() | Indicates that this file is a directory. | +| [isFile](dw.io.File.md#isfile)() | Indicates if this file is a file. | +| [lastModified](dw.io.File.md#lastmodified)() | Return the time, in milliseconds, that this file was last modified. | +| [length](dw.io.File.md#length)() | Return the length of the file in bytes. | +| [list](dw.io.File.md#list)() | Returns an array of strings naming the files and directories in the directory denoted by this object. | +| [listFiles](dw.io.File.md#listfiles)() | Returns an array of `File` objects in the directory denoted by this `File`. | +| [listFiles](dw.io.File.md#listfilesfunction)([Function](TopLevel.Function.md)) | Returns an array of `File` objects denoting the files and directories in the directory denoted by this object that satisfy the specified filter. | +| [md5](dw.io.File.md#md5)() | Returns an MD5 hash of the content of the file of this instance. | +| [mkdir](dw.io.File.md#mkdir)() | Creates a directory. | +| [mkdirs](dw.io.File.md#mkdirs)() | Creates a directory, including, its parent directories, as needed. | +| [remove](dw.io.File.md#remove)() | Deletes the file or directory denoted by this object. | +| [renameTo](dw.io.File.md#renametofile)([File](dw.io.File.md)) | Rename file. | +| [unzip](dw.io.File.md#unzipfile)([File](dw.io.File.md)) | Assumes this instance is a zip file. | +| [zip](dw.io.File.md#zipfile)([File](dw.io.File.md)) | Zip this instance into a new zip file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CATALOGS + +- CATALOGS: [String](TopLevel.String.md) = "CATALOGS" + - : Catalogs root directory. + + +--- + +### CUSTOMERPI + +- CUSTOMERPI: [String](TopLevel.String.md) = "CUSTOMERPI" + - : Customer Payment Instrument root directory. + + +--- + +### CUSTOMER_SNAPSHOTS + +- CUSTOMER_SNAPSHOTS: [String](TopLevel.String.md) = "CUSTOMERSNAPSHOTS" + - : Customer snapshots root directory. + + +--- + +### DYNAMIC + +- DYNAMIC: [String](TopLevel.String.md) = "DYNAMIC" + - : Reserved for future use. + + +--- + +### IMPEX + +- IMPEX: [String](TopLevel.String.md) = "IMPEX" + - : Import/export root directory. + + +--- + +### LIBRARIES + +- LIBRARIES: [String](TopLevel.String.md) = "LIBRARIES" + - : Libraries root directory. + + +--- + +### REALMDATA + +- ~~REALMDATA: [String](TopLevel.String.md) = "REALMDATA"~~ + - : RealmData root directory. + + **Deprecated:** +:::warning +Folder to be removed. +::: + +--- + +### SEPARATOR + +- SEPARATOR: [String](TopLevel.String.md) = "/" + - : The UNIX style '/' path separator, which must be used for files paths. + + +--- + +### STATIC + +- STATIC: [String](TopLevel.String.md) = "STATIC" + - : Static content root directory. + + +--- + +### TEMP + +- TEMP: [String](TopLevel.String.md) = "TEMP" + - : Temp root directory. + + +--- + +## Property Details + +### directory +- directory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates that this file is a directory. + + +--- + +### file +- file: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates if this file is a file. + + +--- + +### fullPath +- fullPath: [String](TopLevel.String.md) `(read-only)` + - : Return the full file path denoted by this `File`. + This value will be the same regardless of which constructor was + used to create this `File`. + + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the file or directory denoted by this object. This is + just the last name in the pathname's name sequence. If the pathname's + name sequence is empty, then the empty string is returned. + + + +--- + +### path +- ~~path: [String](TopLevel.String.md)~~ `(read-only)` + - : Returns the portion of the path relative to the root directory. + + **Deprecated:** +:::warning +Use [getFullPath()](dw.io.File.md#getfullpath) to access the full path. + This method does not return the correct path for files + in the CATALOGS or LIBRARIES virtual directories. + +::: + +--- + +### rootDirectoryType +- rootDirectoryType: [String](TopLevel.String.md) `(read-only)` + - : Returns the root directory type, e.g. "IMPEX" represented by this + `File`. + + + +--- + +## Constructor Details + +### File(String) +- File(absPath: [String](TopLevel.String.md)) + - : Creates a `File` from the given absolute file path in the + file namespace. If the specified path is not a valid accessible path, + an exception will be thrown. + + + The passed path should use the forward slash '/' as the path + separator and begin with a leading slash. However, if a leading slash + is not provided, or the backslash character is used as the separator, + these problems will be fixed. The normalized value will then be returned + by [getFullPath()](dw.io.File.md#getfullpath). + + + **Parameters:** + - absPath - the absolute file path throws IOException + + +--- + +### File(File, String) +- File(rootDir: [File](dw.io.File.md), relPath: [String](TopLevel.String.md)) + - : Creates a `File` given a root directory and a relative path. + + **Parameters:** + - rootDir - File object representing root directory + - relPath - relative file path + + +--- + +## Method Details + +### copyTo(File) +- copyTo(file: [File](dw.io.File.md)): [File](dw.io.File.md) + - : Copy a file. Directories cannot be copied. This method cannot be used from storefront requests. + + **Parameters:** + - file - the File object to copy to + + **Returns:** + - a reference to the copied file. + + **Throws:** + - IOException - if there is an interruption during file copy. + - FileAlreadyExistsException - if the file to copy to already exists + - UnsupportedOperationException - if invoked from a storefront request + + +--- + +### createNewFile() +- createNewFile(): [Boolean](TopLevel.Boolean.md) + - : Create file. + + **Returns:** + - boolean, true - if file has been created, false - file already exists + + **Throws:** + - Exception - + + +--- + +### exists() +- exists(): [Boolean](TopLevel.Boolean.md) + - : Indicates if the file exists. + + **Returns:** + - true if file exists, false otherwise. + + +--- + +### getFullPath() +- getFullPath(): [String](TopLevel.String.md) + - : Return the full file path denoted by this `File`. + This value will be the same regardless of which constructor was + used to create this `File`. + + + **Returns:** + - the full file path. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the file or directory denoted by this object. This is + just the last name in the pathname's name sequence. If the pathname's + name sequence is empty, then the empty string is returned. + + + **Returns:** + - The name of the file or directory denoted by this object. + + +--- + +### getPath() +- ~~getPath(): [String](TopLevel.String.md)~~ + - : Returns the portion of the path relative to the root directory. + + **Returns:** + - the relative file path, possibly blank but not null. + + **Deprecated:** +:::warning +Use [getFullPath()](dw.io.File.md#getfullpath) to access the full path. + This method does not return the correct path for files + in the CATALOGS or LIBRARIES virtual directories. + +::: + +--- + +### getRootDirectory(String, String...) +- static getRootDirectory(rootDir: [String](TopLevel.String.md), args: [String...](TopLevel.String.md)): [File](dw.io.File.md) + - : Returns a `File` representing a directory for the specified + root directory type. If the root directory + type is CATALOGS or LIBRARIES, then an additional argument representing + the specific catalog or library must be provided. Otherwise, no + additional arguments are needed. + + + **Parameters:** + - rootDir - root directory type (see the constants defined in this class) + - args - root directory specific arguments + + **Returns:** + - File object representing the directory + + +--- + +### getRootDirectoryType() +- getRootDirectoryType(): [String](TopLevel.String.md) + - : Returns the root directory type, e.g. "IMPEX" represented by this + `File`. + + + **Returns:** + - root directory type + + +--- + +### gunzip(File) +- gunzip(root: [File](dw.io.File.md)): void + - : Assumes this instance is a gzip file. Unzipping it will + explode the contents in the directory passed in (root). + + + **Parameters:** + - root - a File indicating root. root must be a directory. + + **Throws:** + - Exception - if the zip files contents can't be exploded. + + +--- + +### gzip(File) +- gzip(outputZipFile: [File](dw.io.File.md)): void + - : GZip this instance into a new gzip file. If you're zipping a file, then a single entry, the instance, + is included in the output gzip file. Note that a new File is created. GZipping directories is not supported. + This file is never modified. + + + **Parameters:** + - outputZipFile - the zip file created. + + **Throws:** + - IOException - if the zip file can't be created. + + +--- + +### isDirectory() +- isDirectory(): [Boolean](TopLevel.Boolean.md) + - : Indicates that this file is a directory. + + **Returns:** + - true if the file is a directory, false otherwise. + + +--- + +### isFile() +- isFile(): [Boolean](TopLevel.Boolean.md) + - : Indicates if this file is a file. + + **Returns:** + - true if the file is a file, false otherwise. + + +--- + +### lastModified() +- lastModified(): [Number](TopLevel.Number.md) + - : Return the time, in milliseconds, that this file was last modified. + + **Returns:** + - the time, in milliseconds, that this file was last modified. + + +--- + +### length() +- length(): [Number](TopLevel.Number.md) + - : Return the length of the file in bytes. + + **Returns:** + - the file length in bytes. + + +--- + +### list() +- list(): [String\[\]](TopLevel.String.md) + - : Returns an array of strings naming the files and directories in the + directory denoted by this object. + + + + If this object does not denote a directory, then this method returns + `null`. Otherwise an array of strings is returned, one for + each file or directory in the directory. Names denoting the directory + itself and the directory's parent directory are not included in the + result. Each string is a file name rather than a complete path. + + + + There is no guarantee that the name strings in the resulting array will + appear in any specific order; they are not, in particular, guaranteed to + appear in alphabetical order. + + + **Returns:** + - An array of strings naming the files and directories in the + directory denoted by this `File`. The array will be + empty if the directory is empty. Returns `null` if + this `File` does not denote a directory. + + + +--- + +### listFiles() +- listFiles(): [List](dw.util.List.md) + - : Returns an array of `File` objects in the directory denoted + by this `File`. + + + + If this `File` does not denote a directory, then this method + returns `null`. Otherwise an array of `File` + objects is returned, one for each file or directory in the directory. + Files denoting the directory itself and the directory's parent directory + are not included in the result. + + + + There is no guarantee that the files in the resulting array will appear + in any specific order; they are not, in particular, guaranteed to appear + in alphabetical order. Example usage: + + + + ` + // Assume "foo" is an accessible directory. + + var this_directory : dw.io.File = new File("foo"); + + + + // Find all files in directory foo, one level "down". + + // listFiles() will _not_ traverse subdirectories. + + var folder : dw.util.List = this_directory.listFiles(); + + var first_element : dw.io.File = folder[0]; + + + + function modification_comparison(lhs : File, rhs : File) + + { + +   return lhs.lastModified() < rhs.lastModified(); + + } + + + + function lexigraphic_comparison(lhs: File, rhs : File) + + { + +   return lhs.getName() < rhs.getName(); + + } + + + + var time_ordered_folder : dw.util.ArrayList = folder.sort(modification_comparison); + + var alphabetic_folder : dw.util.ArrayList = folder.sort(lexigraphic_comparison); + + ` + + + **Returns:** + - a list of `File` objects or `null` if + this is not a directory. + + + +--- + +### listFiles(Function) +- listFiles(filter: [Function](TopLevel.Function.md)): [List](dw.util.List.md) + - : Returns an array of `File` objects denoting the files and + directories in the directory denoted by this object that satisfy the + specified filter. The behavior of this method is the same as that of the + `[listFiles()](dw.io.File.md#listfiles)` method, except that the files in the + returned array must satisfy the filter. The filter is a Javascript + function which accepts one argument, a `File`, and returns + true or false depending on whether the file meets the filter conditions. + If the given `filter` is `null` then all files + are accepted. Otherwise, a file satisfies the filter if and only if the + filter returns `true`. Example usage: + + + + ` + // Assume "foo" is an accessible directory. + + var this_directory : dw.io.File = new File("foo"); + + + + function longer_than_3(candidate : dw.io.File) + + { + +   return candidate.getName().length > 3; + + } + + + + // Find all files in directory foo, one level "down", + + // such that the filename is longer than 3 characters. + + var folder_long_names : dw.util.List = this_directory.listFiles(longer_than_3); + + ` + + + **Parameters:** + - filter - a Javascript function which accepts a `File` argument and returns `true` or `false`. + + **Returns:** + - list of `File` objects or `null` if + this is not a directory + + + +--- + +### md5() +- md5(): [String](TopLevel.String.md) + - : Returns an MD5 hash of the content of the file of this instance. + + **Returns:** + - The MD5 hash of the file's content. + + **Throws:** + - Exception - if the file could not be read or is a directory. + + +--- + +### mkdir() +- mkdir(): [Boolean](TopLevel.Boolean.md) + - : Creates a directory. + + **Returns:** + - true if file creation succeeded, false otherwise. + + +--- + +### mkdirs() +- mkdirs(): [Boolean](TopLevel.Boolean.md) + - : Creates a directory, including, its parent directories, as needed. + + **Returns:** + - true if file creation succeeded, false otherwise. + + +--- + +### remove() +- remove(): [Boolean](TopLevel.Boolean.md) + - : Deletes the file or directory denoted by this object. If this File + represents a directory, then the directory must be empty in order to be + deleted. + + + **Returns:** + - true if file deletion succeeded, false otherwise + + +--- + +### renameTo(File) +- renameTo(file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Rename file. + + **Parameters:** + - file - the File object to rename to + + **Returns:** + - boolean, true - if file rename succeeded, false - failed + + +--- + +### unzip(File) +- unzip(root: [File](dw.io.File.md)): void + - : Assumes this instance is a zip file. Unzipping it will + explode the contents in the directory passed in (root). + + + **Parameters:** + - root - a File indicating root. root must be a directory. + + **Throws:** + - Exception - if the zip files contents can't be exploded. + + +--- + +### zip(File) +- zip(outputZipFile: [File](dw.io.File.md)): void + - : Zip this instance into a new zip file. If you're zipping a directory, + the directory itself and all its children files to any level (any number of subdirectories) + are included in the zip file. The directory will be the only entry in the archive (single root). + If you're zipping a file, then a single entry, the instance, + is included in the output zip file. Note that a new File is created. + This file is never modified. + + + **Parameters:** + - outputZipFile - the zip file created. + + **Throws:** + - IOException - if the zip file can't be created. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.FileReader.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.FileReader.md new file mode 100644 index 00000000..e897f423 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.FileReader.md @@ -0,0 +1,70 @@ + +# Class FileReader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Reader](dw.io.Reader.md) + - [dw.io.FileReader](dw.io.FileReader.md) + +File reader class. + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FileReader](#filereaderfile)([File](dw.io.File.md)) | Constructs the reader. | +| [FileReader](#filereaderfile-string)([File](dw.io.File.md), [String](TopLevel.String.md)) | Constructs the reader. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.FileReader.md#close)() | Closes the reader. | + +### Methods inherited from class Reader + +[close](dw.io.Reader.md#close), [getLines](dw.io.Reader.md#getlines), [getString](dw.io.Reader.md#getstring), [read](dw.io.Reader.md#read), [read](dw.io.Reader.md#readnumber), [readLine](dw.io.Reader.md#readline), [readLines](dw.io.Reader.md#readlines), [readN](dw.io.Reader.md#readnnumber), [readString](dw.io.Reader.md#readstring), [ready](dw.io.Reader.md#ready), [skip](dw.io.Reader.md#skipnumber) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### FileReader(File) +- FileReader(file: [File](dw.io.File.md)) + - : Constructs the reader. + + + To release system resources, close the reader by calling [close()](dw.io.FileReader.md#close). + + + **Parameters:** + - file - the file object to read. + + +--- + +### FileReader(File, String) +- FileReader(file: [File](dw.io.File.md), encoding: [String](TopLevel.String.md)) + - : Constructs the reader. + + + To release system resources, close the reader by calling [close()](dw.io.FileReader.md#close). + + + **Parameters:** + - file - the file object to read. + - encoding - the character encoding to use. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the reader. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.FileWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.FileWriter.md new file mode 100644 index 00000000..efdfd23f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.FileWriter.md @@ -0,0 +1,159 @@ + +# Class FileWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Writer](dw.io.Writer.md) + - [dw.io.FileWriter](dw.io.FileWriter.md) + +Convenience class for writing character files. + + +Files are stored in a shared file system where multiple processes could +access the same file. The client code is responsible for ensuring that no +more than one process writes to a file at a given time. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [lineSeparator](#lineseparator): [String](TopLevel.String.md) | Get the current line separator (e.g. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FileWriter](#filewriterfile)([File](dw.io.File.md)) | Constructs the writer for the specified file. | +| [FileWriter](#filewriterfile-boolean)([File](dw.io.File.md), [Boolean](TopLevel.Boolean.md)) | Constructs the writer for the specified file. | +| [FileWriter](#filewriterfile-string)([File](dw.io.File.md), [String](TopLevel.String.md)) | Constructs the writer for the specified file with the specified encoding. | +| [FileWriter](#filewriterfile-string-boolean)([File](dw.io.File.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Constructs the writer for the specified file with the specified encoding. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.FileWriter.md#close)() | Closes the writer. | +| [getLineSeparator](dw.io.FileWriter.md#getlineseparator)() | Get the current line separator (e.g. | +| [setLineSeparator](dw.io.FileWriter.md#setlineseparatorstring)([String](TopLevel.String.md)) | Set the line separator (e.g. | +| [writeLine](dw.io.FileWriter.md#writelinestring)([String](TopLevel.String.md)) | Writes the specified line and appends the line separator. | + +### Methods inherited from class Writer + +[close](dw.io.Writer.md#close), [flush](dw.io.Writer.md#flush), [write](dw.io.Writer.md#writestring), [write](dw.io.Writer.md#writestring-number-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### lineSeparator +- lineSeparator: [String](TopLevel.String.md) + - : Get the current line separator (e.g. '\n' or '\r\n'), if no value is set the system default '\n' will be used. + + +--- + +## Constructor Details + +### FileWriter(File) +- FileWriter(file: [File](dw.io.File.md)) + - : Constructs the writer for the specified file. Uses "UTF-8" as encoding. + + + To release system resources, close the writer by calling [close()](dw.io.FileWriter.md#close). + + + **Parameters:** + - file - the file object to write to. + + +--- + +### FileWriter(File, Boolean) +- FileWriter(file: [File](dw.io.File.md), append: [Boolean](TopLevel.Boolean.md)) + - : Constructs the writer for the specified file. Optional file append mode + is supported. Uses "UTF-8" as encoding. + + + To release system resources, close the writer by calling [close()](dw.io.FileWriter.md#close). + + + **Parameters:** + - file - the file object to write to. + - append - flag, whether the file should be written in append mode + + +--- + +### FileWriter(File, String) +- FileWriter(file: [File](dw.io.File.md), encoding: [String](TopLevel.String.md)) + - : Constructs the writer for the specified file with the specified encoding. + + + To release system resources, close the writer by calling [close()](dw.io.FileWriter.md#close). + + + **Parameters:** + - file - the file object to write to. + - encoding - the character encoding to use. + + +--- + +### FileWriter(File, String, Boolean) +- FileWriter(file: [File](dw.io.File.md), encoding: [String](TopLevel.String.md), append: [Boolean](TopLevel.Boolean.md)) + - : Constructs the writer for the specified file with the specified encoding. + Optional file append mode is supported. + + + To release system resources, close the writer by calling [close()](dw.io.FileWriter.md#close). + + + **Parameters:** + - file - the file object to write to. + - encoding - the character encoding to use. + - append - flag indicating whether the file should be written in append mode. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the writer. + + +--- + +### getLineSeparator() +- getLineSeparator(): [String](TopLevel.String.md) + - : Get the current line separator (e.g. '\n' or '\r\n'), if no value is set the system default '\n' will be used. + + +--- + +### setLineSeparator(String) +- setLineSeparator(lineSeparator: [String](TopLevel.String.md)): void + - : Set the line separator (e.g. '\n' or '\r\n'), if no value is set the system default '\n' will be used. + + **Parameters:** + - lineSeparator - that will be written at the end of each line + + +--- + +### writeLine(String) +- writeLine(str: [String](TopLevel.String.md)): void + - : Writes the specified line and appends the line separator. + + **Parameters:** + - str - the line to write to the file. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.InputStream.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.InputStream.md new file mode 100644 index 00000000..03a1a0c5 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.InputStream.md @@ -0,0 +1,35 @@ + +# Class InputStream + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.InputStream](dw.io.InputStream.md) + +The class represent a stream of bytes that can be read from the +application. The InputStream itself doesn't provide any methods +to read the data. Instead the InputStream can be chained with +other classes like a XMLStreamReader to read data. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.InputStream.md#close)() | Closes the input stream. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### close() +- close(): void + - : Closes the input stream. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.OutputStream.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.OutputStream.md new file mode 100644 index 00000000..9b2891ae --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.OutputStream.md @@ -0,0 +1,38 @@ + +# Class OutputStream + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.OutputStream](dw.io.OutputStream.md) + +The class represent a stream of bytes that can be written from the +application. The OutputStream itself doesn't provide any methods +to write the data. Instead the OutputStream can be chained with +other classes like a XMLStreamWriter to write data. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.OutputStream.md#close)() | Closes the output stream. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### close() +- close(): void + - : Closes the output stream. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.PrintWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.PrintWriter.md new file mode 100644 index 00000000..53025152 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.PrintWriter.md @@ -0,0 +1,66 @@ + +# Class PrintWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Writer](dw.io.Writer.md) + - [dw.io.PrintWriter](dw.io.PrintWriter.md) + +Template output stream writer. + +Printwriter is available in the template scripting context and is used +to write data into the template output stream. You cannot instantiate this class +directly. Instead, the system assigns the object to variable named 'out' in the script context +to be used by the template scripts. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [print](dw.io.PrintWriter.md#printstring)([String](TopLevel.String.md)) | Prints the given string into the output stream. | +| [println](dw.io.PrintWriter.md#println)() | Prints a line break into the output stream. | +| [println](dw.io.PrintWriter.md#printlnstring)([String](TopLevel.String.md)) | Print the given string followed by a line break into the output stream. | + +### Methods inherited from class Writer + +[close](dw.io.Writer.md#close), [flush](dw.io.Writer.md#flush), [write](dw.io.Writer.md#writestring), [write](dw.io.Writer.md#writestring-number-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### print(String) +- print(str: [String](TopLevel.String.md)): void + - : Prints the given string into the output stream. + + **Parameters:** + - str - the String object + + +--- + +### println() +- println(): void + - : Prints a line break into the output stream. + + +--- + +### println(String) +- println(str: [String](TopLevel.String.md)): void + - : Print the given string followed by a line break into the output stream. + + **Parameters:** + - str - the String object + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.RandomAccessFileReader.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.RandomAccessFileReader.md new file mode 100644 index 00000000..f95f2164 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.RandomAccessFileReader.md @@ -0,0 +1,183 @@ + +# Class RandomAccessFileReader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.RandomAccessFileReader](dw.io.RandomAccessFileReader.md) + +Instances of this class support reading from a random access file. A random +access file behaves like a large array of bytes stored in the file system. +There is a kind of cursor, or index into the implied array, called the file +pointer. Read operations read bytes starting at the file pointer and advance +the file pointer past the bytes read. The file pointer can be read by the +getPosition method and set by the setPosition method. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [MAX_READ_BYTES](#max_read_bytes): [Number](TopLevel.Number.md) = 10240 | The maximum number of bytes that a single call to [readBytes(Number)](dw.io.RandomAccessFileReader.md#readbytesnumber) can return == 10KB | + +## Property Summary + +| Property | Description | +| --- | --- | +| [position](#position): [Number](TopLevel.Number.md) | Returns the current offset in this file. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [RandomAccessFileReader](#randomaccessfilereaderfile)([File](dw.io.File.md)) | Construct a reader for random read access to the provided file. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.RandomAccessFileReader.md#close)() | Closes this random access file reader and releases any system resources associated with the stream. | +| [getPosition](dw.io.RandomAccessFileReader.md#getposition)() | Returns the current offset in this file. | +| [length](dw.io.RandomAccessFileReader.md#length)() | Returns the length of this file. | +| [readByte](dw.io.RandomAccessFileReader.md#readbyte)() | Reads a signed eight-bit value from the file starting from the current file pointer. | +| [readBytes](dw.io.RandomAccessFileReader.md#readbytesnumber)([Number](TopLevel.Number.md)) | Reads up to n bytes from the file starting at the current file pointer. | +| [setPosition](dw.io.RandomAccessFileReader.md#setpositionnumber)([Number](TopLevel.Number.md)) | Sets the file-pointer offset, measured from the beginning of this file, at which the next read occurs. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### MAX_READ_BYTES + +- MAX_READ_BYTES: [Number](TopLevel.Number.md) = 10240 + - : The maximum number of bytes that a single call to [readBytes(Number)](dw.io.RandomAccessFileReader.md#readbytesnumber) can return == 10KB + + +--- + +## Property Details + +### position +- position: [Number](TopLevel.Number.md) + - : Returns the current offset in this file. + + +--- + +## Constructor Details + +### RandomAccessFileReader(File) +- RandomAccessFileReader(file: [File](dw.io.File.md)) + - : Construct a reader for random read access to the provided file. + + + To release system resources, close the reader by calling [close()](dw.io.RandomAccessFileReader.md#close). + + + **Parameters:** + - file - The file to be read. Must not be null. + + **Throws:** + - IOException - If the given file object does not denote an existing regular file + + +--- + +## Method Details + +### close() +- close(): void + - : Closes this random access file reader and releases any system resources + associated with the stream. + + + **Throws:** + - IOException - if an I/O error occurs. + + +--- + +### getPosition() +- getPosition(): [Number](TopLevel.Number.md) + - : Returns the current offset in this file. + + **Returns:** + - the offset from the beginning of the file, in bytes, at which the + next read occurs. + + + **Throws:** + - IOException - if an I/O error occurs. + + +--- + +### length() +- length(): [Number](TopLevel.Number.md) + - : Returns the length of this file. + + **Returns:** + - the length of this file, measured in bytes. + + **Throws:** + - IOException - if an I/O error occurs. + + +--- + +### readByte() +- readByte(): [Number](TopLevel.Number.md) + - : Reads a signed eight-bit value from the file starting from the current + file pointer. Since the byte is interpreted as signed, the value returned + will always be between -128 and +127. + + + **Returns:** + - the next byte of this file as a signed eight-bit byte. + + **Throws:** + - IOException - if an I/O error occurs or if this file has reached the end. + + +--- + +### readBytes(Number) +- readBytes(numBytes: [Number](TopLevel.Number.md)): [Bytes](dw.util.Bytes.md) + - : Reads up to n bytes from the file starting at the current file pointer. + If there are fewer than n bytes remaining in the file, then as many bytes + as possible are read. If no bytes remain in the file, then null is + returned. + + + **Parameters:** + - numBytes - The number of bytes to read. Must be non-negative and smaller than [MAX_READ_BYTES](dw.io.RandomAccessFileReader.md#max_read_bytes) or an exception will be thrown. + + **Returns:** + - A Bytes object representing the read bytes or null if no bytes + were read. + + + **Throws:** + - IOException - if an I/O error occurs. + - IllegalArgumentException - if numBytes< 0 or numBytes > MAX\_READ\_BYTES. + + +--- + +### setPosition(Number) +- setPosition(position: [Number](TopLevel.Number.md)): void + - : Sets the file-pointer offset, measured from the beginning of this file, + at which the next read occurs. The offset may be set beyond the end of + the file. + + + **Parameters:** + - position - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer + + **Throws:** + - IOException - if position is less than 0 or if an I/O error occurs. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.Reader.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.Reader.md new file mode 100644 index 00000000..9331b529 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.Reader.md @@ -0,0 +1,284 @@ + +# Class Reader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Reader](dw.io.Reader.md) + +The class supports reading characters from a stream. + + +## All Known Subclasses +[FileReader](dw.io.FileReader.md) +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[lines](#lines): [List](dw.util.List.md)~~ `(read-only)` | The method reads the whole input stream, parses it and returns a list of strings. | +| ~~[string](#string): [String](TopLevel.String.md)~~ `(read-only)` | The method reads the whole input stream as one string and returns it. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Reader](#readerstring)([String](TopLevel.String.md)) | Creates a reader from a string. | +| [Reader](#readerinputstream)([InputStream](dw.io.InputStream.md)) | Create a reader from a stream using UTF-8 character encoding. | +| [Reader](#readerinputstream-string)([InputStream](dw.io.InputStream.md), [String](TopLevel.String.md)) | Create a reader from a stream using the specified character encoding. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.Reader.md#close)() | Closes the reader. | +| ~~[getLines](dw.io.Reader.md#getlines)()~~ | The method reads the whole input stream, parses it and returns a list of strings. | +| ~~[getString](dw.io.Reader.md#getstring)()~~ | The method reads the whole input stream as one string and returns it. | +| [read](dw.io.Reader.md#read)() | Reads a single character from the stream. | +| ~~[read](dw.io.Reader.md#readnumber)([Number](TopLevel.Number.md))~~ | Reads multiple characters from the stream as string. | +| [readLine](dw.io.Reader.md#readline)() | Reads the next line. | +| [readLines](dw.io.Reader.md#readlines)() | The method reads the whole input stream, parses it and returns a list of strings. | +| [readN](dw.io.Reader.md#readnnumber)([Number](TopLevel.Number.md)) | Reads n characters from the stream as string. | +| [readString](dw.io.Reader.md#readstring)() | The method reads the whole input stream as one string and returns it. | +| [ready](dw.io.Reader.md#ready)() | Identifies if this stream is ready to be read. | +| [skip](dw.io.Reader.md#skipnumber)([Number](TopLevel.Number.md)) | Skips the specified number of characters in the stream. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### lines +- ~~lines: [List](dw.util.List.md)~~ `(read-only)` + - : The method reads the whole input stream, parses it and returns a list of strings. + + + Using this method on large feeds is inherently unsafe and may lead to an out-of-memory condition. Instead use + method [readLine()](dw.io.Reader.md#readline) and process one line at a time. + + + **Deprecated:** +:::warning +Use [readLines()](dw.io.Reader.md#readlines) +::: + +--- + +### string +- ~~string: [String](TopLevel.String.md)~~ `(read-only)` + - : The method reads the whole input stream as one string and returns it. + + + Using this method is unsafe if the length of the input stream is not known and may lead to an out-of-memory + condition. Instead use method [readN(Number)](dw.io.Reader.md#readnnumber). + + + **Deprecated:** +:::warning +Use [readString()](dw.io.Reader.md#readstring) +::: + +--- + +## Constructor Details + +### Reader(String) +- Reader(source: [String](TopLevel.String.md)) + - : Creates a reader from a string. + + **Parameters:** + - source - the source string. + + +--- + +### Reader(InputStream) +- Reader(stream: [InputStream](dw.io.InputStream.md)) + - : Create a reader from a stream using UTF-8 character encoding. + + **Parameters:** + - stream - the input stream to use. + + +--- + +### Reader(InputStream, String) +- Reader(stream: [InputStream](dw.io.InputStream.md), encoding: [String](TopLevel.String.md)) + - : Create a reader from a stream using the specified character encoding. + + **Parameters:** + - stream - the input stream to use. + - encoding - the encoding to use. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the reader. + + +--- + +### getLines() +- ~~getLines(): [List](dw.util.List.md)~~ + - : The method reads the whole input stream, parses it and returns a list of strings. + + + Using this method on large feeds is inherently unsafe and may lead to an out-of-memory condition. Instead use + method [readLine()](dw.io.Reader.md#readline) and process one line at a time. + + + **Returns:** + - a list of strings + + **Deprecated:** +:::warning +Use [readLines()](dw.io.Reader.md#readlines) +::: + +--- + +### getString() +- ~~getString(): [String](TopLevel.String.md)~~ + - : The method reads the whole input stream as one string and returns it. + + + Using this method is unsafe if the length of the input stream is not known and may lead to an out-of-memory + condition. Instead use method [readN(Number)](dw.io.Reader.md#readnnumber). + + + **Returns:** + - a string, which represents the whole content of the InputStream + + **Throws:** + - IOException - if something went wrong while reading from the underlying stream + + **Deprecated:** +:::warning +Use [readString()](dw.io.Reader.md#readstring) +::: + +--- + +### read() +- read(): [String](TopLevel.String.md) + - : Reads a single character from the stream. The method returns null if the end of the stream is reached. + + **Returns:** + - a single character in a string, or null if the end of the stream is reached + + +--- + +### read(Number) +- ~~read(length: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)~~ + - : Reads multiple characters from the stream as string. The actual number of characters that were read can be + determined from the length of the returned string. If the end of the stream is reached and no more characters can + be read, the method exits with an exception. + + + **Parameters:** + - length - the number of characters to read. + + **Returns:** + - a string whose length is controlled by the length parameter. The actual number of characters that were + read can be determined from the length of the returned string. + + + **Throws:** + - an - exception if the stream is exhausted + + **Deprecated:** +:::warning +use [readN(Number)](dw.io.Reader.md#readnnumber) instead which does not throw an exception if the stream is exhausted +::: + +--- + +### readLine() +- readLine(): [String](TopLevel.String.md) + - : Reads the next line. + + **Returns:** + - A String containing the contents of the line, not including any line termination characters, or null if + the end of the stream has been reached. + + + +--- + +### readLines() +- readLines(): [List](dw.util.List.md) + - : The method reads the whole input stream, parses it and returns a list of strings. + + + Using this method on large feeds is inherently unsafe and may lead to an out-of-memory condition. Instead use + method [readLine()](dw.io.Reader.md#readline) and process one line at a time. + + + **Returns:** + - a list of strings + + +--- + +### readN(Number) +- readN(n: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Reads n characters from the stream as string. The actual number of characters that were read can be determined + from the length of the returned string. If the end of the stream is reached and no more characters can be read, + the method returns null. + + + **Parameters:** + - n - the number of characters to read + + **Returns:** + - a string whose maximum length is controlled by the n parameter, or null if the end of the stream is + reached and no more characters can be read + + + +--- + +### readString() +- readString(): [String](TopLevel.String.md) + - : The method reads the whole input stream as one string and returns it. + + + Using this method is unsafe if the length of the input stream is not known and may lead to an out-of-memory + condition. Instead use method [readN(Number)](dw.io.Reader.md#readnnumber). + + + **Returns:** + - a string, which represents the whole content of the InputStream + + **Throws:** + - IOException - if something went wrong while reading from the underlying stream + + +--- + +### ready() +- ready(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this stream is ready to be read. + + **Returns:** + - true guarantees that the stream is ready to read without waiting for input. A false + response means that the stream may or may not block to wait for input. Note that returning + false does not guarantee that the next read() will block. + + + +--- + +### skip(Number) +- skip(n: [Number](TopLevel.Number.md)): void + - : Skips the specified number of characters in the stream. + + **Parameters:** + - n - the number of characters to skip. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.StringWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.StringWriter.md new file mode 100644 index 00000000..76c6b2ad --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.StringWriter.md @@ -0,0 +1,89 @@ + +# Class StringWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Writer](dw.io.Writer.md) + - [dw.io.StringWriter](dw.io.StringWriter.md) + +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](dw.io.FileWriter.md) 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](dw.io.CSVStreamWriter.md) or +[XMLStreamWriter](dw.io.XMLStreamWriter.md), then upload the file with +[FTPClient.putBinary(String, File)](dw.net.FTPClient.md#putbinarystring-file), +[SFTPClient.putBinary(String, File)](dw.net.SFTPClient.md#putbinarystring-file), or +[WebDAVClient.put(String, File)](dw.net.WebDAVClient.md#putstring-file). + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [StringWriter](#stringwriter)() | Creates a new StringWriter. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [toString](dw.io.StringWriter.md#tostring)() | Returns a string representation of this writer. | +| [write](dw.io.StringWriter.md#writestring)([String](TopLevel.String.md)) | Write the given string to the stream. | +| [write](dw.io.StringWriter.md#writestring-number-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Write the given string to the stream. | + +### Methods inherited from class Writer + +[close](dw.io.Writer.md#close), [flush](dw.io.Writer.md#flush), [write](dw.io.Writer.md#writestring), [write](dw.io.Writer.md#writestring-number-number) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### StringWriter() +- StringWriter() + - : Creates a new StringWriter. + + +--- + +## Method Details + +### toString() +- toString(): [String](TopLevel.String.md) + - : Returns a string representation of this writer. + + **Returns:** + - a string representation of this writer. + + +--- + +### write(String) +- write(str: [String](TopLevel.String.md)): void + - : Write the given string to the stream. + + **Parameters:** + - str - the string to write to the stream. + + +--- + +### write(String, Number, Number) +- write(str: [String](TopLevel.String.md), off: [Number](TopLevel.Number.md), len: [Number](TopLevel.Number.md)): void + - : Write the given string to the stream. + + **Parameters:** + - str - the string to write to the stream. + - off - the offset from which to start writing characters to the stream. + - len - the number of characters to write from the stream. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.Writer.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.Writer.md new file mode 100644 index 00000000..0221b2ff --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.Writer.md @@ -0,0 +1,96 @@ + +# Class Writer + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.Writer](dw.io.Writer.md) + +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. + + + +## All Known Subclasses +[FileWriter](dw.io.FileWriter.md), [PrintWriter](dw.io.PrintWriter.md), [StringWriter](dw.io.StringWriter.md) +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Writer](#writeroutputstream)([OutputStream](dw.io.OutputStream.md)) | Create a writer from a stream using UTF-8 character encoding. | +| [Writer](#writeroutputstream-string)([OutputStream](dw.io.OutputStream.md), [String](TopLevel.String.md)) | Create a writer from a stream using the specified character encoding. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.Writer.md#close)() | Closes the writer. | +| [flush](dw.io.Writer.md#flush)() | Flushes the buffer. | +| [write](dw.io.Writer.md#writestring)([String](TopLevel.String.md)) | Write the given string to the stream. | +| [write](dw.io.Writer.md#writestring-number-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Number](TopLevel.Number.md)) | Write the given string to the stream. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### Writer(OutputStream) +- Writer(stream: [OutputStream](dw.io.OutputStream.md)) + - : Create a writer from a stream using UTF-8 character encoding. + + **Parameters:** + - stream - the output stream to use when creating the writer. + + +--- + +### Writer(OutputStream, String) +- Writer(stream: [OutputStream](dw.io.OutputStream.md), encoding: [String](TopLevel.String.md)) + - : Create a writer from a stream using the specified character encoding. + + **Parameters:** + - stream - the output stream to use when creating the writer. + - encoding - the encoding to use when creating the writer. + + +--- + +## Method Details + +### close() +- close(): void + - : Closes the writer. + + +--- + +### flush() +- flush(): void + - : Flushes the buffer. + + +--- + +### write(String) +- write(str: [String](TopLevel.String.md)): void + - : Write the given string to the stream. + + **Parameters:** + - str - the string to write to the stream. + + +--- + +### write(String, Number, Number) +- write(str: [String](TopLevel.String.md), off: [Number](TopLevel.Number.md), len: [Number](TopLevel.Number.md)): void + - : Write the given string to the stream. + + **Parameters:** + - str - the string to write to the stream. + - off - the offset from which to start writing characters to the stream. + - len - the number of characters to write from the stream. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLIndentingStreamWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLIndentingStreamWriter.md new file mode 100644 index 00000000..bfb3b796 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLIndentingStreamWriter.md @@ -0,0 +1,121 @@ + +# Class XMLIndentingStreamWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.XMLStreamWriter](dw.io.XMLStreamWriter.md) + - [dw.io.XMLIndentingStreamWriter](dw.io.XMLIndentingStreamWriter.md) + +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. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [indent](#indent): [String](TopLevel.String.md) | Returns the indent. | +| [newLine](#newline): [String](TopLevel.String.md) | Returns the string that is used for a new line character. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLIndentingStreamWriter](#xmlindentingstreamwriterwriter)([Writer](dw.io.Writer.md)) | Constructs the writer for the specified writer. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getIndent](dw.io.XMLIndentingStreamWriter.md#getindent)() | Returns the indent. | +| [getNewLine](dw.io.XMLIndentingStreamWriter.md#getnewline)() | Returns the string that is used for a new line character. | +| [setIndent](dw.io.XMLIndentingStreamWriter.md#setindentstring)([String](TopLevel.String.md)) | Specifies a string that will be used as identing characters. | +| [setNewLine](dw.io.XMLIndentingStreamWriter.md#setnewlinestring)([String](TopLevel.String.md)) | Sets the string that is used for a new line character. | + +### Methods inherited from class XMLStreamWriter + +[close](dw.io.XMLStreamWriter.md#close), [flush](dw.io.XMLStreamWriter.md#flush), [getDefaultNamespace](dw.io.XMLStreamWriter.md#getdefaultnamespace), [getPrefix](dw.io.XMLStreamWriter.md#getprefixstring), [setDefaultNamespace](dw.io.XMLStreamWriter.md#setdefaultnamespacestring), [setPrefix](dw.io.XMLStreamWriter.md#setprefixstring-string), [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string), [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string-string), [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string-string-string), [writeCData](dw.io.XMLStreamWriter.md#writecdatastring), [writeCharacters](dw.io.XMLStreamWriter.md#writecharactersstring), [writeComment](dw.io.XMLStreamWriter.md#writecommentstring), [writeDTD](dw.io.XMLStreamWriter.md#writedtdstring), [writeDefaultNamespace](dw.io.XMLStreamWriter.md#writedefaultnamespacestring), [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring), [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring-string), [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring-string-string), [writeEndDocument](dw.io.XMLStreamWriter.md#writeenddocument), [writeEndElement](dw.io.XMLStreamWriter.md#writeendelement), [writeEntityRef](dw.io.XMLStreamWriter.md#writeentityrefstring), [writeNamespace](dw.io.XMLStreamWriter.md#writenamespacestring-string), [writeProcessingInstruction](dw.io.XMLStreamWriter.md#writeprocessinginstructionstring), [writeProcessingInstruction](dw.io.XMLStreamWriter.md#writeprocessinginstructionstring-string), [writeRaw](dw.io.XMLStreamWriter.md#writerawstring), [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocument), [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocumentstring), [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocumentstring-string), [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring), [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring-string), [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring-string-string) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### indent +- indent: [String](TopLevel.String.md) + - : Returns the indent. + + +--- + +### newLine +- newLine: [String](TopLevel.String.md) + - : Returns the string that is used for a new line character. The + default is the normal new line character. + + + +--- + +## Constructor Details + +### XMLIndentingStreamWriter(Writer) +- XMLIndentingStreamWriter(writer: [Writer](dw.io.Writer.md)) + - : Constructs the writer for the specified writer. + + **Parameters:** + - writer - the writer to use. + + +--- + +## Method Details + +### getIndent() +- getIndent(): [String](TopLevel.String.md) + - : Returns the indent. + + **Returns:** + - Returns the indent. + + +--- + +### getNewLine() +- getNewLine(): [String](TopLevel.String.md) + - : Returns the string that is used for a new line character. The + default is the normal new line character. + + + **Returns:** + - the new line. + + +--- + +### setIndent(String) +- setIndent(indent: [String](TopLevel.String.md)): void + - : Specifies a string that will be used as identing characters. The + default are two space characters. + + + **Parameters:** + - indent - The indent to set. + + +--- + +### setNewLine(String) +- setNewLine(newLine: [String](TopLevel.String.md)): void + - : Sets the string that is used for a new line character. + + **Parameters:** + - newLine - The newLine to set. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamConstants.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamConstants.md new file mode 100644 index 00000000..867df69c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamConstants.md @@ -0,0 +1,172 @@ + +# Class XMLStreamConstants + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.XMLStreamConstants](dw.io.XMLStreamConstants.md) + +Useful constants for working with XML streams. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ATTRIBUTE](#attribute): [Number](TopLevel.Number.md) = 10 | Represents an attribute in an element. | +| [CDATA](#cdata): [Number](TopLevel.Number.md) = 12 | Represents a CDATA section in an element. | +| [CHARACTERS](#characters): [Number](TopLevel.Number.md) = 4 | Represents the character data in an XML document. | +| [COMMENT](#comment): [Number](TopLevel.Number.md) = 5 | Represents a comment in an XML document. | +| [DTD](#dtd): [Number](TopLevel.Number.md) = 11 | Represents the document type definition. | +| [END_DOCUMENT](#end_document): [Number](TopLevel.Number.md) = 8 | Represents the end of an XML document. | +| [END_ELEMENT](#end_element): [Number](TopLevel.Number.md) = 2 | Represents the end of an element in an XML document. | +| [ENTITY_DECLARATION](#entity_declaration): [Number](TopLevel.Number.md) = 15 | Represents the entity declaration in an XML document. | +| [ENTITY_REFERENCE](#entity_reference): [Number](TopLevel.Number.md) = 9 | Represents an entity reference in an XML document. | +| [NAMESPACE](#namespace): [Number](TopLevel.Number.md) = 13 | Represents a namespace declaration in an XML document. | +| [NOTATION_DECLARATION](#notation_declaration): [Number](TopLevel.Number.md) = 14 | Represents the notation declaration in an XML document. | +| [PROCESSING_INSTRUCTION](#processing_instruction): [Number](TopLevel.Number.md) = 3 | Represents processing instruction in an XML document. | +| [SPACE](#space): [Number](TopLevel.Number.md) = 6 | Represents a space in an XML document. | +| [START_DOCUMENT](#start_document): [Number](TopLevel.Number.md) = 7 | Represents the start of an XML document. | +| [START_ELEMENT](#start_element): [Number](TopLevel.Number.md) = 1 | Represents the start of an element in an XML document. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLStreamConstants](#xmlstreamconstants)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ATTRIBUTE + +- ATTRIBUTE: [Number](TopLevel.Number.md) = 10 + - : Represents an attribute in an element. + + +--- + +### CDATA + +- CDATA: [Number](TopLevel.Number.md) = 12 + - : Represents a CDATA section in an element. + + +--- + +### CHARACTERS + +- CHARACTERS: [Number](TopLevel.Number.md) = 4 + - : Represents the character data in an XML document. + + +--- + +### COMMENT + +- COMMENT: [Number](TopLevel.Number.md) = 5 + - : Represents a comment in an XML document. + + +--- + +### DTD + +- DTD: [Number](TopLevel.Number.md) = 11 + - : Represents the document type definition. + + +--- + +### END_DOCUMENT + +- END_DOCUMENT: [Number](TopLevel.Number.md) = 8 + - : Represents the end of an XML document. + + +--- + +### END_ELEMENT + +- END_ELEMENT: [Number](TopLevel.Number.md) = 2 + - : Represents the end of an element in an XML document. + + +--- + +### ENTITY_DECLARATION + +- ENTITY_DECLARATION: [Number](TopLevel.Number.md) = 15 + - : Represents the entity declaration in an XML document. + + +--- + +### ENTITY_REFERENCE + +- ENTITY_REFERENCE: [Number](TopLevel.Number.md) = 9 + - : Represents an entity reference in an XML document. + + +--- + +### NAMESPACE + +- NAMESPACE: [Number](TopLevel.Number.md) = 13 + - : Represents a namespace declaration in an XML document. + + +--- + +### NOTATION_DECLARATION + +- NOTATION_DECLARATION: [Number](TopLevel.Number.md) = 14 + - : Represents the notation declaration in an XML document. + + +--- + +### PROCESSING_INSTRUCTION + +- PROCESSING_INSTRUCTION: [Number](TopLevel.Number.md) = 3 + - : Represents processing instruction in an XML document. + + +--- + +### SPACE + +- SPACE: [Number](TopLevel.Number.md) = 6 + - : Represents a space in an XML document. + + +--- + +### START_DOCUMENT + +- START_DOCUMENT: [Number](TopLevel.Number.md) = 7 + - : Represents the start of an XML document. + + +--- + +### START_ELEMENT + +- START_ELEMENT: [Number](TopLevel.Number.md) = 1 + - : Represents the start of an element in an XML document. + + +--- + +## Constructor Details + +### XMLStreamConstants() +- XMLStreamConstants() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamReader.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamReader.md new file mode 100644 index 00000000..a572c159 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamReader.md @@ -0,0 +1,1181 @@ + +# Class XMLStreamReader + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.XMLStreamReader](dw.io.XMLStreamReader.md) + +The XMLStreamReader allows forward, read-only access to XML. It is designed +to be the lowest level and most efficient way to read XML data. + + + The XMLStreamReader is designed to iterate over XML using +next() and hasNext(). The data can be accessed using methods such as getEventType(), +getNamespaceURI(), getLocalName() and getText(); + + + + The [next()](dw.io.XMLStreamReader.md#next) method causes the reader to read the next parse event. +The next() method returns an integer which identifies the type of event just read. + + + The event type can be determined using [getEventType()](dw.io.XMLStreamReader.md#geteventtype). + + + Parsing events are defined as the XML Declaration, a DTD, +start tag, character data, white space, end tag, comment, +or processing instruction. An attribute or namespace event may be encountered +at the root level of a document as the result of a query operation. + + + +The following table describes which methods are valid in what state. +If a method is called in an invalid state the method will throw a +java.lang.IllegalStateException. + + +| Valid methods for each state | +| --- | +| Event Type | Valid Methods | +| All States | getProperty(), hasNext(), require(), close(), getNamespaceURI(), isStartElement(), isEndElement(), isCharacters(), isWhiteSpace(), getNamespaceContext(), getEventType(),getLocation(), hasText(), hasName() | +| START\_ELEMENT | next(), getName(), getLocalName(), hasName(), getPrefix(), getAttributeXXX(), isAttributeSpecified(), getNamespaceXXX(), getElementText(), nextTag(), getXMLObject() | +| ATTRIBUTE | next(), nextTag() getAttributeXXX(), isAttributeSpecified(), | +| NAMESPACE | next(), nextTag() getNamespaceXXX() | +| END\_ELEMENT | next(), getName(), getLocalName(), hasName(), getPrefix(), getNamespaceXXX(), nextTag() | +| CHARACTERS | next(), getTextXXX(), nextTag() | +| CDATA | next(), getTextXXX(), nextTag() | +| COMMENT | next(), getTextXXX(), nextTag() | +| SPACE | next(), getTextXXX(), nextTag() | +| START\_DOCUMENT | next(), getEncoding(), getVersion(), isStandalone(), standaloneSet(), getCharacterEncodingScheme(), nextTag() | +| END\_DOCUMENT | close() | +| PROCESSING\_INSTRUCTION | next(), getPITarget(), getPIData(), nextTag() | +| ENTITY\_REFERENCE | next(), getLocalName(), getText(), nextTag() | +| DTD | next(), getText(), nextTag() | + + + + + +The following is a code sample to read an XML file containing multiple +"myobject" sub-elements. Only one myObject instance is kept in memory at +any given time to keep memory consumption low: + + +``` +var fileReader : FileReader = new FileReader(file, "UTF-8"); +var xmlStreamReader : XMLStreamReader = new XMLStreamReader(fileReader); + +while (xmlStreamReader.hasNext()) +{ + if (xmlStreamReader.next() == XMLStreamConstants.START_ELEMENT) + { + var localElementName : String = xmlStreamReader.getLocalName(); + if (localElementName == "myobject") + { + // read single "myobject" as XML + var myObject : XML = xmlStreamReader.getXMLObject(); + + // process myObject + } + } +} + +xmlStreamReader.close(); +fileReader.close(); +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [PIData](#pidata): [String](TopLevel.String.md) `(read-only)` | Get the data section of a processing instruction. | +| [PITarget](#pitarget): [String](TopLevel.String.md) `(read-only)` | Get the target of a processing instruction. | +| ~~[XMLObject](#xmlobject): [Object](TopLevel.Object.md)~~ `(read-only)` | Reads a sub-tree of the XML document and parses it as XML object. | +| [attributeCount](#attributecount): [Number](TopLevel.Number.md) `(read-only)` | Returns the count of attributes on this START\_ELEMENT, this method is only valid on a START\_ELEMENT or ATTRIBUTE. | +| [characterEncodingScheme](#characterencodingscheme): [String](TopLevel.String.md) `(read-only)` | Returns the character encoding declared on the XML declaration Returns null if none was declared. | +| [characters](#characters): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the cursor points to a character data event. | +| [columnNumber](#columnnumber): [Number](TopLevel.Number.md) `(read-only)` | Returns the column number where the current event ends or -1 if none is available. | +| ~~[elementText](#elementtext): [String](TopLevel.String.md)~~ `(read-only)` | Reads the content of a text-only element, an exception is thrown if this is not a text-only element. | +| [encoding](#encoding): [String](TopLevel.String.md) `(read-only)` | Return input encoding if known or null if unknown. | +| [endElement](#endelement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the cursor points to an end tag. | +| [eventType](#eventtype): [Number](TopLevel.Number.md) `(read-only)` | Returns an integer code that indicates the type of the event the cursor is pointing to. | +| [lineNumber](#linenumber): [Number](TopLevel.Number.md) `(read-only)` | Returns the line number where the current event ends or -1 if none is available. | +| [localName](#localname): [String](TopLevel.String.md) `(read-only)` | Returns the (local) name of the current event. | +| [namespaceCount](#namespacecount): [Number](TopLevel.Number.md) `(read-only)` | Returns the count of namespaces declared on this START\_ELEMENT or END\_ELEMENT, this method is only valid on a START\_ELEMENT, END\_ELEMENT or NAMESPACE. | +| [namespaceURI](#namespaceuri): [String](TopLevel.String.md) `(read-only)` | If the current event is a START\_ELEMENT or END\_ELEMENT this method returns the URI of the prefix or the default namespace. | +| [prefix](#prefix): [String](TopLevel.String.md) `(read-only)` | Returns the prefix of the current event or null if the event does not have a prefix | +| [standalone](#standalone): [Boolean](TopLevel.Boolean.md) `(read-only)` | Get the standalone declaration from the xml declaration. | +| [startElement](#startelement): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the cursor points to a start tag. | +| [text](#text): [String](TopLevel.String.md) `(read-only)` | Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY\_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. | +| [textLength](#textlength): [Number](TopLevel.Number.md) `(read-only)` | Returns the length of the sequence of characters for this Text event within the text character array. | +| [textStart](#textstart): [Number](TopLevel.Number.md) `(read-only)` | Returns the offset into the text character array where the first character (of this text event) is stored. | +| [version](#version): [String](TopLevel.String.md) `(read-only)` | Get the xml version declared on the xml declaration. | +| [whiteSpace](#whitespace): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the cursor points to a character data event that consists of all whitespace. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLStreamReader](#xmlstreamreaderreader)([Reader](dw.io.Reader.md)) | Constructs the stream readon on behalf of the reader. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.XMLStreamReader.md#close)() | Frees any resources associated with this Reader. | +| [getAttributeCount](dw.io.XMLStreamReader.md#getattributecount)() | Returns the count of attributes on this START\_ELEMENT, this method is only valid on a START\_ELEMENT or ATTRIBUTE. | +| [getAttributeLocalName](dw.io.XMLStreamReader.md#getattributelocalnamenumber)([Number](TopLevel.Number.md)) | Returns the localName of the attribute at the provided index. | +| [getAttributeNamespace](dw.io.XMLStreamReader.md#getattributenamespacenumber)([Number](TopLevel.Number.md)) | Returns the namespace of the attribute at the provided index. | +| [getAttributePrefix](dw.io.XMLStreamReader.md#getattributeprefixnumber)([Number](TopLevel.Number.md)) | Returns the prefix of this attribute at the provided index. | +| [getAttributeType](dw.io.XMLStreamReader.md#getattributetypenumber)([Number](TopLevel.Number.md)) | Returns the XML type of the attribute at the provided index. | +| [getAttributeValue](dw.io.XMLStreamReader.md#getattributevaluenumber)([Number](TopLevel.Number.md)) | Returns the value of the attribute at the index. | +| [getAttributeValue](dw.io.XMLStreamReader.md#getattributevaluestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality | +| [getCharacterEncodingScheme](dw.io.XMLStreamReader.md#getcharacterencodingscheme)() | Returns the character encoding declared on the XML declaration Returns null if none was declared. | +| [getColumnNumber](dw.io.XMLStreamReader.md#getcolumnnumber)() | Returns the column number where the current event ends or -1 if none is available. | +| ~~[getElementText](dw.io.XMLStreamReader.md#getelementtext)()~~ | Reads the content of a text-only element, an exception is thrown if this is not a text-only element. | +| [getEncoding](dw.io.XMLStreamReader.md#getencoding)() | Return input encoding if known or null if unknown. | +| [getEventType](dw.io.XMLStreamReader.md#geteventtype)() | Returns an integer code that indicates the type of the event the cursor is pointing to. | +| [getLineNumber](dw.io.XMLStreamReader.md#getlinenumber)() | Returns the line number where the current event ends or -1 if none is available. | +| [getLocalName](dw.io.XMLStreamReader.md#getlocalname)() | Returns the (local) name of the current event. | +| [getNamespaceCount](dw.io.XMLStreamReader.md#getnamespacecount)() | Returns the count of namespaces declared on this START\_ELEMENT or END\_ELEMENT, this method is only valid on a START\_ELEMENT, END\_ELEMENT or NAMESPACE. | +| [getNamespacePrefix](dw.io.XMLStreamReader.md#getnamespaceprefixnumber)([Number](TopLevel.Number.md)) | Returns the prefix for the namespace declared at the index. | +| [getNamespaceURI](dw.io.XMLStreamReader.md#getnamespaceuri)() | If the current event is a START\_ELEMENT or END\_ELEMENT this method returns the URI of the prefix or the default namespace. | +| [getNamespaceURI](dw.io.XMLStreamReader.md#getnamespaceurinumber)([Number](TopLevel.Number.md)) | Returns the uri for the namespace declared at the index. | +| [getNamespaceURI](dw.io.XMLStreamReader.md#getnamespaceuristring)([String](TopLevel.String.md)) | Return the uri for the given prefix. | +| [getPIData](dw.io.XMLStreamReader.md#getpidata)() | Get the data section of a processing instruction. | +| [getPITarget](dw.io.XMLStreamReader.md#getpitarget)() | Get the target of a processing instruction. | +| [getPrefix](dw.io.XMLStreamReader.md#getprefix)() | Returns the prefix of the current event or null if the event does not have a prefix | +| [getText](dw.io.XMLStreamReader.md#gettext)() | Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY\_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. | +| [getTextLength](dw.io.XMLStreamReader.md#gettextlength)() | Returns the length of the sequence of characters for this Text event within the text character array. | +| [getTextStart](dw.io.XMLStreamReader.md#gettextstart)() | Returns the offset into the text character array where the first character (of this text event) is stored. | +| [getVersion](dw.io.XMLStreamReader.md#getversion)() | Get the xml version declared on the xml declaration. | +| ~~[getXMLObject](dw.io.XMLStreamReader.md#getxmlobject)()~~ | Reads a sub-tree of the XML document and parses it as XML object. | +| [hasName](dw.io.XMLStreamReader.md#hasname)() | Identifies if the current event has a name (is a START\_ELEMENT or END\_ELEMENT) | +| [hasNext](dw.io.XMLStreamReader.md#hasnext)() | Returns true if there are more parsing events and false if there are no more events. | +| [hasText](dw.io.XMLStreamReader.md#hastext)() | Indicates if the current event has text. | +| [isAttributeSpecified](dw.io.XMLStreamReader.md#isattributespecifiednumber)([Number](TopLevel.Number.md)) | Identifies if this attribute was created by default. | +| [isCharacters](dw.io.XMLStreamReader.md#ischaracters)() | Identifies if the cursor points to a character data event. | +| [isEndElement](dw.io.XMLStreamReader.md#isendelement)() | Identifies if the cursor points to an end tag. | +| [isStandalone](dw.io.XMLStreamReader.md#isstandalone)() | Get the standalone declaration from the xml declaration. | +| [isStartElement](dw.io.XMLStreamReader.md#isstartelement)() | Identifies if the cursor points to a start tag. | +| [isWhiteSpace](dw.io.XMLStreamReader.md#iswhitespace)() | Identifies if the cursor points to a character data event that consists of all whitespace. | +| [next](dw.io.XMLStreamReader.md#next)() | Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. | +| [nextTag](dw.io.XMLStreamReader.md#nexttag)() | Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING\_INSTRUCTION, until a START\_ELEMENT or END\_ELEMENT is reached. | +| [readElementText](dw.io.XMLStreamReader.md#readelementtext)() | Reads the content of a text-only element, an exception is thrown if this is not a text-only element. | +| [readXMLObject](dw.io.XMLStreamReader.md#readxmlobject)() | Reads a sub-tree of the XML document and parses it as XML object. | +| [require](dw.io.XMLStreamReader.md#requirenumber-string-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event. | +| [standaloneSet](dw.io.XMLStreamReader.md#standaloneset)() | Identifies if standalone was set in the document. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### PIData +- PIData: [String](TopLevel.String.md) `(read-only)` + - : Get the data section of a processing instruction. + + +--- + +### PITarget +- PITarget: [String](TopLevel.String.md) `(read-only)` + - : Get the target of a processing instruction. + + +--- + +### XMLObject +- ~~XMLObject: [Object](TopLevel.Object.md)~~ `(read-only)` + - : Reads a sub-tree of the XML document and parses it as XML object. + + + The stream must be positioned on a START\_ELEMENT. Do not call the method + when the stream is positioned at document's root element. This would + cause the whole document to be parsed into a single XML what may lead to + an out-of-memory condition. Instead use \#next() to navigate to + sub-elements and invoke getXMLObject() there. Do not keep references to + more than the currently processed XML to keep memory consumption low. The + method reads the stream up to the matching END\_ELEMENT. When the method + returns the current event is the END\_ELEMENT event. + + + **Deprecated:** +:::warning +Use [readXMLObject()](dw.io.XMLStreamReader.md#readxmlobject) +::: + +--- + +### attributeCount +- attributeCount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the count of attributes on this START\_ELEMENT, + this method is only valid on a START\_ELEMENT or ATTRIBUTE. This + count excludes namespace definitions. Attribute indices are + zero-based. + + + +--- + +### characterEncodingScheme +- characterEncodingScheme: [String](TopLevel.String.md) `(read-only)` + - : Returns the character encoding declared on the XML declaration + Returns null if none was declared. + + + +--- + +### characters +- characters: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the cursor points to a character data event. + + +--- + +### columnNumber +- columnNumber: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the column number where the current event ends or -1 if none is + available. + + + +--- + +### elementText +- ~~elementText: [String](TopLevel.String.md)~~ `(read-only)` + - : Reads the content of a text-only element, an exception is thrown if this is not a text-only element. This method + always returns coalesced content. + + Precondition: the current event is START\_ELEMENT. + + Postcondition: the current event is the corresponding END\_ELEMENT. + + The method does the following (implementations are free to be optimized but must do equivalent processing): + + + ``` + if ( getEventType() != XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "parser must be on START_ELEMENT to read next text", getLocation() ); + } + int eventType = next(); + StringBuffer content = new StringBuffer(); + while ( eventType != XMLStreamConstants.END_ELEMENT ) + { + if ( eventType == XMLStreamConstants.CHARACTERS || eventType == XMLStreamConstants.CDATA + || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.ENTITY_REFERENCE ) + { + buf.append( getText() ); + } + else if ( eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT ) + { + // skipping + } + else if ( eventType == XMLStreamConstants.END_DOCUMENT ) + { + throw new XMLStreamException( "unexpected end of document when reading element text content", this ); + } + else if ( eventType == XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "element text content may not contain START_ELEMENT", getLocation() ); + } + else + { + throw new XMLStreamException( "Unexpected event type " + eventType, getLocation() ); + } + eventType = next(); + } + return buf.toString(); + ``` + + + **Deprecated:** +:::warning +Use [readElementText()](dw.io.XMLStreamReader.md#readelementtext) +::: + +--- + +### encoding +- encoding: [String](TopLevel.String.md) `(read-only)` + - : Return input encoding if known or null if unknown. + + +--- + +### endElement +- endElement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the cursor points to an end tag. + + +--- + +### eventType +- eventType: [Number](TopLevel.Number.md) `(read-only)` + - : Returns an integer code that indicates the type + of the event the cursor is pointing to. + + + +--- + +### lineNumber +- lineNumber: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the line number where the current event ends or -1 if none is + available. + + + +--- + +### localName +- localName: [String](TopLevel.String.md) `(read-only)` + - : Returns the (local) name of the current event. + For START\_ELEMENT or END\_ELEMENT returns the (local) name of the current element. + For ENTITY\_REFERENCE it returns entity name. + The current event must be START\_ELEMENT or END\_ELEMENT, + or ENTITY\_REFERENCE. + + + +--- + +### namespaceCount +- namespaceCount: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the count of namespaces declared on this START\_ELEMENT or END\_ELEMENT, + this method is only valid on a START\_ELEMENT, END\_ELEMENT or NAMESPACE. On + an END\_ELEMENT the count is of the namespaces that are about to go + out of scope. This is the equivalent of the information reported + by SAX callback for an end element event. + + + +--- + +### namespaceURI +- namespaceURI: [String](TopLevel.String.md) `(read-only)` + - : If the current event is a START\_ELEMENT or END\_ELEMENT this method + returns the URI of the prefix or the default namespace. + Returns null if the event does not have a prefix. + + + +--- + +### prefix +- prefix: [String](TopLevel.String.md) `(read-only)` + - : Returns the prefix of the current event or null if the event does not have a prefix + + +--- + +### standalone +- standalone: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Get the standalone declaration from the xml declaration. + + +--- + +### startElement +- startElement: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the cursor points to a start tag. + + +--- + +### text +- text: [String](TopLevel.String.md) `(read-only)` + - : Returns the current value of the parse event as a string, + this returns the string value of a CHARACTERS event, + returns the value of a COMMENT, the replacement value + for an ENTITY\_REFERENCE, the string value of a CDATA section, + the string value for a SPACE event, + or the String value of the internal subset of the DTD. + If an ENTITY\_REFERENCE has been resolved, any character data + will be reported as CHARACTERS events. + + + +--- + +### textLength +- textLength: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the length of the sequence of characters for this + Text event within the text character array. + + + +--- + +### textStart +- textStart: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the offset into the text character array where the first + character (of this text event) is stored. + + + +--- + +### version +- version: [String](TopLevel.String.md) `(read-only)` + - : Get the xml version declared on the xml declaration. + Returns null if none was declared. + + + +--- + +### whiteSpace +- whiteSpace: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the cursor points to a character data event + that consists of all whitespace. + + + +--- + +## Constructor Details + +### XMLStreamReader(Reader) +- XMLStreamReader(reader: [Reader](dw.io.Reader.md)) + - : Constructs the stream readon on behalf of the reader. + + **Parameters:** + - reader - the reader to use. + + +--- + +## Method Details + +### close() +- close(): void + - : Frees any resources associated with this Reader. This method does not close the + underlying reader. + + + +--- + +### getAttributeCount() +- getAttributeCount(): [Number](TopLevel.Number.md) + - : Returns the count of attributes on this START\_ELEMENT, + this method is only valid on a START\_ELEMENT or ATTRIBUTE. This + count excludes namespace definitions. Attribute indices are + zero-based. + + + **Returns:** + - returns the number of attributes. + + +--- + +### getAttributeLocalName(Number) +- getAttributeLocalName(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the localName of the attribute at the provided + index. + + + **Parameters:** + - index - the position of the attribute. + + **Returns:** + - the local name of the attribute. + + +--- + +### getAttributeNamespace(Number) +- getAttributeNamespace(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the namespace of the attribute at the provided + index. + + + **Parameters:** + - index - the position of the attribute + + **Returns:** + - the namespace URI (can be null) + + +--- + +### getAttributePrefix(Number) +- getAttributePrefix(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the prefix of this attribute at the + provided index. + + + **Parameters:** + - index - the position of the attribute. + + **Returns:** + - the prefix of the attribute. + + +--- + +### getAttributeType(Number) +- getAttributeType(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the XML type of the attribute at the provided + index. + + + **Parameters:** + - index - the position of the attribute. + + **Returns:** + - the XML type of the attribute. + + +--- + +### getAttributeValue(Number) +- getAttributeValue(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the value of the attribute at the + index. + + + **Parameters:** + - index - the position of the attribute. + + **Returns:** + - the attribute value. + + +--- + +### getAttributeValue(String, String) +- getAttributeValue(namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the normalized attribute value of the + attribute with the namespace and localName + If the namespaceURI is null the namespace + is not checked for equality + + + **Parameters:** + - namespaceURI - the namespace of the attribute + - localName - the local name of the attribute, cannot be null + + **Returns:** + - returns the value of the attribute or null if not found. + + +--- + +### getCharacterEncodingScheme() +- getCharacterEncodingScheme(): [String](TopLevel.String.md) + - : Returns the character encoding declared on the XML declaration + Returns null if none was declared. + + + **Returns:** + - the encoding declared in the document or null. + + +--- + +### getColumnNumber() +- getColumnNumber(): [Number](TopLevel.Number.md) + - : Returns the column number where the current event ends or -1 if none is + available. + + + **Returns:** + - the column number or -1. + + +--- + +### getElementText() +- ~~getElementText(): [String](TopLevel.String.md)~~ + - : Reads the content of a text-only element, an exception is thrown if this is not a text-only element. This method + always returns coalesced content. + + Precondition: the current event is START\_ELEMENT. + + Postcondition: the current event is the corresponding END\_ELEMENT. + + The method does the following (implementations are free to be optimized but must do equivalent processing): + + + ``` + if ( getEventType() != XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "parser must be on START_ELEMENT to read next text", getLocation() ); + } + int eventType = next(); + StringBuffer content = new StringBuffer(); + while ( eventType != XMLStreamConstants.END_ELEMENT ) + { + if ( eventType == XMLStreamConstants.CHARACTERS || eventType == XMLStreamConstants.CDATA + || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.ENTITY_REFERENCE ) + { + buf.append( getText() ); + } + else if ( eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT ) + { + // skipping + } + else if ( eventType == XMLStreamConstants.END_DOCUMENT ) + { + throw new XMLStreamException( "unexpected end of document when reading element text content", this ); + } + else if ( eventType == XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "element text content may not contain START_ELEMENT", getLocation() ); + } + else + { + throw new XMLStreamException( "Unexpected event type " + eventType, getLocation() ); + } + eventType = next(); + } + return buf.toString(); + ``` + + + **Deprecated:** +:::warning +Use [readElementText()](dw.io.XMLStreamReader.md#readelementtext) +::: + +--- + +### getEncoding() +- getEncoding(): [String](TopLevel.String.md) + - : Return input encoding if known or null if unknown. + + **Returns:** + - the encoding of this instance or null + + +--- + +### getEventType() +- getEventType(): [Number](TopLevel.Number.md) + - : Returns an integer code that indicates the type + of the event the cursor is pointing to. + + + **Returns:** + - an integer code that indicates the type + of the event the cursor is pointing to. + + + +--- + +### getLineNumber() +- getLineNumber(): [Number](TopLevel.Number.md) + - : Returns the line number where the current event ends or -1 if none is + available. + + + **Returns:** + - the line number or -1. + + +--- + +### getLocalName() +- getLocalName(): [String](TopLevel.String.md) + - : Returns the (local) name of the current event. + For START\_ELEMENT or END\_ELEMENT returns the (local) name of the current element. + For ENTITY\_REFERENCE it returns entity name. + The current event must be START\_ELEMENT or END\_ELEMENT, + or ENTITY\_REFERENCE. + + + **Returns:** + - the local name. + + +--- + +### getNamespaceCount() +- getNamespaceCount(): [Number](TopLevel.Number.md) + - : Returns the count of namespaces declared on this START\_ELEMENT or END\_ELEMENT, + this method is only valid on a START\_ELEMENT, END\_ELEMENT or NAMESPACE. On + an END\_ELEMENT the count is of the namespaces that are about to go + out of scope. This is the equivalent of the information reported + by SAX callback for an end element event. + + + **Returns:** + - returns the number of namespace declarations on this specific element. + + +--- + +### getNamespacePrefix(Number) +- getNamespacePrefix(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the prefix for the namespace declared at the + index. Returns null if this is the default namespace + declaration. + + + **Parameters:** + - index - the position of the namespace declaration. + + **Returns:** + - returns the namespace prefix. + + +--- + +### getNamespaceURI() +- getNamespaceURI(): [String](TopLevel.String.md) + - : If the current event is a START\_ELEMENT or END\_ELEMENT this method + returns the URI of the prefix or the default namespace. + Returns null if the event does not have a prefix. + + + **Returns:** + - the URI bound to this elements prefix, the default namespace, or null. + + +--- + +### getNamespaceURI(Number) +- getNamespaceURI(index: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the uri for the namespace declared at the + index. + + + **Parameters:** + - index - the position of the namespace declaration. + + **Returns:** + - returns the namespace uri. + + +--- + +### getNamespaceURI(String) +- getNamespaceURI(prefix: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Return the uri for the given prefix. + The uri returned depends on the current state of the processor. + + + **NOTE:**The 'xml' prefix is bound as defined in + [Namespaces in XML](http://www.w3.org/TR/REC-xml-names/\#ns-using) + specification to "http://www.w3.org/XML/1998/namespace". + + + **NOTE:** The 'xmlns' prefix must be resolved to following namespace + [http://www.w3.org/2000/xmlns/](http://www.w3.org/2000/xmlns/) + + + **Parameters:** + - prefix - The prefix to lookup, may not be null + + **Returns:** + - the uri bound to the given prefix or null if it is not bound + + +--- + +### getPIData() +- getPIData(): [String](TopLevel.String.md) + - : Get the data section of a processing instruction. + + **Returns:** + - the data or null. + + +--- + +### getPITarget() +- getPITarget(): [String](TopLevel.String.md) + - : Get the target of a processing instruction. + + **Returns:** + - the target or null. + + +--- + +### getPrefix() +- getPrefix(): [String](TopLevel.String.md) + - : Returns the prefix of the current event or null if the event does not have a prefix + + **Returns:** + - the prefix or null. + + +--- + +### getText() +- getText(): [String](TopLevel.String.md) + - : Returns the current value of the parse event as a string, + this returns the string value of a CHARACTERS event, + returns the value of a COMMENT, the replacement value + for an ENTITY\_REFERENCE, the string value of a CDATA section, + the string value for a SPACE event, + or the String value of the internal subset of the DTD. + If an ENTITY\_REFERENCE has been resolved, any character data + will be reported as CHARACTERS events. + + + **Returns:** + - the current text or null. + + +--- + +### getTextLength() +- getTextLength(): [Number](TopLevel.Number.md) + - : Returns the length of the sequence of characters for this + Text event within the text character array. + + + **Returns:** + - the length of the sequence of characters for this + Text event within the text character array. + + + +--- + +### getTextStart() +- getTextStart(): [Number](TopLevel.Number.md) + - : Returns the offset into the text character array where the first + character (of this text event) is stored. + + + **Returns:** + - the offset into the text character array where the first + character (of this text event) is stored. + + + +--- + +### getVersion() +- getVersion(): [String](TopLevel.String.md) + - : Get the xml version declared on the xml declaration. + Returns null if none was declared. + + + **Returns:** + - the XML version or null. + + +--- + +### getXMLObject() +- ~~getXMLObject(): [Object](TopLevel.Object.md)~~ + - : Reads a sub-tree of the XML document and parses it as XML object. + + + The stream must be positioned on a START\_ELEMENT. Do not call the method + when the stream is positioned at document's root element. This would + cause the whole document to be parsed into a single XML what may lead to + an out-of-memory condition. Instead use \#next() to navigate to + sub-elements and invoke getXMLObject() there. Do not keep references to + more than the currently processed XML to keep memory consumption low. The + method reads the stream up to the matching END\_ELEMENT. When the method + returns the current event is the END\_ELEMENT event. + + + **Deprecated:** +:::warning +Use [readXMLObject()](dw.io.XMLStreamReader.md#readxmlobject) +::: + +--- + +### hasName() +- hasName(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the current event has a name (is a START\_ELEMENT or END\_ELEMENT) + + **Returns:** + - true if the current event has a name, false otherwise. + + +--- + +### hasNext() +- hasNext(): [Boolean](TopLevel.Boolean.md) + - : Returns true if there are more parsing events and false + if there are no more events. This method will return + false if the current state of the XMLStreamReader is + END\_DOCUMENT + + + **Returns:** + - true if there are more events, false otherwise + + +--- + +### hasText() +- hasText(): [Boolean](TopLevel.Boolean.md) + - : Indicates if the current event has text. + The following events have text: + CHARACTERS,DTD ,ENTITY\_REFERENCE, COMMENT, SPACE. + + + **Returns:** + - true if the current event has text, false otherwise. + + +--- + +### isAttributeSpecified(Number) +- isAttributeSpecified(index: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Identifies if this + attribute was created by default. + + + **Parameters:** + - index - the position of the attribute. + + **Returns:** + - true if this is a default attribute, false otherwise. + + +--- + +### isCharacters() +- isCharacters(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the cursor points to a character data event. + + **Returns:** + - true if the cursor points to character data, false otherwise. + + +--- + +### isEndElement() +- isEndElement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the cursor points to an end tag. + + **Returns:** + - true if the cursor points to an end tag, false otherwise. + + +--- + +### isStandalone() +- isStandalone(): [Boolean](TopLevel.Boolean.md) + - : Get the standalone declaration from the xml declaration. + + **Returns:** + - true if this is standalone, or false otherwise. + + +--- + +### isStartElement() +- isStartElement(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the cursor points to a start tag. + + **Returns:** + - true if the cursor points to a start tag, false otherwise. + + +--- + +### isWhiteSpace() +- isWhiteSpace(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the cursor points to a character data event + that consists of all whitespace. + + + **Returns:** + - true if the cursor points to all whitespace, false otherwise. + + +--- + +### next() +- next(): [Number](TopLevel.Number.md) + - : Get next parsing event - a processor may return all contiguous + character data in a single chunk, or it may split it into several chunks. + If the property javax.xml.stream.isCoalescing is set to true + element content must be coalesced and only one CHARACTERS event + must be returned for contiguous element content or + CDATA Sections. + + By default entity references must be + expanded and reported transparently to the application. + An exception will be thrown if an entity reference cannot be expanded. + If element content is empty (i.e. content is "") then no CHARACTERS event will be reported. + + + Given the following XML: + + content textHello]]>other content + + The behavior of calling next() when being on foo will be: + + 1- the comment (COMMENT) + + 2- then the characters section (CHARACTERS) + + 3- then the CDATA section (another CHARACTERS) + + 4- then the next characters section (another CHARACTERS) + + 5- then the END\_ELEMENT + + + + **NOTE:** empty element (such as ) will be reported + with two separate events: START\_ELEMENT, END\_ELEMENT - This preserves + parsing equivalency of empty element to . + + This method will throw an IllegalStateException if it is called after hasNext() returns false. + + + **Returns:** + - the integer code corresponding to the current parse event + + +--- + +### nextTag() +- nextTag(): [Number](TopLevel.Number.md) + - : Skips any white space (isWhiteSpace() returns true), COMMENT, + or PROCESSING\_INSTRUCTION, + until a START\_ELEMENT or END\_ELEMENT is reached. + If other than white space characters, COMMENT, PROCESSING\_INSTRUCTION, START\_ELEMENT, END\_ELEMENT + are encountered, an exception is thrown. This method should + be used when processing element-only content separated by white space. + + + Precondition: none + + Postcondition: the current event is START\_ELEMENT or END\_ELEMENT + and cursor may have moved over any whitespace event. + + + Essentially it does the following (implementations are free to optimized + but must do equivalent processing): + + + ``` + int eventType = next(); + while ( (eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace() ) + || (eventType == XMLStreamConstants.CDATA && isWhiteSpace()) + || eventType == XMLStreamConstants.SPACE + || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION + || eventType == XMLStreamConstants.COMMENT ) + { + eventType = next(); + } + if ( eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT ) + { + throw new String XMLStreamException( "expected start or end tag", getLocation() ); + } + return eventType; + ``` + + + **Returns:** + - the event type of the element read (START\_ELEMENT or END\_ELEMENT) + + +--- + +### readElementText() +- readElementText(): [String](TopLevel.String.md) + - : Reads the content of a text-only element, an exception is thrown if this is not a text-only element. This method + always returns coalesced content. + + Precondition: the current event is START\_ELEMENT. + + Postcondition: the current event is the corresponding END\_ELEMENT. + + The method does the following (implementations are free to be optimized but must do equivalent processing): + + + ``` + if ( getEventType() != XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "parser must be on START_ELEMENT to read next text", getLocation() ); + } + int eventType = next(); + StringBuffer content = new StringBuffer(); + while ( eventType != XMLStreamConstants.END_ELEMENT ) + { + if ( eventType == XMLStreamConstants.CHARACTERS || eventType == XMLStreamConstants.CDATA + || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.ENTITY_REFERENCE ) + { + buf.append( getText() ); + } + else if ( eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT ) + { + // skipping + } + else if ( eventType == XMLStreamConstants.END_DOCUMENT ) + { + throw new XMLStreamException( "unexpected end of document when reading element text content", this ); + } + else if ( eventType == XMLStreamConstants.START_ELEMENT ) + { + throw new XMLStreamException( "element text content may not contain START_ELEMENT", getLocation() ); + } + else + { + throw new XMLStreamException( "Unexpected event type " + eventType, getLocation() ); + } + eventType = next(); + } + return buf.toString(); + ``` + + + +--- + +### readXMLObject() +- readXMLObject(): [Object](TopLevel.Object.md) + - : Reads a sub-tree of the XML document and parses it as XML object. + + + The stream must be positioned on a START\_ELEMENT. Do not call the method + when the stream is positioned at document's root element. This would + cause the whole document to be parsed into a single XML what may lead to + an out-of-memory condition. Instead use \#next() to navigate to + sub-elements and invoke getXMLObject() there. Do not keep references to + more than the currently processed XML to keep memory consumption low. The + method reads the stream up to the matching END\_ELEMENT. When the method + returns the current event is the END\_ELEMENT event. + + + +--- + +### require(Number, String, String) +- require(type: [Number](TopLevel.Number.md), namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md)): void + - : Test if the current event is of the given type and if the namespace and name match the current + namespace and name of the current event. If the namespaceURI is null it is not checked for equality, + if the localName is null it is not checked for equality. + + + **Parameters:** + - type - the event type + - namespaceURI - the uri of the event, may be null + - localName - the localName of the event, may be null + + +--- + +### standaloneSet() +- standaloneSet(): [Boolean](TopLevel.Boolean.md) + - : Identifies if standalone was set in the document. + + **Returns:** + - true if standalone was set in the document, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamWriter.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamWriter.md new file mode 100644 index 00000000..df97020f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.XMLStreamWriter.md @@ -0,0 +1,478 @@ + +# Class XMLStreamWriter + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.io.XMLStreamWriter](dw.io.XMLStreamWriter.md) + +The XMLStreamWriter can be used to write small and large XML feeds. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +The XMLStreamWriter does not perform well-formedness checking on its input. +However the writeCharacters method escapes '&' , '<' and '>'. For attribute +values the writeAttribute method escapes the above characters plus '"' to +ensure that all character content and attribute values are well formed. + + +The following example illustrates how to use this class: + + +``` +var fileWriter : FileWriter = new FileWriter(file, "UTF-8"); +var xsw : XMLStreamWriter = new XMLStreamWriter(fileWriter); + +xsw.writeStartDocument(); +xsw.writeStartElement("products"); + xsw.writeStartElement("product"); + xsw.writeAttribute("id", "p42"); + xsw.writeStartElement("name"); + xsw.writeCharacters("blue t-shirt"); + xsw.writeEndElement(); + xsw.writeStartElement("rating"); + xsw.writeCharacters("2.0"); + xsw.writeEndElement(); + xsw.writeEndElement(); +xsw.writeEndElement(); +xsw.writeEndDocument(); + +xsw.close(); +fileWriter.close(); +``` + + + + + +The code above will write the following to file: + + +``` + + + + a blue t-shirt + 2.0 + + +``` + + +Note: This output has been formatted for readability. See +[XMLIndentingStreamWriter](dw.io.XMLIndentingStreamWriter.md). + + + +## All Known Subclasses +[XMLIndentingStreamWriter](dw.io.XMLIndentingStreamWriter.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [defaultNamespace](#defaultnamespace): [String](TopLevel.String.md) | Returns the current default name space. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [XMLStreamWriter](#xmlstreamwriterwriter)([Writer](dw.io.Writer.md)) | Constructs the XMLStreamWriter for a writer. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [close](dw.io.XMLStreamWriter.md#close)() | Close this writer and free any resources associated with the writer. | +| [flush](dw.io.XMLStreamWriter.md#flush)() | Write any cached data to the underlying output mechanism. | +| [getDefaultNamespace](dw.io.XMLStreamWriter.md#getdefaultnamespace)() | Returns the current default name space. | +| [getPrefix](dw.io.XMLStreamWriter.md#getprefixstring)([String](TopLevel.String.md)) | Gets the prefix the URI is bound to. | +| [setDefaultNamespace](dw.io.XMLStreamWriter.md#setdefaultnamespacestring)([String](TopLevel.String.md)) | Binds a URI to the default namespace. | +| [setPrefix](dw.io.XMLStreamWriter.md#setprefixstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Sets the prefix the uri is bound to. | +| [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes an attribute to the output stream without a prefix. | +| [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes an attribute to the output stream. | +| [writeAttribute](dw.io.XMLStreamWriter.md#writeattributestring-string-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes an attribute to the output stream. | +| [writeCData](dw.io.XMLStreamWriter.md#writecdatastring)([String](TopLevel.String.md)) | Writes a CData section. | +| [writeCharacters](dw.io.XMLStreamWriter.md#writecharactersstring)([String](TopLevel.String.md)) | Write text to the output. | +| [writeComment](dw.io.XMLStreamWriter.md#writecommentstring)([String](TopLevel.String.md)) | Writes an XML comment with the data enclosed. | +| [writeDTD](dw.io.XMLStreamWriter.md#writedtdstring)([String](TopLevel.String.md)) | Write a DTD section. | +| [writeDefaultNamespace](dw.io.XMLStreamWriter.md#writedefaultnamespacestring)([String](TopLevel.String.md)) | Writes the default namespace to the stream. | +| [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring)([String](TopLevel.String.md)) | Writes an empty element tag to the output. | +| [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes an empty element tag to the output. | +| [writeEmptyElement](dw.io.XMLStreamWriter.md#writeemptyelementstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes an empty element tag to the output. | +| [writeEndDocument](dw.io.XMLStreamWriter.md#writeenddocument)() | Closes any start tags and writes corresponding end tags. | +| [writeEndElement](dw.io.XMLStreamWriter.md#writeendelement)() | Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event. | +| [writeEntityRef](dw.io.XMLStreamWriter.md#writeentityrefstring)([String](TopLevel.String.md)) | Writes an entity reference. | +| [writeNamespace](dw.io.XMLStreamWriter.md#writenamespacestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes a namespace to the output stream. | +| [writeProcessingInstruction](dw.io.XMLStreamWriter.md#writeprocessinginstructionstring)([String](TopLevel.String.md)) | Writes a processing instruction. | +| [writeProcessingInstruction](dw.io.XMLStreamWriter.md#writeprocessinginstructionstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes a processing instruction. | +| [writeRaw](dw.io.XMLStreamWriter.md#writerawstring)([String](TopLevel.String.md)) | Writes the given string directly into the output stream. | +| [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocument)() | Write the XML Declaration. | +| [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocumentstring)([String](TopLevel.String.md)) | Write the XML Declaration. | +| [writeStartDocument](dw.io.XMLStreamWriter.md#writestartdocumentstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Write the XML Declaration. | +| [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring)([String](TopLevel.String.md)) | Writes a start tag to the output. | +| [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes a start tag to the output. | +| [writeStartElement](dw.io.XMLStreamWriter.md#writestartelementstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Writes a start tag to the output. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### defaultNamespace +- defaultNamespace: [String](TopLevel.String.md) + - : Returns the current default name space. + + +--- + +## Constructor Details + +### XMLStreamWriter(Writer) +- XMLStreamWriter(writer: [Writer](dw.io.Writer.md)) + - : Constructs the XMLStreamWriter for a writer. + + **Parameters:** + - writer - the writer for which the XMLStreamWriter is constructed. + + +--- + +## Method Details + +### close() +- close(): void + - : Close this writer and free any resources associated with the + writer. This method does not close the underlying writer. + + + +--- + +### flush() +- flush(): void + - : Write any cached data to the underlying output mechanism. + + +--- + +### getDefaultNamespace() +- getDefaultNamespace(): [String](TopLevel.String.md) + - : Returns the current default name space. + + **Returns:** + - the current default name space. + + +--- + +### getPrefix(String) +- getPrefix(uri: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Gets the prefix the URI is bound to. + + **Parameters:** + - uri - the URI to use. + + **Returns:** + - the prefix or null. + + +--- + +### setDefaultNamespace(String) +- setDefaultNamespace(uri: [String](TopLevel.String.md)): void + - : Binds a URI to the default namespace. + This URI is bound + in the scope of the current START\_ELEMENT / END\_ELEMENT pair. + If this method is called before a START\_ELEMENT has been written + the uri is bound in the root scope. + + + **Parameters:** + - uri - the uri to bind to the default namespace, may be null. + + +--- + +### setPrefix(String, String) +- setPrefix(prefix: [String](TopLevel.String.md), uri: [String](TopLevel.String.md)): void + - : Sets the prefix the uri is bound to. This prefix is bound + in the scope of the current START\_ELEMENT / END\_ELEMENT pair. + If this method is called before a START\_ELEMENT has been written + the prefix is bound in the root scope. + + + **Parameters:** + - prefix - the prefix to bind to the uri, may not be null. + - uri - the uri to bind to the prefix, may be null. + + +--- + +### writeAttribute(String, String) +- writeAttribute(localName: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): void + - : Writes an attribute to the output stream without + a prefix. + + + **Parameters:** + - localName - the local name of the attribute. + - value - the value of the attribute. + + +--- + +### writeAttribute(String, String, String) +- writeAttribute(namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): void + - : Writes an attribute to the output stream. + + **Parameters:** + - namespaceURI - the uri of the prefix for this attribute. + - localName - the local name of the attribute. + - value - the value of the attribute. + + +--- + +### writeAttribute(String, String, String, String) +- writeAttribute(prefix: [String](TopLevel.String.md), namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): void + - : Writes an attribute to the output stream. + + **Parameters:** + - prefix - the prefix for this attribute. + - namespaceURI - the uri of the prefix for this attribute. + - localName - the local name of the attribute. + - value - the value of the attribute. + + +--- + +### writeCData(String) +- writeCData(data: [String](TopLevel.String.md)): void + - : Writes a CData section. + + **Parameters:** + - data - the data contained in the CData Section, may not be null. + + +--- + +### writeCharacters(String) +- writeCharacters(text: [String](TopLevel.String.md)): void + - : Write text to the output. + + **Parameters:** + - text - the value to write. + + +--- + +### writeComment(String) +- writeComment(data: [String](TopLevel.String.md)): void + - : Writes an XML comment with the data enclosed. + + **Parameters:** + - data - the data contained in the comment, may be null. + + +--- + +### writeDTD(String) +- writeDTD(dtd: [String](TopLevel.String.md)): void + - : Write a DTD section. This string represents the entire doctypedecl production + from the XML 1.0 specification. + + + **Parameters:** + - dtd - the DTD to be written. + + +--- + +### writeDefaultNamespace(String) +- writeDefaultNamespace(namespaceURI: [String](TopLevel.String.md)): void + - : Writes the default namespace to the stream. + + **Parameters:** + - namespaceURI - the uri to bind the default namespace to. + + +--- + +### writeEmptyElement(String) +- writeEmptyElement(localName: [String](TopLevel.String.md)): void + - : Writes an empty element tag to the output. + + **Parameters:** + - localName - local name of the tag, may not be null. + + +--- + +### writeEmptyElement(String, String) +- writeEmptyElement(namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md)): void + - : Writes an empty element tag to the output. + + **Parameters:** + - namespaceURI - the uri to bind the tag to, may not be null. + - localName - local name of the tag, may not be null. + + +--- + +### writeEmptyElement(String, String, String) +- writeEmptyElement(prefix: [String](TopLevel.String.md), localName: [String](TopLevel.String.md), namespaceURI: [String](TopLevel.String.md)): void + - : Writes an empty element tag to the output. + + **Parameters:** + - prefix - the prefix of the tag, may not be null. + - localName - local name of the tag, may not be null. + - namespaceURI - the uri to bind the tag to, may not be null. + + +--- + +### writeEndDocument() +- writeEndDocument(): void + - : Closes any start tags and writes corresponding end tags. + + +--- + +### writeEndElement() +- writeEndElement(): void + - : Writes an end tag to the output relying on the internal + state of the writer to determine the prefix and local name + of the event. + + + +--- + +### writeEntityRef(String) +- writeEntityRef(name: [String](TopLevel.String.md)): void + - : Writes an entity reference. + + **Parameters:** + - name - the name of the entity. + + +--- + +### writeNamespace(String, String) +- writeNamespace(prefix: [String](TopLevel.String.md), namespaceURI: [String](TopLevel.String.md)): void + - : Writes a namespace to the output stream. + If the prefix argument to this method is the empty string, + "xmlns", or null this method will delegate to writeDefaultNamespace. + + + **Parameters:** + - prefix - the prefix to bind this namespace to. + - namespaceURI - the uri to bind the prefix to. + + +--- + +### writeProcessingInstruction(String) +- writeProcessingInstruction(target: [String](TopLevel.String.md)): void + - : Writes a processing instruction. + + **Parameters:** + - target - the target of the processing instruction, may not be null. + + +--- + +### writeProcessingInstruction(String, String) +- writeProcessingInstruction(target: [String](TopLevel.String.md), data: [String](TopLevel.String.md)): void + - : Writes a processing instruction. + + **Parameters:** + - target - the target of the processing instruction, may not be null. + - data - the data contained in the processing instruction, may not be null. + + +--- + +### writeRaw(String) +- writeRaw(raw: [String](TopLevel.String.md)): void + - : Writes the given string directly into the output stream. No checks + regarding the correctness of the XML are done. The caller must ensure + that the final result is a correct XML. + + + **Parameters:** + - raw - the string to write to the output stream. + + +--- + +### writeStartDocument() +- writeStartDocument(): void + - : Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8 + + +--- + +### writeStartDocument(String) +- writeStartDocument(version: [String](TopLevel.String.md)): void + - : Write the XML Declaration. Defaults the XML version to 1.0 + + **Parameters:** + - version - version of the xml document. + + +--- + +### writeStartDocument(String, String) +- writeStartDocument(encoding: [String](TopLevel.String.md), version: [String](TopLevel.String.md)): void + - : Write the XML Declaration. Note that the encoding parameter does + not set the actual encoding of the underlying output. That must + be set when the instance of the XMLStreamWriter is created using the + XMLOutputFactory. + + + **Parameters:** + - encoding - encoding of the xml declaration. + - version - version of the xml document. + + +--- + +### writeStartElement(String) +- writeStartElement(localName: [String](TopLevel.String.md)): void + - : Writes a start tag to the output. All writeStartElement methods + open a new scope in the internal namespace context. Writing the + corresponding EndElement causes the scope to be closed. + + + **Parameters:** + - localName - local name of the tag, may not be null. + + +--- + +### writeStartElement(String, String) +- writeStartElement(namespaceURI: [String](TopLevel.String.md), localName: [String](TopLevel.String.md)): void + - : Writes a start tag to the output. + + **Parameters:** + - namespaceURI - the namespaceURI of the prefix to use, may not be null. + - localName - local name of the tag, may not be null. + + +--- + +### writeStartElement(String, String, String) +- writeStartElement(prefix: [String](TopLevel.String.md), localName: [String](TopLevel.String.md), namespaceURI: [String](TopLevel.String.md)): void + - : Writes a start tag to the output. + + **Parameters:** + - prefix - the prefix of the tag, may not be null. + - localName - local name of the tag, may not be null. + - namespaceURI - the uri to bind the prefix to, may not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.io.md b/packages/b2c-tooling-sdk/data/script-api/dw.io.md new file mode 100644 index 00000000..671a48bf --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.io.md @@ -0,0 +1,21 @@ +# Package dw.io + +## Classes +| Class | Description | +| --- | --- | +| [CSVStreamReader](dw.io.CSVStreamReader.md) | The class supports reading a CSV file. | +| [CSVStreamWriter](dw.io.CSVStreamWriter.md) | The class writes a CSV file. | +| [File](dw.io.File.md) | Represents a file resource accessible from scripting. | +| [FileReader](dw.io.FileReader.md) | File reader class. | +| [FileWriter](dw.io.FileWriter.md) | Convenience class for writing character files. | +| [InputStream](dw.io.InputStream.md) | The class represent a stream of bytes that can be read from the application. | +| [OutputStream](dw.io.OutputStream.md) | The class represent a stream of bytes that can be written from the application. | +| [PrintWriter](dw.io.PrintWriter.md) | Template output stream writer. | +| [RandomAccessFileReader](dw.io.RandomAccessFileReader.md) | Instances of this class support reading from a random access file. | +| [Reader](dw.io.Reader.md) | The class supports reading characters from a stream. | +| [StringWriter](dw.io.StringWriter.md) | A Writer that can be used to generate a String. | +| [Writer](dw.io.Writer.md) | The class supports writing characters to a stream. | +| [XMLIndentingStreamWriter](dw.io.XMLIndentingStreamWriter.md) | A XMLIndentingStreamWriter writes the XML output formatted for good readability. | +| [XMLStreamConstants](dw.io.XMLStreamConstants.md) | Useful constants for working with XML streams. | +| [XMLStreamReader](dw.io.XMLStreamReader.md) | The XMLStreamReader allows forward, read-only access to XML. | +| [XMLStreamWriter](dw.io.XMLStreamWriter.md) | The XMLStreamWriter can be used to write small and large XML feeds. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.job.JobExecution.md b/packages/b2c-tooling-sdk/data/script-api/dw.job.JobExecution.md new file mode 100644 index 00000000..074261dc --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.job.JobExecution.md @@ -0,0 +1,111 @@ + +# Class JobExecution + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.job.JobExecution](dw.job.JobExecution.md) + +Represents an execution of a job. The job execution can be accessed from a [JobStepExecution](dw.job.JobStepExecution.md) via +[JobStepExecution.getJobExecution()](dw.job.JobStepExecution.md#getjobexecution). If a pipeline is used to implement a step the step execution is available +in the pipeline dictionary under the key 'JobStepExecution'. If a script module is used to implement a step the step +execution is available as the second parameter of the module's function that is used to execute the step, e.g.: + + +``` +... +exports.execute( parameters, stepExecution) +{ + ... + var jobExecution = stepExecution.getJobExecution(); + ... +} +... +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of this job execution. | +| [context](#context): [Map](dw.util.Map.md) `(read-only)` | Returns the job context which can be used to share data between steps. | +| [jobID](#jobid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the job this job execution belongs to. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getContext](dw.job.JobExecution.md#getcontext)() | Returns the job context which can be used to share data between steps. | +| [getID](dw.job.JobExecution.md#getid)() | Returns the ID of this job execution. | +| [getJobID](dw.job.JobExecution.md#getjobid)() | Returns the ID of the job this job execution belongs to. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of this job execution. + + +--- + +### context +- context: [Map](dw.util.Map.md) `(read-only)` + - : Returns the job context which can be used to share data between steps. NOTE: Steps should be self-contained, the + job context should only be used when necessary and with caution. If two steps which are running in parallel in + the same job store data in the job context using the same key the result is undefined. Don't add any complex data + to the job context since only simple data types are supported (for example, String and Integer). + + + +--- + +### jobID +- jobID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the job this job execution belongs to. + + +--- + +## Method Details + +### getContext() +- getContext(): [Map](dw.util.Map.md) + - : Returns the job context which can be used to share data between steps. NOTE: Steps should be self-contained, the + job context should only be used when necessary and with caution. If two steps which are running in parallel in + the same job store data in the job context using the same key the result is undefined. Don't add any complex data + to the job context since only simple data types are supported (for example, String and Integer). + + + **Returns:** + - the map that represents the job context. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of this job execution. + + **Returns:** + - the ID of this job execution. + + +--- + +### getJobID() +- getJobID(): [String](TopLevel.String.md) + - : Returns the ID of the job this job execution belongs to. + + **Returns:** + - the ID of the job this job execution belongs to. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.job.JobStepExecution.md b/packages/b2c-tooling-sdk/data/script-api/dw.job.JobStepExecution.md new file mode 100644 index 00000000..e5fa8d66 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.job.JobStepExecution.md @@ -0,0 +1,136 @@ + +# Class JobStepExecution + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.job.JobStepExecution](dw.job.JobStepExecution.md) + +Represents an execution of a step that belongs to a job. The job execution this step execution belongs to can be +accessed via [getJobExecution()](dw.job.JobStepExecution.md#getjobexecution). If a pipeline is used to implement a step this step execution is available +in the pipeline dictionary under the key 'JobStepExecution'. If a script module is used to implement a step this step +execution is available as the second parameter of the module's function that is used to execute the step, e.g.: + + +``` +... +exports.execute( parameters, stepExecution) +{ + ... + var jobExecution = stepExecution.getJobExecution(); + ... +} +... +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of this step execution. | +| [jobExecution](#jobexecution): [JobExecution](dw.job.JobExecution.md) `(read-only)` | Returns the job execution this step execution belongs to. | +| [stepID](#stepid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the step this step execution belongs to. | +| [stepTypeID](#steptypeid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the step type of the step this step execution belongs to. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getID](dw.job.JobStepExecution.md#getid)() | Returns the ID of this step execution. | +| [getJobExecution](dw.job.JobStepExecution.md#getjobexecution)() | Returns the job execution this step execution belongs to. | +| [getParameterValue](dw.job.JobStepExecution.md#getparametervaluestring)([String](TopLevel.String.md)) | Returns the value of the parameter of the step this step execution belongs to. | +| [getStepID](dw.job.JobStepExecution.md#getstepid)() | Returns the ID of the step this step execution belongs to. | +| [getStepTypeID](dw.job.JobStepExecution.md#getsteptypeid)() | Returns the ID of the step type of the step this step execution belongs to. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of this step execution. + + +--- + +### jobExecution +- jobExecution: [JobExecution](dw.job.JobExecution.md) `(read-only)` + - : Returns the job execution this step execution belongs to. + + +--- + +### stepID +- stepID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the step this step execution belongs to. + + +--- + +### stepTypeID +- stepTypeID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the step type of the step this step execution belongs to. + + +--- + +## Method Details + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of this step execution. + + **Returns:** + - the ID of this step execution. + + +--- + +### getJobExecution() +- getJobExecution(): [JobExecution](dw.job.JobExecution.md) + - : Returns the job execution this step execution belongs to. + + **Returns:** + - the job execution this step execution belongs to. + + +--- + +### getParameterValue(String) +- getParameterValue(name: [String](TopLevel.String.md)): [Object](TopLevel.Object.md) + - : Returns the value of the parameter of the step this step execution belongs to. + + **Parameters:** + - name - The name of the parameter. + + **Returns:** + - the value of the parameter of the step this step execution belongs to. + + +--- + +### getStepID() +- getStepID(): [String](TopLevel.String.md) + - : Returns the ID of the step this step execution belongs to. + + **Returns:** + - the ID of the step this step execution belongs to. + + +--- + +### getStepTypeID() +- getStepTypeID(): [String](TopLevel.String.md) + - : Returns the ID of the step type of the step this step execution belongs to. + + **Returns:** + - the ID of the step type of the step this step execution belongs to. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.job.md b/packages/b2c-tooling-sdk/data/script-api/dw.job.md new file mode 100644 index 00000000..021643c4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.job.md @@ -0,0 +1,7 @@ +# Package dw.job + +## Classes +| Class | Description | +| --- | --- | +| [JobExecution](dw.job.JobExecution.md) | Represents an execution of a job. | +| [JobStepExecution](dw.job.JobStepExecution.md) | Represents an execution of a step that belongs to a job. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPClient.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPClient.md new file mode 100644 index 00000000..518894b0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPClient.md @@ -0,0 +1,621 @@ + +# Class FTPClient + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.FTPClient](dw.net.FTPClient.md) + +The FTPClient class supports the FTP commands CD, GET, PUT, DEL, MKDIR, RENAME, and LIST. The FTP connection is +established using passive transfer mode (PASV). The transfer of files can be text or binary. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + +An example usage is as follows: + + + + +``` + + var ftp : FTPClient = new dw.net.FTPClient(); + ftp.connect("my.ftp-server.com", "username", "password"); + var data : String = ftp.get("simple.txt"); + ftp.disconnect(); +``` + + + +The default connection timeout depends on the script context timeout and will be set to a maximum of 30 seconds +(default script context timeout is 10 seconds within storefront requests and 15 minutes within jobs). + + +**IMPORTANT NOTE:** Before you can make an outbound FTP connection, the FTP server IP address must be enabled for +outbound traffic at the Commerce Cloud Digital firewall for your POD. Please file a support request to request a new firewall +rule. + + +**Deprecated:** +:::warning +The FTPClient is deprecated. Use [SFTPClient](dw.net.SFTPClient.md) for a secure alternative. +::: + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[DEFAULT_GET_FILE_SIZE](#default_get_file_size): [Number](TopLevel.Number.md) = 5242880~~ | The default size for `get()` returning a File is 5MB | +| ~~[DEFAULT_GET_STRING_SIZE](#default_get_string_size): [Number](TopLevel.Number.md) = 2097152~~ | The default size for `get()` returning a String is 2MB | +| [MAX_GET_FILE_SIZE](#max_get_file_size): [Number](TopLevel.Number.md) = 209715200 | The maximum size for `get()` returning a File is forty times the default size for getting a file. | +| [MAX_GET_STRING_SIZE](#max_get_string_size): [Number](TopLevel.Number.md) = 10485760 | The maximum size for `get()` returning a String is five times the default size for getting a String. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [connected](#connected): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the FTP client is currently connected to the FTP server. | +| [replyCode](#replycode): [Number](TopLevel.Number.md) `(read-only)` | Returns the reply code from the last FTP action. | +| [replyMessage](#replymessage): [String](TopLevel.String.md) `(read-only)` | Returns the string message from the last FTP action. | +| [timeout](#timeout): [Number](TopLevel.Number.md) | Returns the timeout for this client, in milliseconds. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FTPClient](#ftpclient)() | Constructs the FTPClient instance. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [cd](dw.net.FTPClient.md#cdstring)([String](TopLevel.String.md)) | Changes the current directory on the remote server to the given path. | +| [connect](dw.net.FTPClient.md#connectstring)([String](TopLevel.String.md)) | Connects and logs on to an FTP Server as "anonymous" and returns a boolean indicating success or failure. | +| [connect](dw.net.FTPClient.md#connectstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Connects and logs on to an FTP Server as "anonymous" and returns a boolean indicating success or failure. | +| [connect](dw.net.FTPClient.md#connectstring-number-string-string)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Connects and logs on to an FTP server and returns a boolean indicating success or failure. | +| [connect](dw.net.FTPClient.md#connectstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Connects and logs on to an FTP server and returns a boolean indicating success or failure. | +| [del](dw.net.FTPClient.md#delstring)([String](TopLevel.String.md)) | Deletes the remote file on the server identified by the path parameter. | +| [disconnect](dw.net.FTPClient.md#disconnect)() | The method first logs the current user out from the server and then disconnects from the server. | +| [get](dw.net.FTPClient.md#getstring)([String](TopLevel.String.md)) | Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. | +| ~~[get](dw.net.FTPClient.md#getstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md))~~ | Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. | +| [get](dw.net.FTPClient.md#getstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Reads the content of a remote file and returns it as string using the passed encoding. | +| [get](dw.net.FTPClient.md#getstring-string-file)([String](TopLevel.String.md), [String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to read the file content and using the system standard encoding "UTF-8" to write the file. | +| ~~[get](dw.net.FTPClient.md#getstring-string-file-number)([String](TopLevel.String.md), [String](TopLevel.String.md), [File](dw.io.File.md), [Number](TopLevel.Number.md))~~ | Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to read the file content and using the system standard encoding "UTF-8" to write the file. | +| ~~[get](dw.net.FTPClient.md#getstring-string-number)([String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md))~~ | Reads the content of a remote file and returns it as a string using the specified encoding. | +| [getBinary](dw.net.FTPClient.md#getbinarystring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote file and creates a local copy in the given file. | +| ~~[getBinary](dw.net.FTPClient.md#getbinarystring-file-number)([String](TopLevel.String.md), [File](dw.io.File.md), [Number](TopLevel.Number.md))~~ | Reads the content of a remote file and creates a local copy in the given file. | +| [getConnected](dw.net.FTPClient.md#getconnected)() | Identifies if the FTP client is currently connected to the FTP server. | +| [getReplyCode](dw.net.FTPClient.md#getreplycode)() | Returns the reply code from the last FTP action. | +| [getReplyMessage](dw.net.FTPClient.md#getreplymessage)() | Returns the string message from the last FTP action. | +| [getTimeout](dw.net.FTPClient.md#gettimeout)() | Returns the timeout for this client, in milliseconds. | +| [list](dw.net.FTPClient.md#list)() | Returns a list of FTPFileInfo objects containing information about the files in the current directory. | +| [list](dw.net.FTPClient.md#liststring)([String](TopLevel.String.md)) | Returns a list of FTPFileInfo objects containing information about the files in the remote directory defined by the given path. | +| [mkdir](dw.net.FTPClient.md#mkdirstring)([String](TopLevel.String.md)) | Creates a directory | +| [put](dw.net.FTPClient.md#putstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Puts the specified content to the specified full path using "ISO-8859-1" encoding. | +| [put](dw.net.FTPClient.md#putstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Put the given content to a file on the given full path on the FTP server. | +| [putBinary](dw.net.FTPClient.md#putbinarystring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Put the content of the given file into a file on the remote FTP server with the given full path. | +| [removeDirectory](dw.net.FTPClient.md#removedirectorystring)([String](TopLevel.String.md)) | Deletes the remote directory on the server identified by the path parameter. | +| [rename](dw.net.FTPClient.md#renamestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Renames an existing file. | +| [setTimeout](dw.net.FTPClient.md#settimeoutnumber)([Number](TopLevel.Number.md)) | Sets the timeout for connections made with the FTP client to the given number of milliseconds. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DEFAULT_GET_FILE_SIZE + +- ~~DEFAULT_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 5242880~~ + - : The default size for `get()` returning a File is 5MB + + **Deprecated:** +:::warning +The default size is not supported anymore. The `get()` methods returning a file will + always try to return [MAX_GET_FILE_SIZE](dw.net.FTPClient.md#max_get_file_size) bytes instead. + +::: + +--- + +### DEFAULT_GET_STRING_SIZE + +- ~~DEFAULT_GET_STRING_SIZE: [Number](TopLevel.Number.md) = 2097152~~ + - : The default size for `get()` returning a String is 2MB + + **Deprecated:** +:::warning +The default size is not supported anymore. The `get()` methods returning a String will + always try to return [MAX_GET_STRING_SIZE](dw.net.FTPClient.md#max_get_string_size) bytes instead. + +::: + +--- + +### MAX_GET_FILE_SIZE + +- MAX_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 209715200 + - : The maximum size for `get()` returning a File is forty times the default size for getting a file. The + largest file allowed is 200MB. + + + +--- + +### MAX_GET_STRING_SIZE + +- MAX_GET_STRING_SIZE: [Number](TopLevel.Number.md) = 10485760 + - : The maximum size for `get()` returning a String is five times the default size for getting a String. + The largest String allowed is 10MB. + + + +--- + +## Property Details + +### connected +- connected: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the FTP client is currently connected to the FTP server. + + +--- + +### replyCode +- replyCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the reply code from the last FTP action. + + +--- + +### replyMessage +- replyMessage: [String](TopLevel.String.md) `(read-only)` + - : Returns the string message from the last FTP action. + + +--- + +### timeout +- timeout: [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + +--- + +## Constructor Details + +### FTPClient() +- FTPClient() + - : Constructs the FTPClient instance. + + +--- + +## Method Details + +### cd(String) +- cd(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Changes the current directory on the remote server to the given path. + + **Parameters:** + - path - the new current directory + + **Returns:** + - true if the directory change was okay + + +--- + +### connect(String) +- connect(host: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to an FTP Server as "anonymous" and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the FTP sever + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### connect(String, Number) +- connect(host: [String](TopLevel.String.md), port: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to an FTP Server as "anonymous" and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the FTP sever + - port - Port for FTP server + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### connect(String, Number, String, String) +- connect(host: [String](TopLevel.String.md), port: [Number](TopLevel.Number.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to an FTP server and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the FTP sever + - port - Port for FTP server + - user - Username for the login + - password - Password for the login + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### connect(String, String, String) +- connect(host: [String](TopLevel.String.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to an FTP server and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the FTP sever + - user - Username for the login + - password - Password for the login + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### del(String) +- del(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Deletes the remote file on the server identified by the path parameter. + + **Parameters:** + - path - the path to the file. + + **Returns:** + - true if the file was successfully deleted, false otherwise. + + +--- + +### disconnect() +- disconnect(): void + - : The method first logs the current user out from the server and then disconnects from the server. + + +--- + +### get(String) +- get(path: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. Read at + most MAX\_GET\_STRING\_SIZE bytes. + + + **Parameters:** + - path - remote path of the file to be read. + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + +--- + +### get(String, Number) +- ~~get(path: [String](TopLevel.String.md), maxGetSize: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)~~ + - : Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. Read at + most maxGetSize characters. + + + **Parameters:** + - path - remote path of the file to be read. + - maxGetSize - the maximum bytes fetched from the remote file. + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + **Deprecated:** +:::warning +The maxGetSize attribute is not supported anymore. Use the method [get(String)](dw.net.FTPClient.md#getstring) instead. +::: + +--- + +### get(String, String) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file and returns it as string using the passed encoding. Read at most + MAX\_GET\_STRING\_SIZE characters. + + + **Parameters:** + - path - remote path of the file to be read. + - encoding - an ISO 8859 character encoding labeled as a string, e.g. "ISO-8859-1" + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + +--- + +### get(String, String, File) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to + read the file content and using the system standard encoding "UTF-8" to write the file. Copies at most + MAX\_GET\_FILE\_SIZE bytes. + + + **Parameters:** + - path - remote path of the file to be read. + - encoding - the encoding to use. + - file - the local file name + + **Returns:** + - true if remote file is fetched and copied into local file. + + +--- + +### get(String, String, File, Number) +- ~~get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), file: [File](dw.io.File.md), maxGetSize: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to + read the file content and using the system standard encoding "UTF-8" to write the file. Copies at most maxGetSize + bytes. + + + **Parameters:** + - path - remote path of the file to be read. + - encoding - the encoding to use. + - file - the local file name + - maxGetSize - the maximum number of bytes to fetch + + **Returns:** + - true if remote file is fetched and copied into local file. + + **Deprecated:** +:::warning +The maxGetSize attribute is not supported anymore. Use the method [get(String, String, File)](dw.net.FTPClient.md#getstring-string-file) + instead. + +::: + +--- + +### get(String, String, Number) +- ~~get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), maxGetSize: [Number](TopLevel.Number.md)): [String](TopLevel.String.md)~~ + - : Reads the content of a remote file and returns it as a string using the specified encoding. Returns at most + maxGetSize characters. + + + **Parameters:** + - path - remote path of the file to be read. + - encoding - the encoding to use. + - maxGetSize - the maximum bytes fetched from the remote file. + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + **Deprecated:** +:::warning +The maxGetSize attribute is not supported anymore. Use the method [get(String, String)](dw.net.FTPClient.md#getstring-string) + instead. + +::: + +--- + +### getBinary(String, File) +- getBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file and creates a local copy in the given file. Copies at most MAX\_GET\_FILE\_SIZE + bytes. The FTP transfer is done in Binary mode. + + + **Parameters:** + - path - remote path of the file to be read. + - file - the local file name + + **Returns:** + - true if remote file is fetched and copied into local file. + + +--- + +### getBinary(String, File, Number) +- ~~getBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md), maxGetSize: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md)~~ + - : Reads the content of a remote file and creates a local copy in the given file. Copies at most maxGetSize bytes. + The FTP transfer is done in Binary mode. + + + **Parameters:** + - path - remote path of the file to be read. + - file - the local file name + - maxGetSize - the maximum number of bytes to fetch + + **Returns:** + - true if remote file is fetched and copied into local file. + + **Deprecated:** +:::warning +The maxGetSize attribute is not supported anymore. Use the method [getBinary(String, File)](dw.net.FTPClient.md#getbinarystring-file) + instead. + +::: + +--- + +### getConnected() +- getConnected(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the FTP client is currently connected to the FTP server. + + **Returns:** + - true if the client is currently connected. + + +--- + +### getReplyCode() +- getReplyCode(): [Number](TopLevel.Number.md) + - : Returns the reply code from the last FTP action. + + **Returns:** + - the reply code from the last FTP action. + + +--- + +### getReplyMessage() +- getReplyMessage(): [String](TopLevel.String.md) + - : Returns the string message from the last FTP action. + + **Returns:** + - the string message from the last FTP action. + + +--- + +### getTimeout() +- getTimeout(): [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + **Returns:** + - the timeout in milliseconds + + +--- + +### list() +- list(): [FTPFileInfo\[\]](dw.net.FTPFileInfo.md) + - : Returns a list of FTPFileInfo objects containing information about the files in the current directory. + + **Returns:** + - list of objects with remote file information. + + +--- + +### list(String) +- list(path: [String](TopLevel.String.md)): [FTPFileInfo\[\]](dw.net.FTPFileInfo.md) + - : Returns a list of FTPFileInfo objects containing information about the files in the remote directory defined by + the given path. + + + **Parameters:** + - path - the remote path from which the file info is listed. + + **Returns:** + - list of objects with remote file information. + + +--- + +### mkdir(String) +- mkdir(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Creates a directory + + **Parameters:** + - path - the path to the directory to create. + + **Returns:** + - true if the directory was successfully created, false otherwise. + + +--- + +### put(String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Puts the specified content to the specified full path using "ISO-8859-1" encoding. The full path must include the + path and the file name. If the content of a local file is to be uploaded, please use method + [putBinary(String, File)](dw.net.FTPClient.md#putbinarystring-file) instead. + + + **Parameters:** + - path - full path on the remote FTP server where the file will be stored. + - content - the content to put. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### put(String, String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Put the given content to a file on the given full path on the FTP server. The full path must include the path and + the file name. The transformation from String into binary data is done via the encoding provided with the method + call. If the content of a local file is to be uploaded, please use method [putBinary(String, File)](dw.net.FTPClient.md#putbinarystring-file) + instead. + + + **Parameters:** + - path - the full path on the remote FTP server where the file will be stored. + - content - the content to put. + - encoding - the encoding to use. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### putBinary(String, File) +- putBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Put the content of the given file into a file on the remote FTP server with the given full path. The full path + must include the path and the file name. + + + **Parameters:** + - path - the full path on the remote FTP server where the file will be stored. + - file - the file on the local system, which content is send to the remote FTP server. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### removeDirectory(String) +- removeDirectory(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Deletes the remote directory on the server identified by the path parameter. In order to delete the directory + successfully the directory needs to be empty, otherwise the removeDirectory() method will return false. + + + **Parameters:** + - path - the path to the directory. + + **Returns:** + - true if the directory was successfully deleted, false otherwise. + + +--- + +### rename(String, String) +- rename(from: [String](TopLevel.String.md), to: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Renames an existing file. + + **Parameters:** + - from - the file that will be renamed. + - to - the name of the new file. + + **Returns:** + - true if the file was successfully renamed, false otherwise. + + +--- + +### setTimeout(Number) +- setTimeout(timeoutMillis: [Number](TopLevel.Number.md)): void + - : Sets the timeout for connections made with the FTP client to the given number of milliseconds. If the given + timeout is less than or equal to zero, the timeout is set to the same value as the script context timeout but + will only be set to a maximum of 30 seconds. + + + The maximum and default timeout depend on the script context timeout. The maximum timeout is set to a maximum of + 2 minutes. The default timeout for a new client is set to a maximum of 30 seconds. + + + This method can be called at any time, and will affect the next connection made with this client. It is not + possible to set the timeout for an open connection. + + + **Parameters:** + - timeoutMillis - timeout, in milliseconds, up to a maximum of 2 minutes. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPFileInfo.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPFileInfo.md new file mode 100644 index 00000000..4eb8dbb1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.FTPFileInfo.md @@ -0,0 +1,132 @@ + +# Class FTPFileInfo + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.FTPFileInfo](dw.net.FTPFileInfo.md) + +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. + + +**Deprecated:** +:::warning +The FTPClient is deprecated. Use [SFTPClient](dw.net.SFTPClient.md) for a secure alternative. +::: + +## Property Summary + +| Property | Description | +| --- | --- | +| [directory](#directory): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the file is a directory. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the file. | +| [size](#size): [Number](TopLevel.Number.md) `(read-only)` | Returns the size of the file. | +| [timestamp](#timestamp): [Date](TopLevel.Date.md) `(read-only)` | Returns the timestamp of the file. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [FTPFileInfo](#ftpfileinfostring-number-boolean-date)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md), [Date](TopLevel.Date.md)) | Constructs the FTPFileInfo instance. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getDirectory](dw.net.FTPFileInfo.md#getdirectory)() | Identifies if the file is a directory. | +| [getName](dw.net.FTPFileInfo.md#getname)() | Returns the name of the file. | +| [getSize](dw.net.FTPFileInfo.md#getsize)() | Returns the size of the file. | +| [getTimestamp](dw.net.FTPFileInfo.md#gettimestamp)() | Returns the timestamp of the file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### directory +- directory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the file is a directory. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the file. + + +--- + +### size +- size: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the size of the file. + + +--- + +### timestamp +- timestamp: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the timestamp of the file. + + +--- + +## Constructor Details + +### FTPFileInfo(String, Number, Boolean, Date) +- FTPFileInfo(name: [String](TopLevel.String.md), size: [Number](TopLevel.Number.md), directory: [Boolean](TopLevel.Boolean.md), timestamp: [Date](TopLevel.Date.md)) + - : Constructs the FTPFileInfo instance. + + **Parameters:** + - name - the name of the file. + - size - the size of the file. + - directory - controls if the file is a directory. + - timestamp - the timestamp of the file. + + +--- + +## Method Details + +### getDirectory() +- getDirectory(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the file is a directory. + + **Returns:** + - true if the file is a directory, false otherwise. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the file. + + **Returns:** + - the name of the file. + + +--- + +### getSize() +- getSize(): [Number](TopLevel.Number.md) + - : Returns the size of the file. + + **Returns:** + - the size of the file. + + +--- + +### getTimestamp() +- getTimestamp(): [Date](TopLevel.Date.md) + - : Returns the timestamp of the file. + + **Returns:** + - the timestamp of the file. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClient.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClient.md new file mode 100644 index 00000000..6b4c5a86 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClient.md @@ -0,0 +1,775 @@ + +# Class HTTPClient + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.HTTPClient](dw.net.HTTPClient.md) + +The HTTPClient class supports the HTTP methods GET, POST, HEAD, PUT, PATCH, OPTIONS, and DELETE. +If a secure connection via HTTPS is +established the used server certificate or the signing CAs certificate needs to be imported into the customer key +store via Business Manager. **Note:** when this class is used with sensitive data, be careful in persisting +sensitive information. + +Key selection for mutual TLS: + +1. Check if there is an explicit identity requested [setIdentity(KeyRef)](dw.net.HTTPClient.md#setidentitykeyref) +2. Else, Check if there is a mapping for hostname in the keystore +3. Deprecated: Select an arbitrary private key from the keystore + + + + +``` + +var httpClient = new HTTPClient(); +var message; +httpClient.open('GET', 'http://www.myinstance.com/feed.xml'); +httpClient.setTimeout(3000); +httpClient.send(); +if (httpClient.statusCode == 200) +{ + message = httpClient.text; +} +else +{ + // error handling + message = "An error occurred with status code "+httpClient.statusCode; +} +``` + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[DEFAULT_GET_FILE_SIZE](#default_get_file_size): [Number](TopLevel.Number.md) = 5242880~~ | The default size for `sendAndReceiveToFile()` returning a File is 5MB deprecated in favor of MAX\_GET\_FILE\_SIZE | +| [MAX_GET_FILE_SIZE](#max_get_file_size): [Number](TopLevel.Number.md) = 209715200 | The maximum permitted size (in bytes) of an HTTP response when calling operations which write the response to file. | +| [MAX_GET_MEM_SIZE](#max_get_mem_size): [Number](TopLevel.Number.md) = 10485760 | The maximum permitted size (in bytes) of an HTTP response when calling operations which store the response in memory. | + +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[allResponseHeaders](#allresponseheaders): [HashMap](dw.util.HashMap.md)~~ `(read-only)` | Returns all response headers as a map containing the name and value of the response header. | +| [allowRedirect](#allowredirect): [Boolean](TopLevel.Boolean.md) | Determines whether redirect handling is enabled. | +| [bytes](#bytes): [Bytes](dw.util.Bytes.md) `(read-only)` | Returns the bytes in the message body for HTTP status codes between 200 and 299. | +| [errorBytes](#errorbytes): [Bytes](dw.util.Bytes.md) `(read-only)` | Returns the returned message body as bytes for HTTP status code greater or equal to 400. | +| [errorText](#errortext): [String](TopLevel.String.md) `(read-only)` | Returns the returned message body as text for HTTP status code greater or equal to 400. | +| [hostNameVerification](#hostnameverification): [Boolean](TopLevel.Boolean.md) | Determines whether host name verification is enabled. | +| [identity](#identity): [KeyRef](dw.crypto.KeyRef.md) | Gets the identity used for mutual TLS (mTLS). | +| [loggingConfig](#loggingconfig): [HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md) | Gets the logging configuration for this HTTP client. | +| [responseHeaders](#responseheaders): [Map](dw.util.Map.md) `(read-only)` | Returns all response headers as a map in which each entry represents an individual header. | +| [statusCode](#statuscode): [Number](TopLevel.Number.md) `(read-only)` | Returns the status code of the last HTTP operation. | +| [statusMessage](#statusmessage): [String](TopLevel.String.md) `(read-only)` | Returns the message text of the last HTTP operation. | +| [text](#text): [String](TopLevel.String.md) `(read-only)` | Returns the returned message body as text for HTTP status codes between 200 and 299. | +| [timeout](#timeout): [Number](TopLevel.Number.md) | Returns the timeout for this client, in milliseconds. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [HTTPClient](#httpclient)() | Constructs the HTTPClient instance with the default configuration. | +| [HTTPClient](#httpclientobject)([Object](TopLevel.Object.md)) | Constructs the HTTPClient instance with the given configuration. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [enableCaching](dw.net.HTTPClient.md#enablecachingnumber)([Number](TopLevel.Number.md)) | Calling this method enables caching for GET requests. | +| ~~[getAllResponseHeaders](dw.net.HTTPClient.md#getallresponseheaders)()~~ | Returns all response headers as a map containing the name and value of the response header. | +| [getAllowRedirect](dw.net.HTTPClient.md#getallowredirect)() | Determines whether redirect handling is enabled. | +| [getBytes](dw.net.HTTPClient.md#getbytes)() | Returns the bytes in the message body for HTTP status codes between 200 and 299. | +| [getErrorBytes](dw.net.HTTPClient.md#geterrorbytes)() | Returns the returned message body as bytes for HTTP status code greater or equal to 400. | +| [getErrorText](dw.net.HTTPClient.md#geterrortext)() | Returns the returned message body as text for HTTP status code greater or equal to 400. | +| [getHostNameVerification](dw.net.HTTPClient.md#gethostnameverification)() | Determines whether host name verification is enabled. | +| [getIdentity](dw.net.HTTPClient.md#getidentity)() | Gets the identity used for mutual TLS (mTLS). | +| [getLoggingConfig](dw.net.HTTPClient.md#getloggingconfig)() | Gets the logging configuration for this HTTP client. | +| [getResponseHeader](dw.net.HTTPClient.md#getresponseheaderstring)([String](TopLevel.String.md)) | Returns a specific response header from the last HTTP operation. | +| [getResponseHeaders](dw.net.HTTPClient.md#getresponseheaders)() | Returns all response headers as a map in which each entry represents an individual header. | +| [getResponseHeaders](dw.net.HTTPClient.md#getresponseheadersstring)([String](TopLevel.String.md)) | Returns all the values of a response header from the last HTTP operation as a list of strings. | +| [getStatusCode](dw.net.HTTPClient.md#getstatuscode)() | Returns the status code of the last HTTP operation. | +| [getStatusMessage](dw.net.HTTPClient.md#getstatusmessage)() | Returns the message text of the last HTTP operation. | +| [getText](dw.net.HTTPClient.md#gettext)() | Returns the returned message body as text for HTTP status codes between 200 and 299. | +| [getText](dw.net.HTTPClient.md#gettextstring)([String](TopLevel.String.md)) | Returns the returned message body as text for HTTP status codes between 200 and 299. | +| [getTimeout](dw.net.HTTPClient.md#gettimeout)() | Returns the timeout for this client, in milliseconds. | +| [open](dw.net.HTTPClient.md#openstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Opens the specified URL using the specified method. | +| ~~[open](dw.net.HTTPClient.md#openstring-string-boolean-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md), [String](TopLevel.String.md), [String](TopLevel.String.md))~~ | Deprecated method. | +| [open](dw.net.HTTPClient.md#openstring-string-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Opens the specified URL with the in parameter method specified Http method with given credentials \[user, password\] using HTTP basic authentication. | +| [send](dw.net.HTTPClient.md#send)() | Sends an HTTP request. | +| [send](dw.net.HTTPClient.md#sendfile)([File](dw.io.File.md)) | This method performs the actual HTTP communication. | +| [send](dw.net.HTTPClient.md#sendstring)([String](TopLevel.String.md)) | This method performs the actual HTTP communication. | +| [send](dw.net.HTTPClient.md#sendstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | This method performs the actual HTTP communication. | +| [sendAndReceiveToFile](dw.net.HTTPClient.md#sendandreceivetofilefile)([File](dw.io.File.md)) | This method performs the actual HTTP communication. | +| [sendAndReceiveToFile](dw.net.HTTPClient.md#sendandreceivetofilestring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | This method performs the actual HTTP communication. | +| [sendAndReceiveToFile](dw.net.HTTPClient.md#sendandreceivetofilestring-string-file)([String](TopLevel.String.md), [String](TopLevel.String.md), [File](dw.io.File.md)) | This method performs the actual HTTP communication. | +| [sendBytes](dw.net.HTTPClient.md#sendbytesbytes)([Bytes](dw.util.Bytes.md)) | This method performs the actual HTTP communication. | +| [sendBytesAndReceiveToFile](dw.net.HTTPClient.md#sendbytesandreceivetofilebytes-file)([Bytes](dw.util.Bytes.md), [File](dw.io.File.md)) | This method performs the actual HTTP communication. | +| [sendMultiPart](dw.net.HTTPClient.md#sendmultiparthttprequestpart)([HTTPRequestPart\[\]](dw.net.HTTPRequestPart.md)) | Sends a multipart HTTP request. | +| [setAllowRedirect](dw.net.HTTPClient.md#setallowredirectboolean)([Boolean](TopLevel.Boolean.md)) | Sets whether automatic HTTP redirect handling is enabled. | +| [setHostNameVerification](dw.net.HTTPClient.md#sethostnameverificationboolean)([Boolean](TopLevel.Boolean.md)) | Sets whether certificate host name verification is enabled. | +| [setIdentity](dw.net.HTTPClient.md#setidentitykeyref)([KeyRef](dw.crypto.KeyRef.md)) | Sets the identity (private key) to use when mutual TLS (mTLS) is configured. | +| [setLoggingConfig](dw.net.HTTPClient.md#setloggingconfighttpclientloggingconfig)([HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md)) | Sets the logging configuration for this HTTP client. | +| [setRequestHeader](dw.net.HTTPClient.md#setrequestheaderstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Sets a request header for the next HTTP operation. | +| [setTimeout](dw.net.HTTPClient.md#settimeoutnumber)([Number](TopLevel.Number.md)) | Sets the timeout for connections made with this client to the given number of milliseconds. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DEFAULT_GET_FILE_SIZE + +- ~~DEFAULT_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 5242880~~ + - : The default size for `sendAndReceiveToFile()` returning a File is 5MB deprecated in favor of + MAX\_GET\_FILE\_SIZE + + + **Deprecated:** +:::warning +Use [MAX_GET_FILE_SIZE](dw.net.HTTPClient.md#max_get_file_size) instead. +::: + +--- + +### MAX_GET_FILE_SIZE + +- MAX_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 209715200 + - : The maximum permitted size (in bytes) of an HTTP response when calling operations which write the response to + file. (200MB) + + + +--- + +### MAX_GET_MEM_SIZE + +- MAX_GET_MEM_SIZE: [Number](TopLevel.Number.md) = 10485760 + - : The maximum permitted size (in bytes) of an HTTP response when calling operations which store the response in + memory. (10MB) + + + +--- + +## Property Details + +### allResponseHeaders +- ~~allResponseHeaders: [HashMap](dw.util.HashMap.md)~~ `(read-only)` + - : Returns all response headers as a map containing the name and value of the response header. + + **Deprecated:** +:::warning +Use [getResponseHeaders()](dw.net.HTTPClient.md#getresponseheaders) instead. +::: + +--- + +### allowRedirect +- allowRedirect: [Boolean](TopLevel.Boolean.md) + - : Determines whether redirect handling is enabled. + + +--- + +### bytes +- bytes: [Bytes](dw.util.Bytes.md) `(read-only)` + - : Returns the bytes in the message body for HTTP status codes between 200 and 299. + + +--- + +### errorBytes +- errorBytes: [Bytes](dw.util.Bytes.md) `(read-only)` + - : Returns the returned message body as bytes for HTTP status code greater or equal to 400. Error messages are not + written to the response file. + + + +--- + +### errorText +- errorText: [String](TopLevel.String.md) `(read-only)` + - : Returns the returned message body as text for HTTP status code greater or equal to 400. Error messages are not + written to the response file. + + + +--- + +### hostNameVerification +- hostNameVerification: [Boolean](TopLevel.Boolean.md) + - : Determines whether host name verification is enabled. + + +--- + +### identity +- identity: [KeyRef](dw.crypto.KeyRef.md) + - : Gets the identity used for mutual TLS (mTLS). + + +--- + +### loggingConfig +- loggingConfig: [HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md) + - : Gets the logging configuration for this HTTP client. + + +--- + +### responseHeaders +- responseHeaders: [Map](dw.util.Map.md) `(read-only)` + - : Returns all response headers as a map in which each entry represents an individual header. The key of the entry + holds the header name and the entry value holds a list of all header values. + + + +--- + +### statusCode +- statusCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the status code of the last HTTP operation. + + +--- + +### statusMessage +- statusMessage: [String](TopLevel.String.md) `(read-only)` + - : Returns the message text of the last HTTP operation. + + +--- + +### text +- text: [String](TopLevel.String.md) `(read-only)` + - : Returns the returned message body as text for HTTP status codes between 200 and 299. + + +--- + +### timeout +- timeout: [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + +--- + +## Constructor Details + +### HTTPClient() +- HTTPClient() + - : Constructs the HTTPClient instance with the default configuration. + + +--- + +### HTTPClient(Object) +- HTTPClient(configMap: [Object](TopLevel.Object.md)) + - : Constructs the HTTPClient instance with the given configuration. + + + There is one supported configuration option. Unknown options are ignored. + | Name | Type | Description | + | --- |--- |--- | + | `allowHTTP2` | `boolean` | Allow connections over HTTP/2. This will still allow HTTP/1.1 if that is what the remote server supports. It will also cause all request and response headers to be case-insensitive. The default value is `false`. | + + + + + Sample usage: + + ``` + var httpClient = new HTTPClient( { allowHTTP2: true } ) + ``` + + + **Parameters:** + - configMap - A Map containing configuration options. + + +--- + +## Method Details + +### enableCaching(Number) +- enableCaching(ttl: [Number](TopLevel.Number.md)): void + - : Calling this method enables caching for GET requests. + + + It basically means that a response is cached, and before making a request the HTTP client looks into the cache to + determine whether the response is already available. Only responses with a status code of 2xx, with a content + length, with a size less than 50k, and which are not intended to be immediately written to a file are cached. + + + The provided parameter defines the TTL (time to live) for the cached content. A value of 0 disables caching. The + URL and the username are used as cache keys. The total size of the cacheable content and the number of cached + items is limited and automatically managed by the system. Cache control information send by the remote server is + ignored. Caching HTTP responses should be done very carefully. It is important to ensure that the response really + depends only on the URL and doesn't contain any remote state information or time information which is independent + of the URL. It is also important to verify that the application sends exactly the same URL multiple times. + + + **Parameters:** + - ttl - the TTL for the cached content in secs + + +--- + +### getAllResponseHeaders() +- ~~getAllResponseHeaders(): [HashMap](dw.util.HashMap.md)~~ + - : Returns all response headers as a map containing the name and value of the response header. + + **Returns:** + - a map containing the names and corresponding values of the response headers. + + **Deprecated:** +:::warning +Use [getResponseHeaders()](dw.net.HTTPClient.md#getresponseheaders) instead. +::: + +--- + +### getAllowRedirect() +- getAllowRedirect(): [Boolean](TopLevel.Boolean.md) + - : Determines whether redirect handling is enabled. + + **Returns:** + - true if redirect handling is enabled, false otherwise. + + +--- + +### getBytes() +- getBytes(): [Bytes](dw.util.Bytes.md) + - : Returns the bytes in the message body for HTTP status codes between 200 and 299. + + **Returns:** + - the returned message body as bytes. + + +--- + +### getErrorBytes() +- getErrorBytes(): [Bytes](dw.util.Bytes.md) + - : Returns the returned message body as bytes for HTTP status code greater or equal to 400. Error messages are not + written to the response file. + + + **Returns:** + - the returned message body as bytes. + + +--- + +### getErrorText() +- getErrorText(): [String](TopLevel.String.md) + - : Returns the returned message body as text for HTTP status code greater or equal to 400. Error messages are not + written to the response file. + + + **Returns:** + - the returned message body as text. + + +--- + +### getHostNameVerification() +- getHostNameVerification(): [Boolean](TopLevel.Boolean.md) + - : Determines whether host name verification is enabled. + + **Returns:** + - true if verification is enabled, false otherwise + + +--- + +### getIdentity() +- getIdentity(): [KeyRef](dw.crypto.KeyRef.md) + - : Gets the identity used for mutual TLS (mTLS). + + **Returns:** + - Reference to the private key, or null if not configured + + +--- + +### getLoggingConfig() +- getLoggingConfig(): [HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md) + - : Gets the logging configuration for this HTTP client. + + **Returns:** + - the current logging configuration + + +--- + +### getResponseHeader(String) +- getResponseHeader(header: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns a specific response header from the last HTTP operation. The method returns null if the specific header + was not returned. + + + **Parameters:** + - header - the name of the response header to locate. + + **Returns:** + - the value of the specified header or null if the header cannot be found. + + +--- + +### getResponseHeaders() +- getResponseHeaders(): [Map](dw.util.Map.md) + - : Returns all response headers as a map in which each entry represents an individual header. The key of the entry + holds the header name and the entry value holds a list of all header values. + + + **Returns:** + - A map containing the names and corresponding values of the response headers. + + +--- + +### getResponseHeaders(String) +- getResponseHeaders(name: [String](TopLevel.String.md)): [List](dw.util.List.md) + - : Returns all the values of a response header from the last HTTP operation as a list of strings. This reflects the + fact that a specific header, e.g. `"Set-Cookie"`, may be set multiple times. In case there is no such + header, the method returns an empty list. + + + **Parameters:** + - name - The name of the response header to locate. + + **Returns:** + - The values of the specified header as a list of strings or an empty list if the header cannot be found. + + +--- + +### getStatusCode() +- getStatusCode(): [Number](TopLevel.Number.md) + - : Returns the status code of the last HTTP operation. + + **Returns:** + - the status code of the last HTTP operation. + + +--- + +### getStatusMessage() +- getStatusMessage(): [String](TopLevel.String.md) + - : Returns the message text of the last HTTP operation. + + **Returns:** + - the message text of the last HTTP operation. + + +--- + +### getText() +- getText(): [String](TopLevel.String.md) + - : Returns the returned message body as text for HTTP status codes between 200 and 299. + + **Returns:** + - the returned message body as text. + + +--- + +### getText(String) +- getText(encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the returned message body as text for HTTP status codes between 200 and 299. + + **Parameters:** + - encoding - the character encoding to use. + + **Returns:** + - String the encoded String. + + +--- + +### getTimeout() +- getTimeout(): [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + **Returns:** + - the timeout in milliseconds + + +--- + +### open(String, String) +- open(method: [String](TopLevel.String.md), url: [String](TopLevel.String.md)): void + - : Opens the specified URL using the specified method. The following methods are supported: GET, POST, HEAD, PUT, + PATCH, OPTIONS, and DELETE + + + **Parameters:** + - method - the method to use for opening the URL. + - url - the url to open. + + +--- + +### open(String, String, Boolean, String, String) +- ~~open(method: [String](TopLevel.String.md), url: [String](TopLevel.String.md), async: [Boolean](TopLevel.Boolean.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): void~~ + - : Deprecated method. + + **Parameters:** + - method - the method to use for opening the URL. + - url - the url to open. + - async - true if asynchronous. + - user - name of the user. + - password - password. + + **Deprecated:** +:::warning +Use [open(String, String, String, String)](dw.net.HTTPClient.md#openstring-string-string-string) instead. +::: + +--- + +### open(String, String, String, String) +- open(method: [String](TopLevel.String.md), url: [String](TopLevel.String.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): void + - : Opens the specified URL with the in parameter method specified Http method with given credentials \[user, + password\] using HTTP basic authentication. The following methods are supported: GET, POST, HEAD, PUT, + PATCH, OPTIONS, and DELETE + + + **Parameters:** + - method - HTTP method + - url - the url + - user - name of the user + - password - password + + +--- + +### send() +- send(): void + - : Sends an HTTP request. + + +--- + +### send(File) +- send(file: [File](dw.io.File.md)): void + - : This method performs the actual HTTP communication. Sends the file to the HTTP server. The file content is sent + as a request body and is sent "as-is" (text or binary). + + + **Parameters:** + - file - File to be sent. + + +--- + +### send(String) +- send(text: [String](TopLevel.String.md)): void + - : This method performs the actual HTTP communication. The text is sent as a request body. If the text is null no + data will be sent to the HTTP server. + + + **Parameters:** + - text - text String to be sent as request body. + + +--- + +### send(String, String) +- send(text: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): void + - : This method performs the actual HTTP communication. The text is sent as a request body. If the text is null no + data will be sent to the HTTP server. + + + **Parameters:** + - text - text String to be sent as request body. + - encoding - character encoding name. + + +--- + +### sendAndReceiveToFile(File) +- sendAndReceiveToFile(file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : This method performs the actual HTTP communication. If the file is null no data will be sent to the HTTP server. + If this method is used with a GET then the file parameter will contain the contents retrieved. When using this + method with a PUT/POST then the contents of the file parameter will be sent to the server. + + + **Parameters:** + - file - local file used to read from or write to, depending on the method used. + + **Returns:** + - true if the returned code was a positive status code + + +--- + +### sendAndReceiveToFile(String, File) +- sendAndReceiveToFile(text: [String](TopLevel.String.md), outFile: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : This method performs the actual HTTP communication. If the text is null no data will be sent to the HTTP server. + + **Parameters:** + - text - text String to be sent. + - outFile - local file to write to. + + **Returns:** + - true if the returned code was a positive status code + + +--- + +### sendAndReceiveToFile(String, String, File) +- sendAndReceiveToFile(text: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), outFile: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : This method performs the actual HTTP communication. If the text is null no data will be sent to the HTTP server. + + **Parameters:** + - text - text String to be sent. + - encoding - character encoding name. + - outFile - local file to write to. + + **Returns:** + - true if the returned code was a positive status code + + +--- + +### sendBytes(Bytes) +- sendBytes(body: [Bytes](dw.util.Bytes.md)): void + - : This method performs the actual HTTP communication. The bytes are sent as a request body. If the bytes are null no + data will be sent to the HTTP server. + + + **Parameters:** + - body - Bytes to be sent as request body. + + +--- + +### sendBytesAndReceiveToFile(Bytes, File) +- sendBytesAndReceiveToFile(body: [Bytes](dw.util.Bytes.md), outFile: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : This method performs the actual HTTP communication. If the body is null no data will be sent to the HTTP server. + + **Parameters:** + - body - Bytes to be sent. + - outFile - local file to write to. + + **Returns:** + - true if the returned code was a positive status code + + **Throws:** + - IOException - + + +--- + +### sendMultiPart(HTTPRequestPart[]) +- sendMultiPart(parts: [HTTPRequestPart\[\]](dw.net.HTTPRequestPart.md)): [Boolean](TopLevel.Boolean.md) + - : Sends a multipart HTTP request. This method should only be called if the connection to the remote URL was opened + with a POST or PATCH method. All other methods will result in an exception being thrown. The request is constructed + from the passed array of parts. + + + **Parameters:** + - parts - List of part objects representing either string or file parts. + + **Returns:** + - true if the returned code was a positive status code. + + +--- + +### setAllowRedirect(Boolean) +- setAllowRedirect(allowRedirect: [Boolean](TopLevel.Boolean.md)): void + - : Sets whether automatic HTTP redirect handling is enabled. + The default value is true. Set it to false to disable all redirects. + + + **Parameters:** + - allowRedirect - true or false for enabling or disabling automatic HTTP redirect + + +--- + +### setHostNameVerification(Boolean) +- setHostNameVerification(enable: [Boolean](TopLevel.Boolean.md)): void + - : Sets whether certificate host name verification is enabled. + The default value is true. Set it to false to disable host name verification. + + + **Parameters:** + - enable - true to enable host name verification or false to disable it. + + +--- + +### setIdentity(KeyRef) +- setIdentity(keyRef: [KeyRef](dw.crypto.KeyRef.md)): void + - : Sets the identity (private key) to use when mutual TLS (mTLS) is configured. + + + If this is not set and mTLS is used then the private key will be chosen from the key store based on the host + name. + If this is set to a reference named "\_\_NONE\_\_" then no private key will be used even if one is requested by the remote server. + + + **Parameters:** + - keyRef - Reference to the private key + + +--- + +### setLoggingConfig(HTTPClientLoggingConfig) +- setLoggingConfig(config: [HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md)): void + - : Sets the logging configuration for this HTTP client. + + **Parameters:** + - config - the logging configuration to use + + +--- + +### setRequestHeader(String, String) +- setRequestHeader(key: [String](TopLevel.String.md), value: [String](TopLevel.String.md)): void + - : Sets a request header for the next HTTP operation. + + **Parameters:** + - key - the request header. + - value - the request headers' value. + + +--- + +### setTimeout(Number) +- setTimeout(timeoutMillis: [Number](TopLevel.Number.md)): void + - : Sets the timeout for connections made with this client to the given number of milliseconds. If the given timeout + is less than or equal to zero, the timeout is set to a maximum value of 2 or 15 minutes, depending on the + context. + + + This timeout value controls both the "connection timeout" (how long it takes to connect to the remote host) and + the "socket timeout" (how long, after connecting, it will wait without any data being read). Therefore, in the + worst case scenario, the total time of inactivity could be twice as long as the specified value. + + + The maximum timeout is 15 minutes when the client is used in a job, and 2 minutes otherwise. The default timeout + for a new client is the maximum timeout value. + + + This method can be called at any time, and will affect the next connection made with this client. It is not + possible to set the timeout for an open connection. + + + You should always set a reasonable timeout (e.g., a few seconds). Allowing connections to run long can result + in thread exhaustion. + + + **Parameters:** + - timeoutMillis - timeout, in milliseconds, up to a maximum of 2 or 15 minutes, depending on the context. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClientLoggingConfig.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClientLoggingConfig.md new file mode 100644 index 00000000..d9119669 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPClientLoggingConfig.md @@ -0,0 +1,363 @@ + +# Class HTTPClientLoggingConfig + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md) + +Script API for configuring HTTP client logging and sensitive data redaction. + + +This class provides a customer-facing interface for configuring HTTP client logging behavior, including +enabling/disabling logging, setting log levels, and defining sensitive fields that should be redacted from HTTP +request and response bodies. + + +**Security Note:** This class handles sensitive security-related data and logging +configuration. Pay special attention to PCI DSS requirements when configuring sensitive field redaction to ensure +proper data protection. +Sensitive Fields of appropriate types MUST be set else logging will be skipped. + + +**Usage Example:** + +``` +var config = new dw.net.HTTPClientLoggingConfig(); +// Enable logging and set level +config.setEnabled(true); +config.setLevel("INFO"); +// Configure sensitive JSON fields +config.setSensitiveJsonFields(["password", "creditCard", "ssn"]); +// Configure sensitive XML fields +config.setSensitiveXmlFields(["password", "creditCard", "ssn"]); +// Configure sensitive headers +config.setSensitiveHeaders(["authorization", "x-api-key", "cookie"]); +// Configure sensitive body fields (for form data) +config.setSensitiveBodyFields(["password", "creditCard", "ssn"]); +// Configure text patterns for plain text/HTML content +config.setSensitiveTextPatterns([["password\\s*=\\s*[^\\s&]+"]]); +``` + + + +**Content Type Support:** + +- **JSON:**Use setSensitiveJsonFields() to specify field names to redact +- **XML:**Use setSensitiveXmlFields() to specify element/attribute names to redact +- **Form Data:**Use setSensitiveBodyFields() to specify parameter names to redact +- **Plain Text/HTML:**Use setSensitiveTextPatterns() to specify regex patterns +- **Binary/Multipart:**Entire body is automatically treated as sensitive + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) | Gets whether HTTP client logging is enabled. | +| [level](#level): [String](TopLevel.String.md) | Gets the current log level for HTTP client logging. | +| [sensitiveBodyFields](#sensitivebodyfields): [String\[\]](TopLevel.String.md) | Gets the sensitive body fields configured for form data redaction. | +| [sensitiveHeaders](#sensitiveheaders): [String\[\]](TopLevel.String.md) | Gets the sensitive headers configured for redaction. | +| [sensitiveJsonFields](#sensitivejsonfields): [String\[\]](TopLevel.String.md) | Gets the sensitive JSON fields configured for redaction. | +| [sensitiveXmlFields](#sensitivexmlfields): [String\[\]](TopLevel.String.md) | Gets the sensitive XML fields configured for redaction. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [HTTPClientLoggingConfig](#httpclientloggingconfig)() | Creates a new HTTPClientLoggingConfig instance. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getLevel](dw.net.HTTPClientLoggingConfig.md#getlevel)() | Gets the current log level for HTTP client logging. | +| [getSensitiveBodyFields](dw.net.HTTPClientLoggingConfig.md#getsensitivebodyfields)() | Gets the sensitive body fields configured for form data redaction. | +| [getSensitiveHeaders](dw.net.HTTPClientLoggingConfig.md#getsensitiveheaders)() | Gets the sensitive headers configured for redaction. | +| [getSensitiveJsonFields](dw.net.HTTPClientLoggingConfig.md#getsensitivejsonfields)() | Gets the sensitive JSON fields configured for redaction. | +| [getSensitiveXmlFields](dw.net.HTTPClientLoggingConfig.md#getsensitivexmlfields)() | Gets the sensitive XML fields configured for redaction. | +| [isEnabled](dw.net.HTTPClientLoggingConfig.md#isenabled)() | Gets whether HTTP client logging is enabled. | +| [setEnabled](dw.net.HTTPClientLoggingConfig.md#setenabledboolean)([Boolean](TopLevel.Boolean.md)) | Sets whether HTTP client logging is enabled. | +| [setLevel](dw.net.HTTPClientLoggingConfig.md#setlevelstring)([String](TopLevel.String.md)) | Sets the log level for HTTP client logging. | +| [setSensitiveBodyFields](dw.net.HTTPClientLoggingConfig.md#setsensitivebodyfieldsstring)([String\[\]](TopLevel.String.md)) | Sets the sensitive body fields that should be redacted from HTTP form data. | +| [setSensitiveHeaders](dw.net.HTTPClientLoggingConfig.md#setsensitiveheadersstring)([String\[\]](TopLevel.String.md)) | Sets the sensitive headers that should be redacted from HTTP requests/responses. | +| [setSensitiveJsonFields](dw.net.HTTPClientLoggingConfig.md#setsensitivejsonfieldsstring)([String\[\]](TopLevel.String.md)) | Sets the sensitive JSON fields that should be redacted from HTTP request/response bodies. | +| [setSensitiveTextPatterns](dw.net.HTTPClientLoggingConfig.md#setsensitivetextpatternsstring)([String\[\]](TopLevel.String.md)) | Sets the sensitive text patterns that should be redacted from HTTP request/response bodies. | +| [setSensitiveXmlFields](dw.net.HTTPClientLoggingConfig.md#setsensitivexmlfieldsstring)([String\[\]](TopLevel.String.md)) | Sets the sensitive XML fields that should be redacted from HTTP request/response bodies. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) + - : Gets whether HTTP client logging is enabled. + + +--- + +### level +- level: [String](TopLevel.String.md) + - : Gets the current log level for HTTP client logging. + + +--- + +### sensitiveBodyFields +- sensitiveBodyFields: [String\[\]](TopLevel.String.md) + - : Gets the sensitive body fields configured for form data redaction. + + +--- + +### sensitiveHeaders +- sensitiveHeaders: [String\[\]](TopLevel.String.md) + - : Gets the sensitive headers configured for redaction. + + +--- + +### sensitiveJsonFields +- sensitiveJsonFields: [String\[\]](TopLevel.String.md) + - : Gets the sensitive JSON fields configured for redaction. + + +--- + +### sensitiveXmlFields +- sensitiveXmlFields: [String\[\]](TopLevel.String.md) + - : Gets the sensitive XML fields configured for redaction. + + +--- + +## Constructor Details + +### HTTPClientLoggingConfig() +- HTTPClientLoggingConfig() + - : Creates a new HTTPClientLoggingConfig instance. + + + The public constructor should only be called from JavaScript, but cfgAPI uses this constructor for creating the + Service instance -> so fill the factory here + + + +--- + +## Method Details + +### getLevel() +- getLevel(): [String](TopLevel.String.md) + - : Gets the current log level for HTTP client logging. + + **Returns:** + - the log level as a string (DEBUG, INFO, WARN, ERROR) + + +--- + +### getSensitiveBodyFields() +- getSensitiveBodyFields(): [String\[\]](TopLevel.String.md) + - : Gets the sensitive body fields configured for form data redaction. + + **Returns:** + - an array of field names that will be redacted from form data + + +--- + +### getSensitiveHeaders() +- getSensitiveHeaders(): [String\[\]](TopLevel.String.md) + - : Gets the sensitive headers configured for redaction. + + **Returns:** + - an array of header names that will be redacted + + +--- + +### getSensitiveJsonFields() +- getSensitiveJsonFields(): [String\[\]](TopLevel.String.md) + - : Gets the sensitive JSON fields configured for redaction. + + **Returns:** + - an array of field names that will be redacted from JSON content + + +--- + +### getSensitiveXmlFields() +- getSensitiveXmlFields(): [String\[\]](TopLevel.String.md) + - : Gets the sensitive XML fields configured for redaction. + + **Returns:** + - an array of field names that will be redacted from XML content + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Gets whether HTTP client logging is enabled. + + **Returns:** + - true if logging is enabled, false otherwise + + +--- + +### setEnabled(Boolean) +- setEnabled(enabled: [Boolean](TopLevel.Boolean.md)): void + - : Sets whether HTTP client logging is enabled. + + + When enabled, HTTP requests and responses will be logged according to the configured log level and sensitive + field redaction settings. When disabled, no HTTP logging will occur. + + + **Parameters:** + - enabled - true to enable logging, false to disable + + +--- + +### setLevel(String) +- setLevel(level: [String](TopLevel.String.md)): void + - : Sets the log level for HTTP client logging. + + + The log level determines the verbosity of HTTP logging output. Available levels: + + - **DEBUG:**Most verbose, includes detailed request/response information + - **INFO:**Standard level, includes basic request/response details + - **WARN:**Only logs warnings and errors + - **ERROR:**Only logs errors + + + **Parameters:** + - level - the log level (DEBUG, INFO, WARN, ERROR). Case-insensitive. + + +--- + +### setSensitiveBodyFields(String[]) +- setSensitiveBodyFields(fields: [String\[\]](TopLevel.String.md)): void + - : Sets the sensitive body fields that should be redacted from HTTP form data. + + + When HTTP requests or responses contain form data (application/x-www-form-urlencoded), any parameters matching + the specified field names will be redacted with "\*\*\*\*FILTERED\*\*\*\*" in the logs. + Sensitive Field MUST be set else logging will be skipped for form body type + Setting with empty array will use default values \["name", "email", "email\_address", "ssn", "first\_name", "last\_name"\] + + + **Example:** + + ``` + config.setSensitiveBodyFields(["fname", "creditCard", "ssn_last_4"]); + ``` + + + **Parameters:** + - fields - an array of field names to redact from form data + + +--- + +### setSensitiveHeaders(String[]) +- setSensitiveHeaders(headers: [String\[\]](TopLevel.String.md)): void + - : Sets the sensitive headers that should be redacted from HTTP requests/responses. + + + Any HTTP headers matching the specified names will be redacted with "\*\*\*\*FILTERED\*\*\*\*" in the logs. This is useful for + protecting sensitive authentication tokens, API keys, and session information. + Sensitive Headers MUST be set else logging will be skipped for headers + Setting the sensitive headers with empty array will use default values \["authorization", "cookie"\] + + + **Example:** + + ``` + config.setSensitiveHeaders([ "x-api-key", "x-auth-token"]); + config.setSensiviteHeaders([]); + ``` + + + **Parameters:** + - headers - an array of header names to redact + + +--- + +### setSensitiveJsonFields(String[]) +- setSensitiveJsonFields(fields: [String\[\]](TopLevel.String.md)): void + - : Sets the sensitive JSON fields that should be redacted from HTTP request/response bodies. + + + When HTTP requests or responses contain JSON content, any fields matching the specified names will be redacted + with "\*\*\*\*FILTERED\*\*\*\*" in the logs. + Sensitive Field MUST be set else logging will be skipped for JSON body type + Setting with empty array will use default values \["name", "email", "email\_address", "ssn", "first\_name", "last\_name", "password"\] + + + **Example:** + + ``` + config.setSensitiveJsonFields(["password", "creditCard", "ssn"]); + ``` + + + **Parameters:** + - fields - an array of field names to redact from JSON content + + +--- + +### setSensitiveTextPatterns(String[]) +- setSensitiveTextPatterns(patterns: [String\[\]](TopLevel.String.md)): void + - : Sets the sensitive text patterns that should be redacted from HTTP request/response bodies. + + + When HTTP requests or responses contain text content, any text matching the specified regex patterns will be + redacted with "\*\*\*\*FILTERED\*\*\*\*" in the logs. + + + **Example:** + + ``` + config.setSensitiveTextPatterns(["password", "credit.*card", "\\d{3}-\\d{2}-\\d{4}"]); + ``` + + + **Parameters:** + - patterns - an array of regex patterns to match and redact from text content + + +--- + +### setSensitiveXmlFields(String[]) +- setSensitiveXmlFields(fields: [String\[\]](TopLevel.String.md)): void + - : Sets the sensitive XML fields that should be redacted from HTTP request/response bodies. + + + When HTTP requests or responses contain XML content, any elements or attributes matching the specified names will + be redacted with "\*\*\*\*FILTERED\*\*\*\*" in the logs. + Sensitive Field MUST be set else logging will be skipped for XML body type + Setting with empty array will use default values \["name", "email", "email\_address", "ssn", "first\_name", "last\_name", "password"\] + + + **Example:** + + ``` + config.setSensitiveXmlFields(["password", "creditCard", "ssn"]); + ``` + + + **Parameters:** + - fields - an array of element/attribute names to redact from XML content + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPRequestPart.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPRequestPart.md new file mode 100644 index 00000000..0698aaf4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.HTTPRequestPart.md @@ -0,0 +1,296 @@ + +# Class HTTPRequestPart + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.HTTPRequestPart](dw.net.HTTPRequestPart.md) + +This represents a part in a multi-part HTTP POST request. + + +A part always has a name and value. The value may be a String, Bytes, or the contents of a File. + + +A character encoding may be specified for any of these, and the content type and a file name may additionally be +specified for the Bytes and File types. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bytesValue](#bytesvalue): [Bytes](dw.util.Bytes.md) `(read-only)` | Get the Bytes value of the part. | +| [contentType](#contenttype): [String](TopLevel.String.md) `(read-only)` | Returns the content type of this part. | +| [encoding](#encoding): [String](TopLevel.String.md) `(read-only)` | Get the charset to be used to encode the string. | +| [fileName](#filename): [String](TopLevel.String.md) `(read-only)` | Get the file name to use when sending a file part. | +| [fileValue](#filevalue): [File](dw.io.File.md) `(read-only)` | Get the file value of the part. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Get the name of the part. | +| [stringValue](#stringvalue): [String](TopLevel.String.md) `(read-only)` | Get the string value of the part. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [HTTPRequestPart](#httprequestpartstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Construct a part representing a simple string name/value pair. | +| [HTTPRequestPart](#httprequestpartstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Construct a part representing a simple string name/value pair. | +| [HTTPRequestPart](#httprequestpartstring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Construct a part representing a name/File pair. | +| [HTTPRequestPart](#httprequestpartstring-bytes)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md)) | Construct a part representing a name/bytes pair. | +| [HTTPRequestPart](#httprequestpartstring-bytes-string-string-string)([String](TopLevel.String.md), [Bytes](dw.util.Bytes.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Construct a part representing a name/File pair. | +| [HTTPRequestPart](#httprequestpartstring-file-string-string)([String](TopLevel.String.md), [File](dw.io.File.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Construct a part representing a name/File pair. | +| [HTTPRequestPart](#httprequestpartstring-file-string-string-string)([String](TopLevel.String.md), [File](dw.io.File.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Construct a part representing a name/File pair. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getBytesValue](dw.net.HTTPRequestPart.md#getbytesvalue)() | Get the Bytes value of the part. | +| [getContentType](dw.net.HTTPRequestPart.md#getcontenttype)() | Returns the content type of this part. | +| [getEncoding](dw.net.HTTPRequestPart.md#getencoding)() | Get the charset to be used to encode the string. | +| [getFileName](dw.net.HTTPRequestPart.md#getfilename)() | Get the file name to use when sending a file part. | +| [getFileValue](dw.net.HTTPRequestPart.md#getfilevalue)() | Get the file value of the part. | +| [getName](dw.net.HTTPRequestPart.md#getname)() | Get the name of the part. | +| [getStringValue](dw.net.HTTPRequestPart.md#getstringvalue)() | Get the string value of the part. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bytesValue +- bytesValue: [Bytes](dw.util.Bytes.md) `(read-only)` + - : Get the Bytes value of the part. + + +--- + +### contentType +- contentType: [String](TopLevel.String.md) `(read-only)` + - : Returns the content type of this part. + + +--- + +### encoding +- encoding: [String](TopLevel.String.md) `(read-only)` + - : Get the charset to be used to encode the string. + + +--- + +### fileName +- fileName: [String](TopLevel.String.md) `(read-only)` + - : Get the file name to use when sending a file part. + + +--- + +### fileValue +- fileValue: [File](dw.io.File.md) `(read-only)` + - : Get the file value of the part. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Get the name of the part. + + +--- + +### stringValue +- stringValue: [String](TopLevel.String.md) `(read-only)` + - : Get the string value of the part. + + +--- + +## Constructor Details + +### HTTPRequestPart(String, String) +- HTTPRequestPart(name: [String](TopLevel.String.md), value: [String](TopLevel.String.md)) + - : Construct a part representing a simple string name/value pair. The HTTP + message uses "US-ASCII" as the default character set for the part. + + + **Parameters:** + - name - The name of the part. + - value - The string to post. + + +--- + +### HTTPRequestPart(String, String, String) +- HTTPRequestPart(name: [String](TopLevel.String.md), value: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)) + - : Construct a part representing a simple string name/value pair. The HTTP + message uses the specified encoding or "US-ASCII" if null is passed + for the part. + + + **Parameters:** + - name - The name of the part. + - value - The string to post. + - encoding - The charset to be used to encode the string, if null the default is used. + + +--- + +### HTTPRequestPart(String, File) +- HTTPRequestPart(name: [String](TopLevel.String.md), file: [File](dw.io.File.md)) + - : Construct a part representing a name/File pair. The HTTP message will use + "application/octet-stream" as the content type and "ISO-8859-1" as the character + set for the part. + + + **Parameters:** + - name - The name of the file part + - file - The file to post + + +--- + +### HTTPRequestPart(String, Bytes) +- HTTPRequestPart(name: [String](TopLevel.String.md), data: [Bytes](dw.util.Bytes.md)) + - : Construct a part representing a name/bytes pair. The HTTP message will use + "application/octet-stream" as the content type without a character set. + + + **Parameters:** + - name - The name of the file part + - data - The bytes to post + + +--- + +### HTTPRequestPart(String, Bytes, String, String, String) +- HTTPRequestPart(name: [String](TopLevel.String.md), data: [Bytes](dw.util.Bytes.md), contentType: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), fileName: [String](TopLevel.String.md)) + - : Construct a part representing a name/File pair. + + + + - If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type without an encoding. - If only the encoding is null, then the contentType will be used without an encoding. - If only the contentType is null, then it will be defaulted to "text/plain". + + + **Parameters:** + - name - The name of the file part + - data - The bytes to post + - contentType - The content type for this part, if null or blank the default is used. + - encoding - the charset encoding for this part, if null or blank the default is used. + - fileName - The file name to use in the Mime header, or null to not use one. + + +--- + +### HTTPRequestPart(String, File, String, String) +- HTTPRequestPart(name: [String](TopLevel.String.md), file: [File](dw.io.File.md), contentType: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)) + - : Construct a part representing a name/File pair. + + + + - If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type and "ISO-8859-1" as the encoding. - If only the encoding is null, then the contentType will be used without an encoding. - If only the contentType is null, then it will be defaulted to "text/plain". + + + **Parameters:** + - name - The name of the file part + - file - The file to post + - contentType - The content type for this part, if null or blank the default is used. + - encoding - the charset encoding for this part, if null or blank the default is used + + +--- + +### HTTPRequestPart(String, File, String, String, String) +- HTTPRequestPart(name: [String](TopLevel.String.md), file: [File](dw.io.File.md), contentType: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), fileName: [String](TopLevel.String.md)) + - : Construct a part representing a name/File pair. + + + + - If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type and "ISO-8859-1" as the encoding. - If only the encoding is null, then the contentType will be used without an encoding. - If only the contentType is null, then it will be defaulted to "text/plain". + + + **Parameters:** + - name - The name of the file part + - file - The file to post + - contentType - The content type for this part, if null or blank the default is used. + - encoding - the charset encoding for this part, if null or blank the default is used + - fileName - The file name to use in the Mime header, or null to use the name of the given file. + + +--- + +## Method Details + +### getBytesValue() +- getBytesValue(): [Bytes](dw.util.Bytes.md) + - : Get the Bytes value of the part. + + **Returns:** + - The Bytes value, or null if this part is not a Bytes part. + + +--- + +### getContentType() +- getContentType(): [String](TopLevel.String.md) + - : Returns the content type of this part. + + **Returns:** + - The content type, or null if content type was not specified. + + +--- + +### getEncoding() +- getEncoding(): [String](TopLevel.String.md) + - : Get the charset to be used to encode the string. + + **Returns:** + - The charset, or null if charset was not specified. + + +--- + +### getFileName() +- getFileName(): [String](TopLevel.String.md) + - : Get the file name to use when sending a file part. + + **Returns:** + - File name to use in the Mime header, or null for default behavior. + + +--- + +### getFileValue() +- getFileValue(): [File](dw.io.File.md) + - : Get the file value of the part. + + **Returns:** + - The file value, or null if this part is not a file part. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Get the name of the part. + + **Returns:** + - The part name, never null. + + +--- + +### getStringValue() +- getStringValue(): [String](TopLevel.String.md) + - : Get the string value of the part. + + **Returns:** + - The string value, or null if this part is not a string part. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.Mail.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.Mail.md new file mode 100644 index 00000000..cae4682c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.Mail.md @@ -0,0 +1,487 @@ + +# Class Mail + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.Mail](dw.net.Mail.md) + +This class is used to send an email with either plain text or MimeEncodedText content. +Recipient data (from, to, cc, bcc) and subject are specified +using setter methods. When the [send()](dw.net.Mail.md#send) method is invoked, +the email is put into an internal queue and sent asynchronously. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + +The following example script sends an email with MimeEncodedText content: + + +``` + +function sendMail() { + var template: Template = new dw.util.Template("myTemplate.isml"); + + var o: Map = new dw.util.HashMap(); + o.put("customer","customer"); + o.put("product","product"); + + var content: MimeEncodedText = template.render(o); + var mail: Mail = new dw.net.Mail(); + mail.addTo("to@example.org"); + mail.setFrom("from@example.org"); + mail.setSubject("Example Email"); + mail.setContent(content); + + mail.send();//returns either Status.ERROR or Status.OK, mail might not be sent yet, when this method returns + } +``` + + + + See **Sending email via scripts or hooks** in the documentation for additional examples. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bcc](#bcc): [List](dw.util.List.md) | Gets the `bcc` address List. | +| [cc](#cc): [List](dw.util.List.md) | Gets the `cc` address List. | +| [from](#from): [String](TopLevel.String.md) | Gets the email address to use as the `from` address for the email. | +| [replyTo](#replyto): [List](dw.util.List.md) `(read-only)` | Gets the `replyTo` address List. | +| [subject](#subject): [String](TopLevel.String.md) | Gets the `subject` of the email. | +| [to](#to): [List](dw.util.List.md) | Gets the `to` address List where the email is sent. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [Mail](#mail)() | | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addAttachment](dw.net.Mail.md#addattachmentfile)([File](dw.io.File.md)) | Adds a file attachment to the email. | +| [addBcc](dw.net.Mail.md#addbccstring)([String](TopLevel.String.md)) | Adds an address to the `bcc` List. | +| [addCc](dw.net.Mail.md#addccstring)([String](TopLevel.String.md)) | Adds an address to the `cc` List. | +| [addReplyTo](dw.net.Mail.md#addreplytostring)([String](TopLevel.String.md)) | Adds an address to the `replyTo` List. | +| [addTo](dw.net.Mail.md#addtostring)([String](TopLevel.String.md)) | Adds an address to the `to` address List. | +| [getBcc](dw.net.Mail.md#getbcc)() | Gets the `bcc` address List. | +| [getCc](dw.net.Mail.md#getcc)() | Gets the `cc` address List. | +| [getFrom](dw.net.Mail.md#getfrom)() | Gets the email address to use as the `from` address for the email. | +| [getReplyTo](dw.net.Mail.md#getreplyto)() | Gets the `replyTo` address List. | +| [getSubject](dw.net.Mail.md#getsubject)() | Gets the `subject` of the email. | +| [getTo](dw.net.Mail.md#getto)() | Gets the `to` address List where the email is sent. | +| [send](dw.net.Mail.md#send)() | prepares an email that is queued to the internal mail system for delivery. | +| [setBcc](dw.net.Mail.md#setbcclist)([List](dw.util.List.md)) | Sets the `bcc` address List. | +| [setCc](dw.net.Mail.md#setcclist)([List](dw.util.List.md)) | Sets the `cc` address List where the email is sent. | +| [setContent](dw.net.Mail.md#setcontentmimeencodedtext)([MimeEncodedText](dw.value.MimeEncodedText.md)) | **Mandatory** Uses [MimeEncodedText](dw.value.MimeEncodedText.md) to set the content, MIME type and encoding. | +| [setContent](dw.net.Mail.md#setcontentstring)([String](TopLevel.String.md)) | **Mandatory** Sets the email content. | +| [setContent](dw.net.Mail.md#setcontentstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | **Mandatory** Sets the email content, MIME type, and encoding. | +| [setFrom](dw.net.Mail.md#setfromstring)([String](TopLevel.String.md)) | **Mandatory** Sets the sender address for this email. | +| [setListUnsubscribe](dw.net.Mail.md#setlistunsubscribestring)([String](TopLevel.String.md)) | Sets the List-Unsubscribe header value to work with List-Unsubscribe-Post to allow integration with an externally-managed mailing list. | +| [setListUnsubscribePost](dw.net.Mail.md#setlistunsubscribepoststring)([String](TopLevel.String.md)) | Sets the List-Unsubscribe-Post header value. | +| [setSubject](dw.net.Mail.md#setsubjectstring)([String](TopLevel.String.md)) | **Mandatory** sets the `subject` for the email. | +| [setTo](dw.net.Mail.md#settolist)([List](dw.util.List.md)) | Sets the `to` address List where the email is sent. | +| static [validateAddress](dw.net.Mail.md#validateaddressstring)([String](TopLevel.String.md)) | Validates the address that is sent as parameter. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bcc +- bcc: [List](dw.util.List.md) + - : Gets the `bcc` address List. + + +--- + +### cc +- cc: [List](dw.util.List.md) + - : Gets the `cc` address List. + + +--- + +### from +- from: [String](TopLevel.String.md) + - : Gets the email address to use as the `from` address for the + email. + + + +--- + +### replyTo +- replyTo: [List](dw.util.List.md) `(read-only)` + - : Gets the `replyTo` address List. + + +--- + +### subject +- subject: [String](TopLevel.String.md) + - : Gets the `subject` of the email. + + +--- + +### to +- to: [List](dw.util.List.md) + - : Gets the `to` address List where the email is sent. + + +--- + +## Constructor Details + +### Mail() +- Mail() + - : + + +--- + +## Method Details + +### addAttachment(File) +- addAttachment(file: [File](dw.io.File.md)): [Mail](dw.net.Mail.md) + - : Adds a file attachment to the email. This method is restricted to Job context only. + + **Parameters:** + - file - The file to be attached to the email. Must not be null and must exist. + + **Returns:** + - this Mail object + + **Throws:** + - IllegalArgumentException - if the file is null, doesn't exist, or is not a file + + +--- + +### addBcc(String) +- addBcc(bcc: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Adds an address to the `bcc` List. Address must conform to the RFC822 standard. + + **Parameters:** + - bcc - new bcc address to add to `bcc` address List. + + **Returns:** + - this Mail object. + + +--- + +### addCc(String) +- addCc(cc: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Adds an address to the `cc` List. The address must conform to RFC822 standard. + + **Parameters:** + - cc - new cc address to be added to `cc` address List. + + **Returns:** + - this Mail object. + + +--- + +### addReplyTo(String) +- addReplyTo(replyTo: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Adds an address to the `replyTo` List. Address must conform to the RFC822 standard. + + **Parameters:** + - replyTo - new replyTo address to add to `replyTo` address List. + + **Returns:** + - this Mail object. + + **Throws:** + - IllegalArgumentException - if the email address is invalid + + +--- + +### addTo(String) +- addTo(to: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Adds an address to the `to` address List. The address must conform to the RFC822 standard. + + **Parameters:** + - to - email address to add to the `to` address List. + + **Returns:** + - this Mail object. + + +--- + +### getBcc() +- getBcc(): [List](dw.util.List.md) + - : Gets the `bcc` address List. + + **Returns:** + - `bcc` address List or empty List if no `bcc` + addresses are set. + + + +--- + +### getCc() +- getCc(): [List](dw.util.List.md) + - : Gets the `cc` address List. + + **Returns:** + - `cc` address List or empty List if no `cc` + addresses are set. + + + +--- + +### getFrom() +- getFrom(): [String](TopLevel.String.md) + - : Gets the email address to use as the `from` address for the + email. + + + **Returns:** + - the `from` address for this mail or null if no `from` + address is set yet. + + + +--- + +### getReplyTo() +- getReplyTo(): [List](dw.util.List.md) + - : Gets the `replyTo` address List. + + **Returns:** + - `replyTo` address List or empty List if no `replyTo` + addresses are set. + + + +--- + +### getSubject() +- getSubject(): [String](TopLevel.String.md) + - : Gets the `subject` of the email. + + **Returns:** + - `subject` or null if no `subject` is set yet. + + +--- + +### getTo() +- getTo(): [List](dw.util.List.md) + - : Gets the `to` address List where the email is sent. + + **Returns:** + - `to` address List or empty List if no `to` + addresses are set. + + + +--- + +### send() +- send(): [Status](dw.system.Status.md) + - : prepares an email that is queued to the internal mail system for + delivery. + + + **Returns:** + - [Status](dw.system.Status.md) which tells if the mail could be + successfully queued ( [Status.OK](dw.system.Status.md#ok)) or not ( + [Status.ERROR](dw.system.Status.md#error)). If an error is raised, more + information about the reason for the failure can be found within the + log files. If the mandatory fields `from`, + `content`, and `subject` are + empty an IllegalArgumentException is raised. An + IllegalArgumentException is raised if neither `to`, `cc` + nor `bcc` are set. + + + +--- + +### setBcc(List) +- setBcc(bcc: [List](dw.util.List.md)): [Mail](dw.net.Mail.md) + - : Sets the `bcc` address List. If there + are already `bcc` addresses they are overwritten. + + + **Parameters:** + - bcc - list of Strings representing RFC822 compliant email addresses. List replaces any previously set list of addresses. Throws an exception if the given list is null. + + **Returns:** + - this Mail object. + + +--- + +### setCc(List) +- setCc(cc: [List](dw.util.List.md)): [Mail](dw.net.Mail.md) + - : Sets the `cc` address List where the email is sent. If there are + already `cc` addresses set, they are overwritten. The address(es) must + conform to the RFC822 standard. + + + **Parameters:** + - cc - List of Strings representing RFC822 compliant email addresses. This List replaces any previously set List of addresses. Throws an exception if the given List is null. + + **Returns:** + - this Mail object + + +--- + +### setContent(MimeEncodedText) +- setContent(mimeEncodedText: [MimeEncodedText](dw.value.MimeEncodedText.md)): [Mail](dw.net.Mail.md) + - : **Mandatory** Uses [MimeEncodedText](dw.value.MimeEncodedText.md) to set the + content, MIME type and encoding. + + + **Parameters:** + - mimeEncodedText - MimeEncodedText from which the content, MIME type, and encoding information is extracted. + + **Returns:** + - this Mail object. + + +--- + +### setContent(String) +- setContent(content: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : **Mandatory** Sets the email content. The MIME type is set to + "text/plain;charset=UTF-8" and encoding set to "UTF-8". + + + **Parameters:** + - content - String containing the content of the email. + + **Returns:** + - this Mail object. + + +--- + +### setContent(String, String, String) +- setContent(content: [String](TopLevel.String.md), mimeType: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : **Mandatory** Sets the email content, MIME type, and encoding. No + validation of MIME type and encoding is done. It is the responsibility of + the caller to specify a valid MIME type and encoding. + + + **Parameters:** + - content - String containing the content of the mail + - mimeType - mime type of the content. For example "text/plain;charset=UTF-8" or "text/html" + - encoding - character encoding of the email content. For example UTF-8-8 + + **Returns:** + - this Mail object. + + +--- + +### setFrom(String) +- setFrom(from: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : **Mandatory** Sets the sender address for this email. The address must + conform to the RFC822 standard. + + + **Parameters:** + - from - String containing a RFC822 compliant email address + + **Returns:** + - this Mail object. + + +--- + +### setListUnsubscribe(String) +- setListUnsubscribe(listUnsubscribe: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Sets the List-Unsubscribe header value to work with List-Unsubscribe-Post to allow integration with an + externally-managed mailing list. + + + **Parameters:** + - listUnsubscribe - The List-Unsubscribe header value, e.g., "" + + **Returns:** + - this Mail object + + +--- + +### setListUnsubscribePost(String) +- setListUnsubscribePost(listUnsubscribePost: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : Sets the List-Unsubscribe-Post header value. This header supports one-click unsubscribe functionality. + + **Parameters:** + - listUnsubscribePost - The List-Unsubscribe-Post header value, typically "List-Unsubscribe=One-Click" + + **Returns:** + - this Mail object + + +--- + +### setSubject(String) +- setSubject(subject: [String](TopLevel.String.md)): [Mail](dw.net.Mail.md) + - : **Mandatory** sets the `subject` for the email. If the `subject` is not set + or set to null at the time [send()](dw.net.Mail.md#send) is invoked and + IllegalArgumentException is thrown. + + + **Parameters:** + - subject - `subject` of the mail to send. + + **Returns:** + - this Mail object. + + +--- + +### setTo(List) +- setTo(to: [List](dw.util.List.md)): [Mail](dw.net.Mail.md) + - : Sets the `to` address List where the email is sent. If there are + already `to` addresses, they are overwritten. + + + **Parameters:** + - to - list of Strings representing RFC822 compliant email addresses. List replaces any previously set List of addresses. Throws an exception if the given List is null. + + **Returns:** + - this Mail object + + +--- + +### validateAddress(String) +- static validateAddress(address: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Validates the address that is sent as parameter. + This validation includes: + + - The format must match RFC822 + - The address must be 7-bit ASCII + - The top-level domain must be IANA-registered + - Sample domains such as example.com are not allowed + + + **Parameters:** + - address - Email address to be validated + + **Returns:** + - true if valid, false otherwise + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPClient.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPClient.md new file mode 100644 index 00000000..89bda2bd --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPClient.md @@ -0,0 +1,535 @@ + +# Class SFTPClient + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.SFTPClient](dw.net.SFTPClient.md) + +The SFTPClient class supports the SFTP commands GET, PUT, DEL, MKDIR, RENAME, and LIST. The transfer of files can be +text or binary. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information. + + +An example usage is as follows: + + + + +``` + + var sftp : SFTPClient = new dw.net.SFTPClient(); + sftp.connect("my.sftp-server.com", "username", "password"); + var data : String = sftp.get("simple.txt"); + sftp.disconnect(); +``` + + + +The default connection timeout depends on the script context timeout and will be set to a maximum of 30 seconds +(default script context timeout is 10 seconds within storefront requests and 15 minutes within jobs). + + +**IMPORTANT NOTE:** Before you can make an outbound SFTP connection to a port other than 22, the SFTP server IP address must be enabled +for outbound traffic at the Commerce Cloud Digital firewall for your POD. Please file a support request to request a new firewall +rule. + + +SSH Version 2 is supported with the following algorithms: +| Type | Algorithms | +| --- |--- | +| Host Key | ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, rsa-sha2-512, rsa-sha2-256, ssh-rsa, ssh-dss | +| Key Exchange (KEX) | curve25519-sha256, curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1 | +| Cipher | aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com, aes128-cbc, 3des-ctr, 3des-cbc, blowfish-cbc, aes192-cbc, aes256-cbc | +| Message Authentication Code (MAC) | hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha1-etm@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1, hmac-md5, hmac-sha1-96, hmac-md5-96 | +| Public Key Authentication | rsa-sha2-512, rsa-sha2-256, ssh-rsa | + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [MAX_GET_FILE_SIZE](#max_get_file_size): [Number](TopLevel.Number.md) = 209715200 | The maximum size for get() methods returning a File is 200 MB. | +| [MAX_GET_STRING_SIZE](#max_get_string_size): [Number](TopLevel.Number.md) = 10485760 | The maximum size for get() methods returning a String is 10 MB. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [connected](#connected): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the SFTP client is currently connected to the SFTP server. | +| [errorMessage](#errormessage): [String](TopLevel.String.md) `(read-only)` | Returns the error message from the last SFTP action. | +| [identity](#identity): [KeyRef](dw.crypto.KeyRef.md) | Gets the identity (private key) used for the connection. | +| [timeout](#timeout): [Number](TopLevel.Number.md) | Returns the timeout for this client, in milliseconds. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SFTPClient](#sftpclient)() | Constructor. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addKnownHostKey](dw.net.SFTPClient.md#addknownhostkeystring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Adds a known public host key for the next connection attempt. | +| [cd](dw.net.SFTPClient.md#cdstring)([String](TopLevel.String.md)) | Changes the current directory on the remote server to the given path. | +| [connect](dw.net.SFTPClient.md#connectstring-number-string-string)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Connects and logs on to a SFTP server and returns a boolean indicating success or failure. | +| [connect](dw.net.SFTPClient.md#connectstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Connects and logs on to a SFTP server and returns a boolean indicating success or failure. | +| [del](dw.net.SFTPClient.md#delstring)([String](TopLevel.String.md)) | Deletes the remote file on the server identified by the path parameter. | +| [disconnect](dw.net.SFTPClient.md#disconnect)() | The method first logs the current user out from the server and then disconnects from the server. | +| [get](dw.net.SFTPClient.md#getstring)([String](TopLevel.String.md)) | Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. | +| [get](dw.net.SFTPClient.md#getstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Reads the content of a remote file and returns it as a string using the specified encoding. | +| [get](dw.net.SFTPClient.md#getstring-string-file)([String](TopLevel.String.md), [String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to read the file content and using the system standard encoding "UTF-8" to write the file. | +| [getBinary](dw.net.SFTPClient.md#getbinarystring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote file and creates a local copy in the given file. | +| [getConnected](dw.net.SFTPClient.md#getconnected)() | Identifies if the SFTP client is currently connected to the SFTP server. | +| [getErrorMessage](dw.net.SFTPClient.md#geterrormessage)() | Returns the error message from the last SFTP action. | +| [getFileInfo](dw.net.SFTPClient.md#getfileinfostring)([String](TopLevel.String.md)) | Returns a SFTPFileInfo objects containing information about the given file/directory path. | +| [getIdentity](dw.net.SFTPClient.md#getidentity)() | Gets the identity (private key) used for the connection. | +| [getTimeout](dw.net.SFTPClient.md#gettimeout)() | Returns the timeout for this client, in milliseconds. | +| [list](dw.net.SFTPClient.md#list)() | Returns a list of SFTPFileInfo objects containing information about the files in the current directory. | +| [list](dw.net.SFTPClient.md#liststring)([String](TopLevel.String.md)) | Returns a list of SFTPFileInfo objects containing information about the files in the remote directory defined by the given path. | +| [mkdir](dw.net.SFTPClient.md#mkdirstring)([String](TopLevel.String.md)) | Creates a directory | +| [put](dw.net.SFTPClient.md#putstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Puts the specified content to the specified path using "ISO-8859-1" encoding. | +| [put](dw.net.SFTPClient.md#putstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Put the given content to a file on the given path on the SFTP server. | +| [putBinary](dw.net.SFTPClient.md#putbinarystring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Put the content of the given file into a file on the remote SFTP server with the given absolute path. | +| [removeDirectory](dw.net.SFTPClient.md#removedirectorystring)([String](TopLevel.String.md)) | Deletes the remote directory on the server identified by the path parameter. | +| [rename](dw.net.SFTPClient.md#renamestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Renames an existing file. | +| [setIdentity](dw.net.SFTPClient.md#setidentitykeyref)([KeyRef](dw.crypto.KeyRef.md)) | Sets the identity (private key) to use for the next connection attempt. | +| [setTimeout](dw.net.SFTPClient.md#settimeoutnumber)([Number](TopLevel.Number.md)) | Sets the timeout for connections made with the SFTP client to the given number of milliseconds. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### MAX_GET_FILE_SIZE + +- MAX_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 209715200 + - : The maximum size for get() methods returning a File is 200 MB. + + +--- + +### MAX_GET_STRING_SIZE + +- MAX_GET_STRING_SIZE: [Number](TopLevel.Number.md) = 10485760 + - : The maximum size for get() methods returning a String is 10 MB. + + +--- + +## Property Details + +### connected +- connected: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the SFTP client is currently connected to the SFTP server. + + +--- + +### errorMessage +- errorMessage: [String](TopLevel.String.md) `(read-only)` + - : Returns the error message from the last SFTP action. + + +--- + +### identity +- identity: [KeyRef](dw.crypto.KeyRef.md) + - : Gets the identity (private key) used for the connection. + + + The key is only associated to this instance of the SFTP client. + + + +--- + +### timeout +- timeout: [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + +--- + +## Constructor Details + +### SFTPClient() +- SFTPClient() + - : Constructor. + + +--- + +## Method Details + +### addKnownHostKey(String, String) +- addKnownHostKey(type: [String](TopLevel.String.md), key: [String](TopLevel.String.md)): void + - : Adds a known public host key for the next connection attempt. + + + This method associates the key to the host used in the subsequent connect method, and must be called prior to connect. + The key is not persisted, and is only associated to this instance of the SFTP client. + + + Multiple keys may be added, and the validation will succeed if the remote host matches any of them. + + + The default behavior is to persist and trust an unknown host key if there are no known host keys available. + If addKnownHostKey is later used to trust specific a specific key or keys, then any previously persisted keys + will be ignored. + + + **Parameters:** + - type - Type of the host key, such as ssh-rsa + - key - Public host key, in the same format as OpenSSH. + + +--- + +### cd(String) +- cd(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Changes the current directory on the remote server to the given path. + + **Parameters:** + - path - the new current directory + + **Returns:** + - true if the directory change was okay + + +--- + +### connect(String, Number, String, String) +- connect(host: [String](TopLevel.String.md), port: [Number](TopLevel.Number.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to a SFTP server and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the SFTP sever + - port - Port for SFTP server + - user - Username for the login + - password - Password for the login + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### connect(String, String, String) +- connect(host: [String](TopLevel.String.md), user: [String](TopLevel.String.md), password: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Connects and logs on to a SFTP server and returns a boolean indicating success or failure. + + **Parameters:** + - host - Name of the SFTP sever + - user - Username for the login + - password - Password for the login + + **Returns:** + - true when connection is successful, false otherwise. + + +--- + +### del(String) +- del(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Deletes the remote file on the server identified by the path parameter. + + **Parameters:** + - path - the path to the file. + + **Returns:** + - true if the file was successfully deleted, false otherwise. + + +--- + +### disconnect() +- disconnect(): void + - : The method first logs the current user out from the server and then disconnects from the server. + + +--- + +### get(String) +- get(path: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file and returns it as a string using "ISO-8859-1" encoding to read it. Files with + at most MAX\_GET\_STRING\_SIZE bytes are read. + + + **Parameters:** + - path - remote path of the file to be read. + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + +--- + +### get(String, String) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file and returns it as a string using the specified encoding. Files with at most + MAX\_GET\_STRING\_SIZE bytes are read. + + + **Parameters:** + - path - the remote path of the file to be read. + - encoding - the encoding to use. + + **Returns:** + - the contents of the file or null if an error occurred while reading the file. + + +--- + +### get(String, String, File) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file and creates a local copy in the given file using the passed string encoding to + read the file content and using the system standard encoding "UTF-8" to write the file. Copies at most + MAX\_GET\_FILE\_SIZE bytes. + + + **Parameters:** + - path - the remote path of the file to be read. + - encoding - the encoding to use. + - file - the local file name + + **Returns:** + - true if complete remote file is fetched and copied into local file. false, otherwise. + + +--- + +### getBinary(String, File) +- getBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file and creates a local copy in the given file. Copies at most MAX\_GET\_FILE\_SIZE + bytes. The SFTP transfer is done in binary mode. + + + **Parameters:** + - path - the remote path of the file to be read. + - file - the local file name + + **Returns:** + - true if complete remote file is fetched and copied into local file. false otherwise + + +--- + +### getConnected() +- getConnected(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the SFTP client is currently connected to the SFTP server. + + **Returns:** + - true if the client is currently connected. + + +--- + +### getErrorMessage() +- getErrorMessage(): [String](TopLevel.String.md) + - : Returns the error message from the last SFTP action. + + **Returns:** + - the error message from the last SFTP action + + +--- + +### getFileInfo(String) +- getFileInfo(path: [String](TopLevel.String.md)): [SFTPFileInfo](dw.net.SFTPFileInfo.md) + - : Returns a SFTPFileInfo objects containing information about the given file/directory path. + + **Parameters:** + - path - the remote path from which the file info should be listed. + + **Returns:** + - the remote file information or `null` if not present. + + +--- + +### getIdentity() +- getIdentity(): [KeyRef](dw.crypto.KeyRef.md) + - : Gets the identity (private key) used for the connection. + + + The key is only associated to this instance of the SFTP client. + + + **Returns:** + - Reference to the private key, or null if not configured + + +--- + +### getTimeout() +- getTimeout(): [Number](TopLevel.Number.md) + - : Returns the timeout for this client, in milliseconds. + + **Returns:** + - the timeout in milliseconds + + +--- + +### list() +- list(): [SFTPFileInfo\[\]](dw.net.SFTPFileInfo.md) + - : Returns a list of SFTPFileInfo objects containing information about the files in the current directory. + + **Returns:** + - list of objects with remote file information or `null` if not present. + + +--- + +### list(String) +- list(path: [String](TopLevel.String.md)): [SFTPFileInfo\[\]](dw.net.SFTPFileInfo.md) + - : Returns a list of SFTPFileInfo objects containing information about the files in the remote directory defined by + the given path. + + + **Parameters:** + - path - the remote path from which the file info should be listed. + + **Returns:** + - list of objects with remote file information or `null` if not present. + + +--- + +### mkdir(String) +- mkdir(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Creates a directory + + **Parameters:** + - path - the path to the directory to create. + + **Returns:** + - true if the directory was successfully created, false otherwise. + + +--- + +### put(String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Puts the specified content to the specified path using "ISO-8859-1" encoding. If the content of a local file is + to be uploaded, please use method putBinary(String,File) instead. + + + NOTE: If the remote file already exists, it is overwritten. + + + **Parameters:** + - path - the path on the remote SFTP server, where the file will be stored. + - content - the content to put. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### put(String, String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Put the given content to a file on the given path on the SFTP server. The transformation from String into binary + data is done via the encoding provided with the method call. If the content of a local file is to be uploaded, + please use method putBinary(String,File) instead. + + + NOTE: If the remote file already exists, it is overwritten. + + + **Parameters:** + - path - the path on the remote SFTP server, where the file will be stored. + - content - the content to put. + - encoding - the encoding to use. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### putBinary(String, File) +- putBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Put the content of the given file into a file on the remote SFTP server with the given absolute path. NOTE: If + the remote file already exists, it is overwritten. + + + **Parameters:** + - path - the path on the remote SFTP server where the file will be stored. + - file - the file on the local system, which content is send to the remote SFTP server. + + **Returns:** + - true or false indicating success or failure. + + +--- + +### removeDirectory(String) +- removeDirectory(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Deletes the remote directory on the server identified by the path parameter. In order to delete the directory + successfully the directory needs to be empty, otherwise the removeDirectory() method will return false. + + + **Parameters:** + - path - the path to the directory. + + **Returns:** + - true if the directory was successfully deleted, false otherwise. + + +--- + +### rename(String, String) +- rename(from: [String](TopLevel.String.md), to: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Renames an existing file. + + **Parameters:** + - from - the file that will be renamed. + - to - the name of the new file. + + **Returns:** + - true if the file was successfully renamed, false otherwise. + + +--- + +### setIdentity(KeyRef) +- setIdentity(keyRef: [KeyRef](dw.crypto.KeyRef.md)): void + - : Sets the identity (private key) to use for the next connection attempt. + + + The key is only associated to this instance of the SFTP client. + + + **Parameters:** + - keyRef - Reference to the private key + + +--- + +### setTimeout(Number) +- setTimeout(timeoutMillis: [Number](TopLevel.Number.md)): void + - : Sets the timeout for connections made with the SFTP client to the given number of milliseconds. If the given + timeout is less than or equal to zero, the timeout is set to the same value as the script context timeout but + will only be set to a maximum of 30 seconds. + + + The maximum and default timeout depend on the script context timeout. The maximum timeout is set to a maximum of + 2 minutes. The default timeout for a new client is set to a maximum of 30 seconds. + + + This method can be called at any time, and will affect the next connection made with this client. It is not + possible to set the timeout for an open connection. + + + **Parameters:** + - timeoutMillis - timeout, in milliseconds, up to a maximum of 2 minutes. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPFileInfo.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPFileInfo.md new file mode 100644 index 00000000..0e4084db --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.SFTPFileInfo.md @@ -0,0 +1,128 @@ + +# Class SFTPFileInfo + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.SFTPFileInfo](dw.net.SFTPFileInfo.md) + +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. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [directory](#directory): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the file is a directory. | +| [modificationTime](#modificationtime): [Date](TopLevel.Date.md) `(read-only)` | Returns the last modification time of the file/directory. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the file/directory. | +| [size](#size): [Number](TopLevel.Number.md) `(read-only)` | Returns the size of the file/directory. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [SFTPFileInfo](#sftpfileinfostring-number-boolean-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md), [Number](TopLevel.Number.md)) | Constructs the SFTPFileInfo instance. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [getDirectory](dw.net.SFTPFileInfo.md#getdirectory)() | Identifies if the file is a directory. | +| [getModificationTime](dw.net.SFTPFileInfo.md#getmodificationtime)() | Returns the last modification time of the file/directory. | +| [getName](dw.net.SFTPFileInfo.md#getname)() | Returns the name of the file/directory. | +| [getSize](dw.net.SFTPFileInfo.md#getsize)() | Returns the size of the file/directory. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### directory +- directory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the file is a directory. + + +--- + +### modificationTime +- modificationTime: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the last modification time of the file/directory. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the file/directory. + + +--- + +### size +- size: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the size of the file/directory. + + +--- + +## Constructor Details + +### SFTPFileInfo(String, Number, Boolean, Number) +- SFTPFileInfo(name: [String](TopLevel.String.md), size: [Number](TopLevel.Number.md), directory: [Boolean](TopLevel.Boolean.md), mtime: [Number](TopLevel.Number.md)) + - : Constructs the SFTPFileInfo instance. + + **Parameters:** + - name - the name of the file. + - size - the size of the file. + - directory - controls if the file is a directory. + - mtime - last modification time. + + +--- + +## Method Details + +### getDirectory() +- getDirectory(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the file is a directory. + + **Returns:** + - true if the file is a directory, false otherwise. + + +--- + +### getModificationTime() +- getModificationTime(): [Date](TopLevel.Date.md) + - : Returns the last modification time of the file/directory. + + **Returns:** + - the last modification time. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the file/directory. + + **Returns:** + - the name. + + +--- + +### getSize() +- getSize(): [Number](TopLevel.Number.md) + - : Returns the size of the file/directory. + + **Returns:** + - the size. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVClient.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVClient.md new file mode 100644 index 00000000..f3b019ee --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVClient.md @@ -0,0 +1,762 @@ + +# Class WebDAVClient + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.WebDAVClient](dw.net.WebDAVClient.md) + +The WebDAVClient class supports the WebDAV methods GET, PUT, MKCOL, MOVE, +COPY, PROPFIND,OPTIONS and DELETE. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + The client can be used as shown in the following example: + + + +``` +var webdavClient : WebDAVClient = new WebDAVClient("http://mywebdav.server.com","myusername", "mypassword"); +var getString : String = webdavClient.get("myData.xml","UTF-8"); +var message : String; + +if (webdavClient.succeeded()) +{ + message = webDavClient.statusText; +} +else +{ + // error handling + message="An error occurred with status code "+webdavClient.statusCode; +} + +var data : XML = new XML(getString); +``` + + + +The WebDAV client supports the following authentication schemes: + +- Basic authentication +- Digest authentication + + +The methods of this class do not generally throw exceptions if the underlying +WebDAV operation do not succeed.The result of a WebDAV operation can be +checked using the methods succeeded(), getStatusCode(), and getStatusText(). + + +Important note: This WebDAV client cannot be used to access the Commerce Cloud Digital +server via WebDAV protocol. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [DEFAULT_ENCODING](#default_encoding): [String](TopLevel.String.md) = "UTF-8" | The default encoding character set. | +| [DEFAULT_GET_FILE_SIZE](#default_get_file_size): [Number](TopLevel.Number.md) = 5242880 | The default size for `get()` returning a File is 5MB. | +| [DEFAULT_GET_STRING_SIZE](#default_get_string_size): [Number](TopLevel.Number.md) = 2097152 | The default size for `get()` returning a String is 2MB. | +| [DEPTH_0](#depth_0): [Number](TopLevel.Number.md) = 0 | The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be searched only on the level of the given path and a list of all containing files on that level will be returned \[is not supported by every server\]. | +| [DEPTH_1](#depth_1): [Number](TopLevel.Number.md) = 1 | The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be searched until one level under the given path and a list of all containing files in that two levels \[/path and one level underneath\] will be returned \[is not supported by every server\]. | +| [DEPTH_INIFINITY](#depth_inifinity): [Number](TopLevel.Number.md) = 2147483647 | The depth of searching a WebDAV destination using the PROPFIND method - if that depth is given to the PROPFIND method as an input parameter the destination will be fully searched and a list of all containing files will be returned \[is not supported by every server\]. | +| [MAX_GET_FILE_SIZE](#max_get_file_size): [Number](TopLevel.Number.md) = 209715200 | The maximum size for `get()` returning a File is forty times the default size for getting a file. | +| [MAX_GET_STRING_SIZE](#max_get_string_size): [Number](TopLevel.Number.md) = 10485760 | The maximum size for `get()` returning a String is five times the default size for getting a String. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [allResponseHeaders](#allresponseheaders): [HashMap](dw.util.HashMap.md) `(read-only)` | Returns a [HashMap](dw.util.HashMap.md) of all response headers. | +| [statusCode](#statuscode): [Number](TopLevel.Number.md) `(read-only)` | Returns the status code after the execution of a method. | +| [statusText](#statustext): [String](TopLevel.String.md) `(read-only)` | Returns the status text after the execution of a method. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [WebDAVClient](#webdavclientstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Creates a new client for the use at a server which requires authentication. | +| [WebDAVClient](#webdavclientstring)([String](TopLevel.String.md)) | Creates a new client for the use at a server which does not require authentication. | + +## Method Summary + +| Method | Description | +| --- | --- | +| [addRequestHeader](dw.net.WebDAVClient.md#addrequestheaderstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Adds a request header to the next WebDAV call. | +| [close](dw.net.WebDAVClient.md#close)() | Closes the current connection to the server. | +| [copy](dw.net.WebDAVClient.md#copystring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Copies a file on the server from one place `rootUrl`/`origin` to the other `rootUrl`/`destination`. | +| [copy](dw.net.WebDAVClient.md#copystring-string-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Copies a file on the server from one place `rootUrl`/`origin` to the other `rootUrl`/`destination`. | +| [copy](dw.net.WebDAVClient.md#copystring-string-boolean-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md), [Boolean](TopLevel.Boolean.md)) | Copies a file on the server from one place `rootUrl`/`origin` to the other `rootUrl`/`destination`. | +| [del](dw.net.WebDAVClient.md#delstring)([String](TopLevel.String.md)) | Deletes a file or directory from the remote server that can be found under `rootUrl`/`path`. | +| [get](dw.net.WebDAVClient.md#getstring)([String](TopLevel.String.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` and returns a string representation of the data found in the DEFAULT\_ENCODING encoding. | +| [get](dw.net.WebDAVClient.md#getstring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` in DEFAULT\_ENCODING encoding and writes a [File](dw.io.File.md) in the system's standard encoding, which is "UTF-8". | +| [get](dw.net.WebDAVClient.md#getstring-file-number)([String](TopLevel.String.md), [File](dw.io.File.md), [Number](TopLevel.Number.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` in DEFAULT\_ENCODING encoding and writes a [File](dw.io.File.md) in the system's standard encoding, which is "UTF-8". | +| [get](dw.net.WebDAVClient.md#getstring-file-string-number)([String](TopLevel.String.md), [File](dw.io.File.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` in the passed encoding and writes a [File](dw.io.File.md) in the system standard encoding, which is "UTF-8". | +| [get](dw.net.WebDAVClient.md#getstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` and returns a string representation of the data found in the given `encoding`. | +| [get](dw.net.WebDAVClient.md#getstring-string-number)([String](TopLevel.String.md), [String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Reads the content of a remote file or directory that can be found under `rootUrl`/`path` and returns a string representation of the data found in the given `encoding`. | +| [getAllResponseHeaders](dw.net.WebDAVClient.md#getallresponseheaders)() | Returns a [HashMap](dw.util.HashMap.md) of all response headers. | +| [getBinary](dw.net.WebDAVClient.md#getbinarystring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Reads the content of a remote binary file that can be found under `rootUrl`/`path` and creates a local copy in [File](dw.io.File.md). | +| [getBinary](dw.net.WebDAVClient.md#getbinarystring-file-number)([String](TopLevel.String.md), [File](dw.io.File.md), [Number](TopLevel.Number.md)) | Reads the content of a remote binary file that can be found under `rootUrl`/`path` and creates a local copy in [File](dw.io.File.md). | +| [getResponseHeader](dw.net.WebDAVClient.md#getresponseheaderstring)([String](TopLevel.String.md)) | Returns a specified response header - multiple headers are separated by CRLF. | +| [getStatusCode](dw.net.WebDAVClient.md#getstatuscode)() | Returns the status code after the execution of a method. | +| [getStatusText](dw.net.WebDAVClient.md#getstatustext)() | Returns the status text after the execution of a method. | +| [mkcol](dw.net.WebDAVClient.md#mkcolstring)([String](TopLevel.String.md)) | Creates a directory on the remote server on the location `rootUrl`/`path`. | +| [move](dw.net.WebDAVClient.md#movestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Moves a file on the server from one place `rootUrl` + "/" +`origin` to the other `rootUrl`/`destination`. | +| [move](dw.net.WebDAVClient.md#movestring-string-boolean)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Moves a file on the server from one place `rootUrl`/`origin` to the other `rootUrl`/`destination` Can also be used to rename a remote file. | +| [options](dw.net.WebDAVClient.md#optionsstring)([String](TopLevel.String.md)) | Returns a list of methods which can be executed on the server location `rootUrl`/`path`. | +| [propfind](dw.net.WebDAVClient.md#propfindstring)([String](TopLevel.String.md)) | Get file listing of a remote location. | +| [propfind](dw.net.WebDAVClient.md#propfindstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Get file listing of a remote location. | +| [put](dw.net.WebDAVClient.md#putstring-file)([String](TopLevel.String.md), [File](dw.io.File.md)) | Puts content out of a passed local file into a remote located file at `rootUrl`/`path`. | +| [put](dw.net.WebDAVClient.md#putstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Puts content encoded with DEFAULT\_ENCODING into a remote located file at `rootUrl`/`path`. | +| [put](dw.net.WebDAVClient.md#putstring-string-string)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md)) | Puts content encoded with the passed encoding into a remote located file at `rootUrl`/`path`. | +| [succeeded](dw.net.WebDAVClient.md#succeeded)() | Returns true if the last executed WebDAV method was executed successfully - otherwise false. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### DEFAULT_ENCODING + +- DEFAULT_ENCODING: [String](TopLevel.String.md) = "UTF-8" + - : The default encoding character set. + + +--- + +### DEFAULT_GET_FILE_SIZE + +- DEFAULT_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 5242880 + - : The default size for `get()` returning a File is 5MB. + + +--- + +### DEFAULT_GET_STRING_SIZE + +- DEFAULT_GET_STRING_SIZE: [Number](TopLevel.Number.md) = 2097152 + - : The default size for `get()` returning a String is 2MB. + + +--- + +### DEPTH_0 + +- DEPTH_0: [Number](TopLevel.Number.md) = 0 + - : The depth of searching a WebDAV destination using the PROPFIND method - + if that depth is given to the PROPFIND method as an input parameter the + destination will be searched only on the level of the given path and a + list of all containing files on that level will be returned \[is not + supported by every server\]. + + + +--- + +### DEPTH_1 + +- DEPTH_1: [Number](TopLevel.Number.md) = 1 + - : The depth of searching a WebDAV destination using the PROPFIND method - + if that depth is given to the PROPFIND method as an input parameter the + destination will be searched until one level under the given path and a + list of all containing files in that two levels \[/path and one level + underneath\] will be returned \[is not supported by every server\]. + + + +--- + +### DEPTH_INIFINITY + +- DEPTH_INIFINITY: [Number](TopLevel.Number.md) = 2147483647 + - : The depth of searching a WebDAV destination using the PROPFIND method - + if that depth is given to the PROPFIND method as an input parameter the + destination will be fully searched and a list of all containing files + will be returned \[is not supported by every server\]. + + + +--- + +### MAX_GET_FILE_SIZE + +- MAX_GET_FILE_SIZE: [Number](TopLevel.Number.md) = 209715200 + - : The maximum size for `get()` returning a File is forty times + the default size for getting a file. The largest file allowed is 200MB. + + + +--- + +### MAX_GET_STRING_SIZE + +- MAX_GET_STRING_SIZE: [Number](TopLevel.Number.md) = 10485760 + - : The maximum size for `get()` returning a String is five + times the default size for getting a String. The largest String allowed + is 10MB. + + + +--- + +## Property Details + +### allResponseHeaders +- allResponseHeaders: [HashMap](dw.util.HashMap.md) `(read-only)` + - : Returns a [HashMap](dw.util.HashMap.md) of all response headers. + + +--- + +### statusCode +- statusCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the status code after the execution of a method. + + +--- + +### statusText +- statusText: [String](TopLevel.String.md) `(read-only)` + - : Returns the status text after the execution of a method. + + +--- + +## Constructor Details + +### WebDAVClient(String, String, String) +- WebDAVClient(rootUrl: [String](TopLevel.String.md), username: [String](TopLevel.String.md), password: [String](TopLevel.String.md)) + - : Creates a new client for the use at a server which requires + authentication. + The client supports the following authentication schemes: + - Basic authentication scheme + - Digest authentication scheme + + + **Parameters:** + - rootUrl - the url of the server one wants to connect to. All commands will be executed by the client relative to that url. + - username - username of the user for server authentication. + - password - password of the user for server authentication. + + +--- + +### WebDAVClient(String) +- WebDAVClient(rootUrl: [String](TopLevel.String.md)) + - : Creates a new client for the use at a server which does not require + authentication. + + + **Parameters:** + - rootUrl - the url of the server one wants to connect to. All commands will be executed by the client relative to that url. + + +--- + +## Method Details + +### addRequestHeader(String, String) +- addRequestHeader(headerName: [String](TopLevel.String.md), headerValue: [String](TopLevel.String.md)): void + - : Adds a request header to the next WebDAV call. + + **Parameters:** + - headerName - name of the header. + - headerValue - value of the header. + + +--- + +### close() +- close(): void + - : Closes the current connection to the server. + + +--- + +### copy(String, String) +- copy(origin: [String](TopLevel.String.md), destination: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Copies a file on the server from one place `rootUrl`/`origin` + to the other `rootUrl`/`destination`. If + `destination` already exists it gets overwritten. Returns + true if succeeded, otherwise false. + + + **Parameters:** + - origin - The origin where a file is located, relative to the `rootUrl` stated when instantiating the client. + - destination - The destination where the file should be copied to, relative to the `rootUrl` stated when instantiating the client. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### copy(String, String, Boolean) +- copy(origin: [String](TopLevel.String.md), destination: [String](TopLevel.String.md), overwrite: [Boolean](TopLevel.Boolean.md)): [Boolean](TopLevel.Boolean.md) + - : Copies a file on the server from one place `rootUrl`/`origin` + to the other `rootUrl`/`destination`. If + the passed parameter `overwrite` is true and + `destination` already exists it gets overwritten. Returns + true if succeeded, otherwise false. + + + **Parameters:** + - origin - The origin where a file is located, relative to the `rootUrl` stated when instantiating the client. + - destination - The destination where the file should be copied to, relative to the `rootUrl` stated when instantiating the client. + - overwrite - A flag which determines whether the destination gets overwritten if it exists before copying. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### copy(String, String, Boolean, Boolean) +- copy(origin: [String](TopLevel.String.md), destination: [String](TopLevel.String.md), overwrite: [Boolean](TopLevel.Boolean.md), shallow: [Boolean](TopLevel.Boolean.md)): [Boolean](TopLevel.Boolean.md) + - : Copies a file on the server from one place `rootUrl`/`origin` + to the other `rootUrl`/`destination`. If + the passed parameter `overwrite` is true and + `destination` already exists it gets overwritten. If the + passed parameter `shallow` is true a flat copy mechanism is + used. + + Returns true if succeeded, otherwise false. + + + **Parameters:** + - origin - The origin where a file is located, relative to the `rootUrl` stated when instantiating the client. + - destination - The destination where the file should be copied to, relative to the `rootUrl` stated when instantiating the client. + - overwrite - A flag which determines whether the destination gets overwritten if it exits before copying + - shallow - A flag which determines how to copy the given data. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### del(String) +- del(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Deletes a file or directory from the remote server that can be found + under `rootUrl`/`path`. Returns true if + succeeded, otherwise false. + + + **Parameters:** + - path - The path of the file or collection to delete, relative to the `rootUrl` stated when instantiating the client. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### get(String) +- get(path: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` and returns a string + representation of the data found in the DEFAULT\_ENCODING encoding. If the + remote location is a directory the result depends on the server + configuration, some return an HTML formatted directory listing. Returns + at most DEFAULT\_GET\_STRING\_SIZE bytes. + + + **Parameters:** + - path - The path of the collection or file one wants to get, relative to the `rootUrl` stated when instantiating the client. + + **Returns:** + - returns the String representation of the data found on the given + path. + + + +--- + +### get(String, File) +- get(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` in DEFAULT\_ENCODING + encoding and writes a [File](dw.io.File.md) in the system's standard + encoding, which is "UTF-8". If the remote location is a directory the + result depends on the server configuration, some return an HTML formatted + directory listing. Receives at most DEFAULT\_GET\_FILE\_SIZE bytes which + determines the file size of the local file. Returns true if succeeded + otherwise false. + + + **Parameters:** + - path - The path of the collection or file one wants to get - relative to the `rootUrl` stated when instantiating the client. + - file - The file to save the received data in. + + **Returns:** + - returns true if succeeded, otherwise false. + + +--- + +### get(String, File, Number) +- get(path: [String](TopLevel.String.md), file: [File](dw.io.File.md), maxFileSize: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` in DEFAULT\_ENCODING + encoding and writes a [File](dw.io.File.md) in the system's standard + encoding, which is "UTF-8". If the remote location is a directory the + result depends on the server configuration, some return an HTML formatted + directory listing. Receives at most maxFileSize bytes which determines + the file size of the local file. Returns true if succeeded, otherwise + false. + + + **Parameters:** + - path - The path of the collection or file one wants to get - relative to the `rootUrl` stated when instantiating the client. + - file - The file to save the received data in. + - maxFileSize - The maximum size of bytes to stream into the file. Not to exceed MAX\_GET\_FILE\_SIZE. + + **Returns:** + - returns true if succeeded, otherwise false. + + +--- + +### get(String, File, String, Number) +- get(path: [String](TopLevel.String.md), file: [File](dw.io.File.md), encoding: [String](TopLevel.String.md), maxFileSize: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` in the passed encoding and + writes a [File](dw.io.File.md) in the system standard encoding, which is + "UTF-8". If the remote location is a directory the result depends on the + server configuration, some return an HTML formatted directory listing. + Receives at most maxFileSize bytes which determines the file size of the + local file. Returns true if succeeded, otherwise false. + + + **Parameters:** + - path - The path of the collection or file one wants to get - relative to the `rootUrl` stated when instantiating the client. + - file - The file to save the received data in. + - encoding - The encoding to use when reading the remote file. + - maxFileSize - The maximum number of bytes to stream into the file. Not to exceed MAX\_GET\_FILE\_SIZE. + + **Returns:** + - returns true if succeeded, otherwise false. + + +--- + +### get(String, String) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` and returns a string + representation of the data found in the given `encoding`. If + the remote location is a directory the result depends on the server + configuration, some return an HTML formatted directory listing. Returns + at most DEFAULT\_GET\_STRING\_SIZE bytes. + + + **Parameters:** + - path - The path of the collection or file one wants to get - relative to the `rootUrl` stated when instantiating the client. + - encoding - The encoding of the resulting String. + + **Returns:** + - returns the String representation of the data found on the given + path in the given encoding. + + + +--- + +### get(String, String, Number) +- get(path: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md), maxGetSize: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Reads the content of a remote file or directory that can be found under + `rootUrl`/`path` and returns a string + representation of the data found in the given `encoding`. If + the remote location is a directory the result depends on the server + configuration, some return an HTML formatted directory listing. Returns + at most maxGetSize bytes. + + + **Parameters:** + - path - The path of the collection or file one wants to get - relative to the `rootUrl` stated when instantiating the client. + - encoding - The encoding of the resulting String. + - maxGetSize - The maximum size of data in bytes. Not to exceed MAX\_GET\_STRING\_SIZE. + + **Returns:** + - returns the String representation of the data found on the given + path in the given encoding. + + + +--- + +### getAllResponseHeaders() +- getAllResponseHeaders(): [HashMap](dw.util.HashMap.md) + - : Returns a [HashMap](dw.util.HashMap.md) of all response headers. + + **Returns:** + - all headers in a [HashMap](dw.util.HashMap.md). + + +--- + +### getBinary(String, File) +- getBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote binary file that can be found under + `rootUrl`/`path` and creates a local copy + in [File](dw.io.File.md). If the remote location is a directory the result + depends on the server configuration, some return an HTML formatted + directory listing. Copies at most DEFAULT\_GET\_FILE\_SIZE bytes. Returns + true if succeeded, otherwise false. + + + **Parameters:** + - path - The path relative to `rootUrl` on the remote server including the file name. + - file - The local file where the received binary data should be stored. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### getBinary(String, File, Number) +- getBinary(path: [String](TopLevel.String.md), file: [File](dw.io.File.md), maxFileSize: [Number](TopLevel.Number.md)): [Boolean](TopLevel.Boolean.md) + - : Reads the content of a remote binary file that can be found under + `rootUrl`/`path` and creates a local copy + in [File](dw.io.File.md). If the remote location is a directory the result + depends on the server configuration, some return an HTML formatted + directory listing. Copies at most maxFileSize bytes. Returns true if + succeeded, otherwise false. + + + **Parameters:** + - path - The path relative to `rootUrl` on the remote server including the file name. + - file - The file local file where the received binary data should be stored. + - maxFileSize - The maximum number of bytes to stream into the file. Not to exceed MAX\_GET\_FILE\_SIZE. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### getResponseHeader(String) +- getResponseHeader(header: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns a specified response header - multiple headers are separated by + CRLF. + + + **Parameters:** + - header - The name of the header. + + **Returns:** + - The header - in case of multiple headers separated by CRLF. + + +--- + +### getStatusCode() +- getStatusCode(): [Number](TopLevel.Number.md) + - : Returns the status code after the execution of a method. + + **Returns:** + - the `statusCode`. + + +--- + +### getStatusText() +- getStatusText(): [String](TopLevel.String.md) + - : Returns the status text after the execution of a method. + + **Returns:** + - the `statusText`. + + +--- + +### mkcol(String) +- mkcol(path: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Creates a directory on the remote server on the location + `rootUrl`/`path`. + + + **Parameters:** + - path - The path relative to the `rootUrl` stated when instantiating the client where the new collection should be created. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### move(String, String) +- move(origin: [String](TopLevel.String.md), destination: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Moves a file on the server from one place `rootUrl` + "/" +`origin` + to the other `rootUrl`/`destination`. If + `destination` already exists it gets overwritten. Can also + be used to rename a remote file. Returns true if succeeded, otherwise + false. + + + **Parameters:** + - origin - The origin where a file is located, relative to the `rootUrl` stated when instantiating the client. + - destination - The destination where the file should be moved to, relative to the `rootUrl` stated when instantiating the client. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### move(String, String, Boolean) +- move(origin: [String](TopLevel.String.md), destination: [String](TopLevel.String.md), overwrite: [Boolean](TopLevel.Boolean.md)): [Boolean](TopLevel.Boolean.md) + - : Moves a file on the server from one place `rootUrl`/`origin` + to the other `rootUrl`/`destination` Can + also be used to rename a remote file. If `overwrite` is true + and `destination` already exists it gets overwritten. + Returns true if succeeded, otherwise false. + + + **Parameters:** + - origin - The origin where a file is located, relative to the `rootUrl` stated when instantiating the client. + - destination - The destination where the file should be moved to, relative to the `rootUrl` stated when instantiating the client. + - overwrite - A flag which determines whether the destination gets overwritten if it exists before moving. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### options(String) +- options(path: [String](TopLevel.String.md)): [String\[\]](TopLevel.String.md) + - : Returns a list of methods which can be executed on the server location + `rootUrl`/`path`. + + + **Parameters:** + - path - The path relative to the `rootUrl` stated when instantiating the client one wants to get the options for. + + **Returns:** + - list of WebDav methods which can be executed on the given path. + + +--- + +### propfind(String) +- propfind(path: [String](TopLevel.String.md)): [WebDAVFileInfo\[\]](dw.net.WebDAVFileInfo.md) + - : Get file listing of a remote location. + + Returns a list of [WebDAVFileInfo](dw.net.WebDAVFileInfo.md) objects which contain + information about the files and directories located on + `rootUrl`/`path` and DEPTH\_1 (1) level + underneath. + + + **Parameters:** + - path - The path relative to the `rootUrl` stated when instantiating the client where to get information about the containing files from. + + **Returns:** + - an Array of [WebDAVFileInfo](dw.net.WebDAVFileInfo.md) objects which hold + information about the files located on the server at the + location. + + + +--- + +### propfind(String, Number) +- propfind(path: [String](TopLevel.String.md), depth: [Number](TopLevel.Number.md)): [WebDAVFileInfo\[\]](dw.net.WebDAVFileInfo.md) + - : Get file listing of a remote location. + + Returns a list of [WebDAVFileInfo](dw.net.WebDAVFileInfo.md) objects which contain + information about the files and directories located on + `rootUrl`/`path` and the passed depth + underneath. + + + **Parameters:** + - path - The path relative to the `rootUrl` stated when instantiating the client where to get information about the containing files from. + - depth - The level starting from `rootUrl` down to which the file information gets collected. + + **Returns:** + - an Array of [WebDAVFileInfo](dw.net.WebDAVFileInfo.md) objects which hold + information about the files located on the server at the + location. + + + +--- + +### put(String, File) +- put(path: [String](TopLevel.String.md), file: [File](dw.io.File.md)): [Boolean](TopLevel.Boolean.md) + - : Puts content out of a passed local file into a remote located file + at `rootUrl`/`path`. This method performs + a binary file transfer. Returns true if succeeded, otherwise false. + + + **Parameters:** + - path - The path to put given content up to, relative to the `rootUrl` stated when instantiating the client. + - file - The file to push up to the server. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### put(String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Puts content encoded with DEFAULT\_ENCODING into a remote located file at + `rootUrl`/`path`. Returns true if + succeeded, otherwise false. + + + If the content of a local file is to be uploaded, please use method + [put(String, File)](dw.net.WebDAVClient.md#putstring-file) instead. + + + **Parameters:** + - path - The path to put given content up to, relative to the `rootUrl` stated when instantiating the client. + - content - The content that has to be pushed on to the server. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### put(String, String, String) +- put(path: [String](TopLevel.String.md), content: [String](TopLevel.String.md), encoding: [String](TopLevel.String.md)): [Boolean](TopLevel.Boolean.md) + - : Puts content encoded with the passed encoding into a remote located file + at `rootUrl`/`path`. Returns true if + succeeded, otherwise false. + + + If the content of a local file is to be uploaded, please use method + [put(String, File)](dw.net.WebDAVClient.md#putstring-file) instead. + + + **Parameters:** + - path - The path to put a given content up to, relative to the `rootUrl` stated when instantiating the client. + - content - The content that has to be pushed on to a remote location. + - encoding - The encoding in which the data should be stored on the server. + + **Returns:** + - true if succeeded, otherwise false. + + +--- + +### succeeded() +- succeeded(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the last executed WebDAV method was executed successfully - otherwise false. + See the code snippet above for an example how to use the succeed() method. + + + **Returns:** + - true if the last executed WebDAV method was successful - otherwise false. + + **See Also:** + - [WebDAVClient](dw.net.WebDAVClient.md) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVFileInfo.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVFileInfo.md new file mode 100644 index 00000000..02f6fbec --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.WebDAVFileInfo.md @@ -0,0 +1,163 @@ + +# Class WebDAVFileInfo + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.net.WebDAVFileInfo](dw.net.WebDAVFileInfo.md) + +Simple class representing a file on a remote WebDAV location. The class +possesses only read-only attributes of the file and does not permit any +manipulation of the file itself. Instances of this class are returned +by [WebDAVClient.propfind(String)](dw.net.WebDAVClient.md#propfindstring) which is used to get a +listing of files in a WebDAV directory. + + +**Note:** when this class is used with sensitive data, be careful in persisting sensitive information to disk. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [contentType](#contenttype): [String](TopLevel.String.md) `(read-only)` | Returns the content type of the file. | +| [creationDate](#creationdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the creationDate of the file. | +| [directory](#directory): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the file is a directory. | +| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the name of the file. | +| [path](#path): [String](TopLevel.String.md) `(read-only)` | Returns the path of the file. | +| [size](#size): [Number](TopLevel.Number.md) `(read-only)` | Returns the size of the file. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getContentType](dw.net.WebDAVFileInfo.md#getcontenttype)() | Returns the content type of the file. | +| [getCreationDate](dw.net.WebDAVFileInfo.md#getcreationdate)() | Returns the creationDate of the file. | +| [getName](dw.net.WebDAVFileInfo.md#getname)() | Returns the name of the file. | +| [getPath](dw.net.WebDAVFileInfo.md#getpath)() | Returns the path of the file. | +| [getSize](dw.net.WebDAVFileInfo.md#getsize)() | Returns the size of the file. | +| [isDirectory](dw.net.WebDAVFileInfo.md#isdirectory)() | Identifies if the file is a directory. | +| [lastModified](dw.net.WebDAVFileInfo.md#lastmodified)() | Returns the lastModified date of the file. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### contentType +- contentType: [String](TopLevel.String.md) `(read-only)` + - : Returns the content type of the file. + + +--- + +### creationDate +- creationDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the creationDate of the file. + + +--- + +### directory +- directory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the file is a directory. + + +--- + +### name +- name: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the file. + + +--- + +### path +- path: [String](TopLevel.String.md) `(read-only)` + - : Returns the path of the file. + + +--- + +### size +- size: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the size of the file. + + +--- + +## Method Details + +### getContentType() +- getContentType(): [String](TopLevel.String.md) + - : Returns the content type of the file. + + **Returns:** + - the content type of the file. + + +--- + +### getCreationDate() +- getCreationDate(): [Date](TopLevel.Date.md) + - : Returns the creationDate of the file. + + **Returns:** + - the creationDate of the file. + + +--- + +### getName() +- getName(): [String](TopLevel.String.md) + - : Returns the name of the file. + + **Returns:** + - the name of the file. + + +--- + +### getPath() +- getPath(): [String](TopLevel.String.md) + - : Returns the path of the file. + + **Returns:** + - the path of the file. + + +--- + +### getSize() +- getSize(): [Number](TopLevel.Number.md) + - : Returns the size of the file. + + **Returns:** + - the size of the file. + + +--- + +### isDirectory() +- isDirectory(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the file is a directory. + + **Returns:** + - true if the file is a directory, false otherwise. + + +--- + +### lastModified() +- lastModified(): [Date](TopLevel.Date.md) + - : Returns the lastModified date of the file. + + **Returns:** + - the lastModified date of the file. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.net.md b/packages/b2c-tooling-sdk/data/script-api/dw.net.md new file mode 100644 index 00000000..cce7cfd4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.net.md @@ -0,0 +1,15 @@ +# Package dw.net + +## Classes +| Class | Description | +| --- | --- | +| [FTPClient](dw.net.FTPClient.md) | The FTPClient class supports the FTP commands CD, GET, PUT, DEL, MKDIR, RENAME, and LIST. | +| [FTPFileInfo](dw.net.FTPFileInfo.md) | The class is used to store information about a remote file. | +| [HTTPClient](dw.net.HTTPClient.md) | The HTTPClient class supports the HTTP methods GET, POST, HEAD, PUT, PATCH, OPTIONS, and DELETE. | +| [HTTPClientLoggingConfig](dw.net.HTTPClientLoggingConfig.md) | Script API for configuring HTTP client logging and sensitive data redaction. | +| [HTTPRequestPart](dw.net.HTTPRequestPart.md) | This represents a part in a multi-part HTTP POST request. | +| [Mail](dw.net.Mail.md) | This class is used to send an email with either plain text or MimeEncodedText content. | +| [SFTPClient](dw.net.SFTPClient.md) | The SFTPClient class supports the SFTP commands GET, PUT, DEL, MKDIR, RENAME, and LIST. | +| [SFTPFileInfo](dw.net.SFTPFileInfo.md) | The class is used to store information about a remote file. | +| [WebDAVClient](dw.net.WebDAVClient.md) | The WebDAVClient class supports the WebDAV methods GET, PUT, MKCOL, MOVE, COPY, PROPFIND,OPTIONS and DELETE. | +| [WebDAVFileInfo](dw.net.WebDAVFileInfo.md) | Simple class representing a file on a remote WebDAV location. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ActiveData.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ActiveData.md new file mode 100644 index 00000000..e7236027 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ActiveData.md @@ -0,0 +1,86 @@ + +# Class ActiveData + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.object.ActiveData](dw.object.ActiveData.md) + +Represents the active data for an object in Commerce Cloud Digital. + + +## All Known Subclasses +[CustomerActiveData](dw.customer.CustomerActiveData.md), [ProductActiveData](dw.catalog.ProductActiveData.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this object. | +| [empty](#empty): [Boolean](TopLevel.Boolean.md) `(read-only)` | Return true if the ActiveData doesn't exist for the object | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCustom](dw.object.ActiveData.md#getcustom)() | Returns the custom attributes for this object. | +| [isEmpty](dw.object.ActiveData.md#isempty)() | Return true if the ActiveData doesn't exist for the object | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this object. The returned object can + only be used for retrieving attribute values, not storing them. See + [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for + working with custom attributes. + + + +--- + +### empty +- empty: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Return true if the ActiveData doesn't exist for the object + + +--- + +## Method Details + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this object. The returned object can + only be used for retrieving attribute values, not storing them. See + [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for + working with custom attributes. + + + **Returns:** + - the custom attributes for this object. + + +--- + +### isEmpty() +- isEmpty(): [Boolean](TopLevel.Boolean.md) + - : Return true if the ActiveData doesn't exist for the object + + **Returns:** + - true if ActiveData is empty, false otherwise + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomAttributes.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomAttributes.md new file mode 100644 index 00000000..b418653e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomAttributes.md @@ -0,0 +1,122 @@ + +# Class CustomAttributes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.CustomAttributes](dw.object.CustomAttributes.md) + +This class is used together with other classes that contain custom attributes +and is used to read and write these attributes. The actual attributes are +accessible as ECMA properties. The syntax for setting and retrieving the +value of a custom attribute depends upon the type of the attribute. If the +wrong syntax is used to set an individual attribute than an exception will be +thrown. + + + + +The following script examples demonstrate how to work with custom attributes. +Suppose we have an ExtensibleObject named "eo" possessing attributes of all +the different types supported by the Commerce Cloud Digital metadata system. The +following script snippet shows that setting single-valued attributes is +simply a matter of using the assignment operator and standard ECMA primitives +and built-in types: + + + + + +``` +// attribute of value type 'Boolean' +eo.custom.bvalue = true; +var b : Boolean = eo.custom.bvalue; + +// attribute of value type 'Integer' +eo.custom.ivalue = 10; +var i : Number = eo.custom.ivalue; + +// attribute of value type 'Number' +eo.custom.dvalue = 99.99; +var d : Number = eo.custom.dvalue; + +// attribute of value type 'String' +eo.custom.svalue = "String1"; +var s : String = eo.custom.svalue; + +// attribute of value type 'Email' +eo.custom.emailvalue = "email@demandware.com"; +var e : String = eo.custom.emailvalue; + +// attribute of value type 'Text' +eo.custom.tvalue = "laaaaaaaaaaaarge text"; +var t : String = eo.custom.tvalue; + +// attribute of value type 'Date' +eo.custom.dtvalue = new Date; +var date : Date = eo.custom.dtvalue; +``` + + + + + +Setting and retrieving the values for multi-value attributes is also +straightforward and uses ECMA arrays to represent the multiple values. Set-of +attributes and enum-of attributes are handled in a very similar manner. The +chief difference is that enum-of attributes are limited to a prescribed set +of value definitions whereas set-of attributes are open-ended. Furthermore, +each value in an enum-of attribute has a value and a display name which +affects the retrieval logic. + +Multi-value attributes are returned as an array. This array is read-only and +can't be used to update the multi-value attribute. To update the multi-value +attribute an array with new values must be assigned to the attribute. + + + + + +``` +// attribute of value type 'Set of String' +// set the attribute value only if it hasn't been already set +if( !('setofstringvalue' in eo.custom) ) +{ + eo.custom.setofstringvalue = new Array("abc","def","ghi"); +} + +// returns an Array of String instances +var setofstring : Array = eo.custom.setofstringvalue; +var s1 : String = setofstring[0]; +var s2 : String = setofstring[1]; +var s3 : String = setofstring[2]; + +// attribute of value type 'Enum of Integer' with multi-value handling +eo.custom.enumofintmultivalue = new Array(1, 2, 3); + +// returns an Array of EnumValue instances +var enumofintmulti : Array = eo.custom.enumofintmultivalue; +var value1 : Number = enumofintmulti[0].getValue(); +var displayvalue1 : String = enumofintmulti[0].getDisplayValue(); +var value2 : Number = enumofintmulti[1].getValue(); +var displayvalue2 : String = enumofintmulti[1].getDisplayValue(); +var value3 : Number = enumofintmulti[2].getValue(); +var displayvalue3 : String = enumofintmulti[2].getDisplayValue(); +``` + + + + + +For further details on the Commerce Cloud Digital attribute system, see the core +Commerce Cloud Digital documentation. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObject.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObject.md new file mode 100644 index 00000000..c9ce51f1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObject.md @@ -0,0 +1,82 @@ + +# Class CustomObject + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.object.CustomObject](dw.object.CustomObject.md) + +Represents a custom object and its corresponding attributes. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes of this object. | +| [type](#type): [String](TopLevel.String.md) `(read-only)` | Returns the type of the CustomObject. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCustom](dw.object.CustomObject.md#getcustom)() | Returns the custom attributes of this object. | +| [getType](dw.object.CustomObject.md#gettype)() | Returns the type of the CustomObject. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes of this + object. + + + +--- + +### type +- type: [String](TopLevel.String.md) `(read-only)` + - : Returns the type of the CustomObject. + + +--- + +## Method Details + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes of this + object. + + + **Returns:** + - the custom attributes of this + object. + + + +--- + +### getType() +- getType(): [String](TopLevel.String.md) + - : Returns the type of the CustomObject. + + **Returns:** + - the type of the CustomObject. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObjectMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObjectMgr.md new file mode 100644 index 00000000..2607768e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.CustomObjectMgr.md @@ -0,0 +1,478 @@ + +# Class CustomObjectMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.CustomObjectMgr](dw.object.CustomObjectMgr.md) + +Manager class which provides methods for creating, retrieving, deleting, +and searching for custom objects. + + +To search for system objects, use [SystemObjectMgr](dw.object.SystemObjectMgr.md). + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [createCustomObject](dw.object.CustomObjectMgr.md#createcustomobjectstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns a new custom object instance of the specified type, using the given key value. | +| static [createCustomObject](dw.object.CustomObjectMgr.md#createcustomobjectstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns a new custom object instance of the specified type, using the given key value. | +| static [describe](dw.object.CustomObjectMgr.md#describestring)([String](TopLevel.String.md)) | Returns the meta data for the given type. | +| static [getAllCustomObjects](dw.object.CustomObjectMgr.md#getallcustomobjectsstring)([String](TopLevel.String.md)) | Returns all custom objects of a specific type. | +| static [getCustomObject](dw.object.CustomObjectMgr.md#getcustomobjectstring-number)([String](TopLevel.String.md), [Number](TopLevel.Number.md)) | Returns a custom object based on it's type and unique key. | +| static [getCustomObject](dw.object.CustomObjectMgr.md#getcustomobjectstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns a custom object based on it's type and unique key. | +| static [queryCustomObject](dw.object.CustomObjectMgr.md#querycustomobjectstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) |

          Searches for a single custom object instance. | +| static [queryCustomObjects](dw.object.CustomObjectMgr.md#querycustomobjectsstring-map-string)([String](TopLevel.String.md), [Map](dw.util.Map.md), [String](TopLevel.String.md)) |

          Searches for custom object instances. | +| static [queryCustomObjects](dw.object.CustomObjectMgr.md#querycustomobjectsstring-string-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) | Searches for custom object instances. | +| static [remove](dw.object.CustomObjectMgr.md#removecustomobject)([CustomObject](dw.object.CustomObject.md)) | Removes a given custom object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### createCustomObject(String, Number) +- static createCustomObject(type: [String](TopLevel.String.md), keyValue: [Number](TopLevel.Number.md)): [CustomObject](dw.object.CustomObject.md) + - : Returns a new custom object instance of the specified type, using the + given key value. Custom object keys need to be unique for custom object + type. + + + **Parameters:** + - type - The unique name of the custom object type. + - keyValue - The unique key value for the instance. + + **Returns:** + - The newly created custom object instance. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### createCustomObject(String, String) +- static createCustomObject(type: [String](TopLevel.String.md), keyValue: [String](TopLevel.String.md)): [CustomObject](dw.object.CustomObject.md) + - : Returns a new custom object instance of the specified type, using the + given key value. Custom object keys need to be unique for custom object + type. + + + **Parameters:** + - type - The unique name of the custom object type. + - keyValue - The unique key value for the instance. + + **Returns:** + - The newly created custom object instance. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### describe(String) +- static describe(type: [String](TopLevel.String.md)): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : Returns the meta data for the given type. + + **Parameters:** + - type - the type whose meta data is returned. + + **Returns:** + - the meta data for the given type. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### getAllCustomObjects(String) +- static getAllCustomObjects(type: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all custom objects of a specific type. + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - type - The name of the custom object type. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### getCustomObject(String, Number) +- static getCustomObject(type: [String](TopLevel.String.md), keyValue: [Number](TopLevel.Number.md)): [CustomObject](dw.object.CustomObject.md) + - : Returns a custom object based on it's type and unique key. + + **Parameters:** + - type - The name of the custom object type. + - keyValue - The unique key value. + + **Returns:** + - The matching custom object instance or `null` in case + no matching custom object instance could be found. + + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### getCustomObject(String, String) +- static getCustomObject(type: [String](TopLevel.String.md), keyValue: [String](TopLevel.String.md)): [CustomObject](dw.object.CustomObject.md) + - : Returns a custom object based on it's type and unique key. + + **Parameters:** + - type - The name of the custom object type. + - keyValue - The unique key value. + + **Returns:** + - The matching custom object instance or `null` in case + no matching custom object instance could be found. + + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### queryCustomObject(String, String, Object...) +- static queryCustomObject(type: [String](TopLevel.String.md), queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [CustomObject](dw.object.CustomObject.md) + - : + + Searches for a single custom object instance. + + + The search can be configured using a simple query language, which provides most common filter and operator + functionality. + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + The following **operators** are supported in a condition: + + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Case-independent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + The query language provides a placeholder syntax to pass objects as additional search parameters. Each passed + object is related to a placeholder in the query string. The placeholder must be an Integer that is surrounded by + braces. The first Integer value must be '0', the second '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + If there is more than one object matching the specified query criteria, the result is not deterministic. In order + to retrieve a single object from a sorted result set it is recommended to use the following code: + `queryCustomObjects("", "custom.myAttr asc", null).first()`. The method `first()` returns + only the next element and closes the iterator. + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: + + - Get the custom objects using this method with non-localized attributes query. + - Access the `obj.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the custom object type for the query. + - queryString - the actual query. + - args - optional parameters for the queryString. + + **Returns:** + - the custom object defined by `type` which was found when executing the + `queryString`. + + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + +--- + +### queryCustomObjects(String, Map, String) +- static queryCustomObjects(type: [String](TopLevel.String.md), queryAttributes: [Map](dw.util.Map.md), sortString: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + + Searches for custom object instances. + + + The search can be configured with a map, which key-value pairs are converted into a query expression. The + key-value pairs are turned into a sequence of '=' or 'like' conditions, which are combined with AND statements. + + + Example: + + A map with the key/value pairs: _'name'/'tom\*', 'age'/66_ will be converted as follows: + `"name like 'tom*' and age = 66"` + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + The **sorting** parameter is optional and may contain a comma separated list of attribute names to sort by. + Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default + sorting directions is ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is currently not supported. + + + It is strongly recommended to call `close()` on the returned SeekableIterator if not all of its + elements are being retrieved. This will ensure the proper cleanup of system resources. + + + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: + + - Get the custom objects using this method with non-localized attributes query. + - Access the `obj.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the custom object type for the query. + - queryAttributes - key-value pairs, which define the query. + - sortString - an optional sorting or null if no sorting is necessary. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### queryCustomObjects(String, String, String, Object...) +- static queryCustomObjects(type: [String](TopLevel.String.md), queryString: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Searches for custom object instances. + + + The search can be configured using a simple query language, which provides most common filter and operator + functionality. + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + The following **operators** are supported in a condition: + + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + The query language provides a placeholder syntax to pass objects as additional search parameters. Each passed + object is related to a placeholder in the query string. The placeholder must be an Integer that is surrounded by + braces. The first Integer value must be '0', the second '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + The **sorting** parameter is optional and may contain a comma separated list of attribute names to sort by. + Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default + sorting directions is ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is currently not supported. + + + Sometimes it is desired to get all instances of specified type with a special sorting condition. This can be + easily done by providing the 'type' of the custom object and the 'sortString' in combination with an empty + 'queryString', e.g. `queryCustomObjects("sample", "", "custom.myAttr asc")` + + + It is strongly recommended to call `close()` on the returned SeekableIterator if not all of its + elements are being retrieved. This will ensure the proper cleanup of system resources. + + + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: + + - Get the custom objects using this method with non-localized attributes query. + - Access the `obj.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the custom object type for the query. + - queryString - the actual query. + - sortString - an optional sorting or null if no sorting is necessary. + - args - optional parameters for the queryString. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **Throws:** + - IllegalArgumentException - if the given type is invalid + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### remove(CustomObject) +- static remove(object: [CustomObject](dw.object.CustomObject.md)): void + - : Removes a given custom object. + + **Parameters:** + - object - the custom object to remove, must not be null. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.Extensible.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.Extensible.md new file mode 100644 index 00000000..d160644c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.Extensible.md @@ -0,0 +1,71 @@ + +# Class Extensible + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + +Base class alternative to ExtensibleObject for objects customizable through the metadata system. +Similar to ExtensibleObject: the [describe()](dw.object.Extensible.md#describe) method provides access to the related object-type metadata. +The [getCustom()](dw.object.Extensible.md#getcustom) method is the central point to retrieve and store the objects attribute +values themselves. + + + +## All Known Subclasses +[AbstractItem](dw.order.AbstractItem.md), [AbstractItemCtnr](dw.order.AbstractItemCtnr.md), [Appeasement](dw.order.Appeasement.md), [AppeasementItem](dw.order.AppeasementItem.md), [Invoice](dw.order.Invoice.md), [InvoiceItem](dw.order.InvoiceItem.md), [Return](dw.order.Return.md), [ReturnCase](dw.order.ReturnCase.md), [ReturnCaseItem](dw.order.ReturnCaseItem.md), [ReturnItem](dw.order.ReturnItem.md), [ShippingOrder](dw.order.ShippingOrder.md), [ShippingOrderItem](dw.order.ShippingOrderItem.md), [TrackingInfo](dw.order.TrackingInfo.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this object. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [describe](dw.object.Extensible.md#describe)() | Returns the meta data of this object. | +| [getCustom](dw.object.Extensible.md#getcustom)() | Returns the custom attributes for this object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this object. + + +--- + +## Method Details + +### describe() +- describe(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : 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. + + + **Returns:** + - the meta data of this object. If no meta data is available the + method returns null. + + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this object. + + **Returns:** + - the custom attributes for this object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ExtensibleObject.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ExtensibleObject.md new file mode 100644 index 00000000..d04984b0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ExtensibleObject.md @@ -0,0 +1,85 @@ + +# Class ExtensibleObject + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + +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. + + + +## All Known Subclasses +[ActiveData](dw.object.ActiveData.md), [Basket](dw.order.Basket.md), [BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md), [Campaign](dw.campaign.Campaign.md), [Catalog](dw.catalog.Catalog.md), [Category](dw.catalog.Category.md), [CategoryAssignment](dw.catalog.CategoryAssignment.md), [Content](dw.content.Content.md), [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md), [CouponLineItem](dw.order.CouponLineItem.md), [CustomObject](dw.object.CustomObject.md), [CustomerActiveData](dw.customer.CustomerActiveData.md), [CustomerAddress](dw.customer.CustomerAddress.md), [CustomerGroup](dw.customer.CustomerGroup.md), [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md), [EncryptedObject](dw.customer.EncryptedObject.md), [Folder](dw.content.Folder.md), [GiftCertificate](dw.order.GiftCertificate.md), [GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md), [Library](dw.content.Library.md), [LineItem](dw.order.LineItem.md), [LineItemCtnr](dw.order.LineItemCtnr.md), [Order](dw.order.Order.md), [OrderAddress](dw.order.OrderAddress.md), [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [OrganizationPreferences](dw.system.OrganizationPreferences.md), [PaymentCard](dw.order.PaymentCard.md), [PaymentInstrument](dw.order.PaymentInstrument.md), [PaymentMethod](dw.order.PaymentMethod.md), [PaymentProcessor](dw.order.PaymentProcessor.md), [PaymentTransaction](dw.order.PaymentTransaction.md), [PriceAdjustment](dw.order.PriceAdjustment.md), [PriceBook](dw.catalog.PriceBook.md), [Product](dw.catalog.Product.md), [ProductActiveData](dw.catalog.ProductActiveData.md), [ProductInventoryList](dw.catalog.ProductInventoryList.md), [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md), [ProductLineItem](dw.order.ProductLineItem.md), [ProductList](dw.customer.ProductList.md), [ProductListItem](dw.customer.ProductListItem.md), [ProductListItemPurchase](dw.customer.ProductListItemPurchase.md), [ProductListRegistrant](dw.customer.ProductListRegistrant.md), [ProductOption](dw.catalog.ProductOption.md), [ProductOptionValue](dw.catalog.ProductOptionValue.md), [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md), [ProductShippingLineItem](dw.order.ProductShippingLineItem.md), [Profile](dw.customer.Profile.md), [Promotion](dw.campaign.Promotion.md), [Recommendation](dw.catalog.Recommendation.md), [SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md), [ServiceConfig](dw.svc.ServiceConfig.md), [ServiceCredential](dw.svc.ServiceCredential.md), [ServiceProfile](dw.svc.ServiceProfile.md), [Shipment](dw.order.Shipment.md), [ShippingLineItem](dw.order.ShippingLineItem.md), [ShippingMethod](dw.order.ShippingMethod.md), [SitePreferences](dw.system.SitePreferences.md), [SourceCodeGroup](dw.campaign.SourceCodeGroup.md), [Store](dw.catalog.Store.md), [StoreGroup](dw.catalog.StoreGroup.md), [Variant](dw.catalog.Variant.md), [VariationGroup](dw.catalog.VariationGroup.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this object. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [describe](dw.object.ExtensibleObject.md#describe)() | Returns the meta data of this object. | +| [getCustom](dw.object.ExtensibleObject.md#getcustom)() | Returns the custom attributes for this object. | + +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this object. The returned object is + used for retrieving and storing attribute values. See + [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for + working with custom attributes. + + + +--- + +## Method Details + +### describe() +- describe(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : 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. + + + **Returns:** + - the meta data of this object. If no meta data is available the + method returns null. + + + +--- + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this object. The returned object is + used for retrieving and storing attribute values. See + [CustomAttributes](dw.object.CustomAttributes.md) for a detailed example of the syntax for + working with custom attributes. + + + **Returns:** + - the custom attributes for this object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.Note.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.Note.md new file mode 100644 index 00000000..1572b789 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.Note.md @@ -0,0 +1,118 @@ + +# Class Note + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Note](dw.object.Note.md) + +Represents a note that can be attached to any persistent object +that supports this feature. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [createdBy](#createdby): [String](TopLevel.String.md) `(read-only)` | Return the login ID of user that is stored in the session at the time the note is created. | +| [creationDate](#creationdate): [Date](TopLevel.Date.md) `(read-only)` | Return the date and time that the note was created. | +| [subject](#subject): [String](TopLevel.String.md) `(read-only)` | Return the subject of the note. | +| [text](#text): [String](TopLevel.String.md) `(read-only)` | Return the text of the note. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCreatedBy](dw.object.Note.md#getcreatedby)() | Return the login ID of user that is stored in the session at the time the note is created. | +| [getCreationDate](dw.object.Note.md#getcreationdate)() | Return the date and time that the note was created. | +| [getSubject](dw.object.Note.md#getsubject)() | Return the subject of the note. | +| [getText](dw.object.Note.md#gettext)() | Return the text of the note. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### createdBy +- createdBy: [String](TopLevel.String.md) `(read-only)` + - : Return the login ID of user that is stored in the session at the time + the note is created. + + + +--- + +### creationDate +- creationDate: [Date](TopLevel.Date.md) `(read-only)` + - : 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. + + + +--- + +### subject +- subject: [String](TopLevel.String.md) `(read-only)` + - : Return the subject of the note. + + +--- + +### text +- text: [String](TopLevel.String.md) `(read-only)` + - : Return the text of the note. + + +--- + +## Method Details + +### getCreatedBy() +- getCreatedBy(): [String](TopLevel.String.md) + - : Return the login ID of user that is stored in the session at the time + the note is created. + + + **Returns:** + - the username. + + +--- + +### getCreationDate() +- getCreationDate(): [Date](TopLevel.Date.md) + - : 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. + + + **Returns:** + - the creation date. + + +--- + +### getSubject() +- getSubject(): [String](TopLevel.String.md) + - : Return the subject of the note. + + **Returns:** + - the subject. + + +--- + +### getText() +- getText(): [String](TopLevel.String.md) + - : Return the text of the note. + + **Returns:** + - the text. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeDefinition.md new file mode 100644 index 00000000..3c35e098 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeDefinition.md @@ -0,0 +1,542 @@ + +# Class ObjectAttributeDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) + +Represents the definition of an object's attribute. + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [VALUE_TYPE_BOOLEAN](#value_type_boolean): [Number](TopLevel.Number.md) = 8 | Boolean value type. | +| [VALUE_TYPE_DATE](#value_type_date): [Number](TopLevel.Number.md) = 6 | Date value type. | +| [VALUE_TYPE_DATETIME](#value_type_datetime): [Number](TopLevel.Number.md) = 11 | Date and Time value type. | +| [VALUE_TYPE_EMAIL](#value_type_email): [Number](TopLevel.Number.md) = 12 | Email value type. | +| [VALUE_TYPE_ENUM_OF_INT](#value_type_enum_of_int): [Number](TopLevel.Number.md) = 31 | Enum of int value type. | +| [VALUE_TYPE_ENUM_OF_STRING](#value_type_enum_of_string): [Number](TopLevel.Number.md) = 33 | Enum of String value type. | +| [VALUE_TYPE_HTML](#value_type_html): [Number](TopLevel.Number.md) = 5 | HTML value type. | +| [VALUE_TYPE_IMAGE](#value_type_image): [Number](TopLevel.Number.md) = 7 | Image value type. | +| [VALUE_TYPE_INT](#value_type_int): [Number](TopLevel.Number.md) = 1 | int value type. | +| [VALUE_TYPE_MONEY](#value_type_money): [Number](TopLevel.Number.md) = 9 | Money value type. | +| [VALUE_TYPE_NUMBER](#value_type_number): [Number](TopLevel.Number.md) = 2 | Number value type. | +| [VALUE_TYPE_PASSWORD](#value_type_password): [Number](TopLevel.Number.md) = 13 | Password value type. | +| [VALUE_TYPE_QUANTITY](#value_type_quantity): [Number](TopLevel.Number.md) = 10 | Quantity value type. | +| [VALUE_TYPE_SET_OF_INT](#value_type_set_of_int): [Number](TopLevel.Number.md) = 21 | Set of int value type. | +| [VALUE_TYPE_SET_OF_NUMBER](#value_type_set_of_number): [Number](TopLevel.Number.md) = 22 | Set of Number value type. | +| [VALUE_TYPE_SET_OF_STRING](#value_type_set_of_string): [Number](TopLevel.Number.md) = 23 | Set of String value type. | +| [VALUE_TYPE_STRING](#value_type_string): [Number](TopLevel.Number.md) = 3 | String value type. | +| [VALUE_TYPE_TEXT](#value_type_text): [Number](TopLevel.Number.md) = 4 | Text value type. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the attribute definition. | +| [attributeGroups](#attributegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns all attribute groups the attribute is assigned to. | +| [defaultValue](#defaultvalue): [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md) `(read-only)` | Return the default value for the attribute or null if none is defined. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name for the attribute, which can be used in the user interface. | +| [key](#key): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the attribute represents the primary key of the object. | +| [mandatory](#mandatory): [Boolean](TopLevel.Boolean.md) `(read-only)` | Checks if this attribute is mandatory. | +| [multiValueType](#multivaluetype): [Boolean](TopLevel.Boolean.md) `(read-only)` |

          Returns `true` if the attribute can have multiple values. | +| [objectTypeDefinition](#objecttypedefinition): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) `(read-only)` | Returns the object type definition in which this attribute is defined. | +| ~~[setValueType](#setvaluetype): [Boolean](TopLevel.Boolean.md)~~ `(read-only)` | Returns `true` if the attribute is of type 'Set of'. | +| [system](#system): [Boolean](TopLevel.Boolean.md) `(read-only)` | Indicates if the attribute is a pre-defined system attribute or a custom attribute. | +| [unit](#unit): [String](TopLevel.String.md) `(read-only)` | Returns the attribute's unit representation such as inches for length or pounds for weight. | +| [valueTypeCode](#valuetypecode): [Number](TopLevel.Number.md) `(read-only)` | Returns a code for the data type stored in the attribute. | +| [values](#values): [Collection](dw.util.Collection.md) `(read-only)` | Returns the list of attribute values. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeGroups](dw.object.ObjectAttributeDefinition.md#getattributegroups)() | Returns all attribute groups the attribute is assigned to. | +| [getDefaultValue](dw.object.ObjectAttributeDefinition.md#getdefaultvalue)() | Return the default value for the attribute or null if none is defined. | +| [getDisplayName](dw.object.ObjectAttributeDefinition.md#getdisplayname)() | Returns the display name for the attribute, which can be used in the user interface. | +| [getID](dw.object.ObjectAttributeDefinition.md#getid)() | Returns the ID of the attribute definition. | +| [getObjectTypeDefinition](dw.object.ObjectAttributeDefinition.md#getobjecttypedefinition)() | Returns the object type definition in which this attribute is defined. | +| [getUnit](dw.object.ObjectAttributeDefinition.md#getunit)() | Returns the attribute's unit representation such as inches for length or pounds for weight. | +| [getValueTypeCode](dw.object.ObjectAttributeDefinition.md#getvaluetypecode)() | Returns a code for the data type stored in the attribute. | +| [getValues](dw.object.ObjectAttributeDefinition.md#getvalues)() | Returns the list of attribute values. | +| [isKey](dw.object.ObjectAttributeDefinition.md#iskey)() | Identifies if the attribute represents the primary key of the object. | +| [isMandatory](dw.object.ObjectAttributeDefinition.md#ismandatory)() | Checks if this attribute is mandatory. | +| [isMultiValueType](dw.object.ObjectAttributeDefinition.md#ismultivaluetype)() |

          Returns `true` if the attribute can have multiple values. | +| ~~[isSetValueType](dw.object.ObjectAttributeDefinition.md#issetvaluetype)()~~ | Returns `true` if the attribute is of type 'Set of'. | +| [isSystem](dw.object.ObjectAttributeDefinition.md#issystem)() | Indicates if the attribute is a pre-defined system attribute or a custom attribute. | +| [requiresEncoding](dw.object.ObjectAttributeDefinition.md#requiresencoding)() | Returns a boolean flag indicating whether or not values of this attribute definition should be encoded using the encoding="off" flag in ISML templates. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### VALUE_TYPE_BOOLEAN + +- VALUE_TYPE_BOOLEAN: [Number](TopLevel.Number.md) = 8 + - : Boolean value type. + + +--- + +### VALUE_TYPE_DATE + +- VALUE_TYPE_DATE: [Number](TopLevel.Number.md) = 6 + - : Date value type. + + +--- + +### VALUE_TYPE_DATETIME + +- VALUE_TYPE_DATETIME: [Number](TopLevel.Number.md) = 11 + - : Date and Time value type. + + +--- + +### VALUE_TYPE_EMAIL + +- VALUE_TYPE_EMAIL: [Number](TopLevel.Number.md) = 12 + - : Email value type. + + +--- + +### VALUE_TYPE_ENUM_OF_INT + +- VALUE_TYPE_ENUM_OF_INT: [Number](TopLevel.Number.md) = 31 + - : Enum of int value type. + + +--- + +### VALUE_TYPE_ENUM_OF_STRING + +- VALUE_TYPE_ENUM_OF_STRING: [Number](TopLevel.Number.md) = 33 + - : Enum of String value type. + + +--- + +### VALUE_TYPE_HTML + +- VALUE_TYPE_HTML: [Number](TopLevel.Number.md) = 5 + - : HTML value type. + + +--- + +### VALUE_TYPE_IMAGE + +- VALUE_TYPE_IMAGE: [Number](TopLevel.Number.md) = 7 + - : Image value type. + + +--- + +### VALUE_TYPE_INT + +- VALUE_TYPE_INT: [Number](TopLevel.Number.md) = 1 + - : int value type. + + +--- + +### VALUE_TYPE_MONEY + +- VALUE_TYPE_MONEY: [Number](TopLevel.Number.md) = 9 + - : Money value type. + + +--- + +### VALUE_TYPE_NUMBER + +- VALUE_TYPE_NUMBER: [Number](TopLevel.Number.md) = 2 + - : Number value type. + + +--- + +### VALUE_TYPE_PASSWORD + +- VALUE_TYPE_PASSWORD: [Number](TopLevel.Number.md) = 13 + - : Password value type. + + +--- + +### VALUE_TYPE_QUANTITY + +- VALUE_TYPE_QUANTITY: [Number](TopLevel.Number.md) = 10 + - : Quantity value type. + + +--- + +### VALUE_TYPE_SET_OF_INT + +- VALUE_TYPE_SET_OF_INT: [Number](TopLevel.Number.md) = 21 + - : Set of int value type. + + +--- + +### VALUE_TYPE_SET_OF_NUMBER + +- VALUE_TYPE_SET_OF_NUMBER: [Number](TopLevel.Number.md) = 22 + - : Set of Number value type. + + +--- + +### VALUE_TYPE_SET_OF_STRING + +- VALUE_TYPE_SET_OF_STRING: [Number](TopLevel.Number.md) = 23 + - : Set of String value type. + + +--- + +### VALUE_TYPE_STRING + +- VALUE_TYPE_STRING: [Number](TopLevel.Number.md) = 3 + - : String value type. + + +--- + +### VALUE_TYPE_TEXT + +- VALUE_TYPE_TEXT: [Number](TopLevel.Number.md) = 4 + - : Text value type. + + +--- + +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the attribute definition. + + +--- + +### attributeGroups +- attributeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all attribute groups the attribute is assigned to. + + +--- + +### defaultValue +- defaultValue: [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md) `(read-only)` + - : Return the default value for the attribute or null if none is defined. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name for the attribute, which can be used in the + user interface. + + + +--- + +### key +- key: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the attribute represents the primary key of the object. + + +--- + +### mandatory +- mandatory: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Checks if this attribute is mandatory. + + +--- + +### multiValueType +- multiValueType: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : + Returns `true` if the attribute can have multiple values. + + + Attributes of the following types are multi-value capable: + + + - [VALUE_TYPE_SET_OF_INT](dw.object.ObjectAttributeDefinition.md#value_type_set_of_int) + - [VALUE_TYPE_SET_OF_NUMBER](dw.object.ObjectAttributeDefinition.md#value_type_set_of_number) + - [VALUE_TYPE_SET_OF_STRING](dw.object.ObjectAttributeDefinition.md#value_type_set_of_string) + + + Additionally, attributes of the following types can be multi-value + enabled: + + + - [VALUE_TYPE_ENUM_OF_INT](dw.object.ObjectAttributeDefinition.md#value_type_enum_of_int) + - [VALUE_TYPE_ENUM_OF_STRING](dw.object.ObjectAttributeDefinition.md#value_type_enum_of_string) + + + +--- + +### objectTypeDefinition +- objectTypeDefinition: [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) `(read-only)` + - : Returns the object type definition in which this attribute is defined. + + +--- + +### setValueType +- ~~setValueType: [Boolean](TopLevel.Boolean.md)~~ `(read-only)` + - : Returns `true` if the attribute is of type 'Set of'. + + **Deprecated:** +:::warning +Use [isMultiValueType()](dw.object.ObjectAttributeDefinition.md#ismultivaluetype) instead. +::: + +--- + +### system +- system: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Indicates if the attribute is a pre-defined system attribute + or a custom attribute. + + + +--- + +### unit +- unit: [String](TopLevel.String.md) `(read-only)` + - : Returns the attribute's unit representation such as + inches for length or pounds for weight. The value returned by + this method is based on the attribute itself. + + + +--- + +### valueTypeCode +- valueTypeCode: [Number](TopLevel.Number.md) `(read-only)` + - : Returns a code for the data type stored in the attribute. See constants + defined in this class. + + + +--- + +### values +- values: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the list of attribute values. In the user interface only the + values specified in this list should be offered as valid input values. + + The collection contains instances of ObjectAttributeValueDefinition. + + + +--- + +## Method Details + +### getAttributeGroups() +- getAttributeGroups(): [Collection](dw.util.Collection.md) + - : Returns all attribute groups the attribute is assigned to. + + **Returns:** + - all attribute groups the attribute is assigned to. + + +--- + +### getDefaultValue() +- getDefaultValue(): [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md) + - : Return the default value for the attribute or null if none is defined. + + **Returns:** + - the default value for the attribute or null if none is defined. + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name for the attribute, which can be used in the + user interface. + + + **Returns:** + - the display name for the attribute, which can be used in the + user interface. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of the attribute definition. + + **Returns:** + - the ID of the attribute definition. + + +--- + +### getObjectTypeDefinition() +- getObjectTypeDefinition(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : Returns the object type definition in which this attribute is defined. + + **Returns:** + - the object type definition in which this attribute is defined. + + +--- + +### getUnit() +- getUnit(): [String](TopLevel.String.md) + - : Returns the attribute's unit representation such as + inches for length or pounds for weight. The value returned by + this method is based on the attribute itself. + + + **Returns:** + - the attribute's unit representation such as + inches for length or pounds for weight. + + + +--- + +### getValueTypeCode() +- getValueTypeCode(): [Number](TopLevel.Number.md) + - : Returns a code for the data type stored in the attribute. See constants + defined in this class. + + + **Returns:** + - a code for the data type stored in the attribute. See constants + defined in this class. + + + +--- + +### getValues() +- getValues(): [Collection](dw.util.Collection.md) + - : Returns the list of attribute values. In the user interface only the + values specified in this list should be offered as valid input values. + + The collection contains instances of ObjectAttributeValueDefinition. + + + **Returns:** + - a collection of ObjectAttributeValueDefinition instances representing + the list of attribute values, or null if no values are specified. + + + +--- + +### isKey() +- isKey(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the attribute represents the primary key of the object. + + **Returns:** + - true if the attribute represents the primary key, false otherwise. + + +--- + +### isMandatory() +- isMandatory(): [Boolean](TopLevel.Boolean.md) + - : Checks if this attribute is mandatory. + + **Returns:** + - true, if this attribute is mandatory + + +--- + +### isMultiValueType() +- isMultiValueType(): [Boolean](TopLevel.Boolean.md) + - : + Returns `true` if the attribute can have multiple values. + + + Attributes of the following types are multi-value capable: + + + - [VALUE_TYPE_SET_OF_INT](dw.object.ObjectAttributeDefinition.md#value_type_set_of_int) + - [VALUE_TYPE_SET_OF_NUMBER](dw.object.ObjectAttributeDefinition.md#value_type_set_of_number) + - [VALUE_TYPE_SET_OF_STRING](dw.object.ObjectAttributeDefinition.md#value_type_set_of_string) + + + Additionally, attributes of the following types can be multi-value + enabled: + + + - [VALUE_TYPE_ENUM_OF_INT](dw.object.ObjectAttributeDefinition.md#value_type_enum_of_int) + - [VALUE_TYPE_ENUM_OF_STRING](dw.object.ObjectAttributeDefinition.md#value_type_enum_of_string) + + + **Returns:** + - `true` if attributes can have multiple values, + otherwise `false` + + + +--- + +### isSetValueType() +- ~~isSetValueType(): [Boolean](TopLevel.Boolean.md)~~ + - : Returns `true` if the attribute is of type 'Set of'. + + **Deprecated:** +:::warning +Use [isMultiValueType()](dw.object.ObjectAttributeDefinition.md#ismultivaluetype) instead. +::: + +--- + +### isSystem() +- isSystem(): [Boolean](TopLevel.Boolean.md) + - : Indicates if the attribute is a pre-defined system attribute + or a custom attribute. + + + **Returns:** + - true if the the attribute is a pre-defined system attribute, + false if it is a custom attribute. + + + +--- + +### requiresEncoding() +- requiresEncoding(): [Boolean](TopLevel.Boolean.md) + - : Returns a boolean flag indicating whether or not values of this attribute + definition should be encoded using the encoding="off" flag in ISML + templates. + + + **Returns:** + - a boolean flag indicating whether or not values of this attribute + definition should be encoded using the encoding="off" flag in ISML + templates. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeGroup.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeGroup.md new file mode 100644 index 00000000..77abae2b --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeGroup.md @@ -0,0 +1,160 @@ + +# Class ObjectAttributeGroup + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md) + +Represents a group of object attributes. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the ID of this group. | +| [attributeDefinitions](#attributedefinitions): [Collection](dw.util.Collection.md) `(read-only)` | Returns all attribute definitions for this group. | +| [description](#description): [String](TopLevel.String.md) `(read-only)` | Returns the description of this group in the current locale. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name of this group. | +| [objectTypeDefinition](#objecttypedefinition): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) `(read-only)` | Returns the object type definition to which this attribute group belongs. | +| [system](#system): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this is an sytem or a custom attribute group. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeDefinitions](dw.object.ObjectAttributeGroup.md#getattributedefinitions)() | Returns all attribute definitions for this group. | +| [getDescription](dw.object.ObjectAttributeGroup.md#getdescription)() | Returns the description of this group in the current locale. | +| [getDisplayName](dw.object.ObjectAttributeGroup.md#getdisplayname)() | Returns the display name of this group. | +| [getID](dw.object.ObjectAttributeGroup.md#getid)() | Returns the ID of this group. | +| [getObjectTypeDefinition](dw.object.ObjectAttributeGroup.md#getobjecttypedefinition)() | Returns the object type definition to which this attribute group belongs. | +| [isSystem](dw.object.ObjectAttributeGroup.md#issystem)() | Identifies if this is an sytem or a custom attribute group. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of this group. + + +--- + +### attributeDefinitions +- attributeDefinitions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all attribute definitions for this group. The collection + may contain both system attribute definition as well as custom + attribute definitions. + + + +--- + +### description +- description: [String](TopLevel.String.md) `(read-only)` + - : Returns the description of this group in the current locale. + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name of this group. + + +--- + +### objectTypeDefinition +- objectTypeDefinition: [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) `(read-only)` + - : Returns the object type definition to which this attribute group + belongs. + + + +--- + +### system +- system: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this is an sytem or a custom attribute group. A system + attribute group is pre-defined and can not be deleted. + + + +--- + +## Method Details + +### getAttributeDefinitions() +- getAttributeDefinitions(): [Collection](dw.util.Collection.md) + - : Returns all attribute definitions for this group. The collection + may contain both system attribute definition as well as custom + attribute definitions. + + + **Returns:** + - all attribute definitions for this group. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description of this group in the current locale. + + **Returns:** + - the display name of this group. + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name of this group. + + **Returns:** + - the display name of this group. + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the ID of this group. + + **Returns:** + - the ID of this group. + + +--- + +### getObjectTypeDefinition() +- getObjectTypeDefinition(): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : Returns the object type definition to which this attribute group + belongs. + + + **Returns:** + - the object type definition to which this attribute group + belongs. + + + +--- + +### isSystem() +- isSystem(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this is an sytem or a custom attribute group. A system + attribute group is pre-defined and can not be deleted. + + + **Returns:** + - true if this is a system attribute group, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeValueDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeValueDefinition.md new file mode 100644 index 00000000..b3b62a54 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectAttributeValueDefinition.md @@ -0,0 +1,78 @@ + +# Class ObjectAttributeValueDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md) + +Represents the value definition associated with an +object attribute. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [displayValue](#displayvalue): [String](TopLevel.String.md) `(read-only)` | Returns a display name that can be used to present this value in the user interface. | +| [value](#value): [Object](TopLevel.Object.md) `(read-only)` | Returns the actual value for the attribute. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getDisplayValue](dw.object.ObjectAttributeValueDefinition.md#getdisplayvalue)() | Returns a display name that can be used to present this value in the user interface. | +| [getValue](dw.object.ObjectAttributeValueDefinition.md#getvalue)() | Returns the actual value for the attribute. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### displayValue +- displayValue: [String](TopLevel.String.md) `(read-only)` + - : Returns a display name that can be used to present this value in + the user interface. For example, the value might be '1' but the display + name might be 'Order Exported'. + + + +--- + +### value +- value: [Object](TopLevel.Object.md) `(read-only)` + - : Returns the actual value for the attribute. + + +--- + +## Method Details + +### getDisplayValue() +- getDisplayValue(): [String](TopLevel.String.md) + - : Returns a display name that can be used to present this value in + the user interface. For example, the value might be '1' but the display + name might be 'Order Exported'. + + + **Returns:** + - a display name that can be used to present this value in + the user interface. + + + +--- + +### getValue() +- getValue(): [Object](TopLevel.Object.md) + - : Returns the actual value for the attribute. + + **Returns:** + - the actual value for the attribute. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectTypeDefinition.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectTypeDefinition.md new file mode 100644 index 00000000..8378dfb4 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.ObjectTypeDefinition.md @@ -0,0 +1,239 @@ + +# Class ObjectTypeDefinition + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + +The class provides access to the meta data of a system object or custom +object. A short example should suffice to demonstrate how this metadata can +be used in a script: + + +``` +var co : CustomObject = CustomObjectMgr.getCustomObject("sample", "MyCustomObject"); + +// get the object type definition +var typeDef : ObjectTypeDefinition = co.describe(); +// get the custom object attribute definition for name "enumIntValue" +var attrDef : ObjectAttributeDefinition = typeDef.getCustomAttributeDefinition( "enumIntValue" ); +// get the collection of object attribute value definitions +var valueDefs : Collection = attrDef.getValues(); + +// return function if there are no object attribute value definitions +if(valueDefs.isEmpty()) +{ + return; +} + +var displayValue : String; +// loop over object attribute value definitions collection +for each ( var valueDef : ObjectAttributeValueDefinition in valueDefs ) +{ + if( valueDef.getValue() == co.custom.intValue ) + { + displayValue = valueDef.getDisplayValue(); + break; + } +} +``` + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [ID](#id): [String](TopLevel.String.md) `(read-only)` | Returns the type id of the business objects. | +| [attributeDefinitions](#attributedefinitions): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all declared attributes for the object. | +| [attributeGroups](#attributegroups): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all declared attribute groups. | +| [displayName](#displayname): [String](TopLevel.String.md) `(read-only)` | Returns the display name of the definition, which can be used in the user interface. | +| [system](#system): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if this object definition is for a system type or a custom type. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAttributeDefinitions](dw.object.ObjectTypeDefinition.md#getattributedefinitions)() | Returns a collection of all declared attributes for the object. | +| [getAttributeGroup](dw.object.ObjectTypeDefinition.md#getattributegroupstring)([String](TopLevel.String.md)) | Returns the attribute group with the given name within this object type definition. | +| [getAttributeGroups](dw.object.ObjectTypeDefinition.md#getattributegroups)() | Returns a collection of all declared attribute groups. | +| [getCustomAttributeDefinition](dw.object.ObjectTypeDefinition.md#getcustomattributedefinitionstring)([String](TopLevel.String.md)) | Returns the custom attribute definition with the given name. | +| [getDisplayName](dw.object.ObjectTypeDefinition.md#getdisplayname)() | Returns the display name of the definition, which can be used in the user interface. | +| [getID](dw.object.ObjectTypeDefinition.md#getid)() | Returns the type id of the business objects. | +| [getSystemAttributeDefinition](dw.object.ObjectTypeDefinition.md#getsystemattributedefinitionstring)([String](TopLevel.String.md)) | Returns the system attribute definition with the given name. | +| [isSystem](dw.object.ObjectTypeDefinition.md#issystem)() | Identifies if this object definition is for a system type or a custom type. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### ID +- ID: [String](TopLevel.String.md) `(read-only)` + - : Returns the type id of the business objects. + + +--- + +### attributeDefinitions +- attributeDefinitions: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all declared attributes for the object. + The collection contains both system and custom attributes. There might + be system and custom attribute with identical names. So the name of the + attribute is not a uniqueness criteria. Additional the isCustom() flag + must be checked. + + + +--- + +### attributeGroups +- attributeGroups: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a collection of all declared attribute groups. A attribute group + is a collection of attribute, which are typically displayed together as + a visual group. + + + +--- + +### displayName +- displayName: [String](TopLevel.String.md) `(read-only)` + - : Returns the display name of the definition, which can be used in the + user interface. + + + +--- + +### system +- system: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if this object definition is for a system type or a custom + type. + + + +--- + +## Method Details + +### getAttributeDefinitions() +- getAttributeDefinitions(): [Collection](dw.util.Collection.md) + - : Returns a collection of all declared attributes for the object. + The collection contains both system and custom attributes. There might + be system and custom attribute with identical names. So the name of the + attribute is not a uniqueness criteria. Additional the isCustom() flag + must be checked. + + + **Returns:** + - a collection of all declared attributes for the object. + + +--- + +### getAttributeGroup(String) +- getAttributeGroup(name: [String](TopLevel.String.md)): [ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md) + - : Returns the attribute group with the given name within this object + type definition. + + + **Parameters:** + - name - The name of the attribute scope to return. + + **Returns:** + - The matching attribute scope or `null` if no such + scope exists. + + + +--- + +### getAttributeGroups() +- getAttributeGroups(): [Collection](dw.util.Collection.md) + - : Returns a collection of all declared attribute groups. A attribute group + is a collection of attribute, which are typically displayed together as + a visual group. + + + **Returns:** + - a collection of all declared attribute groups. + + +--- + +### getCustomAttributeDefinition(String) +- getCustomAttributeDefinition(name: [String](TopLevel.String.md)): [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) + - : Returns the custom attribute definition with the given name. The method + returns null if no custom attribute is defined with that name. + + + **Parameters:** + - name - The unique name of the custom attribute definition within the object type. + + **Returns:** + - The matching attribute definition or `null` in + case no such definition exists. + + + +--- + +### getDisplayName() +- getDisplayName(): [String](TopLevel.String.md) + - : Returns the display name of the definition, which can be used in the + user interface. + + + **Returns:** + - the display name of the definition, which can be used in the + user interface. + + + +--- + +### getID() +- getID(): [String](TopLevel.String.md) + - : Returns the type id of the business objects. + + **Returns:** + - the type id of the business objects. + + +--- + +### getSystemAttributeDefinition(String) +- getSystemAttributeDefinition(name: [String](TopLevel.String.md)): [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) + - : Returns the system attribute definition with the given name. The method + returns null if no system attribute is defined with that name. Only + system objects have system attributes. A CustomObject has no system attributes + and so the method will always return null for a CustomObject. + + + **Parameters:** + - name - The unique name of the custom attribute definition within the object type. + + **Returns:** + - The matching attribute definition or `null` in + case no such definition exists. + + + +--- + +### isSystem() +- isSystem(): [Boolean](TopLevel.Boolean.md) + - : Identifies if this object definition is for a system type or a custom + type. + + + **Returns:** + - true if this object definition is for a system type, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.PersistentObject.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.PersistentObject.md new file mode 100644 index 00000000..8522765e --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.PersistentObject.md @@ -0,0 +1,92 @@ + +# Class PersistentObject + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + +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). + + + +## All Known Subclasses +[ABTest](dw.campaign.ABTest.md), [ABTestSegment](dw.campaign.ABTestSegment.md), [ActiveData](dw.object.ActiveData.md), [Basket](dw.order.Basket.md), [BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md), [Campaign](dw.campaign.Campaign.md), [Catalog](dw.catalog.Catalog.md), [Category](dw.catalog.Category.md), [CategoryAssignment](dw.catalog.CategoryAssignment.md), [Content](dw.content.Content.md), [ContentSearchRefinementDefinition](dw.content.ContentSearchRefinementDefinition.md), [Coupon](dw.campaign.Coupon.md), [CouponLineItem](dw.order.CouponLineItem.md), [CustomObject](dw.object.CustomObject.md), [CustomerActiveData](dw.customer.CustomerActiveData.md), [CustomerAddress](dw.customer.CustomerAddress.md), [CustomerGroup](dw.customer.CustomerGroup.md), [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md), [EncryptedObject](dw.customer.EncryptedObject.md), [ExtensibleObject](dw.object.ExtensibleObject.md), [Folder](dw.content.Folder.md), [GiftCertificate](dw.order.GiftCertificate.md), [GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md), [Library](dw.content.Library.md), [LineItem](dw.order.LineItem.md), [LineItemCtnr](dw.order.LineItemCtnr.md), [Order](dw.order.Order.md), [OrderAddress](dw.order.OrderAddress.md), [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [OrganizationPreferences](dw.system.OrganizationPreferences.md), [PaymentCard](dw.order.PaymentCard.md), [PaymentInstrument](dw.order.PaymentInstrument.md), [PaymentMethod](dw.order.PaymentMethod.md), [PaymentProcessor](dw.order.PaymentProcessor.md), [PaymentTransaction](dw.order.PaymentTransaction.md), [PriceAdjustment](dw.order.PriceAdjustment.md), [PriceBook](dw.catalog.PriceBook.md), [Product](dw.catalog.Product.md), [ProductActiveData](dw.catalog.ProductActiveData.md), [ProductInventoryList](dw.catalog.ProductInventoryList.md), [ProductInventoryRecord](dw.catalog.ProductInventoryRecord.md), [ProductLineItem](dw.order.ProductLineItem.md), [ProductList](dw.customer.ProductList.md), [ProductListItem](dw.customer.ProductListItem.md), [ProductListItemPurchase](dw.customer.ProductListItemPurchase.md), [ProductListRegistrant](dw.customer.ProductListRegistrant.md), [ProductOption](dw.catalog.ProductOption.md), [ProductOptionValue](dw.catalog.ProductOptionValue.md), [ProductSearchRefinementDefinition](dw.catalog.ProductSearchRefinementDefinition.md), [ProductShippingLineItem](dw.order.ProductShippingLineItem.md), [Profile](dw.customer.Profile.md), [Promotion](dw.campaign.Promotion.md), [Recommendation](dw.catalog.Recommendation.md), [SearchRefinementDefinition](dw.catalog.SearchRefinementDefinition.md), [ServiceConfig](dw.svc.ServiceConfig.md), [ServiceCredential](dw.svc.ServiceCredential.md), [ServiceProfile](dw.svc.ServiceProfile.md), [Shipment](dw.order.Shipment.md), [ShippingLineItem](dw.order.ShippingLineItem.md), [ShippingMethod](dw.order.ShippingMethod.md), [SitePreferences](dw.system.SitePreferences.md), [SortingOption](dw.catalog.SortingOption.md), [SortingRule](dw.catalog.SortingRule.md), [SourceCodeGroup](dw.campaign.SourceCodeGroup.md), [Store](dw.catalog.Store.md), [StoreGroup](dw.catalog.StoreGroup.md), [Variant](dw.catalog.Variant.md), [VariationGroup](dw.catalog.VariationGroup.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [UUID](#uuid): [String](TopLevel.String.md) `(read-only)` | Returns the unique universal identifier for this object. | +| [creationDate](#creationdate): [Date](TopLevel.Date.md) `(read-only)` | Returns the date that this object was created. | +| [lastModified](#lastmodified): [Date](TopLevel.Date.md) `(read-only)` | Returns the date that this object was last modified. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCreationDate](dw.object.PersistentObject.md#getcreationdate)() | Returns the date that this object was created. | +| [getLastModified](dw.object.PersistentObject.md#getlastmodified)() | Returns the date that this object was last modified. | +| [getUUID](dw.object.PersistentObject.md#getuuid)() | Returns the unique universal identifier for this object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### UUID +- UUID: [String](TopLevel.String.md) `(read-only)` + - : Returns the unique universal identifier for this object. + + +--- + +### creationDate +- creationDate: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date that this object was created. + + +--- + +### lastModified +- lastModified: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the date that this object was last modified. + + +--- + +## Method Details + +### getCreationDate() +- getCreationDate(): [Date](TopLevel.Date.md) + - : Returns the date that this object was created. + + **Returns:** + - the date that this object was created. + + +--- + +### getLastModified() +- getLastModified(): [Date](TopLevel.Date.md) + - : Returns the date that this object was last modified. + + **Returns:** + - the date that this object was last modified. + + +--- + +### getUUID() +- getUUID(): [String](TopLevel.String.md) + - : Returns the unique universal identifier for this object. + + **Returns:** + - the unique universal identifier for this object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.SimpleExtensible.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.SimpleExtensible.md new file mode 100644 index 00000000..0250158c --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.SimpleExtensible.md @@ -0,0 +1,53 @@ + +# Class SimpleExtensible + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.SimpleExtensible](dw.object.SimpleExtensible.md) + +Base class alternative to ExtensibleObject for customizable objects which do not rely on the metadata system. +Unlike Extensible any custom attributes can be set on the fly and are not checked against an available list. +Similar to Extensible method [getCustom()](dw.object.SimpleExtensible.md#getcustom) is the central point to retrieve and store the objects attribute +values. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [custom](#custom): [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` | Returns the custom attributes for this object. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCustom](dw.object.SimpleExtensible.md#getcustom)() | Returns the custom attributes for this object. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### custom +- custom: [CustomAttributes](dw.object.CustomAttributes.md) `(read-only)` + - : Returns the custom attributes for this object. + + +--- + +## Method Details + +### getCustom() +- getCustom(): [CustomAttributes](dw.object.CustomAttributes.md) + - : Returns the custom attributes for this object. + + **Returns:** + - the custom attributes for this object. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.SystemObjectMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.SystemObjectMgr.md new file mode 100644 index 00000000..4bb0f7d7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.SystemObjectMgr.md @@ -0,0 +1,520 @@ + +# Class SystemObjectMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.SystemObjectMgr](dw.object.SystemObjectMgr.md) + +Manager class which provides methods for querying of system objects with +meta data using the Commerce Cloud Digital query language. See individual API methods for +details on the query language. + + +Note: Other manager classes such as [CustomerMgr](dw.customer.CustomerMgr.md), +[ProductMgr](dw.catalog.ProductMgr.md), etc provide more specific and fine-grained +querying methods that can not be achieved using the general query language. + + + +The following system object types are supported: + + +- GiftCertificate +- SourceCodeGroup +- Store +- ProductList + + +Support for the following system object types is deprecated: + + +- Order +- Profile + + +Use the search methods from [CustomerMgr](dw.customer.CustomerMgr.md) and [OrderMgr](dw.order.OrderMgr.md), +respectively for querying these types. + + +To search for custom objects, use [CustomObjectMgr](dw.object.CustomObjectMgr.md). +**Note:** this class allows access to sensitive information through +operations that retrieve the Profile and Order objects. +Pay attention to appropriate legal and regulatory requirements related to this data. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [describe](dw.object.SystemObjectMgr.md#describestring)([String](TopLevel.String.md)) | Returns the object type definition for the given system object type. | +| static [getAllSystemObjects](dw.object.SystemObjectMgr.md#getallsystemobjectsstring)([String](TopLevel.String.md)) | Returns all system objects of a specific type. | +| static [querySystemObject](dw.object.SystemObjectMgr.md#querysystemobjectstring-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) |

          Searches for a single system object instance. | +| static [querySystemObjects](dw.object.SystemObjectMgr.md#querysystemobjectsstring-map-string)([String](TopLevel.String.md), [Map](dw.util.Map.md), [String](TopLevel.String.md)) |

          Searches for system object instances. | +| static [querySystemObjects](dw.object.SystemObjectMgr.md#querysystemobjectsstring-string-string-object)([String](TopLevel.String.md), [String](TopLevel.String.md), [String](TopLevel.String.md), [Object...](TopLevel.Object.md)) |

          Searches for system object instances. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Method Details + +### describe(String) +- static describe(type: [String](TopLevel.String.md)): [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) + - : Returns the object type definition for the given system object type. + + This method can be used for all system object types that are derived from ExtensibleObject. + + + **Parameters:** + - type - system object type whose type definition should be returned + + **Returns:** + - the matching object type definition or `null` in case no + such type definition exists. + + + +--- + +### getAllSystemObjects(String) +- static getAllSystemObjects(type: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : Returns all system objects of a specific type. + The following system object types are supported: + + - GiftCertificate + - Order + - Profile + - SourceCodeGroup + - Store + - ProductList + + + + The method throws an exception in case of another system type. + + + + It is strongly recommended to call `close()` on the returned SeekableIterator + if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources. + + + **Parameters:** + - type - The name of the system object type. If a matching type definition cannot be found for the given type a MetaDataException will be thrown. + + **Returns:** + - SeekableIterator containing all system objects of a specific type. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### querySystemObject(String, String, Object...) +- static querySystemObject(type: [String](TopLevel.String.md), queryString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [PersistentObject](dw.object.PersistentObject.md) + - : + + Searches for a single system object instance. The following system object types are supported: + + + - GiftCertificate + - Order + - Profile + - SourceCodeGroup + - Store + - ProductList + + + + + + The method throws an exception in case of another system type. + + + + + The search can be configured using a simple query language, which provides most common filter and operator + functionality. + + + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + + + The following **operators** are supported in a condition: + + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + + + The query language provides a placeholder syntax to pass objects as additional search parameters. Each passed + object is related to a placeholder in the query string. The placeholder must be an Integer that is surrounded by + braces. The first Integer value must be '0', the second '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + + + If there is more than one object matching the specified query criteria, the result is not deterministic. In order + to retrieve a single object from a sorted result set it is recommended to use the following code: + `querySystemObjects("", "custom.myAttr asc", null).first()`. The method `first()` returns + only the next element and closes the iterator. + + + + + It is strongly recommended to call `close()` on the returned SeekableIterator if not all of its + elements are being processed. This will enable the cleanup of system resources. + + + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: For store objects, such a locale specific filtering can be: + + - Get the store objects using this method with non-localized attributes query. + - Access the `store.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the system object type for the query. + - queryString - the actual query. + - args - optional parameters for the queryString. + + **Returns:** + - the system object defined by `type` which was found when executing the + `queryString`. + + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### querySystemObjects(String, Map, String) +- static querySystemObjects(type: [String](TopLevel.String.md), queryAttributes: [Map](dw.util.Map.md), sortString: [String](TopLevel.String.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + + Searches for system object instances. The following system object types are supported: + + + - GiftCertificate + - Order + - Profile + - SourceCodeGroup + - Store + - ProductList + + + + + + The method throws an exception in case of another system type. + + + + + The search can be configured with a map, which key-value pairs are converted into a query expression. The + key-value pairs are turned into a sequence of '=' or 'like' conditions, which are combined with AND statements. + + + + + Example: + + A map with the key/value pairs: _'name'/'tom\*', 'age'/66_ will be converted as follows: + `"name like 'tom*' and age = 66"` + + + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + + + The **sorting** parameter is optional and may contain a comma separated list of attribute names to sort by. + Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default + sorting directions is ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is currently not supported. + + + + + It is strongly recommended to call `close()` on the returned SeekableIterator if not all of its + elements are being retrieved. This will ensure the proper cleanup of system resources. + + + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: For store objects, such a locale specific filtering can be: + + - Get the store objects using this method with non-localized attributes query. + - Access the `store.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the system object type for the query. + - queryAttributes - key-value pairs, which define the query. + - sortString - an optional sorting or null if no sorting is necessary. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + +### querySystemObjects(String, String, String, Object...) +- static querySystemObjects(type: [String](TopLevel.String.md), queryString: [String](TopLevel.String.md), sortString: [String](TopLevel.String.md), args: [Object...](TopLevel.Object.md)): [SeekableIterator](dw.util.SeekableIterator.md) + - : + + Searches for system object instances. The following system object types are supported: + + + - GiftCertificate + - Order + - Profile + - SourceCodeGroup + - Store + - ProductList + + + + + + The method throws an exception in case of another system type. + + + + + The search can be configured using a simple query language, which provides most common filter and operator + functionality. + + + + + The identifier for an **attribute** to use in a query condition is always the ID of the attribute as defined + in the type definition. For custom defined attributes the prefix custom is required in the search term (e.g. + `custom.color = {1}`), while for system attributes no prefix is used (e.g. `name = {4}`). + + + + + Supported attribute value **types** with sample expression values: + + - _String_`'String', 'Str*', 'Strin?'` + - _Integer_`1, 3E4` + - _Number_`1.0, 3.99E5` + - _Date_`yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)` + - _DateTime_`yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00` + - _Boolean_`true, false` + - _Email_`'search@demandware.com', '*@demandware.com'` + - _Set of String_`'String', 'Str*', 'Strin?'` + - _Set of Integer_`1, 3E4` + - _Set of Number_`1.0, 3.99E5` + - _Enum of String_`'String', 'Str*', 'Strin?'` + - _Enum of Integer_`1, 3E4` + + + + The following types of attributes are not queryable: + + + - _Image_ + - _HTML_ + - _Text_ + - _Quantity_ + - _Password_ + + + + Note, that some system attributes are not queryable by default regardless of the actual value type code. + + + + + The following **operators** are supported in a condition: + + + - `=`Equals - All types; supports NULL value (`thumbnail = NULL`) + - `!=`Not equals - All types; supports NULL value (`thumbnail != NULL`) + - `<`Less than - Integer, Number and Date types only + - `>`Greater than - Integer, Number and Date types only + - `<=`Less or equals than - Integer, Number and Date types only + - `>=`Greater or equals than - Integer, Number and Date types only + - `LIKE`Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(`custom.country LIKE 'US*'`) + - `ILIKE`Caseindependent Like - String types and Email only, use to support case insensitive query (`custom.country ILIKE 'usa'`), does also support wildcards for substring matching + + + + + + Conditions can be combined using logical expressions 'AND', 'OR' and 'NOT' and nested using parenthesis e.g. + `gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))`. + + + + + The query language provides a placeholder syntax to pass objects as additional search parameters. Each passed + object is related to a placeholder in the query string. The placeholder must be an Integer that is surrounded by + braces. The first Integer value must be '0', the second '1' and so on, e.g. + `querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)` + + + + + The **sorting** parameter is optional and may contain a comma separated list of attribute names to sort by. + Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default + sorting directions is ascending, if no direction was specified. + + Example: `age desc, name` + + Please note that specifying a localized custom attribute as the sorting attribute is currently not supported. + + + + + Sometimes it is desired to get all instances of specified type with a special sorting condition. This can be + easily done by providing the 'type' of the system object and the 'sortString' in combination with an empty + 'queryString', e.g. `querySystemObjects("sample", "", "ID asc")` + + + + + It is strongly recommended to call `close()` on the returned SeekableIterator if not all of its + elements are being retrieved. This will ensure the proper cleanup of system resources. + + + + + This method does not consider locale specific attributes. It returns all objects by checking the default + non-localizable attributes. Any locale specific filtering after fetching the objects must be done by other custom + code. + + Example: For store objects, such a locale specific filtering can be: + + - Get the store objects using this method with non-localized attributes query. + - Access the `store.getCustom("myattr")`. It returns the localized value of the attribute. + + + **Parameters:** + - type - the system object type for the query. + - queryString - the actual query. + - sortString - an optional sorting or null if no sorting is necessary. + - args - optional parameters for the queryString. + + **Returns:** + - SeekableIterator containing the result set of the query. + + **See Also:** + - [SeekableIterator.close()](dw.util.SeekableIterator.md#close) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.object.md b/packages/b2c-tooling-sdk/data/script-api/dw.object.md new file mode 100644 index 00000000..601a428d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.object.md @@ -0,0 +1,19 @@ +# Package dw.object + +## Classes +| Class | Description | +| --- | --- | +| [ActiveData](dw.object.ActiveData.md) | Represents the active data for an object in Commerce Cloud Digital. | +| [CustomAttributes](dw.object.CustomAttributes.md) | This class is used together with other classes that contain custom attributes and is used to read and write these attributes. | +| [CustomObject](dw.object.CustomObject.md) | Represents a custom object and its corresponding attributes. | +| [CustomObjectMgr](dw.object.CustomObjectMgr.md) | Manager class which provides methods for creating, retrieving, deleting, and searching for custom objects. | +| [Extensible](dw.object.Extensible.md) | Base class alternative to ExtensibleObject for objects customizable through the metadata system. | +| [ExtensibleObject](dw.object.ExtensibleObject.md) | Base class for all persistent business objects in Commerce Cloud Digital that are customizable through the metadata system. | +| [Note](dw.object.Note.md) | Represents a note that can be attached to any persistent object that supports this feature. | +| [ObjectAttributeDefinition](dw.object.ObjectAttributeDefinition.md) | Represents the definition of an object's attribute. | +| [ObjectAttributeGroup](dw.object.ObjectAttributeGroup.md) | Represents a group of object attributes. | +| [ObjectAttributeValueDefinition](dw.object.ObjectAttributeValueDefinition.md) | Represents the value definition associated with an object attribute. | +| [ObjectTypeDefinition](dw.object.ObjectTypeDefinition.md) | The class provides access to the meta data of a system object or custom object. | +| [PersistentObject](dw.object.PersistentObject.md) | Common base class for all objects in Commerce Cloud Digital that have an identity and can be stored and retrieved. | +| [SimpleExtensible](dw.object.SimpleExtensible.md) | Base class alternative to ExtensibleObject for customizable objects which do not rely on the metadata system. | +| [SystemObjectMgr](dw.object.SystemObjectMgr.md) | Manager class which provides methods for querying of system objects with meta data using the Commerce Cloud Digital query language. | diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItem.md new file mode 100644 index 00000000..023d6563 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItem.md @@ -0,0 +1,220 @@ + +# Class AbstractItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItem](dw.order.AbstractItem.md) + +An item which references, or in other words is based upon, an [OrderItem](dw.order.OrderItem.md). Provides methods to access the +OrderItem, the order [LineItem](dw.order.LineItem.md) which has been extended, and the [Order](dw.order.Order.md). In addition it defines +methods to access item level prices and the item id. Supports custom-properties. + + + +## All Known Subclasses +[AppeasementItem](dw.order.AppeasementItem.md), [InvoiceItem](dw.order.InvoiceItem.md), [ReturnCaseItem](dw.order.ReturnCaseItem.md), [ReturnItem](dw.order.ReturnItem.md), [ShippingOrderItem](dw.order.ShippingOrderItem.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [grossPrice](#grossprice): [Money](dw.value.Money.md) `(read-only)` | Gross price of item. | +| [itemID](#itemid): [String](TopLevel.String.md) `(read-only)` | The item-id used for referencing between items | +| [lineItem](#lineitem): [LineItem](dw.order.LineItem.md) `(read-only)` | Returns the Order Product- or Shipping- LineItem associated with this item. | +| [netPrice](#netprice): [Money](dw.value.Money.md) `(read-only)` | Net price of item. | +| [orderItem](#orderitem): [OrderItem](dw.order.OrderItem.md) `(read-only)` | Returns the order item extensions related to this item. | +| [orderItemID](#orderitemid): [String](TopLevel.String.md) `(read-only)` | The order-item-id used for referencing the [OrderItem](dw.order.OrderItem.md) | +| [tax](#tax): [Money](dw.value.Money.md) `(read-only)` | Total tax for item. | +| [taxBasis](#taxbasis): [Money](dw.value.Money.md) `(read-only)` | Price of entire item on which tax calculation is based. | +| [taxItems](#taxitems): [Collection](dw.util.Collection.md) `(read-only)` | Tax items representing a tax breakdown | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getGrossPrice](dw.order.AbstractItem.md#getgrossprice)() | Gross price of item. | +| [getItemID](dw.order.AbstractItem.md#getitemid)() | The item-id used for referencing between items | +| [getLineItem](dw.order.AbstractItem.md#getlineitem)() | Returns the Order Product- or Shipping- LineItem associated with this item. | +| [getNetPrice](dw.order.AbstractItem.md#getnetprice)() | Net price of item. | +| [getOrderItem](dw.order.AbstractItem.md#getorderitem)() | Returns the order item extensions related to this item. | +| [getOrderItemID](dw.order.AbstractItem.md#getorderitemid)() | The order-item-id used for referencing the [OrderItem](dw.order.OrderItem.md) | +| [getTax](dw.order.AbstractItem.md#gettax)() | Total tax for item. | +| [getTaxBasis](dw.order.AbstractItem.md#gettaxbasis)() | Price of entire item on which tax calculation is based. | +| [getTaxItems](dw.order.AbstractItem.md#gettaxitems)() | Tax items representing a tax breakdown | + +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### grossPrice +- grossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Gross price of item. + + +--- + +### itemID +- itemID: [String](TopLevel.String.md) `(read-only)` + - : The item-id used for referencing between items + + +--- + +### lineItem +- lineItem: [LineItem](dw.order.LineItem.md) `(read-only)` + - : Returns the Order Product- or Shipping- LineItem associated with this item. Should never return null. + + +--- + +### netPrice +- netPrice: [Money](dw.value.Money.md) `(read-only)` + - : Net price of item. + + +--- + +### orderItem +- orderItem: [OrderItem](dw.order.OrderItem.md) `(read-only)` + - : Returns the order item extensions related to this item. Should never return null. + + +--- + +### orderItemID +- orderItemID: [String](TopLevel.String.md) `(read-only)` + - : The order-item-id used for referencing the [OrderItem](dw.order.OrderItem.md) + + +--- + +### tax +- tax: [Money](dw.value.Money.md) `(read-only)` + - : Total tax for item. + + +--- + +### taxBasis +- taxBasis: [Money](dw.value.Money.md) `(read-only)` + - : Price of entire item on which tax calculation is based. Same as [getNetPrice()](dw.order.AbstractItem.md#getnetprice) + or [getGrossPrice()](dw.order.AbstractItem.md#getgrossprice) depending on whether the order is based on net or gross prices. + + + +--- + +### taxItems +- taxItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Tax items representing a tax breakdown + + **See Also:** + - [TaxItem](dw.order.TaxItem.md) + + +--- + +## Method Details + +### getGrossPrice() +- getGrossPrice(): [Money](dw.value.Money.md) + - : Gross price of item. + + **Returns:** + - Gross price of item. + + +--- + +### getItemID() +- getItemID(): [String](TopLevel.String.md) + - : The item-id used for referencing between items + + **Returns:** + - the item-id used for referencing between items + + +--- + +### getLineItem() +- getLineItem(): [LineItem](dw.order.LineItem.md) + - : Returns the Order Product- or Shipping- LineItem associated with this item. Should never return null. + + **Returns:** + - the Order Product- or Shipping- LineItem associated with this item + + +--- + +### getNetPrice() +- getNetPrice(): [Money](dw.value.Money.md) + - : Net price of item. + + **Returns:** + - Net price of item. + + +--- + +### getOrderItem() +- getOrderItem(): [OrderItem](dw.order.OrderItem.md) + - : Returns the order item extensions related to this item. Should never return null. + + **Returns:** + - the order item extensions related to this item + + +--- + +### getOrderItemID() +- getOrderItemID(): [String](TopLevel.String.md) + - : The order-item-id used for referencing the [OrderItem](dw.order.OrderItem.md) + + **Returns:** + - the order-item-id used for referencing the OrderItem + + +--- + +### getTax() +- getTax(): [Money](dw.value.Money.md) + - : Total tax for item. + + **Returns:** + - Total tax for item. + + +--- + +### getTaxBasis() +- getTaxBasis(): [Money](dw.value.Money.md) + - : Price of entire item on which tax calculation is based. Same as [getNetPrice()](dw.order.AbstractItem.md#getnetprice) + or [getGrossPrice()](dw.order.AbstractItem.md#getgrossprice) depending on whether the order is based on net or gross prices. + + + **Returns:** + - Price of entire item on which tax calculation is based + + +--- + +### getTaxItems() +- getTaxItems(): [Collection](dw.util.Collection.md) + - : Tax items representing a tax breakdown + + **Returns:** + - tax items representing a tax breakdown + + **See Also:** + - [TaxItem](dw.order.TaxItem.md) + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItemCtnr.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItemCtnr.md new file mode 100644 index 00000000..aa92e482 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.AbstractItemCtnr.md @@ -0,0 +1,219 @@ + +# Class AbstractItemCtnr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItemCtnr](dw.order.AbstractItemCtnr.md) + +Basis for item-based objects stemming from a single [Order](dw.order.Order.md), with these common +properties (Invoice is used as an example): + + +- The object has been created from an Order accessible using [getOrder()](dw.order.AbstractItemCtnr.md#getorder) +- Contains a collection of [items](dw.order.AbstractItemCtnr.md#getitems), each item related to exactly one [OrderItem](dw.order.OrderItem.md)which in turn represents an extension to one of the order [ProductLineItem](dw.order.ProductLineItem.md)or one [ShippingLineItem](dw.order.ShippingLineItem.md). Example: an [Invoice](dw.order.Invoice.md)has [InvoiceItem](dw.order.InvoiceItem.md)s +- The items hold various prices which are summed, resulting in a [product-subtotal](dw.order.AbstractItemCtnr.md#getproductsubtotal), a [service-subtotal](dw.order.AbstractItemCtnr.md#getservicesubtotal)and a [grand-total](dw.order.AbstractItemCtnr.md#getgrandtotal), each represented by a [SumItem](dw.order.SumItem.md). +- The object is customizable using custom properties + + + +## All Known Subclasses +[Appeasement](dw.order.Appeasement.md), [Invoice](dw.order.Invoice.md), [Return](dw.order.Return.md), [ReturnCase](dw.order.ReturnCase.md), [ShippingOrder](dw.order.ShippingOrder.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [createdBy](#createdby): [String](TopLevel.String.md) `(read-only)` | Created by this user. | +| [creationDate](#creationdate): [Date](TopLevel.Date.md) `(read-only)` | The time of creation. | +| [grandTotal](#grandtotal): [SumItem](dw.order.SumItem.md) `(read-only)` | Returns the sum-item representing the grandtotal for all items. | +| [items](#items): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the unsorted collection of items | +| [lastModified](#lastmodified): [Date](TopLevel.Date.md) `(read-only)` | The last modification time. | +| [modifiedBy](#modifiedby): [String](TopLevel.String.md) `(read-only)` | Last modified by this user. | +| [order](#order): [Order](dw.order.Order.md) `(read-only)` | Returns the [Order](dw.order.Order.md) this object was created for. | +| [productSubtotal](#productsubtotal): [SumItem](dw.order.SumItem.md) `(read-only)` | Returns the sum-item representing the subtotal for product items. | +| [serviceSubtotal](#servicesubtotal): [SumItem](dw.order.SumItem.md) `(read-only)` | Returns the sum-item representing the subtotal for service items such as shipping. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getCreatedBy](dw.order.AbstractItemCtnr.md#getcreatedby)() | Created by this user. | +| [getCreationDate](dw.order.AbstractItemCtnr.md#getcreationdate)() | The time of creation. | +| [getGrandTotal](dw.order.AbstractItemCtnr.md#getgrandtotal)() | Returns the sum-item representing the grandtotal for all items. | +| [getItems](dw.order.AbstractItemCtnr.md#getitems)() | Returns the unsorted collection of items | +| [getLastModified](dw.order.AbstractItemCtnr.md#getlastmodified)() | The last modification time. | +| [getModifiedBy](dw.order.AbstractItemCtnr.md#getmodifiedby)() | Last modified by this user. | +| [getOrder](dw.order.AbstractItemCtnr.md#getorder)() | Returns the [Order](dw.order.Order.md) this object was created for. | +| [getProductSubtotal](dw.order.AbstractItemCtnr.md#getproductsubtotal)() | Returns the sum-item representing the subtotal for product items. | +| [getServiceSubtotal](dw.order.AbstractItemCtnr.md#getservicesubtotal)() | Returns the sum-item representing the subtotal for service items such as shipping. | + +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### createdBy +- createdBy: [String](TopLevel.String.md) `(read-only)` + - : Created by this user. + + +--- + +### creationDate +- creationDate: [Date](TopLevel.Date.md) `(read-only)` + - : The time of creation. + + +--- + +### grandTotal +- grandTotal: [SumItem](dw.order.SumItem.md) `(read-only)` + - : Returns the sum-item representing the grandtotal for all items. + + +--- + +### items +- items: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the unsorted collection of items + + +--- + +### lastModified +- lastModified: [Date](TopLevel.Date.md) `(read-only)` + - : The last modification time. + + +--- + +### modifiedBy +- modifiedBy: [String](TopLevel.String.md) `(read-only)` + - : Last modified by this user. + + +--- + +### order +- order: [Order](dw.order.Order.md) `(read-only)` + - : Returns the [Order](dw.order.Order.md) this object was created for. + + +--- + +### productSubtotal +- productSubtotal: [SumItem](dw.order.SumItem.md) `(read-only)` + - : Returns the sum-item representing the subtotal for product items. + + +--- + +### serviceSubtotal +- serviceSubtotal: [SumItem](dw.order.SumItem.md) `(read-only)` + - : Returns the sum-item representing the subtotal for service items such as + shipping. + + + +--- + +## Method Details + +### getCreatedBy() +- getCreatedBy(): [String](TopLevel.String.md) + - : Created by this user. + + **Returns:** + - Created by this user + + +--- + +### getCreationDate() +- getCreationDate(): [Date](TopLevel.Date.md) + - : The time of creation. + + **Returns:** + - time of creation. + + +--- + +### getGrandTotal() +- getGrandTotal(): [SumItem](dw.order.SumItem.md) + - : Returns the sum-item representing the grandtotal for all items. + + **Returns:** + - sum-item for all items + + +--- + +### getItems() +- getItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the unsorted collection of items + + **Returns:** + - the unsorted collection of items + + +--- + +### getLastModified() +- getLastModified(): [Date](TopLevel.Date.md) + - : The last modification time. + + **Returns:** + - last modification time.. + + +--- + +### getModifiedBy() +- getModifiedBy(): [String](TopLevel.String.md) + - : Last modified by this user. + + **Returns:** + - Last modified by this user + + +--- + +### getOrder() +- getOrder(): [Order](dw.order.Order.md) + - : Returns the [Order](dw.order.Order.md) this object was created for. + + **Returns:** + - the Order this object was created for. + + +--- + +### getProductSubtotal() +- getProductSubtotal(): [SumItem](dw.order.SumItem.md) + - : Returns the sum-item representing the subtotal for product items. + + **Returns:** + - sum-item for product items + + +--- + +### getServiceSubtotal() +- getServiceSubtotal(): [SumItem](dw.order.SumItem.md) + - : Returns the sum-item representing the subtotal for service items such as + shipping. + + + **Returns:** + - sum-item for service items such as shipping + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.Appeasement.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.Appeasement.md new file mode 100644 index 00000000..f41f53a0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.Appeasement.md @@ -0,0 +1,398 @@ + +# Class Appeasement + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItemCtnr](dw.order.AbstractItemCtnr.md) + - [dw.order.Appeasement](dw.order.Appeasement.md) + +The Appeasement represents a shopper request for an order credit. + +Example: The buyer finds any problem with the products but he agrees to preserve them, if he would be compensated, +rather than return them. + + + +The Appeasement contains 1..n appeasement items. +Each appeasement item is associated with one [OrderItem](dw.order.OrderItem.md) usually representing an [Order](dw.order.Order.md) +[ProductLineItem](dw.order.ProductLineItem.md). + + + +An Appeasement can have one of these status values: + +- OPEN - the appeasement is open and appeasement items could be added to it +- COMPLETED - the appeasement is complete and it is not allowed to add new items to it, this is a precondition for refunding the customer for an appeasement. + + + +Order post-processing APIs (gillian) are now inactive by default and will throw +an exception if accessed. Activation needs preliminary approval by Product Management. +Please contact support in this case. Existing customers using these APIs are not +affected by this change and can use the APIs until further notice. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ORDERBY_ITEMID](#orderby_itemid): [Object](TopLevel.Object.md) | Sorting by item id. | +| [ORDERBY_ITEMPOSITION](#orderby_itemposition): [Object](TopLevel.Object.md) | Sorting by the position of the related order item. | +| [ORDERBY_UNSORTED](#orderby_unsorted): [Object](TopLevel.Object.md) | Unsorted, as it is. | +| [QUALIFIER_PRODUCTITEMS](#qualifier_productitems): [Object](TopLevel.Object.md) | Selects the product items. | +| [QUALIFIER_SERVICEITEMS](#qualifier_serviceitems): [Object](TopLevel.Object.md) | Selects the service items. | +| [STATUS_COMPLETED](#status_completed): [String](TopLevel.String.md) = "COMPLETED" | Constant for Appeasement Status COMPLETED | +| [STATUS_OPEN](#status_open): [String](TopLevel.String.md) = "OPEN" | Constant for Appeasement Status OPEN | + +## Property Summary + +| Property | Description | +| --- | --- | +| [appeasementNumber](#appeasementnumber): [String](TopLevel.String.md) `(read-only)` | Returns the appeasement number. | +| [invoice](#invoice): [Invoice](dw.order.Invoice.md) `(read-only)` | Returns null or the previously created [Invoice](dw.order.Invoice.md). | +| [invoiceNumber](#invoicenumber): [String](TopLevel.String.md) `(read-only)` | Returns `null` or the invoice-number. | +| [items](#items): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns a filtering collection of the appeasement items belonging to the appeasement. | +| [reasonCode](#reasoncode): [EnumValue](dw.value.EnumValue.md) | Returns the reason code for the appeasement. | +| [reasonNote](#reasonnote): [String](TopLevel.String.md) | Returns the reason note for the appeasement. | +| [status](#status): [EnumValue](dw.value.EnumValue.md) | Gets the status of this appeasement. The possible values are [STATUS_OPEN](dw.order.Appeasement.md#status_open), [STATUS_COMPLETED](dw.order.Appeasement.md#status_completed). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [addItems](dw.order.Appeasement.md#additemsmoney-list)([Money](dw.value.Money.md), [List](dw.util.List.md)) | Creates appeasement items corresponding to certain order items and adds them to the appeasement. | +| [createInvoice](dw.order.Appeasement.md#createinvoice)() | Creates a new [Invoice](dw.order.Invoice.md) based on this Appeasement. | +| [createInvoice](dw.order.Appeasement.md#createinvoicestring)([String](TopLevel.String.md)) | Creates a new [Invoice](dw.order.Invoice.md) based on this Appeasement. | +| [getAppeasementNumber](dw.order.Appeasement.md#getappeasementnumber)() | Returns the appeasement number. | +| [getInvoice](dw.order.Appeasement.md#getinvoice)() | Returns null or the previously created [Invoice](dw.order.Invoice.md). | +| [getInvoiceNumber](dw.order.Appeasement.md#getinvoicenumber)() | Returns `null` or the invoice-number. | +| [getItems](dw.order.Appeasement.md#getitems)() | Returns a filtering collection of the appeasement items belonging to the appeasement. | +| [getReasonCode](dw.order.Appeasement.md#getreasoncode)() | Returns the reason code for the appeasement. | +| [getReasonNote](dw.order.Appeasement.md#getreasonnote)() | Returns the reason note for the appeasement. | +| [getStatus](dw.order.Appeasement.md#getstatus)() | Gets the status of this appeasement. The possible values are [STATUS_OPEN](dw.order.Appeasement.md#status_open), [STATUS_COMPLETED](dw.order.Appeasement.md#status_completed). | +| [setReasonCode](dw.order.Appeasement.md#setreasoncodestring)([String](TopLevel.String.md)) | Set the reason code for the appeasement. | +| [setReasonNote](dw.order.Appeasement.md#setreasonnotestring)([String](TopLevel.String.md)) | Sets the reason note for the appeasement. | +| [setStatus](dw.order.Appeasement.md#setstatusstring)([String](TopLevel.String.md)) | Sets the appeasement status. | + +### Methods inherited from class AbstractItemCtnr + +[getCreatedBy](dw.order.AbstractItemCtnr.md#getcreatedby), [getCreationDate](dw.order.AbstractItemCtnr.md#getcreationdate), [getGrandTotal](dw.order.AbstractItemCtnr.md#getgrandtotal), [getItems](dw.order.AbstractItemCtnr.md#getitems), [getLastModified](dw.order.AbstractItemCtnr.md#getlastmodified), [getModifiedBy](dw.order.AbstractItemCtnr.md#getmodifiedby), [getOrder](dw.order.AbstractItemCtnr.md#getorder), [getProductSubtotal](dw.order.AbstractItemCtnr.md#getproductsubtotal), [getServiceSubtotal](dw.order.AbstractItemCtnr.md#getservicesubtotal) +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ORDERBY_ITEMID + +- ORDERBY_ITEMID: [Object](TopLevel.Object.md) + - : Sorting by item id. Use with method [getItems()](dw.order.Appeasement.md#getitems) as an argument to method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + +--- + +### ORDERBY_ITEMPOSITION + +- ORDERBY_ITEMPOSITION: [Object](TopLevel.Object.md) + - : Sorting by the position of the related order item. Use with method [getItems()](dw.order.Appeasement.md#getitems) as an argument to method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + +--- + +### ORDERBY_UNSORTED + +- ORDERBY_UNSORTED: [Object](TopLevel.Object.md) + - : Unsorted, as it is. Use with method [getItems()](dw.order.Appeasement.md#getitems) as an argument to method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + +--- + +### QUALIFIER_PRODUCTITEMS + +- QUALIFIER_PRODUCTITEMS: [Object](TopLevel.Object.md) + - : Selects the product items. Use with method [getItems()](dw.order.Appeasement.md#getitems) as an argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + +--- + +### QUALIFIER_SERVICEITEMS + +- QUALIFIER_SERVICEITEMS: [Object](TopLevel.Object.md) + - : Selects the service items. Use with method [getItems()](dw.order.Appeasement.md#getitems) as an argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + +--- + +### STATUS_COMPLETED + +- STATUS_COMPLETED: [String](TopLevel.String.md) = "COMPLETED" + - : Constant for Appeasement Status COMPLETED + + +--- + +### STATUS_OPEN + +- STATUS_OPEN: [String](TopLevel.String.md) = "OPEN" + - : Constant for Appeasement Status OPEN + + +--- + +## Property Details + +### appeasementNumber +- appeasementNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the appeasement number. + + +--- + +### invoice +- invoice: [Invoice](dw.order.Invoice.md) `(read-only)` + - : Returns null or the previously created [Invoice](dw.order.Invoice.md). + + **See Also:** + - [createInvoice(String)](dw.order.Appeasement.md#createinvoicestring) + + +--- + +### invoiceNumber +- invoiceNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns `null` or the invoice-number. + + **See Also:** + - [createInvoice(String)](dw.order.Appeasement.md#createinvoicestring) + + +--- + +### items +- items: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns a filtering collection of the appeasement items belonging to the appeasement. + + + This [FilteringCollection](dw.util.FilteringCollection.md) could be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMID](dw.order.Appeasement.md#orderby_itemid) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMPOSITION](dw.order.Appeasement.md#orderby_itemposition) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Appeasement.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_PRODUCTITEMS](dw.order.Appeasement.md#qualifier_productitems) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_SERVICEITEMS](dw.order.Appeasement.md#qualifier_serviceitems) + + + +--- + +### reasonCode +- reasonCode: [EnumValue](dw.value.EnumValue.md) + - : Returns the reason code for the appeasement. The list of reason codes can be updated + by updating meta-data for Appeasement. + + + +--- + +### reasonNote +- reasonNote: [String](TopLevel.String.md) + - : Returns the reason note for the appeasement. + + +--- + +### status +- status: [EnumValue](dw.value.EnumValue.md) + - : Gets the status of this appeasement. + + The possible values are [STATUS_OPEN](dw.order.Appeasement.md#status_open), [STATUS_COMPLETED](dw.order.Appeasement.md#status_completed). + + + +--- + +## Method Details + +### addItems(Money, List) +- addItems(totalAmount: [Money](dw.value.Money.md), orderItems: [List](dw.util.List.md)): void + - : Creates appeasement items corresponding to certain order items and adds them to the appeasement. + + **Parameters:** + - totalAmount - the appeasement amount corresponding to the provided order items; this amount is the net price when the order is net based and respectively - gross price when the order is gross based + - orderItems - the order items for which appeasement items should be created + + +--- + +### createInvoice() +- createInvoice(): [Invoice](dw.order.Invoice.md) + - : Creates a new [Invoice](dw.order.Invoice.md) based on this Appeasement. The appeasement-number + will be used as the invoice-number. + + + The method must not be called more than once for an Appeasement, + nor may 2 invoices exist with the same invoice-number. + + + The new Invoice is a credit-invoice with a [Invoice.STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid) status, and + should be passed to the refund payment-hook in a separate database transaction for processing. + + + **Returns:** + - the created invoice + + +--- + +### createInvoice(String) +- createInvoice(invoiceNumber: [String](TopLevel.String.md)): [Invoice](dw.order.Invoice.md) + - : Creates a new [Invoice](dw.order.Invoice.md) based on this Appeasement. The + invoice-number must be specified as an argument. + + + The method must not be called more than once for an Appeasement, + nor may 2 invoices exist with the same invoice-number. + + + The new Invoice is a credit-invoice with a [Invoice.STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid) status, and + should be passed to the refund payment-hook in a separate database transaction for processing. + + + **Parameters:** + - invoiceNumber - the invoice-number to be used in the appeasement creation process + + **Returns:** + - the created invoice + + +--- + +### getAppeasementNumber() +- getAppeasementNumber(): [String](TopLevel.String.md) + - : Returns the appeasement number. + + **Returns:** + - the appeasement number + + +--- + +### getInvoice() +- getInvoice(): [Invoice](dw.order.Invoice.md) + - : Returns null or the previously created [Invoice](dw.order.Invoice.md). + + **Returns:** + - null or the previously created invoice + + **See Also:** + - [createInvoice(String)](dw.order.Appeasement.md#createinvoicestring) + + +--- + +### getInvoiceNumber() +- getInvoiceNumber(): [String](TopLevel.String.md) + - : Returns `null` or the invoice-number. + + **Returns:** + - `null` or the number of the previously created invoice + + **See Also:** + - [createInvoice(String)](dw.order.Appeasement.md#createinvoicestring) + + +--- + +### getItems() +- getItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns a filtering collection of the appeasement items belonging to the appeasement. + + + This [FilteringCollection](dw.util.FilteringCollection.md) could be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMID](dw.order.Appeasement.md#orderby_itemid) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMPOSITION](dw.order.Appeasement.md#orderby_itemposition) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Appeasement.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_PRODUCTITEMS](dw.order.Appeasement.md#qualifier_productitems) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_SERVICEITEMS](dw.order.Appeasement.md#qualifier_serviceitems) + + + **Returns:** + - the filtering collection of the appeasement items + + +--- + +### getReasonCode() +- getReasonCode(): [EnumValue](dw.value.EnumValue.md) + - : Returns the reason code for the appeasement. The list of reason codes can be updated + by updating meta-data for Appeasement. + + + **Returns:** + - the appeasement reason code + + +--- + +### getReasonNote() +- getReasonNote(): [String](TopLevel.String.md) + - : Returns the reason note for the appeasement. + + **Returns:** + - the reason note or `null` + + +--- + +### getStatus() +- getStatus(): [EnumValue](dw.value.EnumValue.md) + - : Gets the status of this appeasement. + + The possible values are [STATUS_OPEN](dw.order.Appeasement.md#status_open), [STATUS_COMPLETED](dw.order.Appeasement.md#status_completed). + + + **Returns:** + - the status + + +--- + +### setReasonCode(String) +- setReasonCode(reasonCode: [String](TopLevel.String.md)): void + - : Set the reason code for the appeasement. The list of reason codes can be updated + by updating meta-data for Appeasement. + + + **Parameters:** + - reasonCode - the reason code to set + + +--- + +### setReasonNote(String) +- setReasonNote(reasonNote: [String](TopLevel.String.md)): void + - : Sets the reason note for the appeasement. + + **Parameters:** + - reasonNote - the reason note for the appeasement to set + + +--- + +### setStatus(String) +- setStatus(appeasementStatus: [String](TopLevel.String.md)): void + - : Sets the appeasement status. + + + The possible values are [STATUS_OPEN](dw.order.Appeasement.md#status_open), [STATUS_COMPLETED](dw.order.Appeasement.md#status_completed). + + + When set to status COMPLETED, only the the custom attributes of its appeasement items can be changed. + + + **Parameters:** + - appeasementStatus - the appeasement status to set. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.AppeasementItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.AppeasementItem.md new file mode 100644 index 00000000..3572feb7 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.AppeasementItem.md @@ -0,0 +1,104 @@ + +# Class AppeasementItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItem](dw.order.AbstractItem.md) + - [dw.order.AppeasementItem](dw.order.AppeasementItem.md) + +Represents an item of an [Appeasement](dw.order.Appeasement.md) which is associated with one [OrderItem](dw.order.OrderItem.md) usually representing an [Order](dw.order.Order.md) +[ProductLineItem](dw.order.ProductLineItem.md). Items are created using method [Appeasement.addItems(Money, List)](dw.order.Appeasement.md#additemsmoney-list) + + +When the related Appeasement were set to status COMPLETED, only the the custom attributes of the appeasement item can be changed. + + +Order post-processing APIs (gillian) are now inactive by default and will throw +an exception if accessed. Activation needs preliminary approval by Product Management. +Please contact support in this case. Existing customers using these APIs are not +affected by this change and can use the APIs until further notice. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [appeasementNumber](#appeasementnumber): [String](TopLevel.String.md) `(read-only)` | Returns the number of the [Appeasement](dw.order.Appeasement.md) to which this item belongs. | +| [parentItem](#parentitem): [AppeasementItem](dw.order.AppeasementItem.md) | Returns null or the parent item. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAppeasementNumber](dw.order.AppeasementItem.md#getappeasementnumber)() | Returns the number of the [Appeasement](dw.order.Appeasement.md) to which this item belongs. | +| [getParentItem](dw.order.AppeasementItem.md#getparentitem)() | Returns null or the parent item. | +| [setParentItem](dw.order.AppeasementItem.md#setparentitemappeasementitem)([AppeasementItem](dw.order.AppeasementItem.md)) | Set a parent item. | + +### Methods inherited from class AbstractItem + +[getGrossPrice](dw.order.AbstractItem.md#getgrossprice), [getItemID](dw.order.AbstractItem.md#getitemid), [getLineItem](dw.order.AbstractItem.md#getlineitem), [getNetPrice](dw.order.AbstractItem.md#getnetprice), [getOrderItem](dw.order.AbstractItem.md#getorderitem), [getOrderItemID](dw.order.AbstractItem.md#getorderitemid), [getTax](dw.order.AbstractItem.md#gettax), [getTaxBasis](dw.order.AbstractItem.md#gettaxbasis), [getTaxItems](dw.order.AbstractItem.md#gettaxitems) +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### appeasementNumber +- appeasementNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the number of the [Appeasement](dw.order.Appeasement.md) to which this item belongs. + + +--- + +### parentItem +- parentItem: [AppeasementItem](dw.order.AppeasementItem.md) + - : Returns null or the parent item. + + +--- + +## Method Details + +### getAppeasementNumber() +- getAppeasementNumber(): [String](TopLevel.String.md) + - : Returns the number of the [Appeasement](dw.order.Appeasement.md) to which this item belongs. + + **Returns:** + - the number of the Appeasement to which this item belongs + + +--- + +### getParentItem() +- getParentItem(): [AppeasementItem](dw.order.AppeasementItem.md) + - : Returns null or the parent item. + + **Returns:** + - null or the parent item. + + +--- + +### setParentItem(AppeasementItem) +- setParentItem(parentItem: [AppeasementItem](dw.order.AppeasementItem.md)): void + - : Set a parent item. The parent item must belong to the same + [Appeasement](dw.order.Appeasement.md). An infinite parent-child loop is disallowed + as is a parent-child depth greater than 10. Setting a parent item + indicates a dependency of the child item on the parent item, and can be + used to form a parallel structure to that accessed using + [ProductLineItem.getParent()](dw.order.ProductLineItem.md#getparent). + + + **Parameters:** + - parentItem - The parent item, null is allowed + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.Basket.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.Basket.md new file mode 100644 index 00000000..4484f2fa --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.Basket.md @@ -0,0 +1,867 @@ + +# Class Basket + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.LineItemCtnr](dw.order.LineItemCtnr.md) + - [dw.order.Basket](dw.order.Basket.md) + +The Basket class represents a shopping cart. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [agentBasket](#agentbasket): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns if the basket was created by an agent. | +| [inventoryReservationExpiry](#inventoryreservationexpiry): [Date](TopLevel.Date.md) `(read-only)` | Returns the timestamp when the inventory for this basket expires. | +| [orderBeingEdited](#orderbeingedited): [Order](dw.order.Order.md) `(read-only)` | Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. | +| [orderNoBeingEdited](#ordernobeingedited): [String](TopLevel.String.md) `(read-only)` | Returns the number of the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. | +| [taxRoundedAtGroup](#taxroundedatgroup): [Boolean](TopLevel.Boolean.md) `(read-only)` | Use this method to check if the Basket was calculated with grouped taxation calculation. | +| [temporary](#temporary): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns if the basket is temporary. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getInventoryReservationExpiry](dw.order.Basket.md#getinventoryreservationexpiry)() | Returns the timestamp when the inventory for this basket expires. | +| [getOrderBeingEdited](dw.order.Basket.md#getorderbeingedited)() | Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. | +| [getOrderNoBeingEdited](dw.order.Basket.md#getordernobeingedited)() | Returns the number of the order that this basket represents if the basket is being used to edit an order, otherwise this method returns null. | +| [isAgentBasket](dw.order.Basket.md#isagentbasket)() | Returns if the basket was created by an agent. | +| [isTaxRoundedAtGroup](dw.order.Basket.md#istaxroundedatgroup)() | Use this method to check if the Basket was calculated with grouped taxation calculation. | +| [isTemporary](dw.order.Basket.md#istemporary)() | Returns if the basket is temporary. | +| [releaseInventory](dw.order.Basket.md#releaseinventory)() |

          Release all inventory previously reserved for this basket. | +| [reserveInventory](dw.order.Basket.md#reserveinventory)() |

          Reserves inventory for all items in this basket for 10 minutes. | +| [reserveInventory](dw.order.Basket.md#reserveinventorynumber)([Number](TopLevel.Number.md)) |

          Reserve inventory for all items in this basket for 10 minutes. | +| [reserveInventory](dw.order.Basket.md#reserveinventorynumber-boolean)([Number](TopLevel.Number.md), [Boolean](TopLevel.Boolean.md)) |

          Reserve inventory for all items in this basket for 10 minutes. | +| [setBusinessType](dw.order.Basket.md#setbusinesstypenumber)([Number](TopLevel.Number.md)) | Set the type of the business this order has been placed in.
          Possible values are [LineItemCtnr.BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [LineItemCtnr.BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). | +| [setChannelType](dw.order.Basket.md#setchanneltypenumber)([Number](TopLevel.Number.md)) | Set the channel type in which sales channel this order has been created. | +| ~~[setCustomerNo](dw.order.Basket.md#setcustomernostring)([String](TopLevel.String.md))~~ | Sets the customer number of the customer associated with this container. | +| [startCheckout](dw.order.Basket.md#startcheckout)() | Register a "start checkout" event for the current basket. | +| [updateCurrency](dw.order.Basket.md#updatecurrency)() | Updates the basket currency if different to session currency, otherwise does nothing. | + +### Methods inherited from class LineItemCtnr + +[addNote](dw.order.LineItemCtnr.md#addnotestring-string), [createBillingAddress](dw.order.LineItemCtnr.md#createbillingaddress), [createBonusProductLineItem](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment), [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring), [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring-boolean), [createGiftCertificateLineItem](dw.order.LineItemCtnr.md#creategiftcertificatelineitemnumber-string), [createGiftCertificatePaymentInstrument](dw.order.LineItemCtnr.md#creategiftcertificatepaymentinstrumentstring-money), [createPaymentInstrument](dw.order.LineItemCtnr.md#createpaymentinstrumentstring-money), [createPaymentInstrumentFromWallet](dw.order.LineItemCtnr.md#createpaymentinstrumentfromwalletcustomerpaymentinstrument-money), [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring), [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring-discount), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproduct-productoptionmodel-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproductlistitem-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-quantity-shipment), [createShipment](dw.order.LineItemCtnr.md#createshipmentstring), [createShippingPriceAdjustment](dw.order.LineItemCtnr.md#createshippingpriceadjustmentstring), [getAdjustedMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalgrossprice), [getAdjustedMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalnetprice), [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalprice), [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalpriceboolean), [getAdjustedMerchandizeTotalTax](dw.order.LineItemCtnr.md#getadjustedmerchandizetotaltax), [getAdjustedShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalgrossprice), [getAdjustedShippingTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalnetprice), [getAdjustedShippingTotalPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalprice), [getAdjustedShippingTotalTax](dw.order.LineItemCtnr.md#getadjustedshippingtotaltax), [getAllGiftCertificateLineItems](dw.order.LineItemCtnr.md#getallgiftcertificatelineitems), [getAllLineItems](dw.order.LineItemCtnr.md#getalllineitems), [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitems), [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitemsstring), [getAllProductQuantities](dw.order.LineItemCtnr.md#getallproductquantities), [getAllShippingPriceAdjustments](dw.order.LineItemCtnr.md#getallshippingpriceadjustments), [getBillingAddress](dw.order.LineItemCtnr.md#getbillingaddress), [getBonusDiscountLineItems](dw.order.LineItemCtnr.md#getbonusdiscountlineitems), [getBonusLineItems](dw.order.LineItemCtnr.md#getbonuslineitems), [getBusinessType](dw.order.LineItemCtnr.md#getbusinesstype), [getChannelType](dw.order.LineItemCtnr.md#getchanneltype), [getCouponLineItem](dw.order.LineItemCtnr.md#getcouponlineitemstring), [getCouponLineItems](dw.order.LineItemCtnr.md#getcouponlineitems), [getCurrencyCode](dw.order.LineItemCtnr.md#getcurrencycode), [getCustomer](dw.order.LineItemCtnr.md#getcustomer), [getCustomerEmail](dw.order.LineItemCtnr.md#getcustomeremail), [getCustomerName](dw.order.LineItemCtnr.md#getcustomername), [getCustomerNo](dw.order.LineItemCtnr.md#getcustomerno), [getDefaultShipment](dw.order.LineItemCtnr.md#getdefaultshipment), [getEtag](dw.order.LineItemCtnr.md#getetag), [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitems), [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitemsstring), [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstruments), [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstrumentsstring), [getGiftCertificateTotalGrossPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalgrossprice), [getGiftCertificateTotalNetPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalnetprice), [getGiftCertificateTotalPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalprice), [getGiftCertificateTotalTax](dw.order.LineItemCtnr.md#getgiftcertificatetotaltax), [getMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getmerchandizetotalgrossprice), [getMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getmerchandizetotalnetprice), [getMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getmerchandizetotalprice), [getMerchandizeTotalTax](dw.order.LineItemCtnr.md#getmerchandizetotaltax), [getNotes](dw.order.LineItemCtnr.md#getnotes), [getPaymentInstrument](dw.order.LineItemCtnr.md#getpaymentinstrument), [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstruments), [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstrumentsstring), [getPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getpriceadjustmentbypromotionidstring), [getPriceAdjustments](dw.order.LineItemCtnr.md#getpriceadjustments), [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitems), [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitemsstring), [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantities), [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantitiesboolean), [getProductQuantityTotal](dw.order.LineItemCtnr.md#getproductquantitytotal), [getShipment](dw.order.LineItemCtnr.md#getshipmentstring), [getShipments](dw.order.LineItemCtnr.md#getshipments), [getShippingPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getshippingpriceadjustmentbypromotionidstring), [getShippingPriceAdjustments](dw.order.LineItemCtnr.md#getshippingpriceadjustments), [getShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getshippingtotalgrossprice), [getShippingTotalNetPrice](dw.order.LineItemCtnr.md#getshippingtotalnetprice), [getShippingTotalPrice](dw.order.LineItemCtnr.md#getshippingtotalprice), [getShippingTotalTax](dw.order.LineItemCtnr.md#getshippingtotaltax), [getTaxTotalsPerTaxRate](dw.order.LineItemCtnr.md#gettaxtotalspertaxrate), [getTotalGrossPrice](dw.order.LineItemCtnr.md#gettotalgrossprice), [getTotalNetPrice](dw.order.LineItemCtnr.md#gettotalnetprice), [getTotalTax](dw.order.LineItemCtnr.md#gettotaltax), [isExternallyTaxed](dw.order.LineItemCtnr.md#isexternallytaxed), [isTaxRoundedAtGroup](dw.order.LineItemCtnr.md#istaxroundedatgroup), [removeAllPaymentInstruments](dw.order.LineItemCtnr.md#removeallpaymentinstruments), [removeBonusDiscountLineItem](dw.order.LineItemCtnr.md#removebonusdiscountlineitembonusdiscountlineitem), [removeCouponLineItem](dw.order.LineItemCtnr.md#removecouponlineitemcouponlineitem), [removeGiftCertificateLineItem](dw.order.LineItemCtnr.md#removegiftcertificatelineitemgiftcertificatelineitem), [removeNote](dw.order.LineItemCtnr.md#removenotenote), [removePaymentInstrument](dw.order.LineItemCtnr.md#removepaymentinstrumentpaymentinstrument), [removePriceAdjustment](dw.order.LineItemCtnr.md#removepriceadjustmentpriceadjustment), [removeProductLineItem](dw.order.LineItemCtnr.md#removeproductlineitemproductlineitem), [removeShipment](dw.order.LineItemCtnr.md#removeshipmentshipment), [removeShippingPriceAdjustment](dw.order.LineItemCtnr.md#removeshippingpriceadjustmentpriceadjustment), [setCustomerEmail](dw.order.LineItemCtnr.md#setcustomeremailstring), [setCustomerName](dw.order.LineItemCtnr.md#setcustomernamestring), [updateOrderLevelPriceAdjustmentTax](dw.order.LineItemCtnr.md#updateorderlevelpriceadjustmenttax), [updateTotals](dw.order.LineItemCtnr.md#updatetotals), [verifyPriceAdjustmentLimits](dw.order.LineItemCtnr.md#verifypriceadjustmentlimits) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### agentBasket +- agentBasket: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns if the basket was created by an agent. + + + An agent basket is created by an agent on behalf of the customer in comparison to a storefront basket which is + created by the customer e.g. in the storefront. An agent basket can be created with + [BasketMgr.createAgentBasket()](dw.order.BasketMgr.md#createagentbasket). + + + +--- + +### inventoryReservationExpiry +- inventoryReservationExpiry: [Date](TopLevel.Date.md) `(read-only)` + - : Returns the timestamp when the inventory for this basket expires. + + + It will return `null` for the following reasons: + + - No reservation for the basket was done + - Reservation is outdated meaning the timestamp is in the past + + + + + + Please note that the expiry timestamp will not always be valid for the whole basket. It will not be valid for + new items added or items whose quantity has changed after the reservation was done. + + + +--- + +### orderBeingEdited +- orderBeingEdited: [Order](dw.order.Order.md) `(read-only)` + - : Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method + returns null. Baskets created via [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) will create a reference + to the order that was used to create this basket (please check limitations around basket accessibility in + [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder)). + + + +--- + +### orderNoBeingEdited +- orderNoBeingEdited: [String](TopLevel.String.md) `(read-only)` + - : Returns the number of the order that this basket represents if the basket is being used to edit an order, + otherwise this method returns null. Baskets created via [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) + will create a reference to the order that was used to create this basket (please check limitations around basket + accessibility in [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder)). + + + +--- + +### taxRoundedAtGroup +- taxRoundedAtGroup: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Use this method to check if the Basket was calculated with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + +--- + +### temporary +- temporary: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns if the basket is temporary. + + + Temporary baskets are separate from shopper storefront and agent baskets, and are intended for use to perform + calculations or create an order without disturbing a shopper's open storefront basket. A temporary basket can be + created with [BasketMgr.createTemporaryBasket()](dw.order.BasketMgr.md#createtemporarybasket). + + + +--- + +## Method Details + +### getInventoryReservationExpiry() +- getInventoryReservationExpiry(): [Date](TopLevel.Date.md) + - : Returns the timestamp when the inventory for this basket expires. + + + It will return `null` for the following reasons: + + - No reservation for the basket was done + - Reservation is outdated meaning the timestamp is in the past + + + + + + Please note that the expiry timestamp will not always be valid for the whole basket. It will not be valid for + new items added or items whose quantity has changed after the reservation was done. + + + **Returns:** + - the inventory reservation expiry timestamp or `null` + + +--- + +### getOrderBeingEdited() +- getOrderBeingEdited(): [Order](dw.order.Order.md) + - : Returns the order that this basket represents if the basket is being used to edit an order, otherwise this method + returns null. Baskets created via [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) will create a reference + to the order that was used to create this basket (please check limitations around basket accessibility in + [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder)). + + + **Returns:** + - the order that this basket represents if the basket is being used to edit an order, otherwise this method + returns null. + + + +--- + +### getOrderNoBeingEdited() +- getOrderNoBeingEdited(): [String](TopLevel.String.md) + - : Returns the number of the order that this basket represents if the basket is being used to edit an order, + otherwise this method returns null. Baskets created via [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) + will create a reference to the order that was used to create this basket (please check limitations around basket + accessibility in [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder)). + + + **Returns:** + - the number of the order that this basket represents if the basket is being used to edit an order, + otherwise this method returns null. + + + +--- + +### isAgentBasket() +- isAgentBasket(): [Boolean](TopLevel.Boolean.md) + - : Returns if the basket was created by an agent. + + + An agent basket is created by an agent on behalf of the customer in comparison to a storefront basket which is + created by the customer e.g. in the storefront. An agent basket can be created with + [BasketMgr.createAgentBasket()](dw.order.BasketMgr.md#createagentbasket). + + + **Returns:** + - `true` if the basket was created by an agent otherwise `false` + + +--- + +### isTaxRoundedAtGroup() +- isTaxRoundedAtGroup(): [Boolean](TopLevel.Boolean.md) + - : Use this method to check if the Basket was calculated with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + **Returns:** + - `true` if the Basket was calculated with grouped taxation + + +--- + +### isTemporary() +- isTemporary(): [Boolean](TopLevel.Boolean.md) + - : Returns if the basket is temporary. + + + Temporary baskets are separate from shopper storefront and agent baskets, and are intended for use to perform + calculations or create an order without disturbing a shopper's open storefront basket. A temporary basket can be + created with [BasketMgr.createTemporaryBasket()](dw.order.BasketMgr.md#createtemporarybasket). + + + **Returns:** + - `true` if the basket is temporary otherwise `false` + + +--- + +### releaseInventory() +- releaseInventory(): [Status](dw.system.Status.md) + - : + + Release all inventory previously reserved for this basket. This is not needed for a normal workflow. + You can call `dw.order.Basket.reserveInventory()` one time after every basket change. + For performance and scaling reasons, avoid calling `dw.order.Basket.releaseInventory()` + before `dw.order.Basket.reserveInventory()`. The `reserveInventory` function works in + an optimized way to release inventory reservations that are no longer relevant. + + + + + The method implements its own transaction handling. Calling the method from inside a transaction is disallowed + and results in an exception being thrown. This behavior differs when calling the method from an **OCAPI + hook**. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction + handling, but to ensure the shortest possible locking of the inventory this method should only be called _as + the last step_ in the OCAPI hook. + + + **Returns:** + - a Status instance with - Status.OK if release inventory was successful, otherwise Status.ERROR. + + +--- + +### reserveInventory() +- reserveInventory(): [Status](dw.system.Status.md) + - : + + Reserves inventory for all items in this basket for 10 minutes. Any reservations created by previous calls of + this method are replaced. + + + + + Sample workflow for subsequent basket reservations: + + + + + 1. Request: Add item to basket and reserve the basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku1",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2} is complete. + ``` + + + + + + 2. Request: Add item to basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku2",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2, sku2:2} is complete. The previous reservation was overwritten. + ``` + + + + + + 3. Request: Remove item from basket. + + + + + + ``` + transaction.begin() + basket.removeProductLineItem(item1) + basket.commit() + basket.reserveInventory() + // The reservation {sku2:2} is complete. The previous reservation was + // overwritten and a quantity of 2 is released for sku1. + ``` + + + + + + The method can be used to reserve basket items before checkout to ensure that inventory is still available at the + time an order is created from the basket using [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket). If all or some + basket items are not reserved before creating an order, [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) will + validate item availability and will fail if any item is unavailable. Calling this method in the same request as + [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) is unnecessary and discouraged for performance reasons. + + + + + The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See + [ProductInventoryRecord.getATS()](dw.catalog.ProductInventoryRecord.md#getats).) + + + + + When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the + basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 + and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only + reserve a quantity of 2. + + + + + When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to + an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other + baskets would see an ATS of 2. + + + + + Reservations can only be made for products with an inventory record. The reservation of product bundles is + controlled by the _Use Bundle Inventory Only_ setting on the inventory list. The setting allows inventory to + be reserved for just the bundle or for the bundle and its bundled products. + + + + + The following conditions must be met for the method to succeed: + + - an inventory list must be assigned to the current site + - all products in the basket must exist, and must not be of type Master or ProductSet + - each product line item must have a valid quantity + - each product must have an inventory record, or the inventory list must define that products without inventory record are available by default + - the reservation must succeed for each item as described above. + + + + + + The method implements its own transaction handling. Calling the method from inside a transaction is disallowed + and results in an exception being thrown. This behavior differs when calling the method from an **OCAPI + hook**. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction + handling, but to ensure the shortest possible locking of the inventory this method should only be called _as + the last step_ in the OCAPI hook. + + + + + If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged + but no new reservations will be made. This might lead to a partially reserved basket. + + + + + Behaves same as `reserveInventory( null, false );`. + + + + + This method must not be used with + + - the **CreateOrder2**pipelet, or + - [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket), or + - [OrderMgr.createOrder(Basket, String)](dw.order.OrderMgr.md#createorderbasket-string) + + in the same request. + + + **Returns:** + - a Status instance with - Status.OK if all items could be reserved, otherwise Status.ERROR meaning no + items were reserved. + + + +--- + +### reserveInventory(Number) +- reserveInventory(reservationDurationInMinutes: [Number](TopLevel.Number.md)): [Status](dw.system.Status.md) + - : + + Reserve inventory for all items in this basket for 10 minutes. Any reservations created by previous calls of + this method are replaced. + + + + + Sample workflow for subsequent basket reservations: + + + + + 1. Request: Add item to basket and reserve the basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku1",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2} is complete. + ``` + + + + + + 2. Request: Add item to basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku2",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2, sku2:2} is complete. The previous reservation was overwritten. + ``` + + + + + + 3. Request: Remove item from basket. + + + + + + ``` + transaction.begin() + basket.removeProductLineItem(item1) + basket.commit() + basket.reserveInventory() + // The reservation {sku2:2} is complete. The previous reservation was + // overwritten and a quantity of 2 is released for sku1. + ``` + + + + + + The method can be used to reserve basket items before checkout to ensure that inventory is still available at the + time an order is created from the basket using [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket). If all or some + basket items are not reserved before creating an order, [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) will + validate item availability and will fail if any item is unavailable. Calling this method in the same request as + [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) is unnecessary and discouraged for performance reasons. + + + + + The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See + [ProductInventoryRecord.getATS()](dw.catalog.ProductInventoryRecord.md#getats).) + + + + + When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the + basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 + and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only + reserve a quantity of 2. + + + + + When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to + an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other + baskets would see an ATS of 2. + + + + + Reservations can only be made for products with an inventory record. The reservation of product bundles is + controlled by the _Use Bundle Inventory Only_ setting on the inventory list. The setting allows inventory to + be reserved for just the bundle or for the bundle and its bundled products. + + + + + The following conditions must be met for the method to succeed: + + - an inventory list must be assigned to the current site + - all products in the basket must exist, and must not be of type Master or ProductSet + - each product line item must have a valid quantity + - each product must have an inventory record, or the inventory list must define that products without inventory record are available by default + - the reservation must succeed for each item as described above. + + + + + + The method implements its own transaction handling. Calling the method from inside a transaction is disallowed + and results in an exception being thrown. This behavior differs when calling the method from an **OCAPI + hook**. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction + handling, but to ensure the shortest possible locking of the inventory this method should only be called _as + the last step_ in the OCAPI hook. + + + + + [getInventoryReservationExpiry()](dw.order.Basket.md#getinventoryreservationexpiry) can be used to determine when the expiration will expire. + + + + + If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged + but no new reservations will be made. This might lead to a partially reserved basket. + + + + + Behaves same as `reserveInventory( reservationDurationInMinutes, false );`. + + + + + This method must not be used with + + - the **CreateOrder2**pipelet, or + - [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket), or + - [OrderMgr.createOrder(Basket, String)](dw.order.OrderMgr.md#createorderbasket-string) + + in the same request. + + + **Parameters:** + - reservationDurationInMinutes - reservation duration in minutes, specifying how long the reservation will last. The maximum value for the reservation duration is 240 minutes. + + **Returns:** + - a Status instance with - Status.OK if all items could be reserved, otherwise Status.ERROR meaning no + items were reserved. + + + +--- + +### reserveInventory(Number, Boolean) +- reserveInventory(reservationDurationInMinutes: [Number](TopLevel.Number.md), removeIfNotAvailable: [Boolean](TopLevel.Boolean.md)): [Status](dw.system.Status.md) + - : + + Reserve inventory for all items in this basket for 10 minutes. Any reservations created by previous calls of + this method are replaced. + + + + + Sample workflow for subsequent basket reservations: + + + + + 1. Request: Add item to basket and reserve the basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku1",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2} is complete + ``` + + + + + + 2. Request: Add item to basket. + + + + + + ``` + transaction.begin() + basket.createProductLineItem("sku2",2,basket.defaultShipment) + basket.commit() + basket.reserveInventory() + // The reservation {sku1:2, sku2:2} is complete. The previous reservation was overwritten. + ``` + + + + + + 3. Request: Remove item from basket. + + + + + + ``` + transaction.begin() + basket.removeProductLineItem(item1) + basket.commit() + basket.reserveInventory() + // The reservation {sku2:2} is complete. The previous reservation was + // overwritten and a quantity of 2 is released for sku1. + ``` + + + + + + The method can be used to reserve basket items before checkout to ensure that inventory is still available at the + time an order is created from the basket using [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket). If all or some + basket items are not reserved before creating an order, [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) will + validate item availability and will fail if any item is unavailable. Calling this method in the same request as + [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) is unnecessary and discouraged for performance reasons. + + + + + The maximum quantity that can be reserved at one time is equal to the ATS (Available To Sell) quantity. (See + [ProductInventoryRecord.getATS()](dw.catalog.ProductInventoryRecord.md#getats).) + + + + + When using B2C Commerce inventory, reserving basket inventory does not reduce ATS. In this case, converting the + basket to an order reduces ATS by the reserved amount. For example, consider a product with an ATS quantity of 5 + and no reservations. If a basket reserves a quantity of 3, then other baskets still see an ATS of 5 but can only + reserve a quantity of 2. + + + + + When using Omnichannel Inventory, reserving basket inventory reduces ATS. In this case, converting the basket to + an order doesn't reduce ATS. In the previous example, after the first basket reserved a quantity of 3, other + baskets would see an ATS of 2. + + + + + Reservations can only be made for products with an inventory record. The reservation of product bundles is + controlled by the _Use Bundle Inventory Only_ setting on the inventory list. The setting allows inventory to + be reserved for just the bundle or for the bundle and its bundled products. + + + + + The following conditions must be met for the method to succeed: + + - an inventory list must be assigned to the current site + - all products in the basket must exist, and must not be of type Master or ProductSet + - each product line item must have a valid quantity + - each product must have an inventory record, or the inventory list must define that products without inventory record are available by default + - the reservation must succeed for each item as described above or `removeIfNotAvailable`is set to `true` + + + + + + The method implements its own transaction handling. Calling the method from inside a transaction is disallowed + and results in an exception being thrown. This behavior differs when calling the method from an **OCAPI + hook**. OCAPI hooks handle transactions themselves, so in this case there is also no need to do any transaction + handling, but to ensure the shortest possible locking of the inventory this method should only be called _as + the last step_ in the OCAPI hook. + + + + + [getInventoryReservationExpiry()](dw.order.Basket.md#getinventoryreservationexpiry) can be used to determine when the expiration will expire. + + + + + If the reservation fails with an ERROR status, existing valid reservations for the basket will remain unchanged + but no new reservations will be made. This might lead to a partially reserved basket. + + + + + If the reservation succeeds with an OK status and `removeIfNotAvailable` is `true`, basket + line items quantities might have been changed or line items might have been removed. The returned + [Status](dw.system.Status.md) object will contain information about the changes. Possible values for + [StatusItem.getCode()](dw.system.StatusItem.md#getcode) are: + + - BUNDLE\_REMOVED - a bundle item was removed completely + - ITEM\_REMOVED - a product line item was removed completely + - ITEM\_QUANTITY\_REDUCED - the quantity of a line item was reduced + + [StatusItem.getDetails()](dw.system.StatusItem.md#getdetails) will contain for each item the **sku** and **uuid** of the item + which was changed/removed. + + + + + This method must not be used with + + - the **CreateOrder2**pipelet, or + - [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket), or + - [OrderMgr.createOrder(Basket, String)](dw.order.OrderMgr.md#createorderbasket-string) + + in the same request. + + + **Parameters:** + - reservationDurationInMinutes - reservation duration in minutes, specifying how long the reservation will last. The maximum value for the reservation duration is 240 minutes. + - removeIfNotAvailable - if `true` is specified it will not fail if not the full quantity of the items can be reserved. Item quantity will be reduced to the quantity that could be reserved. Item will be removed if not at least quantity 1 for the item could be reserved. Different to that if a bundle line item cannot be reserved completely it will be removed including dependent line item (bundled items). + + **Returns:** + - a Status instance with - Status.OK meaning reservation process was successful. In case of + `removeIfNotAvailable` is true, status might contain status items + ([Status.getItems()](dw.system.Status.md#getitems)) for each item that needed to be changed or removed. In the worst + case this could result in an empty basket and no items reserved. A Status instance with - Status.ERROR + will be returned if `removeIfNotAvailable` is false and not all items could be reserved fully + or any unexpected error occurred. + + + +--- + +### setBusinessType(Number) +- setBusinessType(aType: [Number](TopLevel.Number.md)): void + - : Set the type of the business this order has been placed in. + + Possible values are [LineItemCtnr.BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [LineItemCtnr.BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). + + + **Parameters:** + - aType - the business type to set for this basket + + +--- + +### setChannelType(Number) +- setChannelType(aType: [Number](TopLevel.Number.md)): void + - : Set the channel type in which sales channel this order has been created. This can be used to distinguish order + placed through e.g. Storefront, Call Center or Marketplace. + + Possible values are [LineItemCtnr.CHANNEL_TYPE_STOREFRONT](dw.order.LineItemCtnr.md#channel_type_storefront), + [LineItemCtnr.CHANNEL_TYPE_CALLCENTER](dw.order.LineItemCtnr.md#channel_type_callcenter), [LineItemCtnr.CHANNEL_TYPE_MARKETPLACE](dw.order.LineItemCtnr.md#channel_type_marketplace), + [LineItemCtnr.CHANNEL_TYPE_DSS](dw.order.LineItemCtnr.md#channel_type_dss), [LineItemCtnr.CHANNEL_TYPE_STORE](dw.order.LineItemCtnr.md#channel_type_store), + [LineItemCtnr.CHANNEL_TYPE_PINTEREST](dw.order.LineItemCtnr.md#channel_type_pinterest), [LineItemCtnr.CHANNEL_TYPE_TWITTER](dw.order.LineItemCtnr.md#channel_type_twitter), + [LineItemCtnr.CHANNEL_TYPE_FACEBOOKADS](dw.order.LineItemCtnr.md#channel_type_facebookads), [LineItemCtnr.CHANNEL_TYPE_SUBSCRIPTIONS](dw.order.LineItemCtnr.md#channel_type_subscriptions), + [LineItemCtnr.CHANNEL_TYPE_ONLINERESERVATION](dw.order.LineItemCtnr.md#channel_type_onlinereservation), + [LineItemCtnr.CHANNEL_TYPE_INSTAGRAMCOMMERCE](dw.order.LineItemCtnr.md#channel_type_instagramcommerce), [LineItemCtnr.CHANNEL_TYPE_GOOGLE](dw.order.LineItemCtnr.md#channel_type_google), + [LineItemCtnr.CHANNEL_TYPE_YOUTUBE](dw.order.LineItemCtnr.md#channel_type_youtube), [LineItemCtnr.CHANNEL_TYPE_TIKTOK](dw.order.LineItemCtnr.md#channel_type_tiktok), + [LineItemCtnr.CHANNEL_TYPE_SNAPCHAT](dw.order.LineItemCtnr.md#channel_type_snapchat), [LineItemCtnr.CHANNEL_TYPE_WHATSAPP](dw.order.LineItemCtnr.md#channel_type_whatsapp) The + value for [LineItemCtnr.CHANNEL_TYPE_CUSTOMERSERVICECENTER](dw.order.LineItemCtnr.md#channel_type_customerservicecenter) is also available, but it can not be + set by the scripting API, it is set only internally. + + + **Parameters:** + - aType - the channel type to set for this basket + + +--- + +### setCustomerNo(String) +- ~~setCustomerNo(customerNo: [String](TopLevel.String.md)): void~~ + - : Sets the customer number of the customer associated with this container. + + + Note this method has little effect as it only sets the customer number and it does _not re-link the basket with + a customer profile object, nor is the number copied into the [Order](dw.order.Order.md) should one be created from + the basket. Use [Order.setCustomer(Customer)](dw.order.Order.md#setcustomercustomer) instead for a registered customer. For a + guest customer the customerNo is usually generated during order creation and the attribute is set at order level. + + + **Parameters:** + - customerNo - the customer number of the customer associated with this container. + + **Deprecated:** +:::warning +The method has been deprecated. Please use [Order.setCustomer(Customer)](dw.order.Order.md#setcustomercustomer) + instead for registered customer. For guest customer the customerNo is usually generated during order + creation and the attribute is set at order level. + +::: + +--- + +### startCheckout() +- startCheckout(): void + - : Register a "start checkout" event for the current basket. This event is tracked for AB test statistics + but otherwise has no effect on the basket. The system will register at most one checkout per basket per session. + + + +--- + +### updateCurrency() +- updateCurrency(): void + - : Updates the basket currency if different to session currency, otherwise does nothing. + + + Use [Session.setCurrency(Currency)](dw.system.Session.md#setcurrencycurrency) to set the currency for the session. To reflect the session + currency change to the basket you need to update the basket with this method. This ensures that any upcoming + basket recalculation, which is based on the session currency, matches the basket currency. + + + + + ``` + ... + if (basket.getBillingAddress().getCountryCode() == 'DE'){ + var newCurrency : Currency = Currency.getCurrency('EUR'); + session.setCurrency( newCurrency ); + basket.updateCurrency(); + } + customBasketRecalculate(); + ... + ``` + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.BasketMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.BasketMgr.md new file mode 100644 index 00000000..b2b0b7cc --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.BasketMgr.md @@ -0,0 +1,673 @@ + +# Class BasketMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.BasketMgr](dw.order.BasketMgr.md) + +Provides static helper methods for managing baskets. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [baskets](#baskets): [List](dw.util.List.md) `(read-only)` |

          Retrieve all open baskets for the logged in customer including the temporary baskets. | +| [currentBasket](#currentbasket): [Basket](dw.order.Basket.md) `(read-only)` | This method returns the current valid basket of the session customer or `null` if no current valid basket exists. | +| [currentOrNewBasket](#currentornewbasket): [Basket](dw.order.Basket.md) `(read-only)` |

          This method returns the current valid basket of the session customer or creates a new one if no current valid basket exists. | +| [storedBasket](#storedbasket): [Basket](dw.order.Basket.md) `(read-only)` |

          This method returns the stored basket of the session customer or `null` if none is found. | +| [temporaryBaskets](#temporarybaskets): [List](dw.util.List.md) `(read-only)` | Retrieve all open temporary baskets for the logged in customer. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [createAgentBasket](dw.order.BasketMgr.md#createagentbasket)() | Creates a new agent basket for the current session customer. | +| static [createBasketFromOrder](dw.order.BasketMgr.md#createbasketfromorderorder)([Order](dw.order.Order.md)) |

          Creates a Basket from an existing Order for the purposes of changing an Order. | +| static [createTemporaryBasket](dw.order.BasketMgr.md#createtemporarybasket)() | Creates a new temporary basket for the current session customer. | +| static [deleteBasket](dw.order.BasketMgr.md#deletebasketbasket)([Basket](dw.order.Basket.md)) | Remove a customer basket including a temporary basket. | +| static [deleteTemporaryBasket](dw.order.BasketMgr.md#deletetemporarybasketbasket)([Basket](dw.order.Basket.md)) | Remove a customer temporary basket. | +| static [getBasket](dw.order.BasketMgr.md#getbasketstring)([String](TopLevel.String.md)) | This method returns a valid basket of the session customer or `null` if none is found. | +| static [getBaskets](dw.order.BasketMgr.md#getbaskets)() |

          Retrieve all open baskets for the logged in customer including the temporary baskets. | +| static [getCurrentBasket](dw.order.BasketMgr.md#getcurrentbasket)() | This method returns the current valid basket of the session customer or `null` if no current valid basket exists. | +| static [getCurrentOrNewBasket](dw.order.BasketMgr.md#getcurrentornewbasket)() |

          This method returns the current valid basket of the session customer or creates a new one if no current valid basket exists. | +| static [getStoredBasket](dw.order.BasketMgr.md#getstoredbasket)() |

          This method returns the stored basket of the session customer or `null` if none is found. | +| static [getTemporaryBasket](dw.order.BasketMgr.md#gettemporarybasketstring)([String](TopLevel.String.md)) | This method returns a valid temporary basket of the session customer or `null` if none is found. | +| static [getTemporaryBaskets](dw.order.BasketMgr.md#gettemporarybaskets)() | Retrieve all open temporary baskets for the logged in customer. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### baskets +- baskets: [List](dw.util.List.md) `(read-only)` + - : + + Retrieve all open baskets for the logged in customer including the temporary baskets. + + + + + Restricted to agent scenario use cases: The returned list contains all agent baskets created with + [createAgentBasket()](dw.order.BasketMgr.md#createagentbasket) and the current storefront basket which can also be retrieved with + [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket). This method will result in an exception if called by a user without permission + Create\_Order\_On\_Behalf\_Of or if no customer is logged in the session. + + + + + Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore. + + + +--- + +### currentBasket +- currentBasket: [Basket](dw.order.Basket.md) `(read-only)` + - : This method returns the current valid basket of the session customer or `null` if no current valid + basket exists. + + + The methods [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) and [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket) work based on the selected basket + persistence, which can be configured in the Business Manager site preferences / baskets section. A basket is + valid for the configured basket lifetime. + + + + + In hybrid storefront scenarios _(Phased Launch sites that utilize SFRA/SiteGenesis for some part while also + utilizing PWA Kit or other custom headless solution for another part of the same site)_, this method must + **NOT** be used. Instead, retrieve baskets via `GET baskets/{basketId}` or + `GET customers/{customerId}/baskets`. Do not use [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket) for basket creation + in any scenario. + + + + + The current basket, if one exists, is usually updated by the method. In particular the last-modified date is + updated. **_No update is done when method [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) is used within a read-only hook + implementation (such as a beforeGet or a modifyResponse hook)._** The lifetime of a basket can be extended + in 2 ways: + + - The basket is modified in some way, e.g. a product is added resulting in the basket total being newly calculated. This results in the basket lifetime being reset. + - The basket has not been modified for 60 minutes, then using this method to access the basket will also reset the basket lifetime. + + + + + + What happens when a customer logs in? Personal data held inside the basket such as addresses, email addresses and + payment settings is associated with the customer to whom the basket belongs. If the basket being updated belongs + to a different customer this data is removed. This happens when a guest customer that has a basket logs in and + hence identifies as a registered customer. In this case the basket which was previously created by the guest + customer gets transferred to the (now logged in) registered customer. Should the registered customer already have + a basket, this basket is effectively invalidated, but made available using [getStoredBasket()](dw.order.BasketMgr.md#getstoredbasket) allowing + the script to merge content from it if desired. + + + + + What happens when a customer logs out or when the customer session times out? After the customer logs out, a + basket belonging to the registered customer (now logged out) is stored (where applicable) and this method + returns `null`. Personal data is also cleared when the session times out for a guest customer. + + + + + The following personal data is cleared: + + - product line items that were added from a wish list + - shipping method + - coupon line items + - gift certificate line items + - billing and shipping addresses + - payment instruments + - buyer email + + If the session currency no longer matches the basket currency, the basket currency should be updated with + [Basket.updateCurrency()](dw.order.Basket.md#updatecurrency). + + + + + Typical usage: + + + ``` + var basket : Basket = BasketMgr.getCurrentBasket(); + if (basket) { + // do something with basket + } + ``` + + + + + + Constraints: + + - The method only accesses the basket for the session customer, an exception is thrown when the session customer is `null`. + - Method [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket)only creates a basket when method [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket)returns `null`. + + + +--- + +### currentOrNewBasket +- currentOrNewBasket: [Basket](dw.order.Basket.md) `(read-only)` + - : + + This method returns the current valid basket of the session customer or creates a new one if no current valid + basket exists. See [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) for more details. + + + + + In hybrid storefront scenarios _(Phased Launch sites that utilize SFRA/SiteGenesis for some part while also + utilizing PWA Kit or other custom headless solution for another part of the same site)_, this method must + **NOT** be used. For these scenarios, create baskets via `POST baskets` REST calls. + + + +--- + +### storedBasket +- storedBasket: [Basket](dw.order.Basket.md) `(read-only)` + - : + + This method returns the stored basket of the session customer or `null` if none is found. A stored + basket is returned in the following situation: + + 1. During one visit, a customer-Q logs in and creates a basket-A by adding products to it. + 2. During a subsequent visit, a second basket-B is created for a guest customer who then logs in as customer-Q. + + In this case, basket-B is reassigned to customer-Q and basket-A is accessible as the stored basket using this + method. It is now possible to merge the information from the stored basket (basket-A) to the active basket + (basket-B). If this method returns `null` in the previous scenario, verify that: + + 1. The session handling between the two visits is correct - the first visit and second visit must be in different sessions. Furthermore, the second session must contain both basket creations: as guest and the customer login. + 2. The stored basket is not expired. + 3. Basket persistence settings are configured correctly in the Business Manager. + + + + + + A stored basket exists only if the corresponding setting is selected in Business Manager. preferences' baskets + section. A basket is valid for the configured basket lifetime. + + + + + Typical usage: + + + ``` + var currentBasket : Basket = BasketMgr.getCurrentOrNewBasket(); + var storedBasket : Basket = BasketMgr.getStoredBasket(); + if (storedBasket) { + // transfer all the data needed from the stored to the active basket + } + ``` + + + A exhaustive example on how to use this method in the context of the Merge Basket functionality can be found + here: [Merge Basket utility + functions using Script API](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f) + + + +--- + +### temporaryBaskets +- temporaryBaskets: [List](dw.util.List.md) `(read-only)` + - : Retrieve all open temporary baskets for the logged in customer. + + + Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore. + + + +--- + +## Method Details + +### createAgentBasket() +- static createAgentBasket(): [Basket](dw.order.Basket.md) + - : Creates a new agent basket for the current session customer. + + + By default only 4 open agent baskets are allowed per customer. If this is exceeded a + [CreateAgentBasketLimitExceededException](dw.order.CreateAgentBasketLimitExceededException.md) will be thrown. + + + + + This method will result in an exception if called by a user without permission Create\_Order\_On\_Behalf\_Of or if no + customer is logged in the session. + + + **Returns:** + - the newly created basket for the customer which is logged in + + **Throws:** + - CreateAgentBasketLimitExceededException - indicates that no agent basket could be created because the agent basket limit is already exceeded + + +--- + +### createBasketFromOrder(Order) +- static createBasketFromOrder(order: [Order](dw.order.Order.md)): [Basket](dw.order.Basket.md) + - : + + Creates a Basket from an existing Order for the purposes of changing an Order. When an Order is later created + from the Basket, the original Order is changed to status [Order.ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced). Restricted + to agent scenario use cases. + + + + + In case a storefront customer is using it the created storefront basket cannot be retrieved via + + - [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket)(ScriptAPI), + - GET /baskets/(REST APIs) or + - DELETE /baskets/(REST APIs) or + - GetBasket (Pipelet) or + - Basket-related CSC Operations from BM (these also use OCAPI REST API). + + Baskets containing an "orderNumberBeingEdited" are explicitly excluded from the list of baskets that can be + retrieved. Responsible for this behavior (this kind of basket cannot be used as general purpose shopping baskets) + - see [Basket.getOrderNoBeingEdited()](dw.order.Basket.md#getordernobeingedited) / [Basket.getOrderBeingEdited()](dw.order.Basket.md#getorderbeingedited). + + + + + In case a Business Manager user is logged in into the session the basket will be marked as an agent basket. See + [Basket.isAgentBasket()](dw.order.Basket.md#isagentbasket). + + + + + Any inventory reservation associated with the order will be canceled either early when + [Basket.reserveInventory()](dw.order.Basket.md#reserveinventory) is called for the new basket or (later) when a new replacement order + is created from the basket. Consider reserving the basket following its creation. + + + + + The method only succeeds for an Order + + - without gift certificates, + - status is not cancelled, + - was not previously replaced and + - was not previously exported. + + Failures are indicated by throwing an APIException of type CreateBasketFromOrderException which provides one of + these errorCodes: + + - Code [OrderProcessStatusCodes.ORDER_CONTAINS_GC](dw.order.OrderProcessStatusCodes.md#order_contains_gc)- the Order contains a gift certificate and cannot be replaced. + - Code [OrderProcessStatusCodes.ORDER_ALREADY_REPLACED](dw.order.OrderProcessStatusCodes.md#order_already_replaced)- the Order was already replaced. + - Code [OrderProcessStatusCodes.ORDER_ALREADY_CANCELLED](dw.order.OrderProcessStatusCodes.md#order_already_cancelled)- the Order was cancelled. + - Code [OrderProcessStatusCodes.ORDER_ALREADY_EXPORTED](dw.order.OrderProcessStatusCodes.md#order_already_exported)- the Order has already been exported. + + + + + + Usage: + + + ``` + var order : Order; // known + try + { + var basket : Basket = BasketMgr.createBasketFromOrder(order); + } + catch (e) + { + if (e instanceof APIException && e.type === 'CreateBasketFromOrderException') + { + // handle e.errorCode + } + } + ``` + + + **Parameters:** + - order - Order to create a Basket for + + **Returns:** + - a new Basket + + **Throws:** + - dw.order.CreateBasketFromOrderException - indicates the Order is in an invalid state. + + **See Also:** + - [AgentUserMgr.loginAgentUser(String, String)](dw.customer.AgentUserMgr.md#loginagentuserstring-string) + - [AgentUserMgr.loginOnBehalfOfCustomer(Customer)](dw.customer.AgentUserMgr.md#loginonbehalfofcustomercustomer) + + +--- + +### createTemporaryBasket() +- static createTemporaryBasket(): [Basket](dw.order.Basket.md) + - : Creates a new temporary basket for the current session customer. Temporary baskets are separate from shopper + storefront and agent baskets, and are intended for use to perform calculations or create an order without + disturbing a shopper's open storefront basket. Temporary baskets are automatically deleted after a time duration + of 15 minutes. + + + By default only 4 open temporary baskets are allowed per customer. If this is exceeded a + [CreateTemporaryBasketLimitExceededException](dw.order.CreateTemporaryBasketLimitExceededException.md) will be thrown. + + + **Returns:** + - the newly created basket for the current session customer + + +--- + +### deleteBasket(Basket) +- static deleteBasket(basket: [Basket](dw.order.Basket.md)): void + - : Remove a customer basket including a temporary basket. + + + This method will result in an exception if called by a user without permission Create\_Order\_On\_Behalf\_Of or if no + customer is logged in the session. + + + **Parameters:** + - basket - the basket to be removed + + **See Also:** + - [AgentUserMgr.loginAgentUser(String, String)](dw.customer.AgentUserMgr.md#loginagentuserstring-string) + - [AgentUserMgr.loginOnBehalfOfCustomer(Customer)](dw.customer.AgentUserMgr.md#loginonbehalfofcustomercustomer) + + +--- + +### deleteTemporaryBasket(Basket) +- static deleteTemporaryBasket(basket: [Basket](dw.order.Basket.md)): void + - : Remove a customer temporary basket. + + **Parameters:** + - basket - the temporary basket to be removed + + +--- + +### getBasket(String) +- static getBasket(uuid: [String](TopLevel.String.md)): [Basket](dw.order.Basket.md) + - : This method returns a valid basket of the session customer or `null` if none is found. This method can + also be used to get a temporary basket for the session customer. + + + If the basket does not belong to the session customer, the method returns `null`. + + + If the registered customer is not logged in, the method returns `null`. + + + + + Restricted to agent scenario use cases: This method will result in an exception if called by a user without + permission Create\_Order\_On\_Behalf\_Of or if no customer is logged in the session. + + + The basket, if accessible, is usually updated in the same way as [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket). + + + If the session currency no longer matches the basket currency, the basket currency should be updated with + [Basket.updateCurrency()](dw.order.Basket.md#updatecurrency). + + + **Parameters:** + - uuid - the id of the requested basket. + + **Returns:** + - the basket or `null` + + +--- + +### getBaskets() +- static getBaskets(): [List](dw.util.List.md) + - : + + Retrieve all open baskets for the logged in customer including the temporary baskets. + + + + + Restricted to agent scenario use cases: The returned list contains all agent baskets created with + [createAgentBasket()](dw.order.BasketMgr.md#createagentbasket) and the current storefront basket which can also be retrieved with + [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket). This method will result in an exception if called by a user without permission + Create\_Order\_On\_Behalf\_Of or if no customer is logged in the session. + + + + + Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore. + + + **Returns:** + - all open baskets + + +--- + +### getCurrentBasket() +- static getCurrentBasket(): [Basket](dw.order.Basket.md) + - : This method returns the current valid basket of the session customer or `null` if no current valid + basket exists. + + + The methods [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) and [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket) work based on the selected basket + persistence, which can be configured in the Business Manager site preferences / baskets section. A basket is + valid for the configured basket lifetime. + + + + + In hybrid storefront scenarios _(Phased Launch sites that utilize SFRA/SiteGenesis for some part while also + utilizing PWA Kit or other custom headless solution for another part of the same site)_, this method must + **NOT** be used. Instead, retrieve baskets via `GET baskets/{basketId}` or + `GET customers/{customerId}/baskets`. Do not use [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket) for basket creation + in any scenario. + + + + + The current basket, if one exists, is usually updated by the method. In particular the last-modified date is + updated. **_No update is done when method [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) is used within a read-only hook + implementation (such as a beforeGet or a modifyResponse hook)._** The lifetime of a basket can be extended + in 2 ways: + + - The basket is modified in some way, e.g. a product is added resulting in the basket total being newly calculated. This results in the basket lifetime being reset. + - The basket has not been modified for 60 minutes, then using this method to access the basket will also reset the basket lifetime. + + + + + + What happens when a customer logs in? Personal data held inside the basket such as addresses, email addresses and + payment settings is associated with the customer to whom the basket belongs. If the basket being updated belongs + to a different customer this data is removed. This happens when a guest customer that has a basket logs in and + hence identifies as a registered customer. In this case the basket which was previously created by the guest + customer gets transferred to the (now logged in) registered customer. Should the registered customer already have + a basket, this basket is effectively invalidated, but made available using [getStoredBasket()](dw.order.BasketMgr.md#getstoredbasket) allowing + the script to merge content from it if desired. + + + + + What happens when a customer logs out or when the customer session times out? After the customer logs out, a + basket belonging to the registered customer (now logged out) is stored (where applicable) and this method + returns `null`. Personal data is also cleared when the session times out for a guest customer. + + + + + The following personal data is cleared: + + - product line items that were added from a wish list + - shipping method + - coupon line items + - gift certificate line items + - billing and shipping addresses + - payment instruments + - buyer email + + If the session currency no longer matches the basket currency, the basket currency should be updated with + [Basket.updateCurrency()](dw.order.Basket.md#updatecurrency). + + + + + Typical usage: + + + ``` + var basket : Basket = BasketMgr.getCurrentBasket(); + if (basket) { + // do something with basket + } + ``` + + + + + + Constraints: + + - The method only accesses the basket for the session customer, an exception is thrown when the session customer is `null`. + - Method [getCurrentOrNewBasket()](dw.order.BasketMgr.md#getcurrentornewbasket)only creates a basket when method [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket)returns `null`. + + + **Returns:** + - the current basket or `null` if no valid current basket exists. + + +--- + +### getCurrentOrNewBasket() +- static getCurrentOrNewBasket(): [Basket](dw.order.Basket.md) + - : + + This method returns the current valid basket of the session customer or creates a new one if no current valid + basket exists. See [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket) for more details. + + + + + In hybrid storefront scenarios _(Phased Launch sites that utilize SFRA/SiteGenesis for some part while also + utilizing PWA Kit or other custom headless solution for another part of the same site)_, this method must + **NOT** be used. For these scenarios, create baskets via `POST baskets` REST calls. + + + **Returns:** + - the basket, existing or newly created + + +--- + +### getStoredBasket() +- static getStoredBasket(): [Basket](dw.order.Basket.md) + - : + + This method returns the stored basket of the session customer or `null` if none is found. A stored + basket is returned in the following situation: + + 1. During one visit, a customer-Q logs in and creates a basket-A by adding products to it. + 2. During a subsequent visit, a second basket-B is created for a guest customer who then logs in as customer-Q. + + In this case, basket-B is reassigned to customer-Q and basket-A is accessible as the stored basket using this + method. It is now possible to merge the information from the stored basket (basket-A) to the active basket + (basket-B). If this method returns `null` in the previous scenario, verify that: + + 1. The session handling between the two visits is correct - the first visit and second visit must be in different sessions. Furthermore, the second session must contain both basket creations: as guest and the customer login. + 2. The stored basket is not expired. + 3. Basket persistence settings are configured correctly in the Business Manager. + + + + + + A stored basket exists only if the corresponding setting is selected in Business Manager. preferences' baskets + section. A basket is valid for the configured basket lifetime. + + + + + Typical usage: + + + ``` + var currentBasket : Basket = BasketMgr.getCurrentOrNewBasket(); + var storedBasket : Basket = BasketMgr.getStoredBasket(); + if (storedBasket) { + // transfer all the data needed from the stored to the active basket + } + ``` + + + A exhaustive example on how to use this method in the context of the Merge Basket functionality can be found + here: [Merge Basket utility + functions using Script API](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f) + + + **Returns:** + - the stored basket or `null` if no valid stored basket exists. + + +--- + +### getTemporaryBasket(String) +- static getTemporaryBasket(uuid: [String](TopLevel.String.md)): [Basket](dw.order.Basket.md) + - : This method returns a valid temporary basket of the session customer or `null` if none is found. + + + If the basket does not belong to the session customer, the method returns `null`. + + + + + If the basket is not a temporary basket, the method returns `null`. + + + + + The basket, if accessible, is usually updated in the same way as [getCurrentBasket()](dw.order.BasketMgr.md#getcurrentbasket). + + + If the session currency no longer matches the basket currency, the basket currency should be updated with + [Basket.updateCurrency()](dw.order.Basket.md#updatecurrency). + + + **Parameters:** + - uuid - the id of the requested temporary basket. + + **Returns:** + - the temporary basket or `null` + + +--- + +### getTemporaryBaskets() +- static getTemporaryBaskets(): [List](dw.util.List.md) + - : Retrieve all open temporary baskets for the logged in customer. + + + Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore. + + + **Returns:** + - all open temporary baskets + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.BonusDiscountLineItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.BonusDiscountLineItem.md new file mode 100644 index 00000000..3edeb822 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.BonusDiscountLineItem.md @@ -0,0 +1,309 @@ + +# Class BonusDiscountLineItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md) + +Line item representing an applied [BonusChoiceDiscount](dw.campaign.BonusChoiceDiscount.md) in a LineItemCtnr. This type of line item +can only be created by the B2C Commerce promotions engine when applying a BonusChoiceDiscount. +A BonusDiscountLineItem is basically a placeholder in the cart which entitles a customer to add one or more bonus +products to his basket from a configured list of products. Merchants typically display this type of line item in the +cart by showing the corresponding promotion callout message. They typically provide links to the bonus products that +the customer can choose from. This line item can be removed from the cart but will be re-added each time the +promotions engine re-applies discounts. Merchants may however add custom logic to show/hide this line item since it +just a placeholder and not an actual product line item. + + +The number of products that a customer is allowed to choose from is determined by [getMaxBonusItems()](dw.order.BonusDiscountLineItem.md#getmaxbonusitems). The +collection of products the customer can choose from is determined by [getBonusProducts()](dw.order.BonusDiscountLineItem.md#getbonusproducts). When a customer +chooses a bonus product in the storefront, it is necessary to use the `AddBonusProductToBasket` pipelet +instead of the usual `AddProductToBasket` pipelet, in order to associate this BonusDiscountLineItem with +the newly created bonus ProductLineItem. Alternatively, the API method +[LineItemCtnr.createBonusProductLineItem(BonusDiscountLineItem, Product, ProductOptionModel, Shipment)](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment) +can be used instead. The system does proper validations in order to prevent incorrect or too many bonus products from +being associated with this BonusDiscountLineItem. Once a customer has selected bonus products, the product line items +representing the chosen bonus products can be retrieved with [getBonusProductLineItems()](dw.order.BonusDiscountLineItem.md#getbonusproductlineitems). + + +**See Also:** +- [BonusChoiceDiscount](dw.campaign.BonusChoiceDiscount.md) + + +## Property Summary + +| Property | Description | +| --- | --- | +| [bonusChoiceRuleBased](#bonuschoicerulebased): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns whether the promotion that triggered the creation of this line item uses a rule to determine the list of bonus products. | +| [bonusProductLineItems](#bonusproductlineitems): [List](dw.util.List.md) `(read-only)` | Get the product line items in the current LineItemCtnr representing the bonus products that the customer has selected for this discount. | +| [bonusProducts](#bonusproducts): [List](dw.util.List.md) `(read-only)` | Get the list of bonus products which the customer is allowed to choose from for this discount. | +| [couponLineItem](#couponlineitem): [CouponLineItem](dw.order.CouponLineItem.md) `(read-only)` | Get the coupon line item associated with this discount. | +| [maxBonusItems](#maxbonusitems): [Number](TopLevel.Number.md) `(read-only)` | Get the maximum number of bonus items that the customer is permitted to select for this bonus discount. | +| [promotion](#promotion): [Promotion](dw.campaign.Promotion.md) `(read-only)` | Get the promotion associated with this discount. | +| [promotionID](#promotionid): [String](TopLevel.String.md) `(read-only)` | Get the promotion ID associated with this discount. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBonusProductLineItems](dw.order.BonusDiscountLineItem.md#getbonusproductlineitems)() | Get the product line items in the current LineItemCtnr representing the bonus products that the customer has selected for this discount. | +| [getBonusProductPrice](dw.order.BonusDiscountLineItem.md#getbonusproductpriceproduct)([Product](dw.catalog.Product.md)) | Get the effective price for the passed bonus product. | +| [getBonusProducts](dw.order.BonusDiscountLineItem.md#getbonusproducts)() | Get the list of bonus products which the customer is allowed to choose from for this discount. | +| [getCouponLineItem](dw.order.BonusDiscountLineItem.md#getcouponlineitem)() | Get the coupon line item associated with this discount. | +| [getMaxBonusItems](dw.order.BonusDiscountLineItem.md#getmaxbonusitems)() | Get the maximum number of bonus items that the customer is permitted to select for this bonus discount. | +| [getPromotion](dw.order.BonusDiscountLineItem.md#getpromotion)() | Get the promotion associated with this discount. | +| [getPromotionID](dw.order.BonusDiscountLineItem.md#getpromotionid)() | Get the promotion ID associated with this discount. | +| [isBonusChoiceRuleBased](dw.order.BonusDiscountLineItem.md#isbonuschoicerulebased)() | Returns whether the promotion that triggered the creation of this line item uses a rule to determine the list of bonus products. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### bonusChoiceRuleBased +- bonusChoiceRuleBased: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns whether the promotion that triggered the creation of this line item uses a rule to determine the list of + bonus products. + + + If the promotion is rule based, then a ProductSearchModel should be used to return the bonus products the + customer may choose from, as the methods that return lists will return nothing. See [getBonusProducts()](dw.order.BonusDiscountLineItem.md#getbonusproducts) + + + +--- + +### bonusProductLineItems +- bonusProductLineItems: [List](dw.util.List.md) `(read-only)` + - : Get the product line items in the current LineItemCtnr representing the + bonus products that the customer has selected for this discount. + + + **See Also:** + - [LineItemCtnr.createBonusProductLineItem(BonusDiscountLineItem, Product, ProductOptionModel, Shipment)](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment) + + +--- + +### bonusProducts +- bonusProducts: [List](dw.util.List.md) `(read-only)` + - : Get the list of bonus products which the customer is allowed to choose + from for this discount. This list is configured by a merchant entering a + list of SKUs for the discount. Products which do not exist in the system, + or are offline, or are not assigned to a category in the site catalog are + filtered out. Unavailable (i.e. out-of-stock) products are NOT filtered + out. This allows merchants to display out-of-stock bonus products with + appropriate messaging. + + + If the promotion which triggered this discount does not exist, or this + promotion is rule based, then this method returns an empty list. + + + If the promotion is rule based, then this method will return an empty list. + A ProductSearchModel should be used to return the bonus products the + customer may choose from instead. See + [ProductSearchModel.PROMOTION_PRODUCT_TYPE_BONUS](dw.catalog.ProductSearchModel.md#promotion_product_type_bonus) and + [ProductSearchModel.setPromotionID(String)](dw.catalog.ProductSearchModel.md#setpromotionidstring) + + + If a returned product is a master product, the customer is entitled to + choose from any variant. If the product is an option product, the + customer is entitled to choose any value for each option. Since the + promotions engine does not touch the value of the product option line + items, it is the responsibility of custom code to set option prices. + + + +--- + +### couponLineItem +- couponLineItem: [CouponLineItem](dw.order.CouponLineItem.md) `(read-only)` + - : Get the coupon line item associated with this discount. + + +--- + +### maxBonusItems +- maxBonusItems: [Number](TopLevel.Number.md) `(read-only)` + - : Get the maximum number of bonus items that the customer is permitted to + select for this bonus discount. + + + If the promotion which triggered this discount does not exist, then this + method returns 0. + + + +--- + +### promotion +- promotion: [Promotion](dw.campaign.Promotion.md) `(read-only)` + - : Get the promotion associated with this discount. + + +--- + +### promotionID +- promotionID: [String](TopLevel.String.md) `(read-only)` + - : Get the promotion ID associated with this discount. + + +--- + +## Method Details + +### getBonusProductLineItems() +- getBonusProductLineItems(): [List](dw.util.List.md) + - : Get the product line items in the current LineItemCtnr representing the + bonus products that the customer has selected for this discount. + + + **Returns:** + - The selected product line items, never null. + + **See Also:** + - [LineItemCtnr.createBonusProductLineItem(BonusDiscountLineItem, Product, ProductOptionModel, Shipment)](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment) + + +--- + +### getBonusProductPrice(Product) +- getBonusProductPrice(product: [Product](dw.catalog.Product.md)): [Money](dw.value.Money.md) + - : Get the effective price for the passed bonus product. This is expected to + be one of the products returned by [getBonusProducts()](dw.order.BonusDiscountLineItem.md#getbonusproducts) with one + exception: If a master product is configured as a bonus product, this + implies that a customer may choose from any of its variants. In this + case, it is allowed to pass in a variant to this method and a price will + be returned. If the passed product is not a valid bonus product, this + method throws an exception. + + + **Parameters:** + - product - The bonus product to retrieve a price for, must not be null. + + **Returns:** + - The price of the passed bonus product as a Number. + + +--- + +### getBonusProducts() +- getBonusProducts(): [List](dw.util.List.md) + - : Get the list of bonus products which the customer is allowed to choose + from for this discount. This list is configured by a merchant entering a + list of SKUs for the discount. Products which do not exist in the system, + or are offline, or are not assigned to a category in the site catalog are + filtered out. Unavailable (i.e. out-of-stock) products are NOT filtered + out. This allows merchants to display out-of-stock bonus products with + appropriate messaging. + + + If the promotion which triggered this discount does not exist, or this + promotion is rule based, then this method returns an empty list. + + + If the promotion is rule based, then this method will return an empty list. + A ProductSearchModel should be used to return the bonus products the + customer may choose from instead. See + [ProductSearchModel.PROMOTION_PRODUCT_TYPE_BONUS](dw.catalog.ProductSearchModel.md#promotion_product_type_bonus) and + [ProductSearchModel.setPromotionID(String)](dw.catalog.ProductSearchModel.md#setpromotionidstring) + + + If a returned product is a master product, the customer is entitled to + choose from any variant. If the product is an option product, the + customer is entitled to choose any value for each option. Since the + promotions engine does not touch the value of the product option line + items, it is the responsibility of custom code to set option prices. + + + **Returns:** + - An ordered list of bonus products that the customer may choose + from for this discount. + + + +--- + +### getCouponLineItem() +- getCouponLineItem(): [CouponLineItem](dw.order.CouponLineItem.md) + - : Get the coupon line item associated with this discount. + + **Returns:** + - The coupon line item associated with this discount, or null if it no + longer exists or there is no one. + + + +--- + +### getMaxBonusItems() +- getMaxBonusItems(): [Number](TopLevel.Number.md) + - : Get the maximum number of bonus items that the customer is permitted to + select for this bonus discount. + + + If the promotion which triggered this discount does not exist, then this + method returns 0. + + + **Returns:** + - The maximum number of bonus items that the customer is permitted + to select for this bonus discount, or 0 if the promotion no + longer exists. + + + +--- + +### getPromotion() +- getPromotion(): [Promotion](dw.campaign.Promotion.md) + - : Get the promotion associated with this discount. + + **Returns:** + - The promotion associated with this discount, or null if it no + longer exists. + + + +--- + +### getPromotionID() +- getPromotionID(): [String](TopLevel.String.md) + - : Get the promotion ID associated with this discount. + + **Returns:** + - The promotion ID associated with this discount, never null. + + +--- + +### isBonusChoiceRuleBased() +- isBonusChoiceRuleBased(): [Boolean](TopLevel.Boolean.md) + - : Returns whether the promotion that triggered the creation of this line item uses a rule to determine the list of + bonus products. + + + If the promotion is rule based, then a ProductSearchModel should be used to return the bonus products the + customer may choose from, as the methods that return lists will return nothing. See [getBonusProducts()](dw.order.BonusDiscountLineItem.md#getbonusproducts) + + + **Returns:** + - If the promotion no longer exists, then null, otherwise, true if the promotion that triggered the + creation of this line item uses a rule to determine the bonus products to choose from. + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CouponLineItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CouponLineItem.md new file mode 100644 index 00000000..0852b71f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CouponLineItem.md @@ -0,0 +1,289 @@ + +# Class CouponLineItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.CouponLineItem](dw.order.CouponLineItem.md) + +The CouponLineItem class is used to store redeemed coupons in the Basket. + + +## Property Summary + +| Property | Description | +| --- | --- | +| [applied](#applied): [Boolean](TopLevel.Boolean.md) `(read-only)` | Identifies if the coupon is currently applied in the basket. | +| [basedOnCampaign](#basedoncampaign): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns true if the line item represents a coupon of a campaign. | +| [bonusDiscountLineItems](#bonusdiscountlineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns the bonus discount line items of the line item container triggered by this coupon. | +| [couponCode](#couponcode): [String](TopLevel.String.md) `(read-only)` | Returns the coupon code. | +| [priceAdjustments](#priceadjustments): [Collection](dw.util.Collection.md) `(read-only)` | Returns the price adjustments of the line item container triggered by this coupon. | +| ~~[promotion](#promotion): [Promotion](dw.campaign.Promotion.md)~~ `(read-only)` | Returns the promotion related to the coupon line item. | +| ~~[promotionID](#promotionid): [String](TopLevel.String.md)~~ `(read-only)` | Returns the id of the related promotion. | +| [statusCode](#statuscode): [String](TopLevel.String.md) `(read-only)` | This method provides a detailed error status in case the coupon code of this coupon line item instance became invalid. | +| [valid](#valid): [Boolean](TopLevel.Boolean.md) `(read-only)` | Allows to check whether the coupon code of this coupon line item instance is valid. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [associatePriceAdjustment](dw.order.CouponLineItem.md#associatepriceadjustmentpriceadjustment)([PriceAdjustment](dw.order.PriceAdjustment.md)) | Associates the specified price adjustment with the coupon line item. | +| [getBonusDiscountLineItems](dw.order.CouponLineItem.md#getbonusdiscountlineitems)() | Returns the bonus discount line items of the line item container triggered by this coupon. | +| [getCouponCode](dw.order.CouponLineItem.md#getcouponcode)() | Returns the coupon code. | +| [getPriceAdjustments](dw.order.CouponLineItem.md#getpriceadjustments)() | Returns the price adjustments of the line item container triggered by this coupon. | +| ~~[getPromotion](dw.order.CouponLineItem.md#getpromotion)()~~ | Returns the promotion related to the coupon line item. | +| ~~[getPromotionID](dw.order.CouponLineItem.md#getpromotionid)()~~ | Returns the id of the related promotion. | +| [getStatusCode](dw.order.CouponLineItem.md#getstatuscode)() | This method provides a detailed error status in case the coupon code of this coupon line item instance became invalid. | +| [isApplied](dw.order.CouponLineItem.md#isapplied)() | Identifies if the coupon is currently applied in the basket. | +| [isBasedOnCampaign](dw.order.CouponLineItem.md#isbasedoncampaign)() | Returns true if the line item represents a coupon of a campaign. | +| [isValid](dw.order.CouponLineItem.md#isvalid)() | Allows to check whether the coupon code of this coupon line item instance is valid. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### applied +- applied: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Identifies if the coupon is currently applied in the basket. A coupon + line is applied if there exists at least one price adjustment related + to the coupon line item. + + + +--- + +### basedOnCampaign +- basedOnCampaign: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns true if the line item represents a coupon of a campaign. If the coupon line item represents a custom + coupon code, the method returns false. + + + +--- + +### bonusDiscountLineItems +- bonusDiscountLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the bonus discount line items of the line item container triggered + by this coupon. + + + +--- + +### couponCode +- couponCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the coupon code. + + +--- + +### priceAdjustments +- priceAdjustments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the price adjustments of the line item container triggered + by this coupon. + + + +--- + +### promotion +- ~~promotion: [Promotion](dw.campaign.Promotion.md)~~ `(read-only)` + - : Returns the promotion related to the coupon line item. + + **Deprecated:** +:::warning +A coupon code and its coupon can be associated with + multiple promotions. Therefore, this method is not + appropriate anymore. For backward-compatibility, the method + returns one of the promotions associated with the coupon + code. + +::: + +--- + +### promotionID +- ~~promotionID: [String](TopLevel.String.md)~~ `(read-only)` + - : Returns the id of the related promotion. + + **Deprecated:** +:::warning +A coupon code and it's coupon can be associated with + multiple promotions. Therefore, this method is not + appropriate anymore. For backward-compatibility, the method + returns the ID of one of the promotions associated with + the coupon code. + +::: + +--- + +### statusCode +- statusCode: [String](TopLevel.String.md) `(read-only)` + - : This method provides a detailed error status in case the coupon code of + this coupon line item instance became invalid. + + + +--- + +### valid +- valid: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Allows to check whether the coupon code of this coupon line item instance + is valid. Coupon line item is valid, if status code is one of the following: + + - [CouponStatusCodes.APPLIED](dw.campaign.CouponStatusCodes.md#applied) + - [CouponStatusCodes.NO_APPLICABLE_PROMOTION](dw.campaign.CouponStatusCodes.md#no_applicable_promotion) + + + +--- + +## Method Details + +### associatePriceAdjustment(PriceAdjustment) +- associatePriceAdjustment(priceAdjustment: [PriceAdjustment](dw.order.PriceAdjustment.md)): void + - : Associates the specified price adjustment with the coupon line item. This method is only applicable if used for + price adjustments and coupon line items NOT based on B2C Commerce campaigns. + + + **Parameters:** + - priceAdjustment - Price adjustment to be associated with coupon line item. + + +--- + +### getBonusDiscountLineItems() +- getBonusDiscountLineItems(): [Collection](dw.util.Collection.md) + - : Returns the bonus discount line items of the line item container triggered + by this coupon. + + + **Returns:** + - Price adjustments triggered by the coupon + + +--- + +### getCouponCode() +- getCouponCode(): [String](TopLevel.String.md) + - : Returns the coupon code. + + **Returns:** + - Coupon code + + +--- + +### getPriceAdjustments() +- getPriceAdjustments(): [Collection](dw.util.Collection.md) + - : Returns the price adjustments of the line item container triggered + by this coupon. + + + **Returns:** + - Price adjustments triggered by the coupon + + +--- + +### getPromotion() +- ~~getPromotion(): [Promotion](dw.campaign.Promotion.md)~~ + - : Returns the promotion related to the coupon line item. + + **Returns:** + - Promotion related to coupon represented by line item + + **Deprecated:** +:::warning +A coupon code and its coupon can be associated with + multiple promotions. Therefore, this method is not + appropriate anymore. For backward-compatibility, the method + returns one of the promotions associated with the coupon + code. + +::: + +--- + +### getPromotionID() +- ~~getPromotionID(): [String](TopLevel.String.md)~~ + - : Returns the id of the related promotion. + + **Returns:** + - the id of the related promotion. + + **Deprecated:** +:::warning +A coupon code and it's coupon can be associated with + multiple promotions. Therefore, this method is not + appropriate anymore. For backward-compatibility, the method + returns the ID of one of the promotions associated with + the coupon code. + +::: + +--- + +### getStatusCode() +- getStatusCode(): [String](TopLevel.String.md) + - : This method provides a detailed error status in case the coupon code of + this coupon line item instance became invalid. + + + **Returns:** + - Returns APPLIED if coupon is applied, and otherwise one of the + codes defined in [CouponStatusCodes](dw.campaign.CouponStatusCodes.md) + + + +--- + +### isApplied() +- isApplied(): [Boolean](TopLevel.Boolean.md) + - : Identifies if the coupon is currently applied in the basket. A coupon + line is applied if there exists at least one price adjustment related + to the coupon line item. + + + **Returns:** + - true if the coupon is currently applied in the basket. + + +--- + +### isBasedOnCampaign() +- isBasedOnCampaign(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the line item represents a coupon of a campaign. If the coupon line item represents a custom + coupon code, the method returns false. + + + +--- + +### isValid() +- isValid(): [Boolean](TopLevel.Boolean.md) + - : Allows to check whether the coupon code of this coupon line item instance + is valid. Coupon line item is valid, if status code is one of the following: + + - [CouponStatusCodes.APPLIED](dw.campaign.CouponStatusCodes.md#applied) + - [CouponStatusCodes.NO_APPLICABLE_PROMOTION](dw.campaign.CouponStatusCodes.md#no_applicable_promotion) + + + **Returns:** + - true if the coupon code is valid, false otherwise. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateAgentBasketLimitExceededException.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateAgentBasketLimitExceededException.md new file mode 100644 index 00000000..feeccc8a --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateAgentBasketLimitExceededException.md @@ -0,0 +1,35 @@ + +# Class CreateAgentBasketLimitExceededException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.CreateAgentBasketLimitExceededException](dw.order.CreateAgentBasketLimitExceededException.md) + +This exception is thrown by [BasketMgr.createAgentBasket()](dw.order.BasketMgr.md#createagentbasket) to indicate that the open agent basket limit for +the current session customer is already reached, and therefore no new agent basket could be created. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CreateAgentBasketLimitExceededException](#createagentbasketlimitexceededexception)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CreateAgentBasketLimitExceededException() +- CreateAgentBasketLimitExceededException() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateBasketFromOrderException.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateBasketFromOrderException.md new file mode 100644 index 00000000..2bfee49f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateBasketFromOrderException.md @@ -0,0 +1,54 @@ + +# Class CreateBasketFromOrderException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.CreateBasketFromOrderException](dw.order.CreateBasketFromOrderException.md) + +This APIException is thrown by method [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) +to indicate no Basket could be created from the Order. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [errorCode](#errorcode): [String](TopLevel.String.md) `(read-only)` | Indicates reason why [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) failed. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getErrorCode](dw.order.CreateBasketFromOrderException.md#geterrorcode)() | Indicates reason why [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) failed. | + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### errorCode +- errorCode: [String](TopLevel.String.md) `(read-only)` + - : Indicates reason why [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) failed. + + +--- + +## Method Details + +### getErrorCode() +- getErrorCode(): [String](TopLevel.String.md) + - : Indicates reason why [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder) failed. + + **Returns:** + - the error code. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateCouponLineItemException.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateCouponLineItemException.md new file mode 100644 index 00000000..6d15b80d --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateCouponLineItemException.md @@ -0,0 +1,67 @@ + +# Class CreateCouponLineItemException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.CreateCouponLineItemException](dw.order.CreateCouponLineItemException.md) + +This exception could be thrown by [LineItemCtnr.createCouponLineItem(String, Boolean)](dw.order.LineItemCtnr.md#createcouponlineitemstring-boolean) +when the provided coupon code is invalid. + + +'errorCode' property is set to one of the following values: + +- [CouponStatusCodes.COUPON_CODE_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#coupon_code_already_in_basket)= Indicates that coupon code has already been added to basket. +- [CouponStatusCodes.COUPON_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#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](dw.campaign.CouponStatusCodes.md#coupon_code_already_redeemed)= Indicates that code of MultiCode/System coupon has already been redeemed. +- [CouponStatusCodes.COUPON_CODE_UNKNOWN](dw.campaign.CouponStatusCodes.md#coupon_code_unknown)= Indicates that coupon not found for given coupon code or that the code itself was not found. +- [CouponStatusCodes.COUPON_DISABLED](dw.campaign.CouponStatusCodes.md#coupon_disabled)= Indicates that coupon is not enabled. +- [CouponStatusCodes.REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#redemption_limit_exceeded)= Indicates that number of redemptions per code exceeded. +- [CouponStatusCodes.CUSTOMER_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#customer_redemption_limit_exceeded)= Indicates that number of redemptions per code and customer exceeded. +- [CouponStatusCodes.TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#timeframe_redemption_limit_exceeded)= Indicates that number of redemptions per code, customer and time exceeded. +- [CouponStatusCodes.NO_ACTIVE_PROMOTION](dw.campaign.CouponStatusCodes.md#no_active_promotion)= Indicates that coupon is not assigned to an active promotion. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [errorCode](#errorcode): [String](TopLevel.String.md) `(read-only)` | Returns one of the error codes listed in the class doc. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getErrorCode](dw.order.CreateCouponLineItemException.md#geterrorcode)() | Returns one of the error codes listed in the class doc. | + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### errorCode +- errorCode: [String](TopLevel.String.md) `(read-only)` + - : Returns one of the error codes listed in the class doc. + + +--- + +## Method Details + +### getErrorCode() +- getErrorCode(): [String](TopLevel.String.md) + - : Returns one of the error codes listed in the class doc. + + **Returns:** + - the error code + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateOrderException.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateOrderException.md new file mode 100644 index 00000000..a09e6a90 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateOrderException.md @@ -0,0 +1,23 @@ + +# Class CreateOrderException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.CreateOrderException](dw.order.CreateOrderException.md) + +This APIException is thrown by method [OrderMgr.createOrder(Basket, String)](dw.order.OrderMgr.md#createorderbasket-string) +to indicate no Order could be created from the Basket. + + + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateTemporaryBasketLimitExceededException.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateTemporaryBasketLimitExceededException.md new file mode 100644 index 00000000..5425b9be --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.CreateTemporaryBasketLimitExceededException.md @@ -0,0 +1,35 @@ + +# Class CreateTemporaryBasketLimitExceededException + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.CreateTemporaryBasketLimitExceededException](dw.order.CreateTemporaryBasketLimitExceededException.md) + +This exception is thrown by [BasketMgr.createTemporaryBasket()](dw.order.BasketMgr.md#createtemporarybasket) to indicate that the open temporary basket +limit for the current session customer is already reached, and therefore no new temporary basket could be created. + + + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [CreateTemporaryBasketLimitExceededException](#createtemporarybasketlimitexceededexception)() | | + +## Method Summary + +### Methods inherited from class Error + +[captureStackTrace](TopLevel.Error.md#capturestacktraceerror-function), [toString](TopLevel.Error.md#tostring) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constructor Details + +### CreateTemporaryBasketLimitExceededException() +- CreateTemporaryBasketLimitExceededException() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificate.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificate.md new file mode 100644 index 00000000..63ddaca0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificate.md @@ -0,0 +1,530 @@ + +# Class GiftCertificate + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.GiftCertificate](dw.order.GiftCertificate.md) + +Represents a Gift Certificate that can be used to purchase +products. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [STATUS_ISSUED](#status_issued): [Number](TopLevel.Number.md) = 1 | Represents a status of 'issued', which indicates that the Gift Certificate has been created and that it can be used to purchase products. | +| [STATUS_PARTIALLY_REDEEMED](#status_partially_redeemed): [Number](TopLevel.Number.md) = 2 | Represents a status of 'partially redeemed', which indicates that the Gift Certificate has been used to purchase products, but that there is still a balance on the gift certificate. | +| [STATUS_PENDING](#status_pending): [Number](TopLevel.Number.md) = 0 | Represents a status of 'pending', which indicates that the Gift Certificate has been created but that it cannot be used yet. | +| [STATUS_REDEEMED](#status_redeemed): [Number](TopLevel.Number.md) = 3 | Represents a status of 'redeemed', which indicates that the Gift Certificate has been used and no longer contains a balance. | + +## Property Summary + +| Property | Description | +| --- | --- | +| ~~[ID](#id): [String](TopLevel.String.md)~~ `(read-only)` | Returns the code of the gift certificate. | +| [amount](#amount): [Money](dw.value.Money.md) `(read-only)` | Returns the original amount on the gift certificate. | +| [balance](#balance): [Money](dw.value.Money.md) `(read-only)` | Returns the balance on the gift certificate. | +| [description](#description): [String](TopLevel.String.md) | Returns the description string. | +| [enabled](#enabled): [Boolean](TopLevel.Boolean.md) | Returns true if the Gift Certificate is enabled, false otherwise. | +| [giftCertificateCode](#giftcertificatecode): [String](TopLevel.String.md) `(read-only)` | Returns the code of the gift certificate. | +| [maskedGiftCertificateCode](#maskedgiftcertificatecode): [String](TopLevel.String.md) `(read-only)` | Returns the masked gift certificate code with all but the last 4 characters replaced with a '\*' character. | +| [merchantID](#merchantid): [String](TopLevel.String.md) `(read-only)` | Returns the merchant ID of the gift certificate. | +| [message](#message): [String](TopLevel.String.md) | Returns the message to include in the email of the person receiving the gift certificate. | +| [orderNo](#orderno): [String](TopLevel.String.md) | Returns the order number | +| [recipientEmail](#recipientemail): [String](TopLevel.String.md) | Returns the email address of the person receiving the gift certificate. | +| [recipientName](#recipientname): [String](TopLevel.String.md) | Returns the name of the person receiving the gift certificate. | +| [senderName](#sendername): [String](TopLevel.String.md) | Returns the name of the person or organization that sent the gift certificate or null if undefined. | +| [status](#status): [Number](TopLevel.Number.md) | Returns the status where the possible values are STATUS\_PENDING, STATUS\_ISSUED, STATUS\_PARTIALLY\_REDEEMED or STATUS\_REDEEMED. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAmount](dw.order.GiftCertificate.md#getamount)() | Returns the original amount on the gift certificate. | +| [getBalance](dw.order.GiftCertificate.md#getbalance)() | Returns the balance on the gift certificate. | +| [getDescription](dw.order.GiftCertificate.md#getdescription)() | Returns the description string. | +| [getGiftCertificateCode](dw.order.GiftCertificate.md#getgiftcertificatecode)() | Returns the code of the gift certificate. | +| ~~[getID](dw.order.GiftCertificate.md#getid)()~~ | Returns the code of the gift certificate. | +| [getMaskedGiftCertificateCode](dw.order.GiftCertificate.md#getmaskedgiftcertificatecode)() | Returns the masked gift certificate code with all but the last 4 characters replaced with a '\*' character. | +| [getMaskedGiftCertificateCode](dw.order.GiftCertificate.md#getmaskedgiftcertificatecodenumber)([Number](TopLevel.Number.md)) | Returns the masked gift certificate code with all but the specified number of characters replaced with a '\*' character. | +| [getMerchantID](dw.order.GiftCertificate.md#getmerchantid)() | Returns the merchant ID of the gift certificate. | +| [getMessage](dw.order.GiftCertificate.md#getmessage)() | Returns the message to include in the email of the person receiving the gift certificate. | +| [getOrderNo](dw.order.GiftCertificate.md#getorderno)() | Returns the order number | +| [getRecipientEmail](dw.order.GiftCertificate.md#getrecipientemail)() | Returns the email address of the person receiving the gift certificate. | +| [getRecipientName](dw.order.GiftCertificate.md#getrecipientname)() | Returns the name of the person receiving the gift certificate. | +| [getSenderName](dw.order.GiftCertificate.md#getsendername)() | Returns the name of the person or organization that sent the gift certificate or null if undefined. | +| [getStatus](dw.order.GiftCertificate.md#getstatus)() | Returns the status where the possible values are STATUS\_PENDING, STATUS\_ISSUED, STATUS\_PARTIALLY\_REDEEMED or STATUS\_REDEEMED. | +| [isEnabled](dw.order.GiftCertificate.md#isenabled)() | Returns true if the Gift Certificate is enabled, false otherwise. | +| [setDescription](dw.order.GiftCertificate.md#setdescriptionstring)([String](TopLevel.String.md)) | An optional description that you can use to categorize the gift certificate. | +| [setEnabled](dw.order.GiftCertificate.md#setenabledboolean)([Boolean](TopLevel.Boolean.md)) | Controls if the Gift Certificate is enabled. | +| [setMessage](dw.order.GiftCertificate.md#setmessagestring)([String](TopLevel.String.md)) | Sets the message to include in the email of the person receiving the gift certificate. | +| [setOrderNo](dw.order.GiftCertificate.md#setordernostring)([String](TopLevel.String.md)) | Sets the order number | +| [setRecipientEmail](dw.order.GiftCertificate.md#setrecipientemailstring)([String](TopLevel.String.md)) | Sets the email address of the person receiving the gift certificate. | +| [setRecipientName](dw.order.GiftCertificate.md#setrecipientnamestring)([String](TopLevel.String.md)) | Sets the name of the person receiving the gift certificate. | +| [setSenderName](dw.order.GiftCertificate.md#setsendernamestring)([String](TopLevel.String.md)) | Sets the name of the person or organization that sent the gift certificate. | +| [setStatus](dw.order.GiftCertificate.md#setstatusnumber)([Number](TopLevel.Number.md)) | Sets the status of the gift certificate. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### STATUS_ISSUED + +- STATUS_ISSUED: [Number](TopLevel.Number.md) = 1 + - : Represents a status of 'issued', which indicates that the Gift Certificate + has been created and that it can be used to purchase products. + + + +--- + +### STATUS_PARTIALLY_REDEEMED + +- STATUS_PARTIALLY_REDEEMED: [Number](TopLevel.Number.md) = 2 + - : Represents a status of 'partially redeemed', which indicates that the Gift Certificate + has been used to purchase products, but that there is still a balance on + the gift certificate. + + + +--- + +### STATUS_PENDING + +- STATUS_PENDING: [Number](TopLevel.Number.md) = 0 + - : Represents a status of 'pending', which indicates that the Gift Certificate + has been created but that it cannot be used yet. + + + +--- + +### STATUS_REDEEMED + +- STATUS_REDEEMED: [Number](TopLevel.Number.md) = 3 + - : Represents a status of 'redeemed', which indicates that the Gift Certificate + has been used and no longer contains a balance. + + + +--- + +## Property Details + +### ID +- ~~ID: [String](TopLevel.String.md)~~ `(read-only)` + - : Returns the code of the gift certificate. This redemption code is send to + gift certificate recipient. + + + **Deprecated:** +:::warning +Use [getGiftCertificateCode()](dw.order.GiftCertificate.md#getgiftcertificatecode) +::: + +--- + +### amount +- amount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the original amount on the gift certificate. + + +--- + +### balance +- balance: [Money](dw.value.Money.md) `(read-only)` + - : Returns the balance on the gift certificate. + + +--- + +### description +- description: [String](TopLevel.String.md) + - : Returns the description string. + + +--- + +### enabled +- enabled: [Boolean](TopLevel.Boolean.md) + - : Returns true if the Gift Certificate is enabled, false otherwise. + + +--- + +### giftCertificateCode +- giftCertificateCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the code of the gift certificate. This redemption code is send to + gift certificate recipient. + + + +--- + +### maskedGiftCertificateCode +- maskedGiftCertificateCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the masked gift certificate code with + all but the last 4 characters replaced with a '\*' character. + + + +--- + +### merchantID +- merchantID: [String](TopLevel.String.md) `(read-only)` + - : Returns the merchant ID of the gift certificate. + + +--- + +### message +- message: [String](TopLevel.String.md) + - : Returns the message to include in the email of the person receiving + the gift certificate. + + + +--- + +### orderNo +- orderNo: [String](TopLevel.String.md) + - : Returns the order number + + +--- + +### recipientEmail +- recipientEmail: [String](TopLevel.String.md) + - : Returns the email address of the person receiving + the gift certificate. + + + +--- + +### recipientName +- recipientName: [String](TopLevel.String.md) + - : Returns the name of the person receiving + the gift certificate. + + + +--- + +### senderName +- senderName: [String](TopLevel.String.md) + - : Returns the name of the person or organization that + sent the gift certificate or null if undefined. + + + +--- + +### status +- status: [Number](TopLevel.Number.md) + - : Returns the status where the possible values are + STATUS\_PENDING, STATUS\_ISSUED, STATUS\_PARTIALLY\_REDEEMED + or STATUS\_REDEEMED. + + + +--- + +## Method Details + +### getAmount() +- getAmount(): [Money](dw.value.Money.md) + - : Returns the original amount on the gift certificate. + + **Returns:** + - the original amount on the gift certificate. + + +--- + +### getBalance() +- getBalance(): [Money](dw.value.Money.md) + - : Returns the balance on the gift certificate. + + **Returns:** + - the balance on the gift certificate. + + +--- + +### getDescription() +- getDescription(): [String](TopLevel.String.md) + - : Returns the description string. + + **Returns:** + - the description. + + +--- + +### getGiftCertificateCode() +- getGiftCertificateCode(): [String](TopLevel.String.md) + - : Returns the code of the gift certificate. This redemption code is send to + gift certificate recipient. + + + **Returns:** + - the code of the gift certificate. + + +--- + +### getID() +- ~~getID(): [String](TopLevel.String.md)~~ + - : Returns the code of the gift certificate. This redemption code is send to + gift certificate recipient. + + + **Returns:** + - the code of the gift certificate. + + **Deprecated:** +:::warning +Use [getGiftCertificateCode()](dw.order.GiftCertificate.md#getgiftcertificatecode) +::: + +--- + +### getMaskedGiftCertificateCode() +- getMaskedGiftCertificateCode(): [String](TopLevel.String.md) + - : Returns the masked gift certificate code with + all but the last 4 characters replaced with a '\*' character. + + + **Returns:** + - the masked gift certificate code. + + +--- + +### getMaskedGiftCertificateCode(Number) +- getMaskedGiftCertificateCode(ignore: [Number](TopLevel.Number.md)): [String](TopLevel.String.md) + - : Returns the masked gift certificate code with + all but the specified number of characters replaced with a '\*' character. + + + **Parameters:** + - ignore - the number of characters to leave unmasked. + + **Returns:** + - the masked gift certificate code. + + **Throws:** + - IllegalArgumentException - if ignore is negative. + + +--- + +### getMerchantID() +- getMerchantID(): [String](TopLevel.String.md) + - : Returns the merchant ID of the gift certificate. + + **Returns:** + - the merchant ID of the gift certificate. + + +--- + +### getMessage() +- getMessage(): [String](TopLevel.String.md) + - : Returns the message to include in the email of the person receiving + the gift certificate. + + + **Returns:** + - the message to include in the email of the person receiving + the gift certificate. + + + +--- + +### getOrderNo() +- getOrderNo(): [String](TopLevel.String.md) + - : Returns the order number + + **Returns:** + - the order number + + +--- + +### getRecipientEmail() +- getRecipientEmail(): [String](TopLevel.String.md) + - : Returns the email address of the person receiving + the gift certificate. + + + **Returns:** + - the email address of the person receiving + the gift certificate. + + + +--- + +### getRecipientName() +- getRecipientName(): [String](TopLevel.String.md) + - : Returns the name of the person receiving + the gift certificate. + + + **Returns:** + - the name of the person receiving + the gift certificate. + + + +--- + +### getSenderName() +- getSenderName(): [String](TopLevel.String.md) + - : Returns the name of the person or organization that + sent the gift certificate or null if undefined. + + + **Returns:** + - the name of the person or organization that + sent the gift certificate or null if undefined. + + + +--- + +### getStatus() +- getStatus(): [Number](TopLevel.Number.md) + - : Returns the status where the possible values are + STATUS\_PENDING, STATUS\_ISSUED, STATUS\_PARTIALLY\_REDEEMED + or STATUS\_REDEEMED. + + + **Returns:** + - the status. + + +--- + +### isEnabled() +- isEnabled(): [Boolean](TopLevel.Boolean.md) + - : Returns true if the Gift Certificate is enabled, false otherwise. + + **Returns:** + - true if the Gift Certificate is enabled, false otherwise. + + +--- + +### setDescription(String) +- setDescription(description: [String](TopLevel.String.md)): void + - : An optional description that you can use to categorize the + gift certificate. + + + **Parameters:** + - description - additional description. + + +--- + +### setEnabled(Boolean) +- setEnabled(enabled: [Boolean](TopLevel.Boolean.md)): void + - : Controls if the Gift Certificate is enabled. + + **Parameters:** + - enabled - if true, enables the Gift Certificate. + + +--- + +### setMessage(String) +- setMessage(message: [String](TopLevel.String.md)): void + - : Sets the message to include in the email of the person receiving + the gift certificate. + + + **Parameters:** + - message - the message to include in the email of the person receiving the gift certificate. + + +--- + +### setOrderNo(String) +- setOrderNo(orderNo: [String](TopLevel.String.md)): void + - : Sets the order number + + **Parameters:** + - orderNo - the order number to be set + + +--- + +### setRecipientEmail(String) +- setRecipientEmail(recipientEmail: [String](TopLevel.String.md)): void + - : Sets the email address of the person receiving + the gift certificate. + + + **Parameters:** + - recipientEmail - the email address of the person receiving the gift certificate. + + +--- + +### setRecipientName(String) +- setRecipientName(recipient: [String](TopLevel.String.md)): void + - : Sets the name of the person receiving + the gift certificate. + + + **Parameters:** + - recipient - the name of the person receiving the gift certificate. + + +--- + +### setSenderName(String) +- setSenderName(sender: [String](TopLevel.String.md)): void + - : Sets the name of the person or organization that + sent the gift certificate. + + + **Parameters:** + - sender - the name of the person or organization that sent the gift certificate. + + +--- + +### setStatus(Number) +- setStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the status of the gift certificate. + + Possible values are: [STATUS_ISSUED](dw.order.GiftCertificate.md#status_issued), + [STATUS_PENDING](dw.order.GiftCertificate.md#status_pending), [STATUS_PARTIALLY_REDEEMED](dw.order.GiftCertificate.md#status_partially_redeemed) + and [STATUS_REDEEMED](dw.order.GiftCertificate.md#status_redeemed). + + + **Parameters:** + - status - Gift certificate status + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateLineItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateLineItem.md new file mode 100644 index 00000000..16447f60 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateLineItem.md @@ -0,0 +1,292 @@ + +# Class GiftCertificateLineItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.LineItem](dw.order.LineItem.md) + - [dw.order.GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md) + +Represents a Gift Certificate line item in the cart. When an order is +processed, a Gift Certificate is created based on the information in +the Gift Certificate line item. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [giftCertificateID](#giftcertificateid): [String](TopLevel.String.md) | Returns the ID of the gift certificate that this line item was used to create. | +| [message](#message): [String](TopLevel.String.md) | Returns the message to include in the email of the person receiving the gift certificate line item. | +| [productListItem](#productlistitem): [ProductListItem](dw.customer.ProductListItem.md) | Returns the associated ProductListItem. | +| [recipientEmail](#recipientemail): [String](TopLevel.String.md) | Returns the email address of the person receiving the gift certificate line item. | +| [recipientName](#recipientname): [String](TopLevel.String.md) | Returns the name of the person receiving the gift certificate line item. | +| [senderName](#sendername): [String](TopLevel.String.md) | Returns the name of the person or organization that sent the gift certificate line item or null if undefined. | +| [shipment](#shipment): [Shipment](dw.order.Shipment.md) | Returns the associated Shipment. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getGiftCertificateID](dw.order.GiftCertificateLineItem.md#getgiftcertificateid)() | Returns the ID of the gift certificate that this line item was used to create. | +| [getMessage](dw.order.GiftCertificateLineItem.md#getmessage)() | Returns the message to include in the email of the person receiving the gift certificate line item. | +| [getProductListItem](dw.order.GiftCertificateLineItem.md#getproductlistitem)() | Returns the associated ProductListItem. | +| [getRecipientEmail](dw.order.GiftCertificateLineItem.md#getrecipientemail)() | Returns the email address of the person receiving the gift certificate line item. | +| [getRecipientName](dw.order.GiftCertificateLineItem.md#getrecipientname)() | Returns the name of the person receiving the gift certificate line item. | +| [getSenderName](dw.order.GiftCertificateLineItem.md#getsendername)() | Returns the name of the person or organization that sent the gift certificate line item or null if undefined. | +| [getShipment](dw.order.GiftCertificateLineItem.md#getshipment)() | Returns the associated Shipment. | +| [setGiftCertificateID](dw.order.GiftCertificateLineItem.md#setgiftcertificateidstring)([String](TopLevel.String.md)) | Sets the ID of the gift certificate associated with this line item. | +| [setMessage](dw.order.GiftCertificateLineItem.md#setmessagestring)([String](TopLevel.String.md)) | Sets the message to include in the email of the person receiving the gift certificate line item. | +| [setProductListItem](dw.order.GiftCertificateLineItem.md#setproductlistitemproductlistitem)([ProductListItem](dw.customer.ProductListItem.md)) | Sets the associated ProductListItem. | +| [setRecipientEmail](dw.order.GiftCertificateLineItem.md#setrecipientemailstring)([String](TopLevel.String.md)) | Sets the email address of the person receiving the gift certificate line item. | +| [setRecipientName](dw.order.GiftCertificateLineItem.md#setrecipientnamestring)([String](TopLevel.String.md)) | Sets the name of the person receiving the gift certificate line item. | +| [setSenderName](dw.order.GiftCertificateLineItem.md#setsendernamestring)([String](TopLevel.String.md)) | Sets the name of the person or organization that sent the gift certificate line item. | +| [setShipment](dw.order.GiftCertificateLineItem.md#setshipmentshipment)([Shipment](dw.order.Shipment.md)) | Associates the gift certificate line item with the specified shipment. | + +### Methods inherited from class LineItem + +[getBasePrice](dw.order.LineItem.md#getbaseprice), [getGrossPrice](dw.order.LineItem.md#getgrossprice), [getLineItemCtnr](dw.order.LineItem.md#getlineitemctnr), [getLineItemText](dw.order.LineItem.md#getlineitemtext), [getNetPrice](dw.order.LineItem.md#getnetprice), [getPrice](dw.order.LineItem.md#getprice), [getPriceValue](dw.order.LineItem.md#getpricevalue), [getTax](dw.order.LineItem.md#gettax), [getTaxBasis](dw.order.LineItem.md#gettaxbasis), [getTaxClassID](dw.order.LineItem.md#gettaxclassid), [getTaxRate](dw.order.LineItem.md#gettaxrate), [setBasePrice](dw.order.LineItem.md#setbasepricemoney), [setGrossPrice](dw.order.LineItem.md#setgrosspricemoney), [setLineItemText](dw.order.LineItem.md#setlineitemtextstring), [setNetPrice](dw.order.LineItem.md#setnetpricemoney), [setPriceValue](dw.order.LineItem.md#setpricevaluenumber), [setTax](dw.order.LineItem.md#settaxmoney), [setTaxClassID](dw.order.LineItem.md#settaxclassidstring), [setTaxRate](dw.order.LineItem.md#settaxratenumber), [updatePrice](dw.order.LineItem.md#updatepricemoney), [updateTax](dw.order.LineItem.md#updatetaxnumber), [updateTax](dw.order.LineItem.md#updatetaxnumber-money), [updateTaxAmount](dw.order.LineItem.md#updatetaxamountmoney) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### giftCertificateID +- giftCertificateID: [String](TopLevel.String.md) + - : Returns the ID of the gift certificate that this line item + was used to create. If this line item has not been used to create + a Gift Certificate, this method returns null. + + + +--- + +### message +- message: [String](TopLevel.String.md) + - : Returns the message to include in the email of the person receiving + the gift certificate line item. + + + +--- + +### productListItem +- productListItem: [ProductListItem](dw.customer.ProductListItem.md) + - : Returns the associated ProductListItem. + + +--- + +### recipientEmail +- recipientEmail: [String](TopLevel.String.md) + - : Returns the email address of the person receiving + the gift certificate line item. + + + +--- + +### recipientName +- recipientName: [String](TopLevel.String.md) + - : Returns the name of the person receiving the gift certificate line item. + + +--- + +### senderName +- senderName: [String](TopLevel.String.md) + - : Returns the name of the person or organization that + sent the gift certificate line item or null if undefined. + + + +--- + +### shipment +- shipment: [Shipment](dw.order.Shipment.md) + - : Returns the associated Shipment. + + +--- + +## Method Details + +### getGiftCertificateID() +- getGiftCertificateID(): [String](TopLevel.String.md) + - : Returns the ID of the gift certificate that this line item + was used to create. If this line item has not been used to create + a Gift Certificate, this method returns null. + + + **Returns:** + - the ID of the gift certificate or null if undefined. + + +--- + +### getMessage() +- getMessage(): [String](TopLevel.String.md) + - : Returns the message to include in the email of the person receiving + the gift certificate line item. + + + **Returns:** + - the message to include in the email of the person receiving + the gift certificate line item. + + + +--- + +### getProductListItem() +- getProductListItem(): [ProductListItem](dw.customer.ProductListItem.md) + - : Returns the associated ProductListItem. + + **Returns:** + - item or null. + + +--- + +### getRecipientEmail() +- getRecipientEmail(): [String](TopLevel.String.md) + - : Returns the email address of the person receiving + the gift certificate line item. + + + **Returns:** + - the email address of the person receiving + the gift certificate line item. + + + +--- + +### getRecipientName() +- getRecipientName(): [String](TopLevel.String.md) + - : Returns the name of the person receiving the gift certificate line item. + + **Returns:** + - the name of the person receiving the gift certificate line item. + + +--- + +### getSenderName() +- getSenderName(): [String](TopLevel.String.md) + - : Returns the name of the person or organization that + sent the gift certificate line item or null if undefined. + + + **Returns:** + - the name of the person or organization that + sent the gift certificate line item or null if undefined. + + + +--- + +### getShipment() +- getShipment(): [Shipment](dw.order.Shipment.md) + - : Returns the associated Shipment. + + **Returns:** + - The shipment of the gift certificate line item + + +--- + +### setGiftCertificateID(String) +- setGiftCertificateID(id: [String](TopLevel.String.md)): void + - : Sets the ID of the gift certificate associated with this line item. + + **Parameters:** + - id - the ID of the gift certificate associated with this line item. + + +--- + +### setMessage(String) +- setMessage(message: [String](TopLevel.String.md)): void + - : Sets the message to include in the email of the person receiving + the gift certificate line item. + + + **Parameters:** + - message - the message to include in the email of the person receiving the gift certificate line item. + + +--- + +### setProductListItem(ProductListItem) +- setProductListItem(productListItem: [ProductListItem](dw.customer.ProductListItem.md)): void + - : Sets the associated ProductListItem. + + + The product list item to be set must be of type gift certificate otherwise an exception is thrown. + + + **Parameters:** + - productListItem - the product list item to be associated + + +--- + +### setRecipientEmail(String) +- setRecipientEmail(recipientEmail: [String](TopLevel.String.md)): void + - : Sets the email address of the person receiving + the gift certificate line item. + + + **Parameters:** + - recipientEmail - the email address of the person receiving the gift certificate line item. + + +--- + +### setRecipientName(String) +- setRecipientName(recipient: [String](TopLevel.String.md)): void + - : Sets the name of the person receiving the gift certificate line item. + + **Parameters:** + - recipient - the name of the person receiving the gift certificate line item. + + +--- + +### setSenderName(String) +- setSenderName(sender: [String](TopLevel.String.md)): void + - : Sets the name of the person or organization that + sent the gift certificate line item. + + + **Parameters:** + - sender - the name of the person or organization that sent the gift certificate line item. + + +--- + +### setShipment(Shipment) +- setShipment(shipment: [Shipment](dw.order.Shipment.md)): void + - : Associates the gift certificate line item with the specified shipment. + + Gift certificate line item and shipment must belong to the same line item ctnr. + + + **Parameters:** + - shipment - The new shipment of the gift certificate line item + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateMgr.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateMgr.md new file mode 100644 index 00000000..e95ce6a1 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateMgr.md @@ -0,0 +1,228 @@ + +# Class GiftCertificateMgr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.GiftCertificateMgr](dw.order.GiftCertificateMgr.md) + +The GiftCertificateMgr class contains a set of static methods for +interacting with GiftCertificates. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| ~~[GC_ERROR_DISABLED](#gc_error_disabled): [String](TopLevel.String.md) = "GIFTCERTIFICATE-100"~~ | Indicates that an error occurred because the Gift Certificate is currently disabled. | +| ~~[GC_ERROR_INSUFFICIENT_BALANCE](#gc_error_insufficient_balance): [String](TopLevel.String.md) = "GIFTCERTIFICATE-110"~~ | Indicates that an error occurred because the Gift Certificate does not have a sufficient balance to perform the requested operation. | +| ~~[GC_ERROR_INVALID_AMOUNT](#gc_error_invalid_amount): [String](TopLevel.String.md) = "GIFTCERTIFICATE-140"~~ | Indicates that an error occurred because the Gift Certificate Amount was not valid. | +| ~~[GC_ERROR_INVALID_CODE](#gc_error_invalid_code): [String](TopLevel.String.md) = "GIFTCERTIFICATE-150"~~ | Indicates that an error occurred because the Gift Certificate ID was not valid. | +| ~~[GC_ERROR_PENDING](#gc_error_pending): [String](TopLevel.String.md) = "GIFTCERTIFICATE-130"~~ | Indicates that an error occurred because the Gift Certificate has been fully redeemed. | +| ~~[GC_ERROR_REDEEMED](#gc_error_redeemed): [String](TopLevel.String.md) = "GIFTCERTIFICATE-120"~~ | Indicates that an error occurred because the Gift Certificate has been fully redeemed. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| static [createGiftCertificate](dw.order.GiftCertificateMgr.md#creategiftcertificatenumber)([Number](TopLevel.Number.md)) | Creates a Gift Certificate. | +| static [createGiftCertificate](dw.order.GiftCertificateMgr.md#creategiftcertificatenumber-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Creates a Gift Certificate. | +| ~~static [getGiftCertificate](dw.order.GiftCertificateMgr.md#getgiftcertificatestring)([String](TopLevel.String.md))~~ | Returns the Gift Certificate identified by the specified gift certificate code. | +| static [getGiftCertificateByCode](dw.order.GiftCertificateMgr.md#getgiftcertificatebycodestring)([String](TopLevel.String.md)) | Returns the Gift Certificate identified by the specified gift certificate code. | +| static [getGiftCertificateByMerchantID](dw.order.GiftCertificateMgr.md#getgiftcertificatebymerchantidstring)([String](TopLevel.String.md)) | Returns the Gift Certificate identified by the specified merchant ID. | +| static [redeemGiftCertificate](dw.order.GiftCertificateMgr.md#redeemgiftcertificateorderpaymentinstrument)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)) | Redeems an amount from a Gift Certificate. | + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### GC_ERROR_DISABLED + +- ~~GC_ERROR_DISABLED: [String](TopLevel.String.md) = "GIFTCERTIFICATE-100"~~ + - : Indicates that an error occurred because the Gift Certificate + is currently disabled. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +### GC_ERROR_INSUFFICIENT_BALANCE + +- ~~GC_ERROR_INSUFFICIENT_BALANCE: [String](TopLevel.String.md) = "GIFTCERTIFICATE-110"~~ + - : Indicates that an error occurred because the Gift Certificate + does not have a sufficient balance to perform the requested + operation. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +### GC_ERROR_INVALID_AMOUNT + +- ~~GC_ERROR_INVALID_AMOUNT: [String](TopLevel.String.md) = "GIFTCERTIFICATE-140"~~ + - : Indicates that an error occurred because the Gift Certificate + Amount was not valid. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +### GC_ERROR_INVALID_CODE + +- ~~GC_ERROR_INVALID_CODE: [String](TopLevel.String.md) = "GIFTCERTIFICATE-150"~~ + - : Indicates that an error occurred because the Gift Certificate + ID was not valid. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +### GC_ERROR_PENDING + +- ~~GC_ERROR_PENDING: [String](TopLevel.String.md) = "GIFTCERTIFICATE-130"~~ + - : Indicates that an error occurred because the Gift Certificate + has been fully redeemed. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +### GC_ERROR_REDEEMED + +- ~~GC_ERROR_REDEEMED: [String](TopLevel.String.md) = "GIFTCERTIFICATE-120"~~ + - : Indicates that an error occurred because the Gift Certificate + has been fully redeemed. + + + **Deprecated:** +:::warning +Use [GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) instead. +::: + +--- + +## Method Details + +### createGiftCertificate(Number) +- static createGiftCertificate(amount: [Number](TopLevel.Number.md)): [GiftCertificate](dw.order.GiftCertificate.md) + - : Creates a Gift Certificate. The system will assign a code to the new Gift Certificate. + + **Parameters:** + - amount - the amount of the gift certificate. Must not be negative or zero. + + **Returns:** + - the newly created Gift Certificate. + + +--- + +### createGiftCertificate(Number, String) +- static createGiftCertificate(amount: [Number](TopLevel.Number.md), code: [String](TopLevel.String.md)): [GiftCertificate](dw.order.GiftCertificate.md) + - : Creates a Gift Certificate. If a non-empty Gift Certificate code is specified, the code will be used to create + the Gift Certificate. Be aware that this code must be unique for the current site. If it is not unique, the Gift + Certificate will not be created. + + + **Parameters:** + - amount - the amount of the gift certificate. Must not be negative or zero. + - code - the code for the new gift certificate. If parameter is null or empty , the system will assign a code to the new gift certificate. + + **Returns:** + - the newly created Gift Certificate. + + +--- + +### getGiftCertificate(String) +- ~~static getGiftCertificate(giftCertificateCode: [String](TopLevel.String.md)): [GiftCertificate](dw.order.GiftCertificate.md)~~ + - : Returns the Gift Certificate identified by the specified + gift certificate code. + + + **Parameters:** + - giftCertificateCode - to identify the Gift Certificate. + + **Returns:** + - the Gift Certificate identified by the specified code or null. + + **Deprecated:** +:::warning +Use [getGiftCertificateByCode(String)](dw.order.GiftCertificateMgr.md#getgiftcertificatebycodestring) +::: + +--- + +### getGiftCertificateByCode(String) +- static getGiftCertificateByCode(giftCertificateCode: [String](TopLevel.String.md)): [GiftCertificate](dw.order.GiftCertificate.md) + - : Returns the Gift Certificate identified by the specified + gift certificate code. + + + **Parameters:** + - giftCertificateCode - to identify the Gift Certificate. + + **Returns:** + - the Gift Certificate identified by the specified code or null. + + +--- + +### getGiftCertificateByMerchantID(String) +- static getGiftCertificateByMerchantID(merchantID: [String](TopLevel.String.md)): [GiftCertificate](dw.order.GiftCertificate.md) + - : Returns the Gift Certificate identified by the specified merchant ID. + + **Parameters:** + - merchantID - to identify the Gift Certificate. + + **Returns:** + - the Gift Certificate identified by the specified merchant ID or + null. + + + +--- + +### redeemGiftCertificate(OrderPaymentInstrument) +- static redeemGiftCertificate(paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)): [Status](dw.system.Status.md) + - : Redeems an amount from a Gift Certificate. The Gift Certificate ID + is specified in the OrderPaymentInstrument and the amount + specified in the PaymentTransaction associated with the + OrderPaymentInstrument. If the PaymentTransaction.getTransactionID() + is not null, the value returned by this method is used as the + 'Order Number' for the redemption transaction. The 'Order Number' is + visible via the Business Manager. + + + **Parameters:** + - paymentInstrument - the OrderPaymentInstrument containing the ID of the Gift Certificate to redeem, and the amount of the redemption. + + **Returns:** + - the status of the redemption operation. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateStatusCodes.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateStatusCodes.md new file mode 100644 index 00000000..f5bb9c2f --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.GiftCertificateStatusCodes.md @@ -0,0 +1,108 @@ + +# Class GiftCertificateStatusCodes + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.GiftCertificateStatusCodes](dw.order.GiftCertificateStatusCodes.md) + +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. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [GIFTCERTIFICATE_CURRENCY_MISMATCH](#giftcertificate_currency_mismatch): [String](TopLevel.String.md) = "GIFTCERTIFICATE_CURRENCY_MISMATCH" | Indicates that an error occurred because the Gift Certificate was in a different currency than the Basket. | +| [GIFTCERTIFICATE_DISABLED](#giftcertificate_disabled): [String](TopLevel.String.md) = "GIFTCERTIFICATE_DISABLED" | Indicates that an error occurred because the Gift Certificate is currently disabled. | +| [GIFTCERTIFICATE_INSUFFICIENT_BALANCE](#giftcertificate_insufficient_balance): [String](TopLevel.String.md) = "GIFTCERTIFICATE_INSUFFICIENT_BALANCE" | Indicates that an error occurred because the Gift Certificate does not have a sufficient balance to perform the requested operation. | +| [GIFTCERTIFICATE_NOT_FOUND](#giftcertificate_not_found): [String](TopLevel.String.md) = "GIFTCERTIFICATE_NOT_FOUND" | Indicates that an error occurred because the Gift Certificate was not found. | +| [GIFTCERTIFICATE_PENDING](#giftcertificate_pending): [String](TopLevel.String.md) = "GIFTCERTIFICATE_PENDING" | Indicates that an error occurred because the Gift Certificate is pending and is not available for use. | +| [GIFTCERTIFICATE_REDEEMED](#giftcertificate_redeemed): [String](TopLevel.String.md) = "GIFTCERTIFICATE_REDEEMED" | Indicates that an error occurred because the Gift Certificate has been fully redeemed. | + +## Constructor Summary + +| Constructor | Description | +| --- | --- | +| [GiftCertificateStatusCodes](#giftcertificatestatuscodes)() | | + +## Method Summary + +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### GIFTCERTIFICATE_CURRENCY_MISMATCH + +- GIFTCERTIFICATE_CURRENCY_MISMATCH: [String](TopLevel.String.md) = "GIFTCERTIFICATE_CURRENCY_MISMATCH" + - : Indicates that an error occurred because the Gift Certificate + was in a different currency than the Basket. + + + +--- + +### GIFTCERTIFICATE_DISABLED + +- GIFTCERTIFICATE_DISABLED: [String](TopLevel.String.md) = "GIFTCERTIFICATE_DISABLED" + - : Indicates that an error occurred because the Gift Certificate + is currently disabled. + + + +--- + +### GIFTCERTIFICATE_INSUFFICIENT_BALANCE + +- GIFTCERTIFICATE_INSUFFICIENT_BALANCE: [String](TopLevel.String.md) = "GIFTCERTIFICATE_INSUFFICIENT_BALANCE" + - : Indicates that an error occurred because the Gift Certificate + does not have a sufficient balance to perform the requested + operation. + + + +--- + +### GIFTCERTIFICATE_NOT_FOUND + +- GIFTCERTIFICATE_NOT_FOUND: [String](TopLevel.String.md) = "GIFTCERTIFICATE_NOT_FOUND" + - : Indicates that an error occurred because the Gift Certificate + was not found. + + + +--- + +### GIFTCERTIFICATE_PENDING + +- GIFTCERTIFICATE_PENDING: [String](TopLevel.String.md) = "GIFTCERTIFICATE_PENDING" + - : Indicates that an error occurred because the Gift Certificate + is pending and is not available for use. + + + +--- + +### GIFTCERTIFICATE_REDEEMED + +- GIFTCERTIFICATE_REDEEMED: [String](TopLevel.String.md) = "GIFTCERTIFICATE_REDEEMED" + - : Indicates that an error occurred because the Gift Certificate + has been fully redeemed. + + + +--- + +## Constructor Details + +### GiftCertificateStatusCodes() +- GiftCertificateStatusCodes() + - : + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.Invoice.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.Invoice.md new file mode 100644 index 00000000..ca7c4271 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.Invoice.md @@ -0,0 +1,571 @@ + +# Class Invoice + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItemCtnr](dw.order.AbstractItemCtnr.md) + - [dw.order.Invoice](dw.order.Invoice.md) + +The Invoice can be a debit or credit invoice, and is created +from custom scripts using one of the methods +[ShippingOrder.createInvoice(String)](dw.order.ShippingOrder.md#createinvoicestring), +[Appeasement.createInvoice(String)](dw.order.Appeasement.md#createinvoicestring), +[ReturnCase.createInvoice(String)](dw.order.ReturnCase.md#createinvoicestring) or +[Return.createInvoice(String)](dw.order.Return.md#createinvoicestring). + + +Order post-processing APIs (gillian) are now inactive by default and will throw +an exception if accessed. Activation needs preliminary approval by Product Management. +Please contact support in this case. Existing customers using these APIs are not +affected by this change and can use the APIs until further notice. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [ORDERBY_CREATION_DATE](#orderby_creation_date): [Object](TopLevel.Object.md) | Sorting by creation date. | +| [ORDERBY_ITEMID](#orderby_itemid): [Object](TopLevel.Object.md) | Sorting by item id. | +| [ORDERBY_ITEMPOSITION](#orderby_itemposition): [Object](TopLevel.Object.md) | Sorting by the position of the related oder item. | +| [ORDERBY_REVERSE](#orderby_reverse): [Object](TopLevel.Object.md) | Reverse orders. | +| [ORDERBY_UNSORTED](#orderby_unsorted): [Object](TopLevel.Object.md) | Unsorted , as it is. | +| [QUALIFIER_CAPTURE](#qualifier_capture): [Object](TopLevel.Object.md) | Selects the capture transactions. | +| [QUALIFIER_PRODUCTITEMS](#qualifier_productitems): [Object](TopLevel.Object.md) | Selects the product items. | +| [QUALIFIER_REFUND](#qualifier_refund): [Object](TopLevel.Object.md) | Selects the refund transactions. | +| [QUALIFIER_SERVICEITEMS](#qualifier_serviceitems): [Object](TopLevel.Object.md) | Selects for the service items. | +| [STATUS_FAILED](#status_failed): [String](TopLevel.String.md) = "FAILED" | Constant for Invoice Status Failed. The invoice handling failed. | +| [STATUS_MANUAL](#status_manual): [String](TopLevel.String.md) = "MANUAL" | Constant for Invoice Status Manual. The invoice is not paid but will **not** be handled automatically. A manual invoice handling (capture or refund) is necessary. | +| [STATUS_NOT_PAID](#status_not_paid): [String](TopLevel.String.md) = "NOT_PAID" | Constant for Invoice Status Not Paid. The invoice is not paid and will be handled automatically. | +| [STATUS_PAID](#status_paid): [String](TopLevel.String.md) = "PAID" | Constant for Invoice Status Paid. The invoice was successfully paid. | +| [TYPE_APPEASEMENT](#type_appeasement): [String](TopLevel.String.md) = "APPEASEMENT" | Constant for Invoice Type Appeasement. The invoice was created for an appeasement. The invoice amount needs to be refunded. | +| [TYPE_RETURN](#type_return): [String](TopLevel.String.md) = "RETURN" | Constant for Invoice Type Return. The invoice was created for a return. The invoice amount needs to be refunded. | +| [TYPE_RETURN_CASE](#type_return_case): [String](TopLevel.String.md) = "RETURN_CASE" | Constant for Invoice Type Return Case. The invoice was created for a return case. The invoice amount needs to be refunded. | +| [TYPE_SHIPPING](#type_shipping): [String](TopLevel.String.md) = "SHIPPING" | Constant for Invoice Type Shipping. The invoice was created for a shipping order. The invoice amount needs to be captured. | + +## Property Summary + +| Property | Description | +| --- | --- | +| [capturedAmount](#capturedamount): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of the captured amounts. | +| [invoiceNumber](#invoicenumber): [String](TopLevel.String.md) `(read-only)` | Returns the invoice number. | +| [items](#items): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Access the collection of [InvoiceItem](dw.order.InvoiceItem.md)s. | +| [paymentTransactions](#paymenttransactions): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the payment transactions belonging to this Invoice. | +| [refundedAmount](#refundedamount): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of the refunded amounts. | +| [status](#status): [EnumValue](dw.value.EnumValue.md) | Returns the invoice status. The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). | +| [type](#type): [EnumValue](dw.value.EnumValue.md) `(read-only)` | Returns the invoice type. The possible values are [TYPE_SHIPPING](dw.order.Invoice.md#type_shipping), [TYPE_RETURN](dw.order.Invoice.md#type_return), [TYPE_RETURN_CASE](dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](dw.order.Invoice.md#type_appeasement). | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [account](dw.order.Invoice.md#account)() |

          The invoice will be accounted. | +| [addCaptureTransaction](dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Money](dw.value.Money.md)) | Calling this method registers an amount captured for a given order payment instrument. | +| [addRefundTransaction](dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Money](dw.value.Money.md)) | Calling this method registers an amount refunded for a given order payment instrument. | +| [getCapturedAmount](dw.order.Invoice.md#getcapturedamount)() | Returns the sum of the captured amounts. | +| [getInvoiceNumber](dw.order.Invoice.md#getinvoicenumber)() | Returns the invoice number. | +| [getItems](dw.order.Invoice.md#getitems)() | Access the collection of [InvoiceItem](dw.order.InvoiceItem.md)s. | +| [getPaymentTransactions](dw.order.Invoice.md#getpaymenttransactions)() | Returns the payment transactions belonging to this Invoice. | +| [getRefundedAmount](dw.order.Invoice.md#getrefundedamount)() | Returns the sum of the refunded amounts. | +| [getStatus](dw.order.Invoice.md#getstatus)() | Returns the invoice status. The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). | +| [getType](dw.order.Invoice.md#gettype)() | Returns the invoice type. The possible values are [TYPE_SHIPPING](dw.order.Invoice.md#type_shipping), [TYPE_RETURN](dw.order.Invoice.md#type_return), [TYPE_RETURN_CASE](dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](dw.order.Invoice.md#type_appeasement). | +| [setStatus](dw.order.Invoice.md#setstatusstring)([String](TopLevel.String.md)) | Sets the invoice status. The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). | + +### Methods inherited from class AbstractItemCtnr + +[getCreatedBy](dw.order.AbstractItemCtnr.md#getcreatedby), [getCreationDate](dw.order.AbstractItemCtnr.md#getcreationdate), [getGrandTotal](dw.order.AbstractItemCtnr.md#getgrandtotal), [getItems](dw.order.AbstractItemCtnr.md#getitems), [getLastModified](dw.order.AbstractItemCtnr.md#getlastmodified), [getModifiedBy](dw.order.AbstractItemCtnr.md#getmodifiedby), [getOrder](dw.order.AbstractItemCtnr.md#getorder), [getProductSubtotal](dw.order.AbstractItemCtnr.md#getproductsubtotal), [getServiceSubtotal](dw.order.AbstractItemCtnr.md#getservicesubtotal) +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### ORDERBY_CREATION_DATE + +- ORDERBY_CREATION_DATE: [Object](TopLevel.Object.md) + - : Sorting by creation date. Use with method [getPaymentTransactions()](dw.order.Invoice.md#getpaymenttransactions) as an argument to + method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + + +--- + +### ORDERBY_ITEMID + +- ORDERBY_ITEMID: [Object](TopLevel.Object.md) + - : Sorting by item id. Use with method [getItems()](dw.order.Invoice.md#getitems) as an argument to + method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + + +--- + +### ORDERBY_ITEMPOSITION + +- ORDERBY_ITEMPOSITION: [Object](TopLevel.Object.md) + - : Sorting by the position of the related oder item. Use with method + [getItems()](dw.order.Invoice.md#getitems) as an argument to method + [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + + +--- + +### ORDERBY_REVERSE + +- ORDERBY_REVERSE: [Object](TopLevel.Object.md) + - : Reverse orders. Use as an argument + to method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + + +--- + +### ORDERBY_UNSORTED + +- ORDERBY_UNSORTED: [Object](TopLevel.Object.md) + - : Unsorted , as it is. Use with method [getItems()](dw.order.Invoice.md#getitems) as an argument + to method [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject). + + + +--- + +### QUALIFIER_CAPTURE + +- QUALIFIER_CAPTURE: [Object](TopLevel.Object.md) + - : Selects the capture transactions. Use with method [getPaymentTransactions()](dw.order.Invoice.md#getpaymenttransactions) as an + argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + + +--- + +### QUALIFIER_PRODUCTITEMS + +- QUALIFIER_PRODUCTITEMS: [Object](TopLevel.Object.md) + - : Selects the product items. Use with method [getItems()](dw.order.Invoice.md#getitems) as an + argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + + +--- + +### QUALIFIER_REFUND + +- QUALIFIER_REFUND: [Object](TopLevel.Object.md) + - : Selects the refund transactions. Use with method [getPaymentTransactions()](dw.order.Invoice.md#getpaymenttransactions) as an + argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + + +--- + +### QUALIFIER_SERVICEITEMS + +- QUALIFIER_SERVICEITEMS: [Object](TopLevel.Object.md) + - : Selects for the service items. Use with method [getItems()](dw.order.Invoice.md#getitems) as an + argument to method [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject). + + + +--- + +### STATUS_FAILED + +- STATUS_FAILED: [String](TopLevel.String.md) = "FAILED" + - : Constant for Invoice Status Failed. + + The invoice handling failed. + + + +--- + +### STATUS_MANUAL + +- STATUS_MANUAL: [String](TopLevel.String.md) = "MANUAL" + - : Constant for Invoice Status Manual. + + The invoice is not paid but will **not** be handled automatically. + + A manual invoice handling (capture or refund) is necessary. + + + +--- + +### STATUS_NOT_PAID + +- STATUS_NOT_PAID: [String](TopLevel.String.md) = "NOT_PAID" + - : Constant for Invoice Status Not Paid. + + The invoice is not paid and will be handled automatically. + + + +--- + +### STATUS_PAID + +- STATUS_PAID: [String](TopLevel.String.md) = "PAID" + - : Constant for Invoice Status Paid. + + The invoice was successfully paid. + + + +--- + +### TYPE_APPEASEMENT + +- TYPE_APPEASEMENT: [String](TopLevel.String.md) = "APPEASEMENT" + - : Constant for Invoice Type Appeasement. + + The invoice was created for an appeasement. + + The invoice amount needs to be refunded. + + + +--- + +### TYPE_RETURN + +- TYPE_RETURN: [String](TopLevel.String.md) = "RETURN" + - : Constant for Invoice Type Return. + + The invoice was created for a return. + + The invoice amount needs to be refunded. + + + +--- + +### TYPE_RETURN_CASE + +- TYPE_RETURN_CASE: [String](TopLevel.String.md) = "RETURN_CASE" + - : Constant for Invoice Type Return Case. + + The invoice was created for a return case. + + The invoice amount needs to be refunded. + + + +--- + +### TYPE_SHIPPING + +- TYPE_SHIPPING: [String](TopLevel.String.md) = "SHIPPING" + - : Constant for Invoice Type Shipping. + + The invoice was created for a shipping order. + + The invoice amount needs to be captured. + + + +--- + +## Property Details + +### capturedAmount +- capturedAmount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of the captured amounts. The captured amounts are + calculated on the fly. + + Associate a payment capture for a [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + with an Invoice using + [addCaptureTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money). + + + +--- + +### invoiceNumber +- invoiceNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the invoice number. + + +--- + +### items +- items: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Access the collection of [InvoiceItem](dw.order.InvoiceItem.md)s. + + + This [FilteringCollection](dw.util.FilteringCollection.md) can be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMID](dw.order.Invoice.md#orderby_itemid) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMPOSITION](dw.order.Invoice.md#orderby_itemposition) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Invoice.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_PRODUCTITEMS](dw.order.Invoice.md#qualifier_productitems) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_SERVICEITEMS](dw.order.Invoice.md#qualifier_serviceitems) + + + +--- + +### paymentTransactions +- paymentTransactions: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the payment transactions belonging to this Invoice. + + + This [FilteringCollection](dw.util.FilteringCollection.md) can be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_CREATION_DATE](dw.order.Invoice.md#orderby_creation_date) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Invoice.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_CAPTURE](dw.order.Invoice.md#qualifier_capture) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_REFUND](dw.order.Invoice.md#qualifier_refund) + + + **See Also:** + - [PaymentTransaction](dw.order.PaymentTransaction.md) + + +--- + +### refundedAmount +- refundedAmount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of the refunded amounts. The refunded amounts are + calculated on the fly. + + Associate a payment capture for a [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + with an Invoice using + [addRefundTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money). + + + +--- + +### status +- status: [EnumValue](dw.value.EnumValue.md) + - : Returns the invoice status. + + The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), + [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). + + + +--- + +### type +- type: [EnumValue](dw.value.EnumValue.md) `(read-only)` + - : Returns the invoice type. + + The possible values are [TYPE_SHIPPING](dw.order.Invoice.md#type_shipping), [TYPE_RETURN](dw.order.Invoice.md#type_return), + [TYPE_RETURN_CASE](dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](dw.order.Invoice.md#type_appeasement). + + + +--- + +## Method Details + +### account() +- account(): [Boolean](TopLevel.Boolean.md) + - : + + The invoice will be accounted. + + + + + It will be captured in case of a shipping invoice and it will be refunded in + case of an appeasement, return case or return invoice. + + + + + + The accounting will be handled in the payment hooks + [PaymentHooks.capture(Invoice)](dw.order.hooks.PaymentHooks.md#captureinvoice) or + [PaymentHooks.refund(Invoice)](dw.order.hooks.PaymentHooks.md#refundinvoice). The implementing script could add + payment transactions to the invoice. The accompanying business logic will + set the status to `PAID` or `FAILED`. + + + + + The accounting will fail when the invoice state is different to + [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid) or [STATUS_FAILED](dw.order.Invoice.md#status_failed). + + + + + The method implements its own transaction handling. The method must not + be called inside a transaction. + + + **Returns:** + - `true` when the accounting was successful, otherwise + `false`. + + + +--- + +### addCaptureTransaction(OrderPaymentInstrument, Money) +- addCaptureTransaction(instrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), capturedAmount: [Money](dw.value.Money.md)): [PaymentTransaction](dw.order.PaymentTransaction.md) + - : Calling this method registers an amount captured for a given + order payment instrument. The authorization for the + capture is associated with the payment transaction belonging to the + instrument. Calling this method allows the Invoice, the + [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) and the [Order](dw.order.Order.md) to + return their captured amount as a sum calculated on the fly. The method + may be called multiple times for the same instrument (multiple capture + for one authorization) or for different instruments (invoice settlement + using multiple payments). + + + **Parameters:** + - instrument - the order payment instrument + - capturedAmount - amount to register as captured + + **Returns:** + - the created capture transaction + + +--- + +### addRefundTransaction(OrderPaymentInstrument, Money) +- addRefundTransaction(instrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), refundedAmount: [Money](dw.value.Money.md)): [PaymentTransaction](dw.order.PaymentTransaction.md) + - : Calling this method registers an amount refunded for a given + order payment instrument. Calling this method allows the + Invoice, the [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) and + the [Order](dw.order.Order.md) to return their refunded amount as a sum + calculated on the fly. The method may be called multiple times for the + same instrument (multiple refunds of one payment) or for different + instruments (invoice settlement using multiple payments). + + + **Parameters:** + - instrument - the order payment instrument + - refundedAmount - amount to register as refunded + + **Returns:** + - the created refund transaction + + +--- + +### getCapturedAmount() +- getCapturedAmount(): [Money](dw.value.Money.md) + - : Returns the sum of the captured amounts. The captured amounts are + calculated on the fly. + + Associate a payment capture for a [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + with an Invoice using + [addCaptureTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money). + + + **Returns:** + - sum of captured amounts + + +--- + +### getInvoiceNumber() +- getInvoiceNumber(): [String](TopLevel.String.md) + - : Returns the invoice number. + + **Returns:** + - the invoice number + + +--- + +### getItems() +- getItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Access the collection of [InvoiceItem](dw.order.InvoiceItem.md)s. + + + This [FilteringCollection](dw.util.FilteringCollection.md) can be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMID](dw.order.Invoice.md#orderby_itemid) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_ITEMPOSITION](dw.order.Invoice.md#orderby_itemposition) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Invoice.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_PRODUCTITEMS](dw.order.Invoice.md#qualifier_productitems) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_SERVICEITEMS](dw.order.Invoice.md#qualifier_serviceitems) + + + **Returns:** + - the invoice items + + +--- + +### getPaymentTransactions() +- getPaymentTransactions(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the payment transactions belonging to this Invoice. + + + This [FilteringCollection](dw.util.FilteringCollection.md) can be sorted / filtered using: + + - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_CREATION_DATE](dw.order.Invoice.md#orderby_creation_date) - [FilteringCollection.sort(Object)](dw.util.FilteringCollection.md#sortobject)with [ORDERBY_UNSORTED](dw.order.Invoice.md#orderby_unsorted) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_CAPTURE](dw.order.Invoice.md#qualifier_capture) - [FilteringCollection.select(Object)](dw.util.FilteringCollection.md#selectobject)with [QUALIFIER_REFUND](dw.order.Invoice.md#qualifier_refund) + + + **Returns:** + - the payment transactions. + + **See Also:** + - [PaymentTransaction](dw.order.PaymentTransaction.md) + + +--- + +### getRefundedAmount() +- getRefundedAmount(): [Money](dw.value.Money.md) + - : Returns the sum of the refunded amounts. The refunded amounts are + calculated on the fly. + + Associate a payment capture for a [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + with an Invoice using + [addRefundTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money). + + + **Returns:** + - sum of refunded amounts + + +--- + +### getStatus() +- getStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the invoice status. + + The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), + [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). + + + **Returns:** + - the invoice status + + +--- + +### getType() +- getType(): [EnumValue](dw.value.EnumValue.md) + - : Returns the invoice type. + + The possible values are [TYPE_SHIPPING](dw.order.Invoice.md#type_shipping), [TYPE_RETURN](dw.order.Invoice.md#type_return), + [TYPE_RETURN_CASE](dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](dw.order.Invoice.md#type_appeasement). + + + **Returns:** + - the invoice type + + +--- + +### setStatus(String) +- setStatus(status: [String](TopLevel.String.md)): void + - : Sets the invoice status. + + The possible values are [STATUS_NOT_PAID](dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](dw.order.Invoice.md#status_manual), + [STATUS_PAID](dw.order.Invoice.md#status_paid), [STATUS_FAILED](dw.order.Invoice.md#status_failed). + + + **Parameters:** + - status - the invoice status to set + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.InvoiceItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.InvoiceItem.md new file mode 100644 index 00000000..d95cbb98 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.InvoiceItem.md @@ -0,0 +1,199 @@ + +# Class InvoiceItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.Extensible](dw.object.Extensible.md) + - [dw.order.AbstractItem](dw.order.AbstractItem.md) + - [dw.order.InvoiceItem](dw.order.InvoiceItem.md) + +Represents a specific item in an [Invoice](dw.order.Invoice.md). Invoice items are added to the invoice +on its creation, each item references exactly one order-item. + + +Order post-processing APIs (gillian) are now inactive by default and will throw +an exception if accessed. Activation needs preliminary approval by Product Management. +Please contact support in this case. Existing customers using these APIs are not +affected by this change and can use the APIs until further notice. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [basePrice](#baseprice): [Money](dw.value.Money.md) `(read-only)` | Price of a single unit before discount application. | +| [capturedAmount](#capturedamount): [Money](dw.value.Money.md) | Returns the captured amount for this item. | +| [invoiceNumber](#invoicenumber): [String](TopLevel.String.md) `(read-only)` | Returns the number of the invoice to which this item belongs. | +| [parentItem](#parentitem): [InvoiceItem](dw.order.InvoiceItem.md) | Returns null or the parent item. | +| [quantity](#quantity): [Quantity](dw.value.Quantity.md) `(read-only)` | Returns the quantity of this item. | +| [refundedAmount](#refundedamount): [Money](dw.value.Money.md) | Returns the refunded amount for this item. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBasePrice](dw.order.InvoiceItem.md#getbaseprice)() | Price of a single unit before discount application. | +| [getCapturedAmount](dw.order.InvoiceItem.md#getcapturedamount)() | Returns the captured amount for this item. | +| [getInvoiceNumber](dw.order.InvoiceItem.md#getinvoicenumber)() | Returns the number of the invoice to which this item belongs. | +| [getParentItem](dw.order.InvoiceItem.md#getparentitem)() | Returns null or the parent item. | +| [getQuantity](dw.order.InvoiceItem.md#getquantity)() | Returns the quantity of this item. | +| [getRefundedAmount](dw.order.InvoiceItem.md#getrefundedamount)() | Returns the refunded amount for this item. | +| [setCapturedAmount](dw.order.InvoiceItem.md#setcapturedamountmoney)([Money](dw.value.Money.md)) | Updates the captured amount for this item. | +| [setParentItem](dw.order.InvoiceItem.md#setparentiteminvoiceitem)([InvoiceItem](dw.order.InvoiceItem.md)) | Set a parent item. | +| [setRefundedAmount](dw.order.InvoiceItem.md#setrefundedamountmoney)([Money](dw.value.Money.md)) | Updates the refunded amount for this item. | + +### Methods inherited from class AbstractItem + +[getGrossPrice](dw.order.AbstractItem.md#getgrossprice), [getItemID](dw.order.AbstractItem.md#getitemid), [getLineItem](dw.order.AbstractItem.md#getlineitem), [getNetPrice](dw.order.AbstractItem.md#getnetprice), [getOrderItem](dw.order.AbstractItem.md#getorderitem), [getOrderItemID](dw.order.AbstractItem.md#getorderitemid), [getTax](dw.order.AbstractItem.md#gettax), [getTaxBasis](dw.order.AbstractItem.md#gettaxbasis), [getTaxItems](dw.order.AbstractItem.md#gettaxitems) +### Methods inherited from class Extensible + +[describe](dw.object.Extensible.md#describe), [getCustom](dw.object.Extensible.md#getcustom) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### basePrice +- basePrice: [Money](dw.value.Money.md) `(read-only)` + - : Price of a single unit before discount application. + + +--- + +### capturedAmount +- capturedAmount: [Money](dw.value.Money.md) + - : Returns the captured amount for this item. + + +--- + +### invoiceNumber +- invoiceNumber: [String](TopLevel.String.md) `(read-only)` + - : Returns the number of the invoice to which this item belongs. + + +--- + +### parentItem +- parentItem: [InvoiceItem](dw.order.InvoiceItem.md) + - : Returns null or the parent item. + + +--- + +### quantity +- quantity: [Quantity](dw.value.Quantity.md) `(read-only)` + - : Returns the quantity of this item. + + +--- + +### refundedAmount +- refundedAmount: [Money](dw.value.Money.md) + - : Returns the refunded amount for this item. + + +--- + +## Method Details + +### getBasePrice() +- getBasePrice(): [Money](dw.value.Money.md) + - : Price of a single unit before discount application. + + **Returns:** + - Price of a single unit before discount application. + + +--- + +### getCapturedAmount() +- getCapturedAmount(): [Money](dw.value.Money.md) + - : Returns the captured amount for this item. + + **Returns:** + - the captured amount for this item + + +--- + +### getInvoiceNumber() +- getInvoiceNumber(): [String](TopLevel.String.md) + - : Returns the number of the invoice to which this item belongs. + + **Returns:** + - the number of the invoice to which this item belongs + + +--- + +### getParentItem() +- getParentItem(): [InvoiceItem](dw.order.InvoiceItem.md) + - : Returns null or the parent item. + + **Returns:** + - null or the parent item. + + +--- + +### getQuantity() +- getQuantity(): [Quantity](dw.value.Quantity.md) + - : Returns the quantity of this item. + + **Returns:** + - quantity of this item + + +--- + +### getRefundedAmount() +- getRefundedAmount(): [Money](dw.value.Money.md) + - : Returns the refunded amount for this item. + + **Returns:** + - the refunded amount for this item + + +--- + +### setCapturedAmount(Money) +- setCapturedAmount(capturedAmount: [Money](dw.value.Money.md)): void + - : Updates the captured amount for this item. + + **Parameters:** + - capturedAmount - the captured amount for this item + + +--- + +### setParentItem(InvoiceItem) +- setParentItem(parentItem: [InvoiceItem](dw.order.InvoiceItem.md)): void + - : Set a parent item. The parent item must belong to the same + [Invoice](dw.order.Invoice.md). An infinite parent-child loop is disallowed + as is a parent-child depth greater than 10. Setting a parent item + indicates a dependency of the child item on the parent item, and can be + used to form a parallel structure to that accessed using + [ProductLineItem.getParent()](dw.order.ProductLineItem.md#getparent). + + + **Parameters:** + - parentItem - The parent item, null is allowed + + +--- + +### setRefundedAmount(Money) +- setRefundedAmount(refundedAmount: [Money](dw.value.Money.md)): void + - : Updates the refunded amount for this item. + + **Parameters:** + - refundedAmount - the refunded amount for this item + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItem.md new file mode 100644 index 00000000..ba6847f0 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItem.md @@ -0,0 +1,489 @@ + +# Class LineItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.LineItem](dw.order.LineItem.md) + +Common line item base class. + + +## All Known Subclasses +[GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md), [PriceAdjustment](dw.order.PriceAdjustment.md), [ProductLineItem](dw.order.ProductLineItem.md), [ProductShippingLineItem](dw.order.ProductShippingLineItem.md), [ShippingLineItem](dw.order.ShippingLineItem.md) +## Property Summary + +| Property | Description | +| --- | --- | +| [basePrice](#baseprice): [Money](dw.value.Money.md) | Returns the base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. | +| [grossPrice](#grossprice): [Money](dw.value.Money.md) | Returns the gross price for the line item, which is the price of the unit before applying adjustments, in the purchase currency, including tax. | +| [lineItemCtnr](#lineitemctnr): [LineItemCtnr](dw.order.LineItemCtnr.md) `(read-only)` | Returns the line item ctnr of the line item. | +| [lineItemText](#lineitemtext): [String](TopLevel.String.md) | Returns the display text for the line item. | +| [netPrice](#netprice): [Money](dw.value.Money.md) | Returns the net price for the line item, which is the price of the unit before applying adjustments, in the purchase currency, excluding tax. | +| [price](#price): [Money](dw.value.Money.md) `(read-only)` | Get the price of the line item. | +| [priceValue](#pricevalue): [Number](TopLevel.Number.md) | Return the price amount for the line item. | +| [tax](#tax): [Money](dw.value.Money.md) | Returns the tax for the line item, which is the tax of the unit before applying adjustments, in the purchase currency. | +| [taxBasis](#taxbasis): [Money](dw.value.Money.md) `(read-only)` | Get the price used to calculate the tax for this line item. | +| [taxClassID](#taxclassid): [String](TopLevel.String.md) | Returns the tax class ID for the line item or null if no tax class ID is associated with the line item. | +| [taxRate](#taxrate): [Number](TopLevel.Number.md) | Returns the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getBasePrice](dw.order.LineItem.md#getbaseprice)() | Returns the base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. | +| [getGrossPrice](dw.order.LineItem.md#getgrossprice)() | Returns the gross price for the line item, which is the price of the unit before applying adjustments, in the purchase currency, including tax. | +| [getLineItemCtnr](dw.order.LineItem.md#getlineitemctnr)() | Returns the line item ctnr of the line item. | +| [getLineItemText](dw.order.LineItem.md#getlineitemtext)() | Returns the display text for the line item. | +| [getNetPrice](dw.order.LineItem.md#getnetprice)() | Returns the net price for the line item, which is the price of the unit before applying adjustments, in the purchase currency, excluding tax. | +| [getPrice](dw.order.LineItem.md#getprice)() | Get the price of the line item. | +| [getPriceValue](dw.order.LineItem.md#getpricevalue)() | Return the price amount for the line item. | +| [getTax](dw.order.LineItem.md#gettax)() | Returns the tax for the line item, which is the tax of the unit before applying adjustments, in the purchase currency. | +| [getTaxBasis](dw.order.LineItem.md#gettaxbasis)() | Get the price used to calculate the tax for this line item. | +| [getTaxClassID](dw.order.LineItem.md#gettaxclassid)() | Returns the tax class ID for the line item or null if no tax class ID is associated with the line item. | +| [getTaxRate](dw.order.LineItem.md#gettaxrate)() | Returns the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. | +| ~~[setBasePrice](dw.order.LineItem.md#setbasepricemoney)([Money](dw.value.Money.md))~~ | Sets the base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. | +| ~~[setGrossPrice](dw.order.LineItem.md#setgrosspricemoney)([Money](dw.value.Money.md))~~ | Sets the gross price for the line item, which is the Price of the unit before applying adjustments, in the purchase currency, including tax. | +| [setLineItemText](dw.order.LineItem.md#setlineitemtextstring)([String](TopLevel.String.md)) | Sets the display text for the line item. | +| ~~[setNetPrice](dw.order.LineItem.md#setnetpricemoney)([Money](dw.value.Money.md))~~ | Sets the value for the net price, which is the price of the unit before applying adjustments, in the purchase currency, excluding tax. | +| [setPriceValue](dw.order.LineItem.md#setpricevaluenumber)([Number](TopLevel.Number.md)) | Sets price attributes of the line item based on the current purchase currency and taxation policy. | +| [setTax](dw.order.LineItem.md#settaxmoney)([Money](dw.value.Money.md)) | Sets the value for the tax of the line item, which is the the tax of the unit before applying adjustments, in the purchase currency. | +| [setTaxClassID](dw.order.LineItem.md#settaxclassidstring)([String](TopLevel.String.md)) | Sets the tax class ID for the line item. | +| [setTaxRate](dw.order.LineItem.md#settaxratenumber)([Number](TopLevel.Number.md)) | Sets the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. | +| ~~[updatePrice](dw.order.LineItem.md#updatepricemoney)([Money](dw.value.Money.md))~~ | Updates the price attributes of the line item based on the specified price. | +| [updateTax](dw.order.LineItem.md#updatetaxnumber)([Number](TopLevel.Number.md)) | Updates the tax-related attributes of the line item based on the specified tax rate, a tax basis determined by the system and the "Tax Rounding Mode" order preference. | +| [updateTax](dw.order.LineItem.md#updatetaxnumber-money)([Number](TopLevel.Number.md), [Money](dw.value.Money.md)) | Updates the tax-related attributes of the line item based on the specified tax rate, the passed tax basis and the "Tax Rounding Mode" order preference. | +| [updateTaxAmount](dw.order.LineItem.md#updatetaxamountmoney)([Money](dw.value.Money.md)) | Updates tax amount of the line item setting the provided value. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### basePrice +- basePrice: [Money](dw.value.Money.md) + - : Returns the base price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency. The base price may be net or gross of tax depending on the configured taxation policy. + + + +--- + +### grossPrice +- grossPrice: [Money](dw.value.Money.md) + - : Returns the gross price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency, including tax. + + + +--- + +### lineItemCtnr +- lineItemCtnr: [LineItemCtnr](dw.order.LineItemCtnr.md) `(read-only)` + - : Returns the line item ctnr of the line item. + + +--- + +### lineItemText +- lineItemText: [String](TopLevel.String.md) + - : Returns the display text for the line item. + + +--- + +### netPrice +- netPrice: [Money](dw.value.Money.md) + - : Returns the net price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency, excluding tax. + + + +--- + +### price +- price: [Money](dw.value.Money.md) `(read-only)` + - : Get the price of the line item. If the line item is based on net pricing then the net price is returned. If the + line item is based on gross pricing then the gross price is returned. + + + +--- + +### priceValue +- priceValue: [Number](TopLevel.Number.md) + - : Return the price amount for the line item. Same as getPrice().getValue(). + + +--- + +### tax +- tax: [Money](dw.value.Money.md) + - : Returns the tax for the line item, which is the tax of the unit before applying adjustments, in the purchase + currency. + + + +--- + +### taxBasis +- taxBasis: [Money](dw.value.Money.md) `(read-only)` + - : Get the price used to calculate the tax for this line item. + + +--- + +### taxClassID +- taxClassID: [String](TopLevel.String.md) + - : Returns the tax class ID for the line item or null if no tax class ID is associated with the line item. In the + case where the tax class ID is null, you should use the default tax class ID. + + + **See Also:** + - [TaxMgr.getDefaultTaxClassID()](dw.order.TaxMgr.md#getdefaulttaxclassid) + + +--- + +### taxRate +- taxRate: [Number](TopLevel.Number.md) + - : Returns the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. A + value of 0.175 represents a percentage of 17.5%. + + + +--- + +## Method Details + +### getBasePrice() +- getBasePrice(): [Money](dw.value.Money.md) + - : Returns the base price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency. The base price may be net or gross of tax depending on the configured taxation policy. + + + **Returns:** + - the base price for the line item. + + +--- + +### getGrossPrice() +- getGrossPrice(): [Money](dw.value.Money.md) + - : Returns the gross price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency, including tax. + + + **Returns:** + - the value of the gross price. + + +--- + +### getLineItemCtnr() +- getLineItemCtnr(): [LineItemCtnr](dw.order.LineItemCtnr.md) + - : Returns the line item ctnr of the line item. + + **Returns:** + - Line item ctnr of the line item + + +--- + +### getLineItemText() +- getLineItemText(): [String](TopLevel.String.md) + - : Returns the display text for the line item. + + **Returns:** + - the display text. + + +--- + +### getNetPrice() +- getNetPrice(): [Money](dw.value.Money.md) + - : Returns the net price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency, excluding tax. + + + **Returns:** + - the value for the net price. + + +--- + +### getPrice() +- getPrice(): [Money](dw.value.Money.md) + - : Get the price of the line item. If the line item is based on net pricing then the net price is returned. If the + line item is based on gross pricing then the gross price is returned. + + + **Returns:** + - either the net or the gross price + + +--- + +### getPriceValue() +- getPriceValue(): [Number](TopLevel.Number.md) + - : Return the price amount for the line item. Same as getPrice().getValue(). + + **Returns:** + - the price for the line item + + +--- + +### getTax() +- getTax(): [Money](dw.value.Money.md) + - : Returns the tax for the line item, which is the tax of the unit before applying adjustments, in the purchase + currency. + + + **Returns:** + - the tax for the line item. + + +--- + +### getTaxBasis() +- getTaxBasis(): [Money](dw.value.Money.md) + - : Get the price used to calculate the tax for this line item. + + **Returns:** + - The tax basis used to calculate tax for this line item, or Money.NOT\_AVAILABLE if tax has not been set + for this line item yet. + + + +--- + +### getTaxClassID() +- getTaxClassID(): [String](TopLevel.String.md) + - : Returns the tax class ID for the line item or null if no tax class ID is associated with the line item. In the + case where the tax class ID is null, you should use the default tax class ID. + + + **Returns:** + - the tax class ID for the line item or null if no tax class ID is associated with the line item. + + **See Also:** + - [TaxMgr.getDefaultTaxClassID()](dw.order.TaxMgr.md#getdefaulttaxclassid) + + +--- + +### getTaxRate() +- getTaxRate(): [Number](TopLevel.Number.md) + - : Returns the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. A + value of 0.175 represents a percentage of 17.5%. + + + **Returns:** + - the value of the tax rate. + + +--- + +### setBasePrice(Money) +- ~~setBasePrice(aValue: [Money](dw.value.Money.md)): void~~ + - : Sets the base price for the line item, which is the price of the unit before applying adjustments, in the + purchase currency. The base price may be net or gross of tax depending on the configured taxation policy. + + + **Parameters:** + - aValue - the new value of the base price. + + **Deprecated:** +:::warning +Use [updatePrice(Money)](dw.order.LineItem.md#updatepricemoney) instead. +::: + +--- + +### setGrossPrice(Money) +- ~~setGrossPrice(aValue: [Money](dw.value.Money.md)): void~~ + - : Sets the gross price for the line item, which is the Price of the unit before applying adjustments, in the + purchase currency, including tax. + + + **Parameters:** + - aValue - the new value of the attribute + + **Deprecated:** +:::warning +Use [updatePrice(Money)](dw.order.LineItem.md#updatepricemoney) which sets the base price and also the gross price if the line item + is based on gross pricing. + +::: + +--- + +### setLineItemText(String) +- setLineItemText(aText: [String](TopLevel.String.md)): void + - : Sets the display text for the line item. + + **Parameters:** + - aText - line item text. + + +--- + +### setNetPrice(Money) +- ~~setNetPrice(aValue: [Money](dw.value.Money.md)): void~~ + - : Sets the value for the net price, which is the price of the unit before applying adjustments, in the purchase + currency, excluding tax. + + + **Parameters:** + - aValue - the new value for the net price + + **Deprecated:** +:::warning +Use [updatePrice(Money)](dw.order.LineItem.md#updatepricemoney) which sets the base price and also the net price if the line item is + based on net pricing. + +::: + +--- + +### setPriceValue(Number) +- setPriceValue(value: [Number](TopLevel.Number.md)): void + - : Sets price attributes of the line item based on the current purchase currency and taxation policy. + + The methods sets the 'basePrice' attribute of the line item. Additionally, it sets the 'netPrice' attribute of + the line item if the current taxation policy is 'net', and the 'grossPrice' attribute, if the current taxation + policy is 'gross'. + + If null is specified as value, the price attributes are reset to Money.NOT\_AVAILABLE. + + + **Parameters:** + - value - Price value or null + + +--- + +### setTax(Money) +- setTax(aValue: [Money](dw.value.Money.md)): void + - : Sets the value for the tax of the line item, which is the the tax of the unit before applying adjustments, in the + purchase currency. + + + **Parameters:** + - aValue - the new value for the tax. + + +--- + +### setTaxClassID(String) +- setTaxClassID(aValue: [String](TopLevel.String.md)): void + - : Sets the tax class ID for the line item. + + **Parameters:** + - aValue - the tax class ID for the line item. + + +--- + +### setTaxRate(Number) +- setTaxRate(taxRate: [Number](TopLevel.Number.md)): void + - : Sets the tax rate, which is the decimal tax rate to be applied to the product represented by this line item. A + value of 0.175 represents a percentage of 17.5%. + + + **Parameters:** + - taxRate - the new value for the tax rate. + + +--- + +### updatePrice(Money) +- ~~updatePrice(price: [Money](dw.value.Money.md)): void~~ + - : Updates the price attributes of the line item based on the specified price. The base price is set to the + specified value. If the line item is based on net pricing then the net price attribute is set. If the line item + is based on gross pricing then the gross price attribute is set. Whether or not a line item is based on net or + gross pricing is a site-wide configuration parameter. + + + **Parameters:** + - price - The price to use when performing the update. This price must not be null and must either be equal to NOT\_AVAIALBLE or must have a currency code equal to that of the parent container. + + **Deprecated:** +:::warning +Use [setPriceValue(Number)](dw.order.LineItem.md#setpricevaluenumber) instead. +::: + +--- + +### updateTax(Number) +- updateTax(taxRate: [Number](TopLevel.Number.md)): void + - : Updates the tax-related attributes of the line item based on the specified tax rate, a tax basis determined by + the system and the "Tax Rounding Mode" order preference. This method sets the tax basis as an attribute, and is + not affected by the previous value of this attribute. + + + The value used as a basis depends on the type of line item this is and on the promotion preferences for the + current site. If you tax products, shipping, and discounts based on price (default), then the tax basis will + simply be equal to [getPrice()](dw.order.LineItem.md#getprice). If you tax products and shipping only based on adjusted price, then the + tax basis depends upon line item type as follows: + + - **ProductLineItem:**basis equals [ProductLineItem.getProratedPrice()](dw.order.ProductLineItem.md#getproratedprice). + - **ShippingLineItem:**basis equals [ShippingLineItem.getAdjustedPrice()](dw.order.ShippingLineItem.md#getadjustedprice). + - **ProductShippingLineItem:**basis equals [ProductShippingLineItem.getAdjustedPrice()](dw.order.ProductShippingLineItem.md#getadjustedprice). + - **PriceAdjustment:**basis equals 0.00. + - All other line item types: basis equals [getPrice()](dw.order.LineItem.md#getprice). + + If null is passed as tax rate, tax-related attribute fields are set to N/A. + + + **Parameters:** + - taxRate - taxRate the tax rate to use or null. + + +--- + +### updateTax(Number, Money) +- updateTax(taxRate: [Number](TopLevel.Number.md), taxBasis: [Money](dw.value.Money.md)): void + - : Updates the tax-related attributes of the line item based on the specified tax rate, the passed tax basis and the + "Tax Rounding Mode" order preference. If null is passed as tax rate or tax basis, tax-related attribute fields + are set to N/A. + + + **Parameters:** + - taxRate - the tax rate to use or null. + - taxBasis - the tax basis to use or null. + + +--- + +### updateTaxAmount(Money) +- updateTaxAmount(tax: [Money](dw.value.Money.md)): void + - : Updates tax amount of the line item setting the provided value. Depending on the way how the tax is calculated + (based on net or gross price), the corresponding gross or net price is updated accordingly. For tax calculation + based on net price, the gross price is calculated by adding the tax to the net price. For tax calculation based + on gross price, the net price is calculated by subtracting the tax from the gross price. + + + If null is passed as tax amount, the item tax and resulting net or gross price are set to N/A. + + + Note that tax rate is not calculated and it is not updated. + + + **Parameters:** + - tax - the tax amount of the line item to set + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItemCtnr.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItemCtnr.md new file mode 100644 index 00000000..68be4370 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.LineItemCtnr.md @@ -0,0 +1,2399 @@ + +# Class LineItemCtnr + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.LineItemCtnr](dw.order.LineItemCtnr.md) + +A container for line items, such as ProductLineItems, CouponLineItems, GiftCertificateLineItems. This container also +provides access to shipments, shipping adjustments (promotions), and payment instruments (credit cards). + + +LineItemCtnr also contains a set of methods for creating line items and adjustments, and for accessing various price +values. There are three types of price-related methods: + + + +- _Net-based_methods represent the amount of a category **before tax has been calculated**. For example, the getMerchandizeTotalNetPrice() returns the price of all merchandise in the container whereas getShippingTotalNetPrice() returns the price of all shipments in the container. +- _Tax-based_methods return the amount of tax on a category. For example, the getMerchandizeTotalTax() returns the total tax for all merchandise and the getShippingTotalTax() returns the tax applied to all shipments. +- _Gross-based_methods represent the amount of a category **after tax has been calculated**. For example, the getMerchandizeTotalGrossPrice() returns the price of all merchandise in the container, including tax on the merchandise, whereas getShippingTotalGrossPrice() returns the price of all shipments in the container, including tax on the shipments in the container. + +There are also a set of methods that provide access to 'adjusted' values. The adjusted-based methods return values +where promotions have been applied. For example, the getAdjustedMerchandizeTotalNetPrice() method returns the net +price of all merchandise after product-level and order-level promotions have been applied. Whereas the +getAdjustedMerchandizeTotalGrossPrice() method returns the price of all merchandise after product-level and +order-level promotions have been applied and includes the amount of merchandise-related tax. + + +Finally, there are a set of methods that return the aggregate values representing the line items in the container. +These are the total-based methods getTotalNetPrice(), getTotalTax() and getTotalGrossPrice(). These methods return +the totals of all items in the container and include any order-level promotions. + + +Note that all merchandise-related methods do not include 'gift certificates' values in the values they return. Gift +certificates are not considered merchandise as they do not represent a product. + + + +## All Known Subclasses +[Basket](dw.order.Basket.md), [Order](dw.order.Order.md) +## Constant Summary + +| Constant | Description | +| --- | --- | +| [BUSINESS_TYPE_B2B](#business_type_b2b): [Number](TopLevel.Number.md) = 2 | constant for Business Type B2B | +| [BUSINESS_TYPE_B2C](#business_type_b2c): [Number](TopLevel.Number.md) = 1 | constant for Business Type B2C | +| [CHANNEL_TYPE_CALLCENTER](#channel_type_callcenter): [Number](TopLevel.Number.md) = 2 | constant for Channel Type CallCenter | +| [CHANNEL_TYPE_CUSTOMERSERVICECENTER](#channel_type_customerservicecenter): [Number](TopLevel.Number.md) = 11 | constant for Channel Type Customer Service Center | +| [CHANNEL_TYPE_DSS](#channel_type_dss): [Number](TopLevel.Number.md) = 4 | constant for Channel Type DSS | +| [CHANNEL_TYPE_FACEBOOKADS](#channel_type_facebookads): [Number](TopLevel.Number.md) = 8 | constant for Channel Type Facebook Ads | +| [CHANNEL_TYPE_GOOGLE](#channel_type_google): [Number](TopLevel.Number.md) = 13 | constant for Channel Type Google | +| [CHANNEL_TYPE_INSTAGRAMCOMMERCE](#channel_type_instagramcommerce): [Number](TopLevel.Number.md) = 12 | constant for Channel Type Instagram Commerce | +| [CHANNEL_TYPE_MARKETPLACE](#channel_type_marketplace): [Number](TopLevel.Number.md) = 3 | constant for Channel Type Marketplace | +| [CHANNEL_TYPE_ONLINERESERVATION](#channel_type_onlinereservation): [Number](TopLevel.Number.md) = 10 | constant for Channel Type Online Reservation | +| [CHANNEL_TYPE_PINTEREST](#channel_type_pinterest): [Number](TopLevel.Number.md) = 6 | constant for Channel Type Pinterest | +| [CHANNEL_TYPE_SNAPCHAT](#channel_type_snapchat): [Number](TopLevel.Number.md) = 15 | constant for Channel Type Snapchat | +| [CHANNEL_TYPE_STORE](#channel_type_store): [Number](TopLevel.Number.md) = 5 | constant for Channel Type Store | +| [CHANNEL_TYPE_STOREFRONT](#channel_type_storefront): [Number](TopLevel.Number.md) = 1 | constant for Channel Type Storefront | +| [CHANNEL_TYPE_SUBSCRIPTIONS](#channel_type_subscriptions): [Number](TopLevel.Number.md) = 9 | constant for Channel Type Subscriptions | +| [CHANNEL_TYPE_TIKTOK](#channel_type_tiktok): [Number](TopLevel.Number.md) = 14 | constant for Channel Type TikTok | +| [CHANNEL_TYPE_TWITTER](#channel_type_twitter): [Number](TopLevel.Number.md) = 7 | constant for Channel Type Twitter | +| [CHANNEL_TYPE_WHATSAPP](#channel_type_whatsapp): [Number](TopLevel.Number.md) = 16 | constant for Channel Type WhatsApp | +| [CHANNEL_TYPE_YOUTUBE](#channel_type_youtube): [Number](TopLevel.Number.md) = 17 | constant for Channel Type YouTube | + +## Property Summary + +| Property | Description | +| --- | --- | +| [adjustedMerchandizeTotalGrossPrice](#adjustedmerchandizetotalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the adjusted total gross price (including tax) in purchase currency. | +| [adjustedMerchandizeTotalNetPrice](#adjustedmerchandizetotalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the total net price (excluding tax) in purchase currency. | +| [adjustedMerchandizeTotalPrice](#adjustedmerchandizetotalprice): [Money](dw.value.Money.md) `(read-only)` | Returns the adjusted merchandize total price including product-level and order-level adjustments. | +| [adjustedMerchandizeTotalTax](#adjustedmerchandizetotaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the subtotal tax in purchase currency. | +| [adjustedShippingTotalGrossPrice](#adjustedshippingtotalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied. | +| [adjustedShippingTotalNetPrice](#adjustedshippingtotalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied. | +| [adjustedShippingTotalPrice](#adjustedshippingtotalprice): [Money](dw.value.Money.md) `(read-only)` | Returns the adjusted shipping total price. | +| [adjustedShippingTotalTax](#adjustedshippingtotaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied. | +| ~~[allGiftCertificateLineItems](#allgiftcertificatelineitems): [Collection](dw.util.Collection.md)~~ `(read-only)` | Returns all gift certificate line items of the container. | +| [allLineItems](#alllineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product, shipping, price adjustment, and gift certificate line items of the line item container. | +| [allProductLineItems](#allproductlineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns all product line items of the container, no matter if they are dependent or independent. | +| [allProductQuantities](#allproductquantities): [HashMap](dw.util.HashMap.md) `(read-only)` | Returns a hash mapping all products in the line item container to their total quantities. | +| [allShippingPriceAdjustments](#allshippingpriceadjustments): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of all shipping price adjustments applied somewhere in the container. | +| [billingAddress](#billingaddress): [OrderAddress](dw.order.OrderAddress.md) `(read-only)` | Returns the billing address defined for the container. | +| [bonusDiscountLineItems](#bonusdiscountlineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns an unsorted collection of the the bonus discount line items associated with this container. | +| [bonusLineItems](#bonuslineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of product line items that are bonus items (where [ProductLineItem.isBonusProductLineItem()](dw.order.ProductLineItem.md#isbonusproductlineitem) is true). | +| [businessType](#businesstype): [EnumValue](dw.value.EnumValue.md) `(read-only)` | Returns the type of the business this order has been placed in.
          Possible values are [BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). | +| [channelType](#channeltype): [EnumValue](dw.value.EnumValue.md) `(read-only)` | The channel type defines in which sales channel this order has been created. | +| [couponLineItems](#couponlineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns a sorted collection of the coupon line items in the container. | +| [currencyCode](#currencycode): [String](TopLevel.String.md) `(read-only)` | Returns the currency code for this line item container. | +| [customer](#customer): [Customer](dw.customer.Customer.md) `(read-only)` | Returns the customer associated with this container. | +| [customerEmail](#customeremail): [String](TopLevel.String.md) | Returns the email of the customer associated with this container. | +| [customerName](#customername): [String](TopLevel.String.md) | Returns the name of the customer associated with this container. | +| [customerNo](#customerno): [String](TopLevel.String.md) `(read-only)` | Returns the customer number of the customer associated with this container. | +| [defaultShipment](#defaultshipment): [Shipment](dw.order.Shipment.md) `(read-only)` | Returns the default shipment of the line item container. | +| [etag](#etag): [String](TopLevel.String.md) `(read-only)` | Returns the Etag of the line item container. | +| [externallyTaxed](#externallytaxed): [Boolean](TopLevel.Boolean.md) `(read-only)` | Use this method to check whether the LineItemCtnr is calculated based on external tax tables. | +| [giftCertificateLineItems](#giftcertificatelineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns all gift certificate line items of the container. | +| [giftCertificatePaymentInstruments](#giftcertificatepaymentinstruments): [Collection](dw.util.Collection.md) `(read-only)` | Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container. | +| [giftCertificateTotalGrossPrice](#giftcertificatetotalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the total gross price of all gift certificates in the cart. | +| [giftCertificateTotalNetPrice](#giftcertificatetotalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the total net price (excluding tax) of all gift certificates in the cart. | +| [giftCertificateTotalPrice](#giftcertificatetotalprice): [Money](dw.value.Money.md) `(read-only)` | Returns the gift certificate total price. | +| [giftCertificateTotalTax](#giftcertificatetotaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the total tax of all gift certificates in the cart. | +| [merchandizeTotalGrossPrice](#merchandizetotalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the total gross price (including tax) in purchase currency. | +| [merchandizeTotalNetPrice](#merchandizetotalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the total net price (excluding tax) in purchase currency. | +| [merchandizeTotalPrice](#merchandizetotalprice): [Money](dw.value.Money.md) `(read-only)` | Returns the merchandize total price. | +| [merchandizeTotalTax](#merchandizetotaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the total tax in purchase currency. | +| [notes](#notes): [List](dw.util.List.md) `(read-only)` | Returns the list of notes for this object, ordered by creation time from oldest to newest. | +| ~~[paymentInstrument](#paymentinstrument): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)~~ `(read-only)` | Returns the payment instrument of the line item container or null. | +| [paymentInstruments](#paymentinstruments): [Collection](dw.util.Collection.md) `(read-only)` | Returns an unsorted collection of the payment instruments in this container. | +| [priceAdjustments](#priceadjustments): [Collection](dw.util.Collection.md) `(read-only)` | Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e. | +| [productLineItems](#productlineitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns the product line items of the container that are not dependent on other product line items. | +| [productQuantities](#productquantities): [HashMap](dw.util.HashMap.md) `(read-only)` | Returns a hash map of all products in the line item container and their total quantities. | +| [productQuantityTotal](#productquantitytotal): [Number](TopLevel.Number.md) `(read-only)` | Returns the total quantity of all product line items. | +| [shipments](#shipments): [Collection](dw.util.Collection.md) `(read-only)` | Returns all shipments of the line item container.
          The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). | +| [shippingPriceAdjustments](#shippingpriceadjustments): [Collection](dw.util.Collection.md) `(read-only)` | Returns the of shipping price adjustments applied to the shipping total of the container. | +| [shippingTotalGrossPrice](#shippingtotalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied. | +| [shippingTotalNetPrice](#shippingtotalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied. | +| [shippingTotalPrice](#shippingtotalprice): [Money](dw.value.Money.md) `(read-only)` | Returns the shipping total price. | +| [shippingTotalTax](#shippingtotaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied. | +| [taxRoundedAtGroup](#taxroundedatgroup): [Boolean](TopLevel.Boolean.md) `(read-only)` | Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation. | +| [taxTotalsPerTaxRate](#taxtotalspertaxrate): [SortedMap](dw.util.SortedMap.md) `(read-only)` | This method returns a [SortedMap](dw.util.SortedMap.md) in which the keys are [Decimal](dw.util.Decimal.md) tax rates and the values are [Money](dw.value.Money.md) total tax for the tax rate. | +| [totalGrossPrice](#totalgrossprice): [Money](dw.value.Money.md) `(read-only)` | Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. | +| [totalNetPrice](#totalnetprice): [Money](dw.value.Money.md) `(read-only)` | Returns the grand total price for LineItemCtnr net of tax, in purchase currency. | +| [totalTax](#totaltax): [Money](dw.value.Money.md) `(read-only)` | Returns the grand total tax for LineItemCtnr, in purchase currency. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [addNote](dw.order.LineItemCtnr.md#addnotestring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Adds a note to the object. | +| [createBillingAddress](dw.order.LineItemCtnr.md#createbillingaddress)() | Create a billing address for the LineItemCtnr. | +| [createBonusProductLineItem](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment)([BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md), [Product](dw.catalog.Product.md), [ProductOptionModel](dw.catalog.ProductOptionModel.md), [Shipment](dw.order.Shipment.md)) | Creates a product line item in the container based on the passed Product and BonusDiscountLineItem. | +| [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring)([String](TopLevel.String.md)) | Creates a coupon line item that is not based on the B2C Commerce campaign system and associates it with the specified coupon code. | +| [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring-boolean)([String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Creates a new CouponLineItem for this container based on the supplied coupon code. | +| [createGiftCertificateLineItem](dw.order.LineItemCtnr.md#creategiftcertificatelineitemnumber-string)([Number](TopLevel.Number.md), [String](TopLevel.String.md)) | Creates a gift certificate line item. | +| [createGiftCertificatePaymentInstrument](dw.order.LineItemCtnr.md#creategiftcertificatepaymentinstrumentstring-money)([String](TopLevel.String.md), [Money](dw.value.Money.md)) | Creates an OrderPaymentInstrument representing a Gift Certificate. | +| [createPaymentInstrument](dw.order.LineItemCtnr.md#createpaymentinstrumentstring-money)([String](TopLevel.String.md), [Money](dw.value.Money.md)) | Creates a payment instrument using the specified payment method id and amount. | +| [createPaymentInstrumentFromWallet](dw.order.LineItemCtnr.md#createpaymentinstrumentfromwalletcustomerpaymentinstrument-money)([CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md), [Money](dw.value.Money.md)) | Creates a payment instrument using the specified wallet payment instrument and amount. | +| [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring)([String](TopLevel.String.md)) | Creates an order price adjustment.
          The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown. | +| [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring-discount)([String](TopLevel.String.md), [Discount](dw.campaign.Discount.md)) | Creates an order level price adjustment for a specific discount.
          The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown. | +| [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproduct-productoptionmodel-shipment)([Product](dw.catalog.Product.md), [ProductOptionModel](dw.catalog.ProductOptionModel.md), [Shipment](dw.order.Shipment.md)) | Creates a new product line item in the container and assigns it to the specified shipment. | +| [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproductlistitem-shipment)([ProductListItem](dw.customer.ProductListItem.md), [Shipment](dw.order.Shipment.md)) | Creates a new product line item in the basket and assigns it to the specified shipment. | +| [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-shipment)([String](TopLevel.String.md), [Shipment](dw.order.Shipment.md)) | Creates a new product line item in the container and assigns it to the specified shipment. | +| ~~[createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-quantity-shipment)([String](TopLevel.String.md), [Quantity](dw.value.Quantity.md), [Shipment](dw.order.Shipment.md))~~ | Creates a new product line item in the container and assigns it to the specified shipment. | +| [createShipment](dw.order.LineItemCtnr.md#createshipmentstring)([String](TopLevel.String.md)) | Creates a standard shipment for the line item container. | +| [createShippingPriceAdjustment](dw.order.LineItemCtnr.md#createshippingpriceadjustmentstring)([String](TopLevel.String.md)) | Creates a shipping price adjustment to be applied to the container. | +| [getAdjustedMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalgrossprice)() | Returns the adjusted total gross price (including tax) in purchase currency. | +| [getAdjustedMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalnetprice)() | Returns the total net price (excluding tax) in purchase currency. | +| [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalprice)() | Returns the adjusted merchandize total price including product-level and order-level adjustments. | +| [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalpriceboolean)([Boolean](TopLevel.Boolean.md)) | Returns the adjusted merchandize total price including order-level adjustments if requested. | +| [getAdjustedMerchandizeTotalTax](dw.order.LineItemCtnr.md#getadjustedmerchandizetotaltax)() | Returns the subtotal tax in purchase currency. | +| [getAdjustedShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalgrossprice)() | Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied. | +| [getAdjustedShippingTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalnetprice)() | Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied. | +| [getAdjustedShippingTotalPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalprice)() | Returns the adjusted shipping total price. | +| [getAdjustedShippingTotalTax](dw.order.LineItemCtnr.md#getadjustedshippingtotaltax)() | Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied. | +| ~~[getAllGiftCertificateLineItems](dw.order.LineItemCtnr.md#getallgiftcertificatelineitems)()~~ | Returns all gift certificate line items of the container. | +| [getAllLineItems](dw.order.LineItemCtnr.md#getalllineitems)() | Returns all product, shipping, price adjustment, and gift certificate line items of the line item container. | +| [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitems)() | Returns all product line items of the container, no matter if they are dependent or independent. | +| [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitemsstring)([String](TopLevel.String.md)) | Returns all product line items of the container that have a product ID equal to the specified product ID, no matter if they are dependent or independent. | +| [getAllProductQuantities](dw.order.LineItemCtnr.md#getallproductquantities)() | Returns a hash mapping all products in the line item container to their total quantities. | +| [getAllShippingPriceAdjustments](dw.order.LineItemCtnr.md#getallshippingpriceadjustments)() | Returns the collection of all shipping price adjustments applied somewhere in the container. | +| [getBillingAddress](dw.order.LineItemCtnr.md#getbillingaddress)() | Returns the billing address defined for the container. | +| [getBonusDiscountLineItems](dw.order.LineItemCtnr.md#getbonusdiscountlineitems)() | Returns an unsorted collection of the the bonus discount line items associated with this container. | +| [getBonusLineItems](dw.order.LineItemCtnr.md#getbonuslineitems)() | Returns the collection of product line items that are bonus items (where [ProductLineItem.isBonusProductLineItem()](dw.order.ProductLineItem.md#isbonusproductlineitem) is true). | +| [getBusinessType](dw.order.LineItemCtnr.md#getbusinesstype)() | Returns the type of the business this order has been placed in.
          Possible values are [BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). | +| [getChannelType](dw.order.LineItemCtnr.md#getchanneltype)() | The channel type defines in which sales channel this order has been created. | +| [getCouponLineItem](dw.order.LineItemCtnr.md#getcouponlineitemstring)([String](TopLevel.String.md)) | Returns the coupon line item representing the specified coupon code. | +| [getCouponLineItems](dw.order.LineItemCtnr.md#getcouponlineitems)() | Returns a sorted collection of the coupon line items in the container. | +| [getCurrencyCode](dw.order.LineItemCtnr.md#getcurrencycode)() | Returns the currency code for this line item container. | +| [getCustomer](dw.order.LineItemCtnr.md#getcustomer)() | Returns the customer associated with this container. | +| [getCustomerEmail](dw.order.LineItemCtnr.md#getcustomeremail)() | Returns the email of the customer associated with this container. | +| [getCustomerName](dw.order.LineItemCtnr.md#getcustomername)() | Returns the name of the customer associated with this container. | +| [getCustomerNo](dw.order.LineItemCtnr.md#getcustomerno)() | Returns the customer number of the customer associated with this container. | +| [getDefaultShipment](dw.order.LineItemCtnr.md#getdefaultshipment)() | Returns the default shipment of the line item container. | +| [getEtag](dw.order.LineItemCtnr.md#getetag)() | Returns the Etag of the line item container. | +| [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitems)() | Returns all gift certificate line items of the container. | +| [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitemsstring)([String](TopLevel.String.md)) | Returns all gift certificate line items of the container, no matter if they are dependent or independent. | +| [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstruments)() | Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container. | +| [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstrumentsstring)([String](TopLevel.String.md)) | Returns an unsorted collection containing all PaymentInstruments of type PaymentInstrument.METHOD\_GIFT\_CERTIFICATE where the specified code is the same code on the payment instrument. | +| [getGiftCertificateTotalGrossPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalgrossprice)() | Returns the total gross price of all gift certificates in the cart. | +| [getGiftCertificateTotalNetPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalnetprice)() | Returns the total net price (excluding tax) of all gift certificates in the cart. | +| [getGiftCertificateTotalPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalprice)() | Returns the gift certificate total price. | +| [getGiftCertificateTotalTax](dw.order.LineItemCtnr.md#getgiftcertificatetotaltax)() | Returns the total tax of all gift certificates in the cart. | +| [getMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getmerchandizetotalgrossprice)() | Returns the total gross price (including tax) in purchase currency. | +| [getMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getmerchandizetotalnetprice)() | Returns the total net price (excluding tax) in purchase currency. | +| [getMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getmerchandizetotalprice)() | Returns the merchandize total price. | +| [getMerchandizeTotalTax](dw.order.LineItemCtnr.md#getmerchandizetotaltax)() | Returns the total tax in purchase currency. | +| [getNotes](dw.order.LineItemCtnr.md#getnotes)() | Returns the list of notes for this object, ordered by creation time from oldest to newest. | +| ~~[getPaymentInstrument](dw.order.LineItemCtnr.md#getpaymentinstrument)()~~ | Returns the payment instrument of the line item container or null. | +| [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstruments)() | Returns an unsorted collection of the payment instruments in this container. | +| [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstrumentsstring)([String](TopLevel.String.md)) | Returns an unsorted collection of PaymentInstrument instances based on the specified payment method ID. | +| [getPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getpriceadjustmentbypromotionidstring)([String](TopLevel.String.md)) | Returns the price adjustment associated to the specified promotion ID. | +| [getPriceAdjustments](dw.order.LineItemCtnr.md#getpriceadjustments)() | Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e. | +| [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitems)() | Returns the product line items of the container that are not dependent on other product line items. | +| [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitemsstring)([String](TopLevel.String.md)) | Returns the product line items of the container that have a product ID equal to the specified product ID and that are not dependent on other product line items. | +| [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantities)() | Returns a hash map of all products in the line item container and their total quantities. | +| [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantitiesboolean)([Boolean](TopLevel.Boolean.md)) | Returns a hash map of all products in the line item container and their total quantities. | +| [getProductQuantityTotal](dw.order.LineItemCtnr.md#getproductquantitytotal)() | Returns the total quantity of all product line items. | +| [getShipment](dw.order.LineItemCtnr.md#getshipmentstring)([String](TopLevel.String.md)) | Returns the shipment for the specified ID or `null` if no shipment with this ID exists in the line item container. | +| [getShipments](dw.order.LineItemCtnr.md#getshipments)() | Returns all shipments of the line item container.
          The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). | +| [getShippingPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getshippingpriceadjustmentbypromotionidstring)([String](TopLevel.String.md)) | Returns the shipping price adjustment associated with the specified promotion ID. | +| [getShippingPriceAdjustments](dw.order.LineItemCtnr.md#getshippingpriceadjustments)() | Returns the of shipping price adjustments applied to the shipping total of the container. | +| [getShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getshippingtotalgrossprice)() | Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied. | +| [getShippingTotalNetPrice](dw.order.LineItemCtnr.md#getshippingtotalnetprice)() | Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied. | +| [getShippingTotalPrice](dw.order.LineItemCtnr.md#getshippingtotalprice)() | Returns the shipping total price. | +| [getShippingTotalTax](dw.order.LineItemCtnr.md#getshippingtotaltax)() | Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied. | +| [getTaxTotalsPerTaxRate](dw.order.LineItemCtnr.md#gettaxtotalspertaxrate)() | This method returns a [SortedMap](dw.util.SortedMap.md) in which the keys are [Decimal](dw.util.Decimal.md) tax rates and the values are [Money](dw.value.Money.md) total tax for the tax rate. | +| [getTotalGrossPrice](dw.order.LineItemCtnr.md#gettotalgrossprice)() | Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. | +| [getTotalNetPrice](dw.order.LineItemCtnr.md#gettotalnetprice)() | Returns the grand total price for LineItemCtnr net of tax, in purchase currency. | +| [getTotalTax](dw.order.LineItemCtnr.md#gettotaltax)() | Returns the grand total tax for LineItemCtnr, in purchase currency. | +| [isExternallyTaxed](dw.order.LineItemCtnr.md#isexternallytaxed)() | Use this method to check whether the LineItemCtnr is calculated based on external tax tables. | +| [isTaxRoundedAtGroup](dw.order.LineItemCtnr.md#istaxroundedatgroup)() | Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation. | +| [removeAllPaymentInstruments](dw.order.LineItemCtnr.md#removeallpaymentinstruments)() | Removes the all Payment Instruments from this container and deletes the Payment Instruments. | +| [removeBonusDiscountLineItem](dw.order.LineItemCtnr.md#removebonusdiscountlineitembonusdiscountlineitem)([BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md)) | Removes the specified bonus discount line item from the line item container. | +| [removeCouponLineItem](dw.order.LineItemCtnr.md#removecouponlineitemcouponlineitem)([CouponLineItem](dw.order.CouponLineItem.md)) | Removes the specified coupon line item from the line item container. | +| [removeGiftCertificateLineItem](dw.order.LineItemCtnr.md#removegiftcertificatelineitemgiftcertificatelineitem)([GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md)) | Removes the specified gift certificate line item from the line item container. | +| [removeNote](dw.order.LineItemCtnr.md#removenotenote)([Note](dw.object.Note.md)) | Removes a note from this line item container and deletes it. | +| [removePaymentInstrument](dw.order.LineItemCtnr.md#removepaymentinstrumentpaymentinstrument)([PaymentInstrument](dw.order.PaymentInstrument.md)) | Removes the specified Payment Instrument from this container and deletes the Payment Instrument. | +| [removePriceAdjustment](dw.order.LineItemCtnr.md#removepriceadjustmentpriceadjustment)([PriceAdjustment](dw.order.PriceAdjustment.md)) | Removes the specified price adjustment line item from the line item container. | +| [removeProductLineItem](dw.order.LineItemCtnr.md#removeproductlineitemproductlineitem)([ProductLineItem](dw.order.ProductLineItem.md)) | Removes the specified product line item from the line item container. | +| [removeShipment](dw.order.LineItemCtnr.md#removeshipmentshipment)([Shipment](dw.order.Shipment.md)) | Removes the specified shipment and all associated product, gift certificate, shipping and price adjustment line items from the line item container. | +| [removeShippingPriceAdjustment](dw.order.LineItemCtnr.md#removeshippingpriceadjustmentpriceadjustment)([PriceAdjustment](dw.order.PriceAdjustment.md)) | Removes the specified shipping price adjustment line item from the line item container. | +| [setCustomerEmail](dw.order.LineItemCtnr.md#setcustomeremailstring)([String](TopLevel.String.md)) | Sets the email address of the customer associated with this container. | +| [setCustomerName](dw.order.LineItemCtnr.md#setcustomernamestring)([String](TopLevel.String.md)) | Sets the name of the customer associated with this container. | +| [updateOrderLevelPriceAdjustmentTax](dw.order.LineItemCtnr.md#updateorderlevelpriceadjustmenttax)() | Calculates the tax for all shipping and order-level merchandise price adjustments in this LineItemCtnr. | +| [updateTotals](dw.order.LineItemCtnr.md#updatetotals)() | Recalculates the totals of the line item container. | +| [verifyPriceAdjustmentLimits](dw.order.LineItemCtnr.md#verifypriceadjustmentlimits)() | Verifies whether the manual price adjustments made for the line item container exceed the corresponding limits for the current user and the current site. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### BUSINESS_TYPE_B2B + +- BUSINESS_TYPE_B2B: [Number](TopLevel.Number.md) = 2 + - : constant for Business Type B2B + + +--- + +### BUSINESS_TYPE_B2C + +- BUSINESS_TYPE_B2C: [Number](TopLevel.Number.md) = 1 + - : constant for Business Type B2C + + +--- + +### CHANNEL_TYPE_CALLCENTER + +- CHANNEL_TYPE_CALLCENTER: [Number](TopLevel.Number.md) = 2 + - : constant for Channel Type CallCenter + + +--- + +### CHANNEL_TYPE_CUSTOMERSERVICECENTER + +- CHANNEL_TYPE_CUSTOMERSERVICECENTER: [Number](TopLevel.Number.md) = 11 + - : constant for Channel Type Customer Service Center + + +--- + +### CHANNEL_TYPE_DSS + +- CHANNEL_TYPE_DSS: [Number](TopLevel.Number.md) = 4 + - : constant for Channel Type DSS + + +--- + +### CHANNEL_TYPE_FACEBOOKADS + +- CHANNEL_TYPE_FACEBOOKADS: [Number](TopLevel.Number.md) = 8 + - : constant for Channel Type Facebook Ads + + +--- + +### CHANNEL_TYPE_GOOGLE + +- CHANNEL_TYPE_GOOGLE: [Number](TopLevel.Number.md) = 13 + - : constant for Channel Type Google + + +--- + +### CHANNEL_TYPE_INSTAGRAMCOMMERCE + +- CHANNEL_TYPE_INSTAGRAMCOMMERCE: [Number](TopLevel.Number.md) = 12 + - : constant for Channel Type Instagram Commerce + + +--- + +### CHANNEL_TYPE_MARKETPLACE + +- CHANNEL_TYPE_MARKETPLACE: [Number](TopLevel.Number.md) = 3 + - : constant for Channel Type Marketplace + + +--- + +### CHANNEL_TYPE_ONLINERESERVATION + +- CHANNEL_TYPE_ONLINERESERVATION: [Number](TopLevel.Number.md) = 10 + - : constant for Channel Type Online Reservation + + +--- + +### CHANNEL_TYPE_PINTEREST + +- CHANNEL_TYPE_PINTEREST: [Number](TopLevel.Number.md) = 6 + - : constant for Channel Type Pinterest + + +--- + +### CHANNEL_TYPE_SNAPCHAT + +- CHANNEL_TYPE_SNAPCHAT: [Number](TopLevel.Number.md) = 15 + - : constant for Channel Type Snapchat + + +--- + +### CHANNEL_TYPE_STORE + +- CHANNEL_TYPE_STORE: [Number](TopLevel.Number.md) = 5 + - : constant for Channel Type Store + + +--- + +### CHANNEL_TYPE_STOREFRONT + +- CHANNEL_TYPE_STOREFRONT: [Number](TopLevel.Number.md) = 1 + - : constant for Channel Type Storefront + + +--- + +### CHANNEL_TYPE_SUBSCRIPTIONS + +- CHANNEL_TYPE_SUBSCRIPTIONS: [Number](TopLevel.Number.md) = 9 + - : constant for Channel Type Subscriptions + + +--- + +### CHANNEL_TYPE_TIKTOK + +- CHANNEL_TYPE_TIKTOK: [Number](TopLevel.Number.md) = 14 + - : constant for Channel Type TikTok + + +--- + +### CHANNEL_TYPE_TWITTER + +- CHANNEL_TYPE_TWITTER: [Number](TopLevel.Number.md) = 7 + - : constant for Channel Type Twitter + + +--- + +### CHANNEL_TYPE_WHATSAPP + +- CHANNEL_TYPE_WHATSAPP: [Number](TopLevel.Number.md) = 16 + - : constant for Channel Type WhatsApp + + +--- + +### CHANNEL_TYPE_YOUTUBE + +- CHANNEL_TYPE_YOUTUBE: [Number](TopLevel.Number.md) = 17 + - : constant for Channel Type YouTube + + +--- + +## Property Details + +### adjustedMerchandizeTotalGrossPrice +- adjustedMerchandizeTotalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the adjusted total gross price (including tax) in purchase currency. Adjusted merchandize prices + represent the sum of product prices before services such as shipping, but after product-level and order-level + adjustments. + + + +--- + +### adjustedMerchandizeTotalNetPrice +- adjustedMerchandizeTotalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total net price (excluding tax) in purchase currency. Adjusted merchandize prices represent the sum + of product prices before services such as shipping, but after product-level and order-level adjustments. + + + +--- + +### adjustedMerchandizeTotalPrice +- adjustedMerchandizeTotalPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the adjusted merchandize total price including product-level and order-level adjustments. If the line + item container is based on net pricing the adjusted merchandize total net price is returned. If the line item + container is based on gross pricing the adjusted merchandize total gross price is returned. + + + +--- + +### adjustedMerchandizeTotalTax +- adjustedMerchandizeTotalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the subtotal tax in purchase currency. Adjusted merchandize prices represent the sum of product prices + before services such as shipping have been added, but after adjustment from promotions have been added. + + + +--- + +### adjustedShippingTotalGrossPrice +- adjustedShippingTotalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping + adjustments have been applied. + + + +--- + +### adjustedShippingTotalNetPrice +- adjustedShippingTotalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments + have been applied. + + + +--- + +### adjustedShippingTotalPrice +- adjustedShippingTotalPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the adjusted shipping total price. If the line item container is based on net pricing the adjusted + shipping total net price is returned. If the line item container is based on gross pricing the adjusted shipping + total gross price is returned. + + + +--- + +### adjustedShippingTotalTax +- adjustedShippingTotalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the tax of all shipping line items of the line item container after shipping adjustments have been + applied. + + + +--- + +### allGiftCertificateLineItems +- ~~allGiftCertificateLineItems: [Collection](dw.util.Collection.md)~~ `(read-only)` + - : Returns all gift certificate line items of the container. + + **Deprecated:** +:::warning +Use [getGiftCertificateLineItems()](dw.order.LineItemCtnr.md#getgiftcertificatelineitems) to get the collection instead. +::: + +--- + +### allLineItems +- allLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product, shipping, price adjustment, and gift certificate line items of the line item container. + + +--- + +### allProductLineItems +- allProductLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all product line items of the container, no matter if they are dependent or independent. This includes + option, bundled and bonus line items. + + + +--- + +### allProductQuantities +- allProductQuantities: [HashMap](dw.util.HashMap.md) `(read-only)` + - : Returns a hash mapping all products in the line item container to their total quantities. The total product + quantity is used chiefly to validate the availability of the items in the cart. This method is not appropriate to + look up prices because it returns products such as bundled line items which are included in the price of their + parent and therefore have no corresponding price. + + + The method counts all direct product line items, plus dependent product line items that are not option line + items. It also excludes product line items that are not associated to any catalog product. + + + +--- + +### allShippingPriceAdjustments +- allShippingPriceAdjustments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of all shipping price adjustments applied somewhere in the container. This can be + adjustments applied to individual shipments or to the container itself. Note that the promotions engine only + applies shipping price adjustments to the the default shipping line item of shipments, and never to the + container. + + + **See Also:** + - [getShippingPriceAdjustments()](dw.order.LineItemCtnr.md#getshippingpriceadjustments) + + +--- + +### billingAddress +- billingAddress: [OrderAddress](dw.order.OrderAddress.md) `(read-only)` + - : Returns the billing address defined for the container. Returns null if no billing address has been created yet. + + +--- + +### bonusDiscountLineItems +- bonusDiscountLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns an unsorted collection of the the bonus discount line items associated with this container. + + +--- + +### bonusLineItems +- bonusLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of product line items that are bonus items (where + [ProductLineItem.isBonusProductLineItem()](dw.order.ProductLineItem.md#isbonusproductlineitem) is true). + + + +--- + +### businessType +- businessType: [EnumValue](dw.value.EnumValue.md) `(read-only)` + - : Returns the type of the business this order has been placed in. + + Possible values are [BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). + + + +--- + +### channelType +- channelType: [EnumValue](dw.value.EnumValue.md) `(read-only)` + - : The channel type defines in which sales channel this order has been created. This can be used to distinguish + order placed through Storefront, Call Center or Marketplace. + + Possible values are [CHANNEL_TYPE_STOREFRONT](dw.order.LineItemCtnr.md#channel_type_storefront), [CHANNEL_TYPE_CALLCENTER](dw.order.LineItemCtnr.md#channel_type_callcenter), + [CHANNEL_TYPE_MARKETPLACE](dw.order.LineItemCtnr.md#channel_type_marketplace), [CHANNEL_TYPE_DSS](dw.order.LineItemCtnr.md#channel_type_dss), [CHANNEL_TYPE_STORE](dw.order.LineItemCtnr.md#channel_type_store), + [CHANNEL_TYPE_PINTEREST](dw.order.LineItemCtnr.md#channel_type_pinterest), [CHANNEL_TYPE_TWITTER](dw.order.LineItemCtnr.md#channel_type_twitter), [CHANNEL_TYPE_FACEBOOKADS](dw.order.LineItemCtnr.md#channel_type_facebookads), + [CHANNEL_TYPE_SUBSCRIPTIONS](dw.order.LineItemCtnr.md#channel_type_subscriptions), [CHANNEL_TYPE_ONLINERESERVATION](dw.order.LineItemCtnr.md#channel_type_onlinereservation), + [CHANNEL_TYPE_CUSTOMERSERVICECENTER](dw.order.LineItemCtnr.md#channel_type_customerservicecenter), [CHANNEL_TYPE_INSTAGRAMCOMMERCE](dw.order.LineItemCtnr.md#channel_type_instagramcommerce), + [CHANNEL_TYPE_GOOGLE](dw.order.LineItemCtnr.md#channel_type_google), [CHANNEL_TYPE_YOUTUBE](dw.order.LineItemCtnr.md#channel_type_youtube), [CHANNEL_TYPE_TIKTOK](dw.order.LineItemCtnr.md#channel_type_tiktok), + [CHANNEL_TYPE_SNAPCHAT](dw.order.LineItemCtnr.md#channel_type_snapchat), [CHANNEL_TYPE_WHATSAPP](dw.order.LineItemCtnr.md#channel_type_whatsapp) + + + +--- + +### couponLineItems +- couponLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns a sorted collection of the coupon line items in the container. The coupon line items are returned in the + order they were added to container. + + + +--- + +### currencyCode +- currencyCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the currency code for this line item container. The currency code is a 3-character currency mnemonic such + as 'USD' or 'EUR'. The currency code represents the currency in which the calculation is made, and in which the + buyer sees all prices in the store front. + + + +--- + +### customer +- customer: [Customer](dw.customer.Customer.md) `(read-only)` + - : Returns the customer associated with this container. + + +--- + +### customerEmail +- customerEmail: [String](TopLevel.String.md) + - : Returns the email of the customer associated with this container. + + +--- + +### customerName +- customerName: [String](TopLevel.String.md) + - : Returns the name of the customer associated with this container. + + +--- + +### customerNo +- customerNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the customer number of the customer associated with this container. + + +--- + +### defaultShipment +- defaultShipment: [Shipment](dw.order.Shipment.md) `(read-only)` + - : Returns the default shipment of the line item container. Every basket and order has a default shipment with the + id "me". If you call a process that accesses a shipment, and you don't specify the shipment, then the process + uses the default shipment. You can't remove a default shipment. Calling [removeShipment(Shipment)](dw.order.LineItemCtnr.md#removeshipmentshipment) on it + throws an exception. + + + +--- + +### etag +- etag: [String](TopLevel.String.md) `(read-only)` + - : Returns the Etag of the line item container. The Etag is a hash that represents the overall container state + including any associated objects like line items. + + + +--- + +### externallyTaxed +- externallyTaxed: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Use this method to check whether the LineItemCtnr is calculated based on external tax tables. + + Note: a basket can only be created in EXTERNAL tax mode using SCAPI. + + + +--- + +### giftCertificateLineItems +- giftCertificateLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all gift certificate line items of the container. + + +--- + +### giftCertificatePaymentInstruments +- giftCertificatePaymentInstruments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this + container. + + + +--- + +### giftCertificateTotalGrossPrice +- giftCertificateTotalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total gross price of all gift certificates in the cart. Should usually be equal to total net price. + + +--- + +### giftCertificateTotalNetPrice +- giftCertificateTotalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total net price (excluding tax) of all gift certificates in the cart. Should usually be equal to + total gross price. + + + +--- + +### giftCertificateTotalPrice +- giftCertificateTotalPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the gift certificate total price. If the line item container is based on net pricing the gift certificate + total net price is returned. If the line item container is based on gross pricing the gift certificate total + gross price is returned. + + + +--- + +### giftCertificateTotalTax +- giftCertificateTotalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total tax of all gift certificates in the cart. Should usually be 0.0. + + +--- + +### merchandizeTotalGrossPrice +- merchandizeTotalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total gross price (including tax) in purchase currency. Merchandize total prices represent the sum of + product prices before services such as shipping or adjustment from promotions have been added. + + + +--- + +### merchandizeTotalNetPrice +- merchandizeTotalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total net price (excluding tax) in purchase currency. Merchandize total prices represent the sum of + product prices before services such as shipping or adjustment from promotion have been added. + + + +--- + +### merchandizeTotalPrice +- merchandizeTotalPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the merchandize total price. If the line item container is based on net pricing the merchandize total net + price is returned. If the line item container is based on gross pricing the merchandize total gross price is + returned. + + + +--- + +### merchandizeTotalTax +- merchandizeTotalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the total tax in purchase currency. Merchandize total prices represent the sum of product prices before + services such as shipping or adjustment from promotions have been added. + + + +--- + +### notes +- notes: [List](dw.util.List.md) `(read-only)` + - : Returns the list of notes for this object, ordered by creation time from oldest to newest. + + +--- + +### paymentInstrument +- ~~paymentInstrument: [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)~~ `(read-only)` + - : Returns the payment instrument of the line item container or null. This method is deprecated. You should use + getPaymentInstruments() or getGiftCertificatePaymentInstruments() instead. + + + **Deprecated:** +:::warning +Use [getPaymentInstruments()](dw.order.LineItemCtnr.md#getpaymentinstruments) or [getGiftCertificatePaymentInstruments()](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstruments) to get the + set of payment instruments. + +::: + +--- + +### paymentInstruments +- paymentInstruments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns an unsorted collection of the payment instruments in this container. + + +--- + +### priceAdjustments +- priceAdjustments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the collection of price adjustments that have been applied to the totals such as promotion on the + purchase value (i.e. $10 Off or 10% Off). The price adjustments are sorted by the order in which they were + applied to the order by the promotions engine. + + + +--- + +### productLineItems +- productLineItems: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the product line items of the container that are not dependent on other product line items. This includes + line items representing bonus products in the container but excludes option, bundled, and bonus line items. The + returned collection is sorted by the position attribute of the product line items. + + + +--- + +### productQuantities +- productQuantities: [HashMap](dw.util.HashMap.md) `(read-only)` + - : Returns a hash map of all products in the line item container and their total quantities. The total product + quantity is for example used to lookup the product price. + + + The method counts all direct product line items, plus dependent product line items that are not bundled line + items and no option line items. It also excludes product line items that are not associated to any catalog + product, and bonus product line items. + + + **See Also:** + - [getProductQuantities(Boolean)](dw.order.LineItemCtnr.md#getproductquantitiesboolean) + + +--- + +### productQuantityTotal +- productQuantityTotal: [Number](TopLevel.Number.md) `(read-only)` + - : Returns the total quantity of all product line items. Not included are bundled line items and option line items. + + +--- + +### shipments +- shipments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns all shipments of the line item container. + + The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). All other + shipments are sorted ascending by shipment ID. + + + +--- + +### shippingPriceAdjustments +- shippingPriceAdjustments: [Collection](dw.util.Collection.md) `(read-only)` + - : Returns the of shipping price adjustments applied to the shipping total of the container. Note that the + promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and + never to the container. + + + **See Also:** + - [getAllShippingPriceAdjustments()](dw.order.LineItemCtnr.md#getallshippingpriceadjustments) + + +--- + +### shippingTotalGrossPrice +- shippingTotalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments + have been applied. + + + +--- + +### shippingTotalNetPrice +- shippingTotalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments + have been applied. + + + +--- + +### shippingTotalPrice +- shippingTotalPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the shipping total price. If the line item container is based on net pricing the shipping total net price + is returned. If the line item container is based on gross pricing the shipping total gross price is returned. + + + +--- + +### shippingTotalTax +- shippingTotalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the tax of all shipping line items of the line item container before shipping adjustments have been + applied. + + + +--- + +### taxRoundedAtGroup +- taxRoundedAtGroup: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + +--- + +### taxTotalsPerTaxRate +- taxTotalsPerTaxRate: [SortedMap](dw.util.SortedMap.md) `(read-only)` + - : This method returns a [SortedMap](dw.util.SortedMap.md) in which the keys are [Decimal](dw.util.Decimal.md) tax rates and the values + are [Money](dw.value.Money.md) total tax for the tax rate. The map is unmodifiable. + + + +--- + +### totalGrossPrice +- totalGrossPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. Total prices represent the sum + of product prices, services prices and adjustments. + + + +--- + +### totalNetPrice +- totalNetPrice: [Money](dw.value.Money.md) `(read-only)` + - : Returns the grand total price for LineItemCtnr net of tax, in purchase currency. Total prices represent the sum + of product prices, services prices and adjustments. + + + +--- + +### totalTax +- totalTax: [Money](dw.value.Money.md) `(read-only)` + - : Returns the grand total tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product + prices, services prices and adjustments. + + + +--- + +## Method Details + +### addNote(String, String) +- addNote(subject: [String](TopLevel.String.md), text: [String](TopLevel.String.md)): [Note](dw.object.Note.md) + - : Adds a note to the object. + + **Parameters:** + - subject - The subject of the note. + - text - The text of the note. Must be no more than 4000 characters or an exception is thrown. + + **Returns:** + - the added note. + + +--- + +### createBillingAddress() +- createBillingAddress(): [OrderAddress](dw.order.OrderAddress.md) + - : Create a billing address for the LineItemCtnr. A LineItemCtnr (e.g. basket) initially has no billing address. + This method creates a billing address for the LineItemCtnr and replaces an existing billing address. + + + **Returns:** + - The new billing address of the LineItemCtnr. + + +--- + +### createBonusProductLineItem(BonusDiscountLineItem, Product, ProductOptionModel, Shipment) +- createBonusProductLineItem(bonusDiscountLineItem: [BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md), product: [Product](dw.catalog.Product.md), optionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md), shipment: [Shipment](dw.order.Shipment.md)): [ProductLineItem](dw.order.ProductLineItem.md) + - : Creates a product line item in the container based on the passed Product and BonusDiscountLineItem. The product + must be assigned to the current site catalog and must also be a bonus product of the specified + BonusDiscountLineItem or an exception is thrown. The line item is always created in the default shipment. If + successful, the operation always creates a new ProductLineItem and never simply increments the quantity of an + existing ProductLineItem. An option model can optionally be specified. + + + **Parameters:** + - bonusDiscountLineItem - Line item representing an applied BonusChoiceDiscount in the LineItemCtnr, must not be null. + - product - Product The product to add to the LineItemCtnr. Must not be null and must be a bonus product of bonusDiscountLineItem. + - optionModel - ProductOptionModel or null. + - shipment - The shipment to add the bonus product to. If null, the product is added to the default shipment. + + +--- + +### createCouponLineItem(String) +- createCouponLineItem(couponCode: [String](TopLevel.String.md)): [CouponLineItem](dw.order.CouponLineItem.md) + - : Creates a coupon line item that is not based on the B2C Commerce campaign system and associates it with the + specified coupon code. + + + There may not be any other coupon line item in the container with the specific coupon code, otherwise an + exception is thrown. + + + If you want to create a coupon line item based on the B2C Commerce campaign system, you must use + [createCouponLineItem(String, Boolean)](dw.order.LineItemCtnr.md#createcouponlineitemstring-boolean) with campaignBased = true. + + + **Parameters:** + - couponCode - couponCode represented by the coupon line item. + + **Returns:** + - New coupon line item. + + +--- + +### createCouponLineItem(String, Boolean) +- createCouponLineItem(couponCode: [String](TopLevel.String.md), campaignBased: [Boolean](TopLevel.Boolean.md)): [CouponLineItem](dw.order.CouponLineItem.md) + - : Creates a new CouponLineItem for this container based on the supplied coupon code. + + + The created coupon line item is based on the B2C Commerce campaign system if campaignBased parameter is true. In + that case, if the supplied coupon code is not valid, APIException with type 'CreateCouponLineItemException' is + thrown. + + + If you want to create a custom coupon line item, you must call this method with campaignBased = false or to use + [createCouponLineItem(String)](dw.order.LineItemCtnr.md#createcouponlineitemstring). + + + + + Example: + + + + + ``` + try { + var cli : CouponLineItem = basket.createCouponLineItem(couponCode, true); + } catch (e if e instanceof APIException && e.type === 'CreateCouponLineItemException') + if (e.errorCode == CouponStatusCodes.COUPON_CODE_ALREADY_IN_BASKET) { + ... + } + } + ``` + + + An dw.order.CreateCouponLineItemException is thrown in case of campaignBased = true only. Indicates that the + provided coupon code is not a valid coupon code to create a coupon line item based on the B2C Commerce campaign + system. The error code property (CreateCouponLineItemException.errorCode) will be set to one of the following + values: + + - [CouponStatusCodes.COUPON_CODE_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#coupon_code_already_in_basket)= Indicates that coupon code has already been added to basket. + - [CouponStatusCodes.COUPON_ALREADY_IN_BASKET](dw.campaign.CouponStatusCodes.md#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](dw.campaign.CouponStatusCodes.md#coupon_code_already_redeemed)= Indicates that code of MultiCode/System coupon has already been redeemed. + - [CouponStatusCodes.COUPON_CODE_UNKNOWN](dw.campaign.CouponStatusCodes.md#coupon_code_unknown)= Indicates that coupon not found for given coupon code or that the code itself was not found. + - [CouponStatusCodes.COUPON_DISABLED](dw.campaign.CouponStatusCodes.md#coupon_disabled)= Indicates that coupon is not enabled. + - [CouponStatusCodes.REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#redemption_limit_exceeded)= Indicates that number of redemptions per code exceeded. + - [CouponStatusCodes.CUSTOMER_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#customer_redemption_limit_exceeded)= Indicates that number of redemptions per code and customer exceeded. + - [CouponStatusCodes.TIMEFRAME_REDEMPTION_LIMIT_EXCEEDED](dw.campaign.CouponStatusCodes.md#timeframe_redemption_limit_exceeded)= Indicates that number of redemptions per code, customer and time exceeded. + - [CouponStatusCodes.NO_ACTIVE_PROMOTION](dw.campaign.CouponStatusCodes.md#no_active_promotion)= Indicates that coupon is not assigned to an active promotion. + + + **Parameters:** + - couponCode - the coupon code to be represented by the coupon line item + - campaignBased - the flag if the created coupon line item should be based on the B2C Commerce campaign system + + **Returns:** + - the created coupon line item + + +--- + +### createGiftCertificateLineItem(Number, String) +- createGiftCertificateLineItem(amount: [Number](TopLevel.Number.md), recipientEmail: [String](TopLevel.String.md)): [GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md) + - : Creates a gift certificate line item. + + **Parameters:** + - amount - the amount of the gift certificate - mandatory + - recipientEmail - the recipient's email address - mandatory + + **Returns:** + - The new gift certificate line item + + +--- + +### createGiftCertificatePaymentInstrument(String, Money) +- createGiftCertificatePaymentInstrument(giftCertificateCode: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Creates an OrderPaymentInstrument representing a Gift Certificate. The amount is set on a PaymentTransaction that + is accessible via the OrderPaymentInstrument. By default, the status of the PaymentTransaction is set to CREATE. + The PaymentTransaction must be processed at a later time. + + + **Parameters:** + - giftCertificateCode - the redemption code of the Gift Certificate. + - amount - the amount to set on the PaymentTransaction. If the OrderPaymentInstrument is actually redeemed, this is the amount that will be deducted from the Gift Certificate. + + **Returns:** + - the OrderPaymentInstrument. + + +--- + +### createPaymentInstrument(String, Money) +- createPaymentInstrument(paymentMethodId: [String](TopLevel.String.md), amount: [Money](dw.value.Money.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Creates a payment instrument using the specified payment method id and amount. The amount is set on the + [PaymentTransaction](dw.order.PaymentTransaction.md) that is attached to the payment instrument. + + + **Parameters:** + - paymentMethodId - The payment method id. See the [PaymentInstrument](dw.order.PaymentInstrument.md) class for payment method types + - amount - The payment amount or null + + **Returns:** + - The new payment instrument + + +--- + +### createPaymentInstrumentFromWallet(CustomerPaymentInstrument, Money) +- createPaymentInstrumentFromWallet(walletPaymentInstrument: [CustomerPaymentInstrument](dw.customer.CustomerPaymentInstrument.md), amount: [Money](dw.value.Money.md)): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md) + - : Creates a payment instrument using the specified wallet payment instrument and amount. The amount is set on the + [PaymentTransaction](dw.order.PaymentTransaction.md) that is attached to the payment instrument. All data from the wallet payment + instrument will be copied over to the created payment instrument. + + + **Parameters:** + - walletPaymentInstrument - The payment instrument from the customer's walled. + - amount - The payment amount or null + + **Returns:** + - The new payment instrument + + +--- + +### createPriceAdjustment(String) +- createPriceAdjustment(promotionID: [String](TopLevel.String.md)): [PriceAdjustment](dw.order.PriceAdjustment.md) + - : Creates an order price adjustment. + + The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise + an exception is thrown. + + + **Parameters:** + - promotionID - Promotion ID + + **Returns:** + - The new price adjustment + + +--- + +### createPriceAdjustment(String, Discount) +- createPriceAdjustment(promotionID: [String](TopLevel.String.md), discount: [Discount](dw.campaign.Discount.md)): [PriceAdjustment](dw.order.PriceAdjustment.md) + - : Creates an order level price adjustment for a specific discount. + + The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise + an exception is thrown. + + The possible discount types are supported: [PercentageDiscount](dw.campaign.PercentageDiscount.md) and + [AmountDiscount](dw.campaign.AmountDiscount.md). + + Examples: + + + ` + var myOrder : dw.order.Order; // assume known + + var paTenPercent : dw.order.PriceAdjustment = myOrder.createPriceAdjustment("myPromotionID1", new dw.campaign.PercentageDiscount(10)); + + var paReduceBy20 : dw.order.PriceAdjustment = myOrder.createPriceAdjustment("myPromotionID2", new dw.campaign.AmountDiscount(20); + + ` + + + **Parameters:** + - promotionID - Promotion ID + - discount - The discount + + **Returns:** + - The new price adjustment + + +--- + +### createProductLineItem(Product, ProductOptionModel, Shipment) +- createProductLineItem(product: [Product](dw.catalog.Product.md), optionModel: [ProductOptionModel](dw.catalog.ProductOptionModel.md), shipment: [Shipment](dw.order.Shipment.md)): [ProductLineItem](dw.order.ProductLineItem.md) + - : Creates a new product line item in the container and assigns it to the specified shipment. An option model can be + specified. + + Please note that the product must be assigned to the current site catalog. + + + **Parameters:** + - product - Product + - optionModel - ProductOptionModel or null + - shipment - Shipment + + +--- + +### createProductLineItem(ProductListItem, Shipment) +- createProductLineItem(productListItem: [ProductListItem](dw.customer.ProductListItem.md), shipment: [Shipment](dw.order.Shipment.md)): [ProductLineItem](dw.order.ProductLineItem.md) + - : Creates a new product line item in the basket and assigns it to the specified shipment. + + + If the product list item references a product in the site catalog, the method will associate the product line + item with that catalog product and will copy all order-relevant information, like the quantity unit, from the + catalog product. The quantity of the product line item is initialized with 1.0 or - if defined - the minimum + order quantity of the product. + + + If the product list item references an option product, the option values are copied from the product list item. + + + If the product list item is associated with an existing product line item, and the BasketAddProductBehaviour + setting is MergeQuantities, then the product line item quantity is increased by 1.0 or, if defined, the minimum + order quantity of the product. + + + An exception is thrown if + + - the line item container is no basket. + - the type of the product list item is not PRODUCT. + - the product list item references a product which is not assigned to the site catalog. + + + **Parameters:** + - productListItem - the product list item + - shipment - the shipment the created product line item will be assigned to + + **Returns:** + - The new product line item + + +--- + +### createProductLineItem(String, Shipment) +- createProductLineItem(productID: [String](TopLevel.String.md), shipment: [Shipment](dw.order.Shipment.md)): [ProductLineItem](dw.order.ProductLineItem.md) + - : Creates a new product line item in the container and assigns it to the specified shipment. + + If the specified productID represents a product in the site catalog, the method will associate the product line + item with that catalog product and will copy all order-relevant information, like the quantity unit, from the + catalog product. The quantity of the product line item is initialized with 1.0 or - if defined - the minimum + order quantity of the product. + + If the product represents a product in the site catalog and is an option product, the product is added with it's + default option values. + + If the specified productID does not represent a product of the site catalog, the method creates a new product + line item and initializes it with the specified product ID and with a quantity, minimum order quantity, and step + quantity value of 1.0. + + If the provided SKU references a product that is not available as described in method [ProductLineItem.isCatalogProduct()](dw.order.ProductLineItem.md#iscatalogproduct), the new product line item is considered a non-catalog product line item without a connection to a product. Such product line items are not included in reservation requests in either OCI-based inventory or eCom-based inventory when calling [Basket.reserveInventory()](dw.order.Basket.md#reserveinventory) or [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket). + + + **Parameters:** + - productID - The product ID. + - shipment - Shipment + + **Returns:** + - The new product line item + + +--- + +### createProductLineItem(String, Quantity, Shipment) +- ~~createProductLineItem(productID: [String](TopLevel.String.md), quantity: [Quantity](dw.value.Quantity.md), shipment: [Shipment](dw.order.Shipment.md)): [ProductLineItem](dw.order.ProductLineItem.md)~~ + - : Creates a new product line item in the container and assigns it to the specified shipment. + + If the specified productID represents a product in the site catalog, the method will associate the product line + item with that catalog product and will copy all order-relevant information, like the quantity unit, from the + catalog product. + + If the specified productID does not represent a product of the site catalog, the method creates a new product + line item and initializes it with the specified product ID and quantity. If the passed in quantity value is not a + positive integer, it will be rounded to the nearest positive integer. The minimum order quantity and step + quantity will be set to 1.0. + + For catalog products, the method follows the configured 'Add2Basket' strategy to either increment the quantity of + an existing product line item or create a new product line item for the same product. For non-catalog products, + the method creates a new product line item no matter if the same product is already in the line item container. + If a negative quantity is specified, it is automatically changed to 1.0. + + + **Parameters:** + - productID - The product ID. + - quantity - The quantity of the product. + - shipment - Shipment + + **Returns:** + - the product line item + + **Deprecated:** +:::warning +Use [createProductLineItem(String, Shipment)](dw.order.LineItemCtnr.md#createproductlineitemstring-shipment) or + [ProductLineItem.updateQuantity(Number)](dw.order.ProductLineItem.md#updatequantitynumber) instead. + +::: + +--- + +### createShipment(String) +- createShipment(id: [String](TopLevel.String.md)): [Shipment](dw.order.Shipment.md) + - : Creates a standard shipment for the line item container. The specified ID must not yet be in use for another + shipment of this line item container. + + + **Parameters:** + - id - ID of the shipment. + + +--- + +### createShippingPriceAdjustment(String) +- createShippingPriceAdjustment(promotionID: [String](TopLevel.String.md)): [PriceAdjustment](dw.order.PriceAdjustment.md) + - : Creates a shipping price adjustment to be applied to the container. + + The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise + the method will throw an exception. + + If there already exists a shipping price adjustment referring to the specified promotion ID, an exception is + thrown. + + + **Parameters:** + - promotionID - Promotion ID + + **Returns:** + - The new price adjustment + + +--- + +### getAdjustedMerchandizeTotalGrossPrice() +- getAdjustedMerchandizeTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the adjusted total gross price (including tax) in purchase currency. Adjusted merchandize prices + represent the sum of product prices before services such as shipping, but after product-level and order-level + adjustments. + + + **Returns:** + - the adjusted total gross price (including tax) in purchase currency. + + +--- + +### getAdjustedMerchandizeTotalNetPrice() +- getAdjustedMerchandizeTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the total net price (excluding tax) in purchase currency. Adjusted merchandize prices represent the sum + of product prices before services such as shipping, but after product-level and order-level adjustments. + + + **Returns:** + - the total net price (excluding tax) in purchase currency. + + +--- + +### getAdjustedMerchandizeTotalPrice() +- getAdjustedMerchandizeTotalPrice(): [Money](dw.value.Money.md) + - : Returns the adjusted merchandize total price including product-level and order-level adjustments. If the line + item container is based on net pricing the adjusted merchandize total net price is returned. If the line item + container is based on gross pricing the adjusted merchandize total gross price is returned. + + + **Returns:** + - either the adjusted merchandize total net or gross price + + +--- + +### getAdjustedMerchandizeTotalPrice(Boolean) +- getAdjustedMerchandizeTotalPrice(applyOrderLevelAdjustments: [Boolean](TopLevel.Boolean.md)): [Money](dw.value.Money.md) + - : Returns the adjusted merchandize total price including order-level adjustments if requested. If the line item + container is based on net pricing the adjusted merchandize total net price is returned. If the line item + container is based on gross pricing the adjusted merchandize total gross price is returned. + + + **Parameters:** + - applyOrderLevelAdjustments - controls if order-level price adjustements are applied. If true, the price that is returned includes order-level price adjustments. If false, only product-level price adjustments are applied. + + **Returns:** + - a price representing the adjusted merchandize total controlled by the applyOrderLevelAdjustments + parameter. + + + +--- + +### getAdjustedMerchandizeTotalTax() +- getAdjustedMerchandizeTotalTax(): [Money](dw.value.Money.md) + - : Returns the subtotal tax in purchase currency. Adjusted merchandize prices represent the sum of product prices + before services such as shipping have been added, but after adjustment from promotions have been added. + + + **Returns:** + - the subtotal tax in purchase currency. + + +--- + +### getAdjustedShippingTotalGrossPrice() +- getAdjustedShippingTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping + adjustments have been applied. + + + **Returns:** + - the adjusted sum of all shipping line items of the line item container, including tax after shipping + adjustments have been applied. + + + +--- + +### getAdjustedShippingTotalNetPrice() +- getAdjustedShippingTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments + have been applied. + + + **Returns:** + - the sum of all shipping line items of the line item container, excluding tax after shipping adjustments + have been applied. + + + +--- + +### getAdjustedShippingTotalPrice() +- getAdjustedShippingTotalPrice(): [Money](dw.value.Money.md) + - : Returns the adjusted shipping total price. If the line item container is based on net pricing the adjusted + shipping total net price is returned. If the line item container is based on gross pricing the adjusted shipping + total gross price is returned. + + + **Returns:** + - either the adjusted shipping total net or gross price + + +--- + +### getAdjustedShippingTotalTax() +- getAdjustedShippingTotalTax(): [Money](dw.value.Money.md) + - : Returns the tax of all shipping line items of the line item container after shipping adjustments have been + applied. + + + **Returns:** + - the tax of all shipping line items of the line item container after shipping adjustments have been + applied. + + + +--- + +### getAllGiftCertificateLineItems() +- ~~getAllGiftCertificateLineItems(): [Collection](dw.util.Collection.md)~~ + - : Returns all gift certificate line items of the container. + + **Returns:** + - A collection of all GiftCertificateLineItems of the container. + + **Deprecated:** +:::warning +Use [getGiftCertificateLineItems()](dw.order.LineItemCtnr.md#getgiftcertificatelineitems) to get the collection instead. +::: + +--- + +### getAllLineItems() +- getAllLineItems(): [Collection](dw.util.Collection.md) + - : Returns all product, shipping, price adjustment, and gift certificate line items of the line item container. + + **Returns:** + - A collection of all product, shipping, price adjustment, and gift certificate line items of the + container, in that order. + + + +--- + +### getAllProductLineItems() +- getAllProductLineItems(): [Collection](dw.util.Collection.md) + - : Returns all product line items of the container, no matter if they are dependent or independent. This includes + option, bundled and bonus line items. + + + **Returns:** + - An unsorted collection of all ProductLineItem instances of the container. + + +--- + +### getAllProductLineItems(String) +- getAllProductLineItems(productID: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns all product line items of the container that have a product ID equal to the specified product ID, no + matter if they are dependent or independent. This includes option, bundled and bonus line items. + + + **Parameters:** + - productID - The product ID used to filter the product line items. + + **Returns:** + - An unsorted collection of all ProductLineItem instances which have the specified product ID. + + +--- + +### getAllProductQuantities() +- getAllProductQuantities(): [HashMap](dw.util.HashMap.md) + - : Returns a hash mapping all products in the line item container to their total quantities. The total product + quantity is used chiefly to validate the availability of the items in the cart. This method is not appropriate to + look up prices because it returns products such as bundled line items which are included in the price of their + parent and therefore have no corresponding price. + + + The method counts all direct product line items, plus dependent product line items that are not option line + items. It also excludes product line items that are not associated to any catalog product. + + + **Returns:** + - A map of products and their total quantities. + + +--- + +### getAllShippingPriceAdjustments() +- getAllShippingPriceAdjustments(): [Collection](dw.util.Collection.md) + - : Returns the collection of all shipping price adjustments applied somewhere in the container. This can be + adjustments applied to individual shipments or to the container itself. Note that the promotions engine only + applies shipping price adjustments to the the default shipping line item of shipments, and never to the + container. + + + **Returns:** + - an unsorted collection of the shipping PriceAdjustment instances associated with this container. + + **See Also:** + - [getShippingPriceAdjustments()](dw.order.LineItemCtnr.md#getshippingpriceadjustments) + + +--- + +### getBillingAddress() +- getBillingAddress(): [OrderAddress](dw.order.OrderAddress.md) + - : Returns the billing address defined for the container. Returns null if no billing address has been created yet. + + **Returns:** + - the billing address or null. + + +--- + +### getBonusDiscountLineItems() +- getBonusDiscountLineItems(): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection of the the bonus discount line items associated with this container. + + **Returns:** + - An unsorted collection of BonusDiscountLine instances in the container. + + +--- + +### getBonusLineItems() +- getBonusLineItems(): [Collection](dw.util.Collection.md) + - : Returns the collection of product line items that are bonus items (where + [ProductLineItem.isBonusProductLineItem()](dw.order.ProductLineItem.md#isbonusproductlineitem) is true). + + + **Returns:** + - the collection of product line items that are bonus items. + + +--- + +### getBusinessType() +- getBusinessType(): [EnumValue](dw.value.EnumValue.md) + - : Returns the type of the business this order has been placed in. + + Possible values are [BUSINESS_TYPE_B2C](dw.order.LineItemCtnr.md#business_type_b2c) or [BUSINESS_TYPE_B2B](dw.order.LineItemCtnr.md#business_type_b2b). + + + **Returns:** + - the type of the business this order has been placed in. or null, if the business type is not set + + +--- + +### getChannelType() +- getChannelType(): [EnumValue](dw.value.EnumValue.md) + - : The channel type defines in which sales channel this order has been created. This can be used to distinguish + order placed through Storefront, Call Center or Marketplace. + + Possible values are [CHANNEL_TYPE_STOREFRONT](dw.order.LineItemCtnr.md#channel_type_storefront), [CHANNEL_TYPE_CALLCENTER](dw.order.LineItemCtnr.md#channel_type_callcenter), + [CHANNEL_TYPE_MARKETPLACE](dw.order.LineItemCtnr.md#channel_type_marketplace), [CHANNEL_TYPE_DSS](dw.order.LineItemCtnr.md#channel_type_dss), [CHANNEL_TYPE_STORE](dw.order.LineItemCtnr.md#channel_type_store), + [CHANNEL_TYPE_PINTEREST](dw.order.LineItemCtnr.md#channel_type_pinterest), [CHANNEL_TYPE_TWITTER](dw.order.LineItemCtnr.md#channel_type_twitter), [CHANNEL_TYPE_FACEBOOKADS](dw.order.LineItemCtnr.md#channel_type_facebookads), + [CHANNEL_TYPE_SUBSCRIPTIONS](dw.order.LineItemCtnr.md#channel_type_subscriptions), [CHANNEL_TYPE_ONLINERESERVATION](dw.order.LineItemCtnr.md#channel_type_onlinereservation), + [CHANNEL_TYPE_CUSTOMERSERVICECENTER](dw.order.LineItemCtnr.md#channel_type_customerservicecenter), [CHANNEL_TYPE_INSTAGRAMCOMMERCE](dw.order.LineItemCtnr.md#channel_type_instagramcommerce), + [CHANNEL_TYPE_GOOGLE](dw.order.LineItemCtnr.md#channel_type_google), [CHANNEL_TYPE_YOUTUBE](dw.order.LineItemCtnr.md#channel_type_youtube), [CHANNEL_TYPE_TIKTOK](dw.order.LineItemCtnr.md#channel_type_tiktok), + [CHANNEL_TYPE_SNAPCHAT](dw.order.LineItemCtnr.md#channel_type_snapchat), [CHANNEL_TYPE_WHATSAPP](dw.order.LineItemCtnr.md#channel_type_whatsapp) + + + **Returns:** + - the sales channel this order has been placed in or null, if the order channel is not set + + +--- + +### getCouponLineItem(String) +- getCouponLineItem(couponCode: [String](TopLevel.String.md)): [CouponLineItem](dw.order.CouponLineItem.md) + - : Returns the coupon line item representing the specified coupon code. + + **Parameters:** + - couponCode - the coupon code. + + **Returns:** + - coupon line item or null. + + +--- + +### getCouponLineItems() +- getCouponLineItems(): [Collection](dw.util.Collection.md) + - : Returns a sorted collection of the coupon line items in the container. The coupon line items are returned in the + order they were added to container. + + + **Returns:** + - A sorted list of the CouponLineItem instances in the container. + + +--- + +### getCurrencyCode() +- getCurrencyCode(): [String](TopLevel.String.md) + - : Returns the currency code for this line item container. The currency code is a 3-character currency mnemonic such + as 'USD' or 'EUR'. The currency code represents the currency in which the calculation is made, and in which the + buyer sees all prices in the store front. + + + **Returns:** + - the currency code for this line item container. + + +--- + +### getCustomer() +- getCustomer(): [Customer](dw.customer.Customer.md) + - : Returns the customer associated with this container. + + **Returns:** + - the customer associated with this container. + + +--- + +### getCustomerEmail() +- getCustomerEmail(): [String](TopLevel.String.md) + - : Returns the email of the customer associated with this container. + + **Returns:** + - the email of the customer associated with this container. + + +--- + +### getCustomerName() +- getCustomerName(): [String](TopLevel.String.md) + - : Returns the name of the customer associated with this container. + + **Returns:** + - the name of the customer associated with this container. + + +--- + +### getCustomerNo() +- getCustomerNo(): [String](TopLevel.String.md) + - : Returns the customer number of the customer associated with this container. + + **Returns:** + - the customer number of the customer associated with this container. + + +--- + +### getDefaultShipment() +- getDefaultShipment(): [Shipment](dw.order.Shipment.md) + - : Returns the default shipment of the line item container. Every basket and order has a default shipment with the + id "me". If you call a process that accesses a shipment, and you don't specify the shipment, then the process + uses the default shipment. You can't remove a default shipment. Calling [removeShipment(Shipment)](dw.order.LineItemCtnr.md#removeshipmentshipment) on it + throws an exception. + + + **Returns:** + - the default shipment of the container + + +--- + +### getEtag() +- getEtag(): [String](TopLevel.String.md) + - : Returns the Etag of the line item container. The Etag is a hash that represents the overall container state + including any associated objects like line items. + + + **Returns:** + - the Etag value + + +--- + +### getGiftCertificateLineItems() +- getGiftCertificateLineItems(): [Collection](dw.util.Collection.md) + - : Returns all gift certificate line items of the container. + + **Returns:** + - A collection of all GiftCertificateLineItems of the container. + + +--- + +### getGiftCertificateLineItems(String) +- getGiftCertificateLineItems(giftCertificateId: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns all gift certificate line items of the container, no matter if they are dependent or independent. + + **Parameters:** + - giftCertificateId - the gift certificate identifier. + + **Returns:** + - A collection of all GiftCertificateLineItems of the container. + + +--- + +### getGiftCertificatePaymentInstruments() +- getGiftCertificatePaymentInstruments(): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this + container. + + + **Returns:** + - an unsorted collection containing the set of PaymentInstrument instances that represent GiftCertificates. + + +--- + +### getGiftCertificatePaymentInstruments(String) +- getGiftCertificatePaymentInstruments(giftCertificateCode: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection containing all PaymentInstruments of type + PaymentInstrument.METHOD\_GIFT\_CERTIFICATE where the specified code is the same code on the payment instrument. + + + **Parameters:** + - giftCertificateCode - the gift certificate code. + + **Returns:** + - an unsorted collection containing all PaymentInstruments of type + PaymentInstrument.METHOD\_GIFT\_CERTIFICATE where the specified code is the same code on the payment + instrument. + + + +--- + +### getGiftCertificateTotalGrossPrice() +- getGiftCertificateTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the total gross price of all gift certificates in the cart. Should usually be equal to total net price. + + **Returns:** + - the total gross price of all gift certificate line items + + +--- + +### getGiftCertificateTotalNetPrice() +- getGiftCertificateTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the total net price (excluding tax) of all gift certificates in the cart. Should usually be equal to + total gross price. + + + **Returns:** + - the total net price of all gift certificate line items + + +--- + +### getGiftCertificateTotalPrice() +- getGiftCertificateTotalPrice(): [Money](dw.value.Money.md) + - : Returns the gift certificate total price. If the line item container is based on net pricing the gift certificate + total net price is returned. If the line item container is based on gross pricing the gift certificate total + gross price is returned. + + + **Returns:** + - either the gift certificate total net or gross price + + +--- + +### getGiftCertificateTotalTax() +- getGiftCertificateTotalTax(): [Money](dw.value.Money.md) + - : Returns the total tax of all gift certificates in the cart. Should usually be 0.0. + + **Returns:** + - the total tax of all gift certificate line items + + +--- + +### getMerchandizeTotalGrossPrice() +- getMerchandizeTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the total gross price (including tax) in purchase currency. Merchandize total prices represent the sum of + product prices before services such as shipping or adjustment from promotions have been added. + + + **Returns:** + - the total gross price (including tax) in purchase currency. + + +--- + +### getMerchandizeTotalNetPrice() +- getMerchandizeTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the total net price (excluding tax) in purchase currency. Merchandize total prices represent the sum of + product prices before services such as shipping or adjustment from promotion have been added. + + + **Returns:** + - the total net price (excluding tax) in purchase currency. + + +--- + +### getMerchandizeTotalPrice() +- getMerchandizeTotalPrice(): [Money](dw.value.Money.md) + - : Returns the merchandize total price. If the line item container is based on net pricing the merchandize total net + price is returned. If the line item container is based on gross pricing the merchandize total gross price is + returned. + + + **Returns:** + - either the merchandize total net or gross price + + +--- + +### getMerchandizeTotalTax() +- getMerchandizeTotalTax(): [Money](dw.value.Money.md) + - : Returns the total tax in purchase currency. Merchandize total prices represent the sum of product prices before + services such as shipping or adjustment from promotions have been added. + + + **Returns:** + - the total tax in purchase currency. + + +--- + +### getNotes() +- getNotes(): [List](dw.util.List.md) + - : Returns the list of notes for this object, ordered by creation time from oldest to newest. + + **Returns:** + - the list of notes for this object, ordered by creation time from oldest to newest. + + +--- + +### getPaymentInstrument() +- ~~getPaymentInstrument(): [OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md)~~ + - : Returns the payment instrument of the line item container or null. This method is deprecated. You should use + getPaymentInstruments() or getGiftCertificatePaymentInstruments() instead. + + + **Returns:** + - the order payment instrument of the line item container or null. + + **Deprecated:** +:::warning +Use [getPaymentInstruments()](dw.order.LineItemCtnr.md#getpaymentinstruments) or [getGiftCertificatePaymentInstruments()](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstruments) to get the + set of payment instruments. + +::: + +--- + +### getPaymentInstruments() +- getPaymentInstruments(): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection of the payment instruments in this container. + + **Returns:** + - an unsorted collection containing the set of PaymentInstrument instances associated with this container. + + +--- + +### getPaymentInstruments(String) +- getPaymentInstruments(paymentMethodID: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns an unsorted collection of PaymentInstrument instances based on the specified payment method ID. + + **Parameters:** + - paymentMethodID - the ID of the payment method used. + + **Returns:** + - an unsorted collection of OrderPaymentInstrument instances based on the payment method. + + +--- + +### getPriceAdjustmentByPromotionID(String) +- getPriceAdjustmentByPromotionID(promotionID: [String](TopLevel.String.md)): [PriceAdjustment](dw.order.PriceAdjustment.md) + - : Returns the price adjustment associated to the specified promotion ID. + + **Parameters:** + - promotionID - Promotion id + + **Returns:** + - The price adjustment associated with the specified promotion ID or null if none was found. + + +--- + +### getPriceAdjustments() +- getPriceAdjustments(): [Collection](dw.util.Collection.md) + - : Returns the collection of price adjustments that have been applied to the totals such as promotion on the + purchase value (i.e. $10 Off or 10% Off). The price adjustments are sorted by the order in which they were + applied to the order by the promotions engine. + + + **Returns:** + - the sorted collection of PriceAdjustment instances. + + +--- + +### getProductLineItems() +- getProductLineItems(): [Collection](dw.util.Collection.md) + - : Returns the product line items of the container that are not dependent on other product line items. This includes + line items representing bonus products in the container but excludes option, bundled, and bonus line items. The + returned collection is sorted by the position attribute of the product line items. + + + **Returns:** + - A sorted collection of ProductLineItem instances which are not dependent on other product line items. + + +--- + +### getProductLineItems(String) +- getProductLineItems(productID: [String](TopLevel.String.md)): [Collection](dw.util.Collection.md) + - : Returns the product line items of the container that have a product ID equal to the specified product ID and that + are not dependent on other product line items. This includes line items representing bonus products in the + container, but excludes option, bundled and bonus line items. The returned collection is sorted by the position + attribute of the product line items. + + + **Parameters:** + - productID - The Product ID used to filter the product line items. + + **Returns:** + - A sorted collection of ProductLineItem instances which have the specified product ID and are not + dependent on other product line items. + + + +--- + +### getProductQuantities() +- getProductQuantities(): [HashMap](dw.util.HashMap.md) + - : Returns a hash map of all products in the line item container and their total quantities. The total product + quantity is for example used to lookup the product price. + + + The method counts all direct product line items, plus dependent product line items that are not bundled line + items and no option line items. It also excludes product line items that are not associated to any catalog + product, and bonus product line items. + + + **Returns:** + - a map of products and their total quantities. + + **See Also:** + - [getProductQuantities(Boolean)](dw.order.LineItemCtnr.md#getproductquantitiesboolean) + + +--- + +### getProductQuantities(Boolean) +- getProductQuantities(includeBonusProducts: [Boolean](TopLevel.Boolean.md)): [HashMap](dw.util.HashMap.md) + - : Returns a hash map of all products in the line item container and their total quantities. The total product + quantity is for example used to lookup the product price in the cart. + + + The method counts all direct product line items, plus dependent product line items that are not bundled line + items and no option line items. It also excludes product line items that are not associated to any catalog + product. + + + If the parameter 'includeBonusProducts' is set to true, the method also counts bonus product line items. + + + **Parameters:** + - includeBonusProducts - if true also bonus product line item are counted + + **Returns:** + - A map of products and their total quantities. + + +--- + +### getProductQuantityTotal() +- getProductQuantityTotal(): [Number](TopLevel.Number.md) + - : Returns the total quantity of all product line items. Not included are bundled line items and option line items. + + **Returns:** + - The total quantity of all line items of the container. + + +--- + +### getShipment(String) +- getShipment(id: [String](TopLevel.String.md)): [Shipment](dw.order.Shipment.md) + - : Returns the shipment for the specified ID or `null` if no shipment with this ID exists in the line + item container. Using "me" always returns the default shipment. + + + **Parameters:** + - id - the shipment identifier + + **Returns:** + - the shipment or `null` + + +--- + +### getShipments() +- getShipments(): [Collection](dw.util.Collection.md) + - : Returns all shipments of the line item container. + + The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). All other + shipments are sorted ascending by shipment ID. + + + **Returns:** + - all shipments of the line item container + + +--- + +### getShippingPriceAdjustmentByPromotionID(String) +- getShippingPriceAdjustmentByPromotionID(promotionID: [String](TopLevel.String.md)): [PriceAdjustment](dw.order.PriceAdjustment.md) + - : Returns the shipping price adjustment associated with the specified promotion ID. + + **Parameters:** + - promotionID - Promotion id + + **Returns:** + - The price adjustment associated with the specified promotion ID or null if none was found. + + +--- + +### getShippingPriceAdjustments() +- getShippingPriceAdjustments(): [Collection](dw.util.Collection.md) + - : Returns the of shipping price adjustments applied to the shipping total of the container. Note that the + promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and + never to the container. + + + **Returns:** + - a collection of shipping price adjustments. + + **See Also:** + - [getAllShippingPriceAdjustments()](dw.order.LineItemCtnr.md#getallshippingpriceadjustments) + + +--- + +### getShippingTotalGrossPrice() +- getShippingTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments + have been applied. + + + **Returns:** + - the sum of all shipping line items of the line item container, including tax before shipping adjustments + have been applied. + + + +--- + +### getShippingTotalNetPrice() +- getShippingTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments + have been applied. + + + **Returns:** + - the sum of all shipping line items of the line item container, excluding tax before shipping adjustments + have been applied. + + + +--- + +### getShippingTotalPrice() +- getShippingTotalPrice(): [Money](dw.value.Money.md) + - : Returns the shipping total price. If the line item container is based on net pricing the shipping total net price + is returned. If the line item container is based on gross pricing the shipping total gross price is returned. + + + **Returns:** + - either the shipping total net or gross price + + +--- + +### getShippingTotalTax() +- getShippingTotalTax(): [Money](dw.value.Money.md) + - : Returns the tax of all shipping line items of the line item container before shipping adjustments have been + applied. + + + **Returns:** + - the tax of all shipping line items of the line item container before shipping adjustments have been + applied. + + + +--- + +### getTaxTotalsPerTaxRate() +- getTaxTotalsPerTaxRate(): [SortedMap](dw.util.SortedMap.md) + - : This method returns a [SortedMap](dw.util.SortedMap.md) in which the keys are [Decimal](dw.util.Decimal.md) tax rates and the values + are [Money](dw.value.Money.md) total tax for the tax rate. The map is unmodifiable. + + + **Returns:** + - sorted map of tax rate against total tax + + +--- + +### getTotalGrossPrice() +- getTotalGrossPrice(): [Money](dw.value.Money.md) + - : Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. Total prices represent the sum + of product prices, services prices and adjustments. + + + **Returns:** + - the grand total price. + + +--- + +### getTotalNetPrice() +- getTotalNetPrice(): [Money](dw.value.Money.md) + - : Returns the grand total price for LineItemCtnr net of tax, in purchase currency. Total prices represent the sum + of product prices, services prices and adjustments. + + + **Returns:** + - the grand total price. + + +--- + +### getTotalTax() +- getTotalTax(): [Money](dw.value.Money.md) + - : Returns the grand total tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product + prices, services prices and adjustments. + + + **Returns:** + - the grand total tax. + + +--- + +### isExternallyTaxed() +- isExternallyTaxed(): [Boolean](TopLevel.Boolean.md) + - : Use this method to check whether the LineItemCtnr is calculated based on external tax tables. + + Note: a basket can only be created in EXTERNAL tax mode using SCAPI. + + + **Returns:** + - `true` if the LineItemCtnr was calculated based on external tax tables. + + +--- + +### isTaxRoundedAtGroup() +- isTaxRoundedAtGroup(): [Boolean](TopLevel.Boolean.md) + - : Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + **Returns:** + - `true` if the LineItemCtnr was calculated with grouped taxation + + +--- + +### removeAllPaymentInstruments() +- removeAllPaymentInstruments(): void + - : Removes the all Payment Instruments from this container and deletes the Payment Instruments. + + +--- + +### removeBonusDiscountLineItem(BonusDiscountLineItem) +- removeBonusDiscountLineItem(bonusDiscountLineItem: [BonusDiscountLineItem](dw.order.BonusDiscountLineItem.md)): void + - : Removes the specified bonus discount line item from the line item container. + + **Parameters:** + - bonusDiscountLineItem - The bonus discount line item to remove, must not be null. + + +--- + +### removeCouponLineItem(CouponLineItem) +- removeCouponLineItem(couponLineItem: [CouponLineItem](dw.order.CouponLineItem.md)): void + - : Removes the specified coupon line item from the line item container. + + **Parameters:** + - couponLineItem - The coupon line item to remove + + +--- + +### removeGiftCertificateLineItem(GiftCertificateLineItem) +- removeGiftCertificateLineItem(giftCertificateLineItem: [GiftCertificateLineItem](dw.order.GiftCertificateLineItem.md)): void + - : Removes the specified gift certificate line item from the line item container. + + **Parameters:** + - giftCertificateLineItem - The gift certificate line item to remove + + +--- + +### removeNote(Note) +- removeNote(note: [Note](dw.object.Note.md)): void + - : Removes a note from this line item container and deletes it. + + **Parameters:** + - note - The note to remove. Must not be null. Must belong to this line item container. + + +--- + +### removePaymentInstrument(PaymentInstrument) +- removePaymentInstrument(pi: [PaymentInstrument](dw.order.PaymentInstrument.md)): void + - : Removes the specified Payment Instrument from this container and deletes the Payment Instrument. + + **Parameters:** + - pi - the Payment Instrument to remove. + + +--- + +### removePriceAdjustment(PriceAdjustment) +- removePriceAdjustment(priceAdjustment: [PriceAdjustment](dw.order.PriceAdjustment.md)): void + - : Removes the specified price adjustment line item from the line item container. + + **Parameters:** + - priceAdjustment - The price adjustment line item to remove, must not be null. + + +--- + +### removeProductLineItem(ProductLineItem) +- removeProductLineItem(productLineItem: [ProductLineItem](dw.order.ProductLineItem.md)): void + - : Removes the specified product line item from the line item container. + + **Parameters:** + - productLineItem - The product line item to remove, must not be null. + + +--- + +### removeShipment(Shipment) +- removeShipment(shipment: [Shipment](dw.order.Shipment.md)): void + - : Removes the specified shipment and all associated product, gift certificate, shipping and price adjustment line + items from the line item container. It is not permissible to remove the default shipment. + + + **Parameters:** + - shipment - Shipment to be removed, must not be null. + + +--- + +### removeShippingPriceAdjustment(PriceAdjustment) +- removeShippingPriceAdjustment(priceAdjustment: [PriceAdjustment](dw.order.PriceAdjustment.md)): void + - : Removes the specified shipping price adjustment line item from the line item container. + + **Parameters:** + - priceAdjustment - The price adjustment line item to remove, must not be null. + + +--- + +### setCustomerEmail(String) +- setCustomerEmail(aValue: [String](TopLevel.String.md)): void + - : Sets the email address of the customer associated with this container. + + **Parameters:** + - aValue - the email address of the customer associated with this container. + + +--- + +### setCustomerName(String) +- setCustomerName(aValue: [String](TopLevel.String.md)): void + - : Sets the name of the customer associated with this container. + + **Parameters:** + - aValue - the name of the customer associated with this container. + + +--- + +### updateOrderLevelPriceAdjustmentTax() +- updateOrderLevelPriceAdjustmentTax(): void + - : Calculates the tax for all shipping and order-level merchandise price adjustments in this LineItemCtnr. + + + The tax on each adjustment is calculated from the taxes of the line items the adjustment applies across. + + + **This method must be invoked at the end of tax calculation of a basket or an order.** + + + +--- + +### updateTotals() +- updateTotals(): void + - : Recalculates the totals of the line item container. It is necessary to call this method after any type of + modification to the basket. + + + +--- + +### verifyPriceAdjustmentLimits() +- verifyPriceAdjustmentLimits(): [Status](dw.system.Status.md) + - : Verifies whether the manual price adjustments made for the line item container exceed the corresponding limits + for the current user and the current site. + + + The results of this method are based on the current values held in the [LineItemCtnr](dw.order.LineItemCtnr.md), such as the + base price of manual price adjustments. It is important the method is only called after the calculation process + has completed. + + + + + Status.OK is returned if NONE of the manual price adjustments exceed the correspondent limits. + + + Status.ERROR is returned if ANY of the manual price adjustments exceed the correspondent limits. If this case + [Status.getItems()](dw.system.Status.md#getitems) returns all price adjustment limit violations. The code of each + [StatusItem](dw.system.StatusItem.md) represents the violated price adjustment type (see + [PriceAdjustmentLimitTypes](dw.order.PriceAdjustmentLimitTypes.md)). [StatusItem.getDetails()](dw.system.StatusItem.md#getdetails) returns a + [Map](dw.util.Map.md) with the max amount and (where relevant) the item to which the violation applies. + + + Usage: + + + ``` + var order : Order; // known + + var status : Status = order.verifyPriceAdjustmentLimits(); + if (status.status == Status.ERROR) + { + for each (var statusItem : StatusItem in status.items) + { + var statusDetail : MapEntry = statusItem.details.entrySet().iterator().next(); + var maxAllowedLimit : Number = (Number) (statusDetail.key); + + if (statusItem.code == PriceAdjustmentLimitTypes.TYPE_ORDER) + { + // fix order price adjustment considering maxAllowedLimit + } + else if (statusItem.code == PriceAdjustmentLimitTypes.TYPE_ITEM) + { + var pli : ProductLineItem = (ProductLineItem) (statusDetail.value); + // fix pli price adjustment considering maxAllowedLimit + } + else if (statusItem.code == PriceAdjustmentLimitTypes.TYPE_SHIPPING) + { + if (statusDetail.value == null) + { + // fix order level shipping price adjustment considering maxAllowedLimit + } + else + { + var sli : ShippingLineItem = (ShippingLineItem) (statusDetail.value); + // fix sli price adjustment considering maxAllowedLimit + } + } + } + } + ``` + + + **Returns:** + - a Status instance with - Status.OK if all manual price adjustments do not exceed the correspondent + limits, otherwise Status.ERROR + + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.Order.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.Order.md new file mode 100644 index 00000000..4dd4acbc --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.Order.md @@ -0,0 +1,2770 @@ + +# Class Order + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.LineItemCtnr](dw.order.LineItemCtnr.md) + - [dw.order.Order](dw.order.Order.md) + +The Order class represents an order. The correct way to retrieve an order is described in [OrderMgr](dw.order.OrderMgr.md). + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [CONFIRMATION_STATUS_CONFIRMED](#confirmation_status_confirmed): [Number](TopLevel.Number.md) = 2 | constant for when Confirmation Status is Confirmed | +| [CONFIRMATION_STATUS_NOTCONFIRMED](#confirmation_status_notconfirmed): [Number](TopLevel.Number.md) = 0 | constant for when Confirmation Status is Not Confirmed | +| [ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING](#encryption_algorithm_rsa_ecb_oaepwithsha_256andmgf1padding): [String](TopLevel.String.md) = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" | The encryption algorithm "RSA/ECB/OAEPWithSHA-256AndMGF1Padding". | +| ~~[ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING](#encryption_algorithm_rsa_ecb_pkcs1padding): [String](TopLevel.String.md) = "RSA/ECB/PKCS1Padding"~~ | The outdated encryption algorithm "RSA/ECB/PKCS1Padding". | +| [EXPORT_STATUS_EXPORTED](#export_status_exported): [Number](TopLevel.Number.md) = 1 | constant for when Export Status is Exported | +| [EXPORT_STATUS_FAILED](#export_status_failed): [Number](TopLevel.Number.md) = 3 | constant for when Export Status is Failed | +| [EXPORT_STATUS_NOTEXPORTED](#export_status_notexported): [Number](TopLevel.Number.md) = 0 | constant for when Export Status is Not Exported | +| [EXPORT_STATUS_READY](#export_status_ready): [Number](TopLevel.Number.md) = 2 | constant for when Export Status is ready to be exported. | +| [ORDER_STATUS_CANCELLED](#order_status_cancelled): [Number](TopLevel.Number.md) = 6 | constant for when Order Status is Cancelled | +| [ORDER_STATUS_COMPLETED](#order_status_completed): [Number](TopLevel.Number.md) = 5 | constant for when Order Status is Completed | +| [ORDER_STATUS_CREATED](#order_status_created): [Number](TopLevel.Number.md) = 0 | constant for when Order Status is Created | +| [ORDER_STATUS_FAILED](#order_status_failed): [Number](TopLevel.Number.md) = 8 | constant for when Order Status is Failed | +| [ORDER_STATUS_NEW](#order_status_new): [Number](TopLevel.Number.md) = 3 | constant for when Order Status is New | +| [ORDER_STATUS_OPEN](#order_status_open): [Number](TopLevel.Number.md) = 4 | constant for when Order Status is Open | +| [ORDER_STATUS_REPLACED](#order_status_replaced): [Number](TopLevel.Number.md) = 7 | constant for when Order Status is Replaced | +| [PAYMENT_STATUS_NOTPAID](#payment_status_notpaid): [Number](TopLevel.Number.md) = 0 | constant for when Payment Status is Not Paid | +| [PAYMENT_STATUS_PAID](#payment_status_paid): [Number](TopLevel.Number.md) = 2 | constant for when Payment Status is Paid | +| [PAYMENT_STATUS_PARTPAID](#payment_status_partpaid): [Number](TopLevel.Number.md) = 1 | constant for when Payment Status is Part Paid | +| [SHIPPING_STATUS_NOTSHIPPED](#shipping_status_notshipped): [Number](TopLevel.Number.md) = 0 | constant for when Shipping Status is Not shipped | +| [SHIPPING_STATUS_PARTSHIPPED](#shipping_status_partshipped): [Number](TopLevel.Number.md) = 1 | constant for when Shipping Status is Part Shipped | +| [SHIPPING_STATUS_SHIPPED](#shipping_status_shipped): [Number](TopLevel.Number.md) = 2 | constant for when Shipping Status is Shipped | + +## Property Summary + +| Property | Description | +| --- | --- | +| [affiliatePartnerID](#affiliatepartnerid): [String](TopLevel.String.md) | Returns the affiliate partner ID value, or null. | +| [affiliatePartnerName](#affiliatepartnername): [String](TopLevel.String.md) | Returns the affiliate partner name value, or null. | +| [appeasementItems](#appeasementitems): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [AppeasementItem](dw.order.AppeasementItem.md)s associated with this order. | +| [appeasements](#appeasements): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [Appeasement](dw.order.Appeasement.md)s associated with this order. | +| [cancelCode](#cancelcode): [EnumValue](dw.value.EnumValue.md) | If this order was cancelled, returns the value of the cancel code or null. | +| [cancelDescription](#canceldescription): [String](TopLevel.String.md) | If this order was cancelled, returns the text describing why the order was cancelled or null. | +| [capturedAmount](#capturedamount): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of the captured amounts. | +| [confirmationStatus](#confirmationstatus): [EnumValue](dw.value.EnumValue.md) | Returns the confirmation status of the order.
          Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) and [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). | +| [createdBy](#createdby): [String](TopLevel.String.md) `(read-only)` | Returns the name of the user who has created the order. | +| [currentOrder](#currentorder): [Order](dw.order.Order.md) `(read-only)` | Returns the current order. | +| [currentOrderNo](#currentorderno): [String](TopLevel.String.md) `(read-only)` | Returns the order number of the current order. | +| [customerLocaleID](#customerlocaleid): [String](TopLevel.String.md) `(read-only)` | Returns the ID of the locale that was in effect when the order was placed. | +| [customerOrderReference](#customerorderreference): [String](TopLevel.String.md) | Returns the customer-specific reference information for the order, or null. | +| [exportAfter](#exportafter): [Date](TopLevel.Date.md) | Returns a date after which an order can be exported. | +| [exportStatus](#exportstatus): [EnumValue](dw.value.EnumValue.md) | Returns the export status of the order.
          Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). | +| [externalOrderNo](#externalorderno): [String](TopLevel.String.md) | Returns the value of an external order number associated with this order, or null. | +| [externalOrderStatus](#externalorderstatus): [String](TopLevel.String.md) | Returns the status of an external order associated with this order, or null. | +| [externalOrderText](#externalordertext): [String](TopLevel.String.md) | Returns the text describing the external order, or null. | +| [globalPartyID](#globalpartyid): [String](TopLevel.String.md) `(read-only)` | The Global Party ID reconciles customer identity across multiple systems. | +| [imported](#imported): [Boolean](TopLevel.Boolean.md) `(read-only)` | Returns `true`, if the order is imported and `false` otherwise. | +| [invoiceItems](#invoiceitems): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [InvoiceItem](dw.order.InvoiceItem.md)s associated with this order. | +| [invoiceNo](#invoiceno): [String](TopLevel.String.md) | Returns the invoice number for this Order. | +| [invoices](#invoices): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [Invoice](dw.order.Invoice.md)s associated with this order. | +| [orderExportXML](#orderexportxml): [String](TopLevel.String.md) `(read-only)` | Returns the order export XML as String object. | +| [orderNo](#orderno): [String](TopLevel.String.md) `(read-only)` | Returns the order number for this order. | +| [orderToken](#ordertoken): [String](TopLevel.String.md) `(read-only)` | Returns the token for this order. | +| [originalOrder](#originalorder): [Order](dw.order.Order.md) `(read-only)` | Returns the original order associated with this order. | +| [originalOrderNo](#originalorderno): [String](TopLevel.String.md) `(read-only)` | Returns the order number of the original order associated with this order. | +| [paymentStatus](#paymentstatus): [EnumValue](dw.value.EnumValue.md) | Returns the order payment status value.
          Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). | +| ~~[paymentTransaction](#paymenttransaction): [PaymentTransaction](dw.order.PaymentTransaction.md)~~ `(read-only)` | Returns the payment transaction associated with this order. | +| [refundedAmount](#refundedamount): [Money](dw.value.Money.md) `(read-only)` | Returns the sum of the refunded amounts. | +| [remoteHost](#remotehost): [String](TopLevel.String.md) `(read-only)` | Returns the IP address of the remote host from which the order was created. | +| [replaceCode](#replacecode): [EnumValue](dw.value.EnumValue.md) | If this order was replaced by another order, returns the value of the replace code. | +| [replaceDescription](#replacedescription): [String](TopLevel.String.md) | If this order was replaced by another order, returns the value of the replace description. | +| [replacedOrder](#replacedorder): [Order](dw.order.Order.md) `(read-only)` | Returns the order that this order replaced or null. | +| [replacedOrderNo](#replacedorderno): [String](TopLevel.String.md) `(read-only)` | Returns the order number that this order replaced or null if this order did not replace an order. | +| [replacementOrder](#replacementorder): [Order](dw.order.Order.md) `(read-only)` | Returns the order that replaced this order, or null. | +| [replacementOrderNo](#replacementorderno): [String](TopLevel.String.md) `(read-only)` | If this order was replaced by another order, returns the order number that replaced this order. | +| [returnCaseItems](#returncaseitems): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [ReturnCaseItem](dw.order.ReturnCaseItem.md)s associated with this order. | +| [returnCases](#returncases): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [ReturnCase](dw.order.ReturnCase.md)s associated with this order. | +| [returnItems](#returnitems): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [ReturnItem](dw.order.ReturnItem.md)s associated with this order. | +| [returns](#returns): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [Return](dw.order.Return.md)s associated with this order. | +| [shippingOrderItems](#shippingorderitems): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [ShippingOrderItem](dw.order.ShippingOrderItem.md)s associated with this order. | +| [shippingOrders](#shippingorders): [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` | Returns the collection of [ShippingOrder](dw.order.ShippingOrder.md)s associated with this order. | +| [shippingStatus](#shippingstatus): [EnumValue](dw.value.EnumValue.md) | Returns the order shipping status.
          Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). | +| [sourceCode](#sourcecode): [String](TopLevel.String.md) `(read-only)` | Returns the source code stored with the order or `null` if no source code is attached to the order. | +| [sourceCodeGroup](#sourcecodegroup): [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) `(read-only)` | Returns the source code group attached to the order or `null` if no source code group is attached to the order. | +| [sourceCodeGroupID](#sourcecodegroupid): [String](TopLevel.String.md) `(read-only)` | Returns the source code group id stored with the order or `null` if no source code group is attached to the order. | +| [status](#status): [EnumValue](dw.value.EnumValue.md) | Returns the status of the order.
          Possible values are:

          • [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created)
          • [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new)
          • [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open)
          • [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed)
          • [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled)
          • [ORDER_STATUS_FAILED](dw.order.Order.md#order_status_failed)
          • [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced)
          | +| [taxRoundedAtGroup](#taxroundedatgroup): [Boolean](TopLevel.Boolean.md) `(read-only)` | Use this method to check if the Order was created with grouped taxation calculation. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [createAppeasement](dw.order.Order.md#createappeasement)() | Creates a new [Appeasement](dw.order.Appeasement.md) associated with this order. | +| [createAppeasement](dw.order.Order.md#createappeasementstring)([String](TopLevel.String.md)) | Creates a new [Appeasement](dw.order.Appeasement.md) associated with this order. | +| [createReturnCase](dw.order.Order.md#createreturncaseboolean)([Boolean](TopLevel.Boolean.md)) | Creates a new [ReturnCase](dw.order.ReturnCase.md) associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization). | +| [createReturnCase](dw.order.Order.md#createreturncasestring-boolean)([String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md)) | Creates a new [ReturnCase](dw.order.ReturnCase.md) associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization). | +| [createServiceItem](dw.order.Order.md#createserviceitemstring-string)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the [order item](dw.order.OrderItem.md) with the given status which wraps a new [service item](dw.order.ShippingLineItem.md) which is created and added to the order. | +| [createShippingOrder](dw.order.Order.md#createshippingorder)() | Creates a new [ShippingOrder](dw.order.ShippingOrder.md) for this order. | +| [createShippingOrder](dw.order.Order.md#createshippingorderstring)([String](TopLevel.String.md)) | Creates a new [ShippingOrder](dw.order.ShippingOrder.md) for this order. | +| [getAffiliatePartnerID](dw.order.Order.md#getaffiliatepartnerid)() | Returns the affiliate partner ID value, or null. | +| [getAffiliatePartnerName](dw.order.Order.md#getaffiliatepartnername)() | Returns the affiliate partner name value, or null. | +| [getAppeasement](dw.order.Order.md#getappeasementstring)([String](TopLevel.String.md)) | Returns the [Appeasement](dw.order.Appeasement.md) associated with this order with the given appeasementNumber. | +| [getAppeasementItem](dw.order.Order.md#getappeasementitemstring)([String](TopLevel.String.md)) | Returns the [AppeasementItem](dw.order.AppeasementItem.md) associated with this Order with the given appeasementItemID. | +| [getAppeasementItems](dw.order.Order.md#getappeasementitems)() | Returns the collection of [AppeasementItem](dw.order.AppeasementItem.md)s associated with this order. | +| [getAppeasements](dw.order.Order.md#getappeasements)() | Returns the collection of [Appeasement](dw.order.Appeasement.md)s associated with this order. | +| [getCancelCode](dw.order.Order.md#getcancelcode)() | If this order was cancelled, returns the value of the cancel code or null. | +| [getCancelDescription](dw.order.Order.md#getcanceldescription)() | If this order was cancelled, returns the text describing why the order was cancelled or null. | +| [getCapturedAmount](dw.order.Order.md#getcapturedamount)() | Returns the sum of the captured amounts. | +| [getConfirmationStatus](dw.order.Order.md#getconfirmationstatus)() | Returns the confirmation status of the order.
          Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) and [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). | +| [getCreatedBy](dw.order.Order.md#getcreatedby)() | Returns the name of the user who has created the order. | +| [getCurrentOrder](dw.order.Order.md#getcurrentorder)() | Returns the current order. | +| [getCurrentOrderNo](dw.order.Order.md#getcurrentorderno)() | Returns the order number of the current order. | +| [getCustomerLocaleID](dw.order.Order.md#getcustomerlocaleid)() | Returns the ID of the locale that was in effect when the order was placed. | +| [getCustomerOrderReference](dw.order.Order.md#getcustomerorderreference)() | Returns the customer-specific reference information for the order, or null. | +| [getExportAfter](dw.order.Order.md#getexportafter)() | Returns a date after which an order can be exported. | +| [getExportStatus](dw.order.Order.md#getexportstatus)() | Returns the export status of the order.
          Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). | +| [getExternalOrderNo](dw.order.Order.md#getexternalorderno)() | Returns the value of an external order number associated with this order, or null. | +| [getExternalOrderStatus](dw.order.Order.md#getexternalorderstatus)() | Returns the status of an external order associated with this order, or null. | +| [getExternalOrderText](dw.order.Order.md#getexternalordertext)() | Returns the text describing the external order, or null. | +| [getGlobalPartyID](dw.order.Order.md#getglobalpartyid)() | The Global Party ID reconciles customer identity across multiple systems. | +| [getInvoice](dw.order.Order.md#getinvoicestring)([String](TopLevel.String.md)) | Returns the [Invoice](dw.order.Invoice.md) associated with this order with the given invoiceNumber. | +| [getInvoiceItem](dw.order.Order.md#getinvoiceitemstring)([String](TopLevel.String.md)) | Returns the [InvoiceItem](dw.order.InvoiceItem.md) associated with this order with the given ID. | +| [getInvoiceItems](dw.order.Order.md#getinvoiceitems)() | Returns the collection of [InvoiceItem](dw.order.InvoiceItem.md)s associated with this order. | +| [getInvoiceNo](dw.order.Order.md#getinvoiceno)() | Returns the invoice number for this Order. | +| [getInvoices](dw.order.Order.md#getinvoices)() | Returns the collection of [Invoice](dw.order.Invoice.md)s associated with this order. | +| [getOrderExportXML](dw.order.Order.md#getorderexportxml)() | Returns the order export XML as String object. | +| [getOrderExportXML](dw.order.Order.md#getorderexportxmlstring-string---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key. | +| ~~[getOrderExportXML](dw.order.Order.md#getorderexportxmlstring-string-boolean---variant-1)([String](TopLevel.String.md), [String](TopLevel.String.md), [Boolean](TopLevel.Boolean.md))~~ | Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key. | +| [getOrderExportXML](dw.order.Order.md#getorderexportxmlstring-string---variant-2)([String](TopLevel.String.md), [String](TopLevel.String.md)) | Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key. | +| [getOrderItem](dw.order.Order.md#getorderitemstring)([String](TopLevel.String.md)) | Returns the [OrderItem](dw.order.OrderItem.md) for the itemID. | +| [getOrderNo](dw.order.Order.md#getorderno)() | Returns the order number for this order. | +| [getOrderToken](dw.order.Order.md#getordertoken)() | Returns the token for this order. | +| [getOriginalOrder](dw.order.Order.md#getoriginalorder)() | Returns the original order associated with this order. | +| [getOriginalOrderNo](dw.order.Order.md#getoriginalorderno)() | Returns the order number of the original order associated with this order. | +| [getPaymentStatus](dw.order.Order.md#getpaymentstatus)() | Returns the order payment status value.
          Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). | +| ~~[getPaymentTransaction](dw.order.Order.md#getpaymenttransaction)()~~ | Returns the payment transaction associated with this order. | +| [getRefundedAmount](dw.order.Order.md#getrefundedamount)() | Returns the sum of the refunded amounts. | +| [getRemoteHost](dw.order.Order.md#getremotehost)() | Returns the IP address of the remote host from which the order was created. | +| [getReplaceCode](dw.order.Order.md#getreplacecode)() | If this order was replaced by another order, returns the value of the replace code. | +| [getReplaceDescription](dw.order.Order.md#getreplacedescription)() | If this order was replaced by another order, returns the value of the replace description. | +| [getReplacedOrder](dw.order.Order.md#getreplacedorder)() | Returns the order that this order replaced or null. | +| [getReplacedOrderNo](dw.order.Order.md#getreplacedorderno)() | Returns the order number that this order replaced or null if this order did not replace an order. | +| [getReplacementOrder](dw.order.Order.md#getreplacementorder)() | Returns the order that replaced this order, or null. | +| [getReplacementOrderNo](dw.order.Order.md#getreplacementorderno)() | If this order was replaced by another order, returns the order number that replaced this order. | +| [getReturn](dw.order.Order.md#getreturnstring)([String](TopLevel.String.md)) | Returns the [Return](dw.order.Return.md) associated with this order with the given returnNumber. | +| [getReturnCase](dw.order.Order.md#getreturncasestring)([String](TopLevel.String.md)) | Returns the [ReturnCase](dw.order.ReturnCase.md) associated with this order with the given returnCaseNumber. | +| [getReturnCaseItem](dw.order.Order.md#getreturncaseitemstring)([String](TopLevel.String.md)) | Returns the [ReturnCaseItem](dw.order.ReturnCaseItem.md) associated with this order with the given returnCaseItemID. | +| [getReturnCaseItems](dw.order.Order.md#getreturncaseitems)() | Returns the collection of [ReturnCaseItem](dw.order.ReturnCaseItem.md)s associated with this order. | +| [getReturnCases](dw.order.Order.md#getreturncases)() | Returns the collection of [ReturnCase](dw.order.ReturnCase.md)s associated with this order. | +| [getReturnItem](dw.order.Order.md#getreturnitemstring)([String](TopLevel.String.md)) | Returns the [ReturnItem](dw.order.ReturnItem.md) associated with this order with the given ID. | +| [getReturnItems](dw.order.Order.md#getreturnitems)() | Returns the collection of [ReturnItem](dw.order.ReturnItem.md)s associated with this order. | +| [getReturns](dw.order.Order.md#getreturns)() | Returns the collection of [Return](dw.order.Return.md)s associated with this order. | +| [getShippingOrder](dw.order.Order.md#getshippingorderstring)([String](TopLevel.String.md)) | Returns the [ShippingOrder](dw.order.ShippingOrder.md) associated with this order with the given shippingOrderNumber. | +| [getShippingOrderItem](dw.order.Order.md#getshippingorderitemstring)([String](TopLevel.String.md)) | Returns the [ShippingOrderItem](dw.order.ShippingOrderItem.md) associated with this order with the given shippingOrderItemID. | +| [getShippingOrderItems](dw.order.Order.md#getshippingorderitems)() | Returns the collection of [ShippingOrderItem](dw.order.ShippingOrderItem.md)s associated with this order. | +| [getShippingOrders](dw.order.Order.md#getshippingorders)() | Returns the collection of [ShippingOrder](dw.order.ShippingOrder.md)s associated with this order. | +| [getShippingStatus](dw.order.Order.md#getshippingstatus)() | Returns the order shipping status.
          Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). | +| [getSourceCode](dw.order.Order.md#getsourcecode)() | Returns the source code stored with the order or `null` if no source code is attached to the order. | +| [getSourceCodeGroup](dw.order.Order.md#getsourcecodegroup)() | Returns the source code group attached to the order or `null` if no source code group is attached to the order. | +| [getSourceCodeGroupID](dw.order.Order.md#getsourcecodegroupid)() | Returns the source code group id stored with the order or `null` if no source code group is attached to the order. | +| [getStatus](dw.order.Order.md#getstatus)() | Returns the status of the order.
          Possible values are:
          • [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created)
          • [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new)
          • [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open)
          • [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed)
          • [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled)
          • [ORDER_STATUS_FAILED](dw.order.Order.md#order_status_failed)
          • [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced)
          | +| [isImported](dw.order.Order.md#isimported)() | Returns `true`, if the order is imported and `false` otherwise. | +| [isTaxRoundedAtGroup](dw.order.Order.md#istaxroundedatgroup)() | Use this method to check if the Order was created with grouped taxation calculation. | +| [reauthorize](dw.order.Order.md#reauthorize)() | Ensures that the order is authorized. | +| [removeRemoteHost](dw.order.Order.md#removeremotehost)() | Removes the IP address of the remote host if stored. | +| [setAffiliatePartnerID](dw.order.Order.md#setaffiliatepartneridstring)([String](TopLevel.String.md)) | Sets the affiliate partner ID value. | +| [setAffiliatePartnerName](dw.order.Order.md#setaffiliatepartnernamestring)([String](TopLevel.String.md)) | Sets the affiliate partner name value. | +| [setCancelCode](dw.order.Order.md#setcancelcodestring)([String](TopLevel.String.md)) | Sets the cancel code value. | +| [setCancelDescription](dw.order.Order.md#setcanceldescriptionstring)([String](TopLevel.String.md)) | Sets the description as to why the order was cancelled. | +| [setConfirmationStatus](dw.order.Order.md#setconfirmationstatusnumber)([Number](TopLevel.Number.md)) | Sets the confirmation status value.
          Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) or [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). | +| [setCustomer](dw.order.Order.md#setcustomercustomer)([Customer](dw.customer.Customer.md)) | This method is used to associate the order object with the specified customer object. | +| [setCustomerNo](dw.order.Order.md#setcustomernostring)([String](TopLevel.String.md)) | Sets the customer number associated with this order. | +| [setCustomerOrderReference](dw.order.Order.md#setcustomerorderreferencestring)([String](TopLevel.String.md)) | Sets the customer-specific reference information for the order. | +| [setExportAfter](dw.order.Order.md#setexportafterdate)([Date](TopLevel.Date.md)) | Sets the date after which an order can be exported. | +| [setExportStatus](dw.order.Order.md#setexportstatusnumber)([Number](TopLevel.Number.md)) | Sets the export status of the order.
          Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). | +| [setExternalOrderNo](dw.order.Order.md#setexternalordernostring)([String](TopLevel.String.md)) | Sets the value of an external order number associated with this order | +| [setExternalOrderStatus](dw.order.Order.md#setexternalorderstatusstring)([String](TopLevel.String.md)) | Sets the status of an external order associated with this order | +| [setExternalOrderText](dw.order.Order.md#setexternalordertextstring)([String](TopLevel.String.md)) | Sets the text describing the external order. | +| [setInvoiceNo](dw.order.Order.md#setinvoicenostring)([String](TopLevel.String.md)) | Sets the invoice number for this Order. | +| ~~[setOrderStatus](dw.order.Order.md#setorderstatusnumber)([Number](TopLevel.Number.md))~~ | Sets the order status. | +| [setPaymentStatus](dw.order.Order.md#setpaymentstatusnumber)([Number](TopLevel.Number.md)) | Sets the order payment status.
          Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). | +| [setReplaceCode](dw.order.Order.md#setreplacecodestring)([String](TopLevel.String.md)) | Sets the value of the replace code. | +| [setReplaceDescription](dw.order.Order.md#setreplacedescriptionstring)([String](TopLevel.String.md)) | Sets the value of the replace description. | +| [setShippingStatus](dw.order.Order.md#setshippingstatusnumber)([Number](TopLevel.Number.md)) | Sets the order shipping status value.
          Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). | +| [setStatus](dw.order.Order.md#setstatusnumber)([Number](TopLevel.Number.md)) | Sets the status of the order. | +| [trackOrderChange](dw.order.Order.md#trackorderchangestring)([String](TopLevel.String.md)) | Tracks an order change. | + +### Methods inherited from class LineItemCtnr + +[addNote](dw.order.LineItemCtnr.md#addnotestring-string), [createBillingAddress](dw.order.LineItemCtnr.md#createbillingaddress), [createBonusProductLineItem](dw.order.LineItemCtnr.md#createbonusproductlineitembonusdiscountlineitem-product-productoptionmodel-shipment), [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring), [createCouponLineItem](dw.order.LineItemCtnr.md#createcouponlineitemstring-boolean), [createGiftCertificateLineItem](dw.order.LineItemCtnr.md#creategiftcertificatelineitemnumber-string), [createGiftCertificatePaymentInstrument](dw.order.LineItemCtnr.md#creategiftcertificatepaymentinstrumentstring-money), [createPaymentInstrument](dw.order.LineItemCtnr.md#createpaymentinstrumentstring-money), [createPaymentInstrumentFromWallet](dw.order.LineItemCtnr.md#createpaymentinstrumentfromwalletcustomerpaymentinstrument-money), [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring), [createPriceAdjustment](dw.order.LineItemCtnr.md#createpriceadjustmentstring-discount), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproduct-productoptionmodel-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemproductlistitem-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-shipment), [createProductLineItem](dw.order.LineItemCtnr.md#createproductlineitemstring-quantity-shipment), [createShipment](dw.order.LineItemCtnr.md#createshipmentstring), [createShippingPriceAdjustment](dw.order.LineItemCtnr.md#createshippingpriceadjustmentstring), [getAdjustedMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalgrossprice), [getAdjustedMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalnetprice), [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalprice), [getAdjustedMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getadjustedmerchandizetotalpriceboolean), [getAdjustedMerchandizeTotalTax](dw.order.LineItemCtnr.md#getadjustedmerchandizetotaltax), [getAdjustedShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalgrossprice), [getAdjustedShippingTotalNetPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalnetprice), [getAdjustedShippingTotalPrice](dw.order.LineItemCtnr.md#getadjustedshippingtotalprice), [getAdjustedShippingTotalTax](dw.order.LineItemCtnr.md#getadjustedshippingtotaltax), [getAllGiftCertificateLineItems](dw.order.LineItemCtnr.md#getallgiftcertificatelineitems), [getAllLineItems](dw.order.LineItemCtnr.md#getalllineitems), [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitems), [getAllProductLineItems](dw.order.LineItemCtnr.md#getallproductlineitemsstring), [getAllProductQuantities](dw.order.LineItemCtnr.md#getallproductquantities), [getAllShippingPriceAdjustments](dw.order.LineItemCtnr.md#getallshippingpriceadjustments), [getBillingAddress](dw.order.LineItemCtnr.md#getbillingaddress), [getBonusDiscountLineItems](dw.order.LineItemCtnr.md#getbonusdiscountlineitems), [getBonusLineItems](dw.order.LineItemCtnr.md#getbonuslineitems), [getBusinessType](dw.order.LineItemCtnr.md#getbusinesstype), [getChannelType](dw.order.LineItemCtnr.md#getchanneltype), [getCouponLineItem](dw.order.LineItemCtnr.md#getcouponlineitemstring), [getCouponLineItems](dw.order.LineItemCtnr.md#getcouponlineitems), [getCurrencyCode](dw.order.LineItemCtnr.md#getcurrencycode), [getCustomer](dw.order.LineItemCtnr.md#getcustomer), [getCustomerEmail](dw.order.LineItemCtnr.md#getcustomeremail), [getCustomerName](dw.order.LineItemCtnr.md#getcustomername), [getCustomerNo](dw.order.LineItemCtnr.md#getcustomerno), [getDefaultShipment](dw.order.LineItemCtnr.md#getdefaultshipment), [getEtag](dw.order.LineItemCtnr.md#getetag), [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitems), [getGiftCertificateLineItems](dw.order.LineItemCtnr.md#getgiftcertificatelineitemsstring), [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstruments), [getGiftCertificatePaymentInstruments](dw.order.LineItemCtnr.md#getgiftcertificatepaymentinstrumentsstring), [getGiftCertificateTotalGrossPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalgrossprice), [getGiftCertificateTotalNetPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalnetprice), [getGiftCertificateTotalPrice](dw.order.LineItemCtnr.md#getgiftcertificatetotalprice), [getGiftCertificateTotalTax](dw.order.LineItemCtnr.md#getgiftcertificatetotaltax), [getMerchandizeTotalGrossPrice](dw.order.LineItemCtnr.md#getmerchandizetotalgrossprice), [getMerchandizeTotalNetPrice](dw.order.LineItemCtnr.md#getmerchandizetotalnetprice), [getMerchandizeTotalPrice](dw.order.LineItemCtnr.md#getmerchandizetotalprice), [getMerchandizeTotalTax](dw.order.LineItemCtnr.md#getmerchandizetotaltax), [getNotes](dw.order.LineItemCtnr.md#getnotes), [getPaymentInstrument](dw.order.LineItemCtnr.md#getpaymentinstrument), [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstruments), [getPaymentInstruments](dw.order.LineItemCtnr.md#getpaymentinstrumentsstring), [getPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getpriceadjustmentbypromotionidstring), [getPriceAdjustments](dw.order.LineItemCtnr.md#getpriceadjustments), [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitems), [getProductLineItems](dw.order.LineItemCtnr.md#getproductlineitemsstring), [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantities), [getProductQuantities](dw.order.LineItemCtnr.md#getproductquantitiesboolean), [getProductQuantityTotal](dw.order.LineItemCtnr.md#getproductquantitytotal), [getShipment](dw.order.LineItemCtnr.md#getshipmentstring), [getShipments](dw.order.LineItemCtnr.md#getshipments), [getShippingPriceAdjustmentByPromotionID](dw.order.LineItemCtnr.md#getshippingpriceadjustmentbypromotionidstring), [getShippingPriceAdjustments](dw.order.LineItemCtnr.md#getshippingpriceadjustments), [getShippingTotalGrossPrice](dw.order.LineItemCtnr.md#getshippingtotalgrossprice), [getShippingTotalNetPrice](dw.order.LineItemCtnr.md#getshippingtotalnetprice), [getShippingTotalPrice](dw.order.LineItemCtnr.md#getshippingtotalprice), [getShippingTotalTax](dw.order.LineItemCtnr.md#getshippingtotaltax), [getTaxTotalsPerTaxRate](dw.order.LineItemCtnr.md#gettaxtotalspertaxrate), [getTotalGrossPrice](dw.order.LineItemCtnr.md#gettotalgrossprice), [getTotalNetPrice](dw.order.LineItemCtnr.md#gettotalnetprice), [getTotalTax](dw.order.LineItemCtnr.md#gettotaltax), [isExternallyTaxed](dw.order.LineItemCtnr.md#isexternallytaxed), [isTaxRoundedAtGroup](dw.order.LineItemCtnr.md#istaxroundedatgroup), [removeAllPaymentInstruments](dw.order.LineItemCtnr.md#removeallpaymentinstruments), [removeBonusDiscountLineItem](dw.order.LineItemCtnr.md#removebonusdiscountlineitembonusdiscountlineitem), [removeCouponLineItem](dw.order.LineItemCtnr.md#removecouponlineitemcouponlineitem), [removeGiftCertificateLineItem](dw.order.LineItemCtnr.md#removegiftcertificatelineitemgiftcertificatelineitem), [removeNote](dw.order.LineItemCtnr.md#removenotenote), [removePaymentInstrument](dw.order.LineItemCtnr.md#removepaymentinstrumentpaymentinstrument), [removePriceAdjustment](dw.order.LineItemCtnr.md#removepriceadjustmentpriceadjustment), [removeProductLineItem](dw.order.LineItemCtnr.md#removeproductlineitemproductlineitem), [removeShipment](dw.order.LineItemCtnr.md#removeshipmentshipment), [removeShippingPriceAdjustment](dw.order.LineItemCtnr.md#removeshippingpriceadjustmentpriceadjustment), [setCustomerEmail](dw.order.LineItemCtnr.md#setcustomeremailstring), [setCustomerName](dw.order.LineItemCtnr.md#setcustomernamestring), [updateOrderLevelPriceAdjustmentTax](dw.order.LineItemCtnr.md#updateorderlevelpriceadjustmenttax), [updateTotals](dw.order.LineItemCtnr.md#updatetotals), [verifyPriceAdjustmentLimits](dw.order.LineItemCtnr.md#verifypriceadjustmentlimits) +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Constant Details + +### CONFIRMATION_STATUS_CONFIRMED + +- CONFIRMATION_STATUS_CONFIRMED: [Number](TopLevel.Number.md) = 2 + - : constant for when Confirmation Status is Confirmed + + +--- + +### CONFIRMATION_STATUS_NOTCONFIRMED + +- CONFIRMATION_STATUS_NOTCONFIRMED: [Number](TopLevel.Number.md) = 0 + - : constant for when Confirmation Status is Not Confirmed + + +--- + +### ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING + +- ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING: [String](TopLevel.String.md) = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" + - : The encryption algorithm "RSA/ECB/OAEPWithSHA-256AndMGF1Padding". + + +--- + +### ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING + +- ~~ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING: [String](TopLevel.String.md) = "RSA/ECB/PKCS1Padding"~~ + - : The outdated encryption algorithm "RSA/ECB/PKCS1Padding". Please do not use anymore! + + **Deprecated:** +:::warning +Support for this algorithm will be removed in a future release. Please use + [ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_oaepwithsha_256andmgf1padding) instead. + +::: + +--- + +### EXPORT_STATUS_EXPORTED + +- EXPORT_STATUS_EXPORTED: [Number](TopLevel.Number.md) = 1 + - : constant for when Export Status is Exported + + +--- + +### EXPORT_STATUS_FAILED + +- EXPORT_STATUS_FAILED: [Number](TopLevel.Number.md) = 3 + - : constant for when Export Status is Failed + + +--- + +### EXPORT_STATUS_NOTEXPORTED + +- EXPORT_STATUS_NOTEXPORTED: [Number](TopLevel.Number.md) = 0 + - : constant for when Export Status is Not Exported + + +--- + +### EXPORT_STATUS_READY + +- EXPORT_STATUS_READY: [Number](TopLevel.Number.md) = 2 + - : constant for when Export Status is ready to be exported. + + +--- + +### ORDER_STATUS_CANCELLED + +- ORDER_STATUS_CANCELLED: [Number](TopLevel.Number.md) = 6 + - : constant for when Order Status is Cancelled + + +--- + +### ORDER_STATUS_COMPLETED + +- ORDER_STATUS_COMPLETED: [Number](TopLevel.Number.md) = 5 + - : constant for when Order Status is Completed + + +--- + +### ORDER_STATUS_CREATED + +- ORDER_STATUS_CREATED: [Number](TopLevel.Number.md) = 0 + - : constant for when Order Status is Created + + +--- + +### ORDER_STATUS_FAILED + +- ORDER_STATUS_FAILED: [Number](TopLevel.Number.md) = 8 + - : constant for when Order Status is Failed + + +--- + +### ORDER_STATUS_NEW + +- ORDER_STATUS_NEW: [Number](TopLevel.Number.md) = 3 + - : constant for when Order Status is New + + +--- + +### ORDER_STATUS_OPEN + +- ORDER_STATUS_OPEN: [Number](TopLevel.Number.md) = 4 + - : constant for when Order Status is Open + + +--- + +### ORDER_STATUS_REPLACED + +- ORDER_STATUS_REPLACED: [Number](TopLevel.Number.md) = 7 + - : constant for when Order Status is Replaced + + +--- + +### PAYMENT_STATUS_NOTPAID + +- PAYMENT_STATUS_NOTPAID: [Number](TopLevel.Number.md) = 0 + - : constant for when Payment Status is Not Paid + + +--- + +### PAYMENT_STATUS_PAID + +- PAYMENT_STATUS_PAID: [Number](TopLevel.Number.md) = 2 + - : constant for when Payment Status is Paid + + +--- + +### PAYMENT_STATUS_PARTPAID + +- PAYMENT_STATUS_PARTPAID: [Number](TopLevel.Number.md) = 1 + - : constant for when Payment Status is Part Paid + + +--- + +### SHIPPING_STATUS_NOTSHIPPED + +- SHIPPING_STATUS_NOTSHIPPED: [Number](TopLevel.Number.md) = 0 + - : constant for when Shipping Status is Not shipped + + +--- + +### SHIPPING_STATUS_PARTSHIPPED + +- SHIPPING_STATUS_PARTSHIPPED: [Number](TopLevel.Number.md) = 1 + - : constant for when Shipping Status is Part Shipped + + +--- + +### SHIPPING_STATUS_SHIPPED + +- SHIPPING_STATUS_SHIPPED: [Number](TopLevel.Number.md) = 2 + - : constant for when Shipping Status is Shipped + + +--- + +## Property Details + +### affiliatePartnerID +- affiliatePartnerID: [String](TopLevel.String.md) + - : Returns the affiliate partner ID value, or null. + + +--- + +### affiliatePartnerName +- affiliatePartnerName: [String](TopLevel.String.md) + - : Returns the affiliate partner name value, or null. + + +--- + +### appeasementItems +- appeasementItems: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [AppeasementItem](dw.order.AppeasementItem.md)s associated with this order. + + +--- + +### appeasements +- appeasements: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [Appeasement](dw.order.Appeasement.md)s associated with this order. + + +--- + +### cancelCode +- cancelCode: [EnumValue](dw.value.EnumValue.md) + - : If this order was cancelled, returns the value of the + cancel code or null. + + + +--- + +### cancelDescription +- cancelDescription: [String](TopLevel.String.md) + - : If this order was cancelled, returns the text describing why + the order was cancelled or null. + + + +--- + +### capturedAmount +- capturedAmount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of the captured amounts. The captured amounts + are calculated on the fly. Associate a payment capture for an [PaymentInstrument](dw.order.PaymentInstrument.md) with an [Invoice](dw.order.Invoice.md) + using [Invoice.addCaptureTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money). + + + +--- + +### confirmationStatus +- confirmationStatus: [EnumValue](dw.value.EnumValue.md) + - : Returns the confirmation status of the order. + + Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) and + [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). + + + +--- + +### createdBy +- createdBy: [String](TopLevel.String.md) `(read-only)` + - : Returns the name of the user who has created the order. + If an agent user has created the order, the agent user's name + is returned. Otherwise "Customer" is returned. + + + +--- + +### currentOrder +- currentOrder: [Order](dw.order.Order.md) `(read-only)` + - : Returns the current order. The current order + represents the most recent order in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order 3 is now the + current order and Order1 is still the original representation of the + order. If this order has not been replaced, this method returns this + order because this order is the current order. + + + **See Also:** + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### currentOrderNo +- currentOrderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the order number of the current order. The current order + represents the most recent order in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order 3 is now the + current order and Order1 is still the original representation of the + order. If this order has not been replaced, calling this method returns the + same value as the [getOrderNo()](dw.order.Order.md#getorderno) method because this order is the + current order. + + + **See Also:** + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### customerLocaleID +- customerLocaleID: [String](TopLevel.String.md) `(read-only)` + - : Returns the ID of the locale that was in effect when the order + was placed. This is the customer's locale. + + + +--- + +### customerOrderReference +- customerOrderReference: [String](TopLevel.String.md) + - : Returns the customer-specific reference information for the order, or null. + + +--- + +### exportAfter +- exportAfter: [Date](TopLevel.Date.md) + - : Returns a date after which an order can be exported. + + +--- + +### exportStatus +- exportStatus: [EnumValue](dw.value.EnumValue.md) + - : Returns the export status of the order. + + Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), + [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), + and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). + + + +--- + +### externalOrderNo +- externalOrderNo: [String](TopLevel.String.md) + - : Returns the value of an external order number associated + with this order, or null. + + + +--- + +### externalOrderStatus +- externalOrderStatus: [String](TopLevel.String.md) + - : Returns the status of an external order associated + with this order, or null. + + + +--- + +### externalOrderText +- externalOrderText: [String](TopLevel.String.md) + - : Returns the text describing the external order, or null. + + +--- + +### globalPartyID +- globalPartyID: [String](TopLevel.String.md) `(read-only)` + - : The Global Party ID reconciles customer identity across multiple systems. For example, as part of the Service for + Commerce experience, service agents can find information for customers who have never called into the call + center, but have created a profile on the website. Service agents can find guest order data from B2C Commerce and + easily create accounts for customers. Customer 360 Data Manager matches records from multiple data sources to + determine all the records associated with a specific customer. + + + +--- + +### imported +- imported: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Returns `true`, if the order is imported and `false` + otherwise. + + + +--- + +### invoiceItems +- invoiceItems: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [InvoiceItem](dw.order.InvoiceItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### invoiceNo +- invoiceNo: [String](TopLevel.String.md) + - : Returns the invoice number for this Order. + + + When an order is placed (e.g. with [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder)) invoice number will be filled + using a sequence. Before order was placed `null` will be returned unless it was set with + [setInvoiceNo(String)](dw.order.Order.md#setinvoicenostring). + + + +--- + +### invoices +- invoices: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [Invoice](dw.order.Invoice.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### orderExportXML +- orderExportXML: [String](TopLevel.String.md) `(read-only)` + - : Returns the order export XML as String object. + + + NOTE: This method will return payment instrument data masked. If payment instrument re-encryption is needed + please use [getOrderExportXML(String, String)](dw.order.Order.md#getorderexportxmlstring-string---variant-2) instead. + + + Example: + + + ``` + var orderXMLAsString : String = order.getOrderExportXML(); + var orderXML : XML = new XML(orderXMLAsString); + ``` + + + +--- + +### orderNo +- orderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the order number for this order. + + +--- + +### orderToken +- orderToken: [String](TopLevel.String.md) `(read-only)` + - : Returns the token for this order. The order token is a string (length 32 bytes) associated + with this one order. The order token is random. It reduces the capability of malicious + users to access an order through guessing. Order token can be used to **further** validate order + ownership, but should never be used to solely validate ownership. In addition, the storefront + should ensure authentication and authorization. See the [Security Best Practices for Developers](https://help.salesforce.com/s/articleView?id=cc.b2c\_developer\_authentication\_and\_authorization.htm) for details. + + + +--- + +### originalOrder +- originalOrder: [Order](dw.order.Order.md) `(read-only)` + - : Returns the original order associated with + this order. The original order represents an order that was the + first ancestor in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order1 is still the + original representation of the order. If this order is the first + ancestor, this method returns this order. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### originalOrderNo +- originalOrderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the order number of the original order associated with + this order. The original order represents an order that was the + first ancestor in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order1 is still the + original representation of the order. If this order is the first + ancestor, this method returns the value of getOrderNo(). + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### paymentStatus +- paymentStatus: [EnumValue](dw.value.EnumValue.md) + - : Returns the order payment status value. + + Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) + or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). + + + +--- + +### paymentTransaction +- ~~paymentTransaction: [PaymentTransaction](dw.order.PaymentTransaction.md)~~ `(read-only)` + - : Returns the payment transaction associated with this order. + It is possible that there are multiple payment transactions + associated with the order. In this case, this method returns + the transaction associated with the first PaymentInstrument + returned by `getPaymentInstruments()`. + + + **Deprecated:** +:::warning +Use [LineItemCtnr.getPaymentInstruments()](dw.order.LineItemCtnr.md#getpaymentinstruments) +to get the list of PaymentInstrument instances and then use +getPaymentTransaction() method on each PaymentInstrument to access +the individual transactions. + +::: + +--- + +### refundedAmount +- refundedAmount: [Money](dw.value.Money.md) `(read-only)` + - : Returns the sum of the refunded amounts. The refunded amounts are + calculated on the fly. Associate a payment refund for an [PaymentInstrument](dw.order.PaymentInstrument.md) with an [Invoice](dw.order.Invoice.md) + using [Invoice.addRefundTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money). + + + +--- + +### remoteHost +- remoteHost: [String](TopLevel.String.md) `(read-only)` + - : Returns the IP address of the remote host from which the order was created. + + + If the IP address was not captured for the order because order IP logging + was disabled at the time the order was created, null will be returned. + + + +--- + +### replaceCode +- replaceCode: [EnumValue](dw.value.EnumValue.md) + - : If this order was replaced by another order, + returns the value of the replace code. Otherwise. + returns null. + + + +--- + +### replaceDescription +- replaceDescription: [String](TopLevel.String.md) + - : If this order was replaced by another order, + returns the value of the replace description. Otherwise + returns null. + + + +--- + +### replacedOrder +- replacedOrder: [Order](dw.order.Order.md) `(read-only)` + - : Returns the order that this order replaced or null. For example, if you + have three orders where Order1 was replaced by Order2 and Order2 was + replaced by Order3, calling this method on Order3 will return Order2. + Similarly, calling this method on Order1 will return null as Order1 was + the original order. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### replacedOrderNo +- replacedOrderNo: [String](TopLevel.String.md) `(read-only)` + - : Returns the order number that this order replaced or null if this order + did not replace an order. For example, if you have three orders + where Order1 was replaced by Order2 and Order2 was replaced by Order3, + calling this method on Order3 will return the order number for + Order2. Similarly, calling this method on Order1 will return null as + Order1 was the original order. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### replacementOrder +- replacementOrder: [Order](dw.order.Order.md) `(read-only)` + - : Returns the order that replaced this order, or null. + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + + +--- + +### replacementOrderNo +- replacementOrderNo: [String](TopLevel.String.md) `(read-only)` + - : If this order was replaced by another order, + returns the order number that replaced this order. Otherwise + returns null. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + + +--- + +### returnCaseItems +- returnCaseItems: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [ReturnCaseItem](dw.order.ReturnCaseItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### returnCases +- returnCases: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [ReturnCase](dw.order.ReturnCase.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### returnItems +- returnItems: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [ReturnItem](dw.order.ReturnItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### returns +- returns: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [Return](dw.order.Return.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### shippingOrderItems +- shippingOrderItems: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [ShippingOrderItem](dw.order.ShippingOrderItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### shippingOrders +- shippingOrders: [FilteringCollection](dw.util.FilteringCollection.md) `(read-only)` + - : Returns the collection of [ShippingOrder](dw.order.ShippingOrder.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + +--- + +### shippingStatus +- shippingStatus: [EnumValue](dw.value.EnumValue.md) + - : Returns the order shipping status. + + Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), + [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). + + + +--- + +### sourceCode +- sourceCode: [String](TopLevel.String.md) `(read-only)` + - : Returns the source code stored with the order or `null` if no source code is attached to the order. + + +--- + +### sourceCodeGroup +- sourceCodeGroup: [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) `(read-only)` + - : Returns the source code group attached to the order or `null` if no source code group is attached to + the order. + + + +--- + +### sourceCodeGroupID +- sourceCodeGroupID: [String](TopLevel.String.md) `(read-only)` + - : Returns the source code group id stored with the order or `null` if no source code group is attached + to the order. + + + +--- + +### status +- status: [EnumValue](dw.value.EnumValue.md) + - : Returns the status of the order. + + Possible values are: + + - [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created) + - [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new) + - [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) + - [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) + - [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled) + - [ORDER_STATUS_FAILED](dw.order.Order.md#order_status_failed) + - [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced) + + + + The order status usually changes when a process action is initiated. Most status changes have an action which + needs to executed in order to end having the order in a specific order status. When an order is created with e.g. + [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) the order status will be [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created). The usual + flow is that payment authorization will be added to the order. Once the order is considered as valid (payed, + fraud checked, ...) the order gets placed. This can be done by calling + [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder). The result of placing an order will be status + [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) (from a process standpoint [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new) which has the same meaning). + Status [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced) is related to functionality + [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder). [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) has no meaning by + default but can be used by custom implementations but is a synonym for NEW/OPEN. Below you will find the most important status changes: + + + + | Status before | Action | Status after | Business meaning | + | --- |--- |--- |--- | + | - | [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) | CREATED | Order was created from a basket. | + | CREATED | [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder) | OPEN/NEW | Order was considered as valid. Order can now be exported to 3rd party systems. | + | CREATED | [OrderMgr.failOrder(Order)](dw.order.OrderMgr.md#failorderorder) | FAILED | Order was considered not valid. E.g. payment authorization was wrong or fraud check was not successful. | + | OPEN/NEW | [OrderMgr.cancelOrder(Order)](dw.order.OrderMgr.md#cancelorderorder) | CANCELLED | Order was cancelled. | + | CANCELLED | [OrderMgr.undoCancelOrder(Order)](dw.order.OrderMgr.md#undocancelorderorder) | OPEN/NEW | Order was cancelled by mistake and this needs to be undone. | + | FAILED | [OrderMgr.undoFailOrder(Order)](dw.order.OrderMgr.md#undofailorderorder) | CREATED | Order was failed by mistake and this needs to be undone. | + + + Every status change will trigger a change in the order journal which is the base for GMV calculations. + + + **See Also:** + - [LineItemCtnr](dw.order.LineItemCtnr.md) + + +--- + +### taxRoundedAtGroup +- taxRoundedAtGroup: [Boolean](TopLevel.Boolean.md) `(read-only)` + - : Use this method to check if the Order was created with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + +--- + +## Method Details + +### createAppeasement() +- createAppeasement(): [Appeasement](dw.order.Appeasement.md) + - : Creates a new [Appeasement](dw.order.Appeasement.md) associated with this order. + + The new Appeasement + will have an appeasementNumber based on the [getOrderNo()](dw.order.Order.md#getorderno). + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - the created appeasement + + +--- + +### createAppeasement(String) +- createAppeasement(appeasementNumber: [String](TopLevel.String.md)): [Appeasement](dw.order.Appeasement.md) + - : Creates a new [Appeasement](dw.order.Appeasement.md) associated with this order. + + + An appeasementNumber must be specified. + + + If an Appeasement already exists for the appeasementNumber, the method fails with an + exception. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - appeasementNumber - the appeasementNumber to be assigned to the newly created appeasement + + **Returns:** + - the created appeasement + + **Throws:** + - IllegalArgumentException - if an Appeasement already exists with the number. + + +--- + +### createReturnCase(Boolean) +- createReturnCase(isRMA: [Boolean](TopLevel.Boolean.md)): [ReturnCase](dw.order.ReturnCase.md) + - : Creates a new [ReturnCase](dw.order.ReturnCase.md) associated with this order + specifying whether the ReturnCase is an RMA (return merchandise authorization). + + + The new ReturnCase + will have a returnCaseNumber based on the [getOrderNo()](dw.order.Order.md#getorderno), e.g. for an order-no 1234 the + return cases will have the numbers 1234\#RC1, 1234\#RC2, 1234\#RC3... + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - isRMA - whether the new ReturnCase is an RMA (return merchandise authorization) + + **Returns:** + - the created ReturnCase + + +--- + +### createReturnCase(String, Boolean) +- createReturnCase(returnCaseNumber: [String](TopLevel.String.md), isRMA: [Boolean](TopLevel.Boolean.md)): [ReturnCase](dw.order.ReturnCase.md) + - : Creates a new [ReturnCase](dw.order.ReturnCase.md) associated with this order + specifying whether the ReturnCase is an RMA (return merchandise authorization). + + + A returnCaseNumber must be specified. + + + If a ReturnCase already exists for the returnCaseNumber, the method fails with an + exception. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - returnCaseNumber - returnCaseNumber to use + - isRMA - whether the new ReturnCase is an RMA (return merchandise authorization) + + **Returns:** + - null or the ReturnCase associated with the given returnCaseNumber + + **Throws:** + - IllegalArgumentException - if a ReturnCase already exists with the number. + + +--- + +### createServiceItem(String, String) +- createServiceItem(ID: [String](TopLevel.String.md), status: [String](TopLevel.String.md)): [OrderItem](dw.order.OrderItem.md) + - : Returns the [order item](dw.order.OrderItem.md) with the given status which wraps a new + [service item](dw.order.ShippingLineItem.md) which is created and added to the order. + + + **Parameters:** + - ID - the ID of the new service item. This ID will be returned when [ShippingLineItem.getID()](dw.order.ShippingLineItem.md#getid) is called. + - status - the status of the order item, use one of
        • [OrderItem.STATUS_NEW](dw.order.OrderItem.md#status_new)
        • [OrderItem.STATUS_OPEN](dw.order.OrderItem.md#status_open)
        • [OrderItem.STATUS_SHIPPED](dw.order.OrderItem.md#status_shipped)
        Order post-processing APIs (gillian) are now inactive by default and will throw an exception if accessed. Activation needs preliminary approval by Product Management. Please contact support in this case. Existing customers using these APIs are not affected by this change and can use the APIs until further notice. + + **Returns:** + - the created order item + + +--- + +### createShippingOrder() +- createShippingOrder(): [ShippingOrder](dw.order.ShippingOrder.md) + - : Creates a new [ShippingOrder](dw.order.ShippingOrder.md) for this order. + + + Generates a default shipping order number. Use + [createShippingOrder(String)](dw.order.Order.md#createshippingorderstring) for a defined shipping order number. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - the created shipping order + + **See Also:** + - [ShippingOrder](dw.order.ShippingOrder.md) + + +--- + +### createShippingOrder(String) +- createShippingOrder(shippingOrderNumber: [String](TopLevel.String.md)): [ShippingOrder](dw.order.ShippingOrder.md) + - : Creates a new [ShippingOrder](dw.order.ShippingOrder.md) for this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - shippingOrderNumber - the document number to be used + + **Returns:** + - the created shipping order + + **See Also:** + - [ShippingOrder](dw.order.ShippingOrder.md) + + +--- + +### getAffiliatePartnerID() +- getAffiliatePartnerID(): [String](TopLevel.String.md) + - : Returns the affiliate partner ID value, or null. + + **Returns:** + - the affiliate partner ID value, or null. + + +--- + +### getAffiliatePartnerName() +- getAffiliatePartnerName(): [String](TopLevel.String.md) + - : Returns the affiliate partner name value, or null. + + **Returns:** + - the affiliate partner name value, or null. + + +--- + +### getAppeasement(String) +- getAppeasement(appeasementNumber: [String](TopLevel.String.md)): [Appeasement](dw.order.Appeasement.md) + - : Returns the [Appeasement](dw.order.Appeasement.md) associated with this order with the given appeasementNumber. + The method returns `null` if no instance can be found. + + + **Parameters:** + - appeasementNumber - the appeasement number + + **Returns:** + - the Appeasement associated with the given appeasementNumber + + +--- + +### getAppeasementItem(String) +- getAppeasementItem(appeasementItemID: [String](TopLevel.String.md)): [AppeasementItem](dw.order.AppeasementItem.md) + - : Returns the [AppeasementItem](dw.order.AppeasementItem.md) associated with this Order with the given appeasementItemID. + The method returns `null` if no instance can be found. + + + **Parameters:** + - appeasementItemID - the ID + + **Returns:** + - the AppeasementItem associated with the given appeasementItemID. + + +--- + +### getAppeasementItems() +- getAppeasementItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [AppeasementItem](dw.order.AppeasementItem.md)s associated with this order. + + **Returns:** + - the appeasement items belonging to this order + + +--- + +### getAppeasements() +- getAppeasements(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [Appeasement](dw.order.Appeasement.md)s associated with this order. + + **Returns:** + - the appeasements associated with this order + + +--- + +### getCancelCode() +- getCancelCode(): [EnumValue](dw.value.EnumValue.md) + - : If this order was cancelled, returns the value of the + cancel code or null. + + + **Returns:** + - the value of the cancel code. + + +--- + +### getCancelDescription() +- getCancelDescription(): [String](TopLevel.String.md) + - : If this order was cancelled, returns the text describing why + the order was cancelled or null. + + + **Returns:** + - the description as to why the order was cancelled or null. + + +--- + +### getCapturedAmount() +- getCapturedAmount(): [Money](dw.value.Money.md) + - : Returns the sum of the captured amounts. The captured amounts + are calculated on the fly. Associate a payment capture for an [PaymentInstrument](dw.order.PaymentInstrument.md) with an [Invoice](dw.order.Invoice.md) + using [Invoice.addCaptureTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money). + + + **Returns:** + - sum of captured amounts + + +--- + +### getConfirmationStatus() +- getConfirmationStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the confirmation status of the order. + + Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) and + [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). + + + **Returns:** + - Order confirmation status + + +--- + +### getCreatedBy() +- getCreatedBy(): [String](TopLevel.String.md) + - : Returns the name of the user who has created the order. + If an agent user has created the order, the agent user's name + is returned. Otherwise "Customer" is returned. + + + **Returns:** + - the name of the user who created the order. + + +--- + +### getCurrentOrder() +- getCurrentOrder(): [Order](dw.order.Order.md) + - : Returns the current order. The current order + represents the most recent order in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order 3 is now the + current order and Order1 is still the original representation of the + order. If this order has not been replaced, this method returns this + order because this order is the current order. + + + **Returns:** + - the current order. + + **See Also:** + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getCurrentOrderNo() +- getCurrentOrderNo(): [String](TopLevel.String.md) + - : Returns the order number of the current order. The current order + represents the most recent order in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order 3 is now the + current order and Order1 is still the original representation of the + order. If this order has not been replaced, calling this method returns the + same value as the [getOrderNo()](dw.order.Order.md#getorderno) method because this order is the + current order. + + + **Returns:** + - the order number of the current order + + **See Also:** + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getCustomerLocaleID() +- getCustomerLocaleID(): [String](TopLevel.String.md) + - : Returns the ID of the locale that was in effect when the order + was placed. This is the customer's locale. + + + **Returns:** + - the ID of the locale associated with this order, or null. + + +--- + +### getCustomerOrderReference() +- getCustomerOrderReference(): [String](TopLevel.String.md) + - : Returns the customer-specific reference information for the order, or null. + + **Returns:** + - the customer-specific reference information for the order, or null. + + +--- + +### getExportAfter() +- getExportAfter(): [Date](TopLevel.Date.md) + - : Returns a date after which an order can be exported. + + **Returns:** + - a date after which an order can be exported. + + +--- + +### getExportStatus() +- getExportStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the export status of the order. + + Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), + [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), + and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). + + + **Returns:** + - Order export status + + +--- + +### getExternalOrderNo() +- getExternalOrderNo(): [String](TopLevel.String.md) + - : Returns the value of an external order number associated + with this order, or null. + + + **Returns:** + - the value of an external order number associated + with this order, or null. + + + +--- + +### getExternalOrderStatus() +- getExternalOrderStatus(): [String](TopLevel.String.md) + - : Returns the status of an external order associated + with this order, or null. + + + **Returns:** + - the status of an external order associated + with this order, or null. + + + +--- + +### getExternalOrderText() +- getExternalOrderText(): [String](TopLevel.String.md) + - : Returns the text describing the external order, or null. + + **Returns:** + - the text describing the external order, or null. + + +--- + +### getGlobalPartyID() +- getGlobalPartyID(): [String](TopLevel.String.md) + - : The Global Party ID reconciles customer identity across multiple systems. For example, as part of the Service for + Commerce experience, service agents can find information for customers who have never called into the call + center, but have created a profile on the website. Service agents can find guest order data from B2C Commerce and + easily create accounts for customers. Customer 360 Data Manager matches records from multiple data sources to + determine all the records associated with a specific customer. + + + **Returns:** + - the Global Party ID associated with this order, or null. + + +--- + +### getInvoice(String) +- getInvoice(invoiceNumber: [String](TopLevel.String.md)): [Invoice](dw.order.Invoice.md) + - : Returns the [Invoice](dw.order.Invoice.md) associated with this order with the given invoiceNumber. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - invoiceNumber - the invoice number + + **Returns:** + - the invoice associated with the given invoiceNumber + + +--- + +### getInvoiceItem(String) +- getInvoiceItem(invoiceItemID: [String](TopLevel.String.md)): [InvoiceItem](dw.order.InvoiceItem.md) + - : Returns the [InvoiceItem](dw.order.InvoiceItem.md) associated with this order with the given ID. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - invoiceItemID - the item ID + + **Returns:** + - the invoice item associated with the given ID + + +--- + +### getInvoiceItems() +- getInvoiceItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [InvoiceItem](dw.order.InvoiceItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - invoice items belonging to this order + + +--- + +### getInvoiceNo() +- getInvoiceNo(): [String](TopLevel.String.md) + - : Returns the invoice number for this Order. + + + When an order is placed (e.g. with [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder)) invoice number will be filled + using a sequence. Before order was placed `null` will be returned unless it was set with + [setInvoiceNo(String)](dw.order.Order.md#setinvoicenostring). + + + **Returns:** + - the invoice number for this Order. + + +--- + +### getInvoices() +- getInvoices(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [Invoice](dw.order.Invoice.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - invoices belonging to this order + + +--- + +### getOrderExportXML() +- getOrderExportXML(): [String](TopLevel.String.md) + - : Returns the order export XML as String object. + + + NOTE: This method will return payment instrument data masked. If payment instrument re-encryption is needed + please use [getOrderExportXML(String, String)](dw.order.Order.md#getorderexportxmlstring-string---variant-2) instead. + + + Example: + + + ``` + var orderXMLAsString : String = order.getOrderExportXML(); + var orderXML : XML = new XML(orderXMLAsString); + ``` + + + **Returns:** + - the order export XML + + **Throws:** + - IllegalStateException - If the method is called in a transaction with changes. + - IllegalStateException - If the order is not placed. This method can be called for placed orders only. + - IllegalStateException - If the order export XML could not be generated. + + +--- + +### getOrderExportXML(String, String) - Variant 1 +- getOrderExportXML(encryptionAlgorithm: [String](TopLevel.String.md), encryptionKey: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the order export XML as String object, with payment instrument data re-encrypted using the given + encryption algorithm and key. + + + NOTE: If no encryption is needed or desired please always use [getOrderExportXML()](dw.order.Order.md#getorderexportxml) instead, which returns + the payment instrument data masked. Do **not** pass in any null arguments! + + + Example: + + + ``` + var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]" ); + var orderXML : XML = new XML( orderXMLAsString ); + ``` + + + **Parameters:** + - encryptionAlgorithm - The encryption algorithm to be used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be a valid, non-null algorithm. Currently, only [ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_pkcs1padding) is supported, but this will be fixed and support for [ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_oaepwithsha_256andmgf1padding) will be added soon. + - encryptionKey - The Base64 encoded form of the public key to be used for the re-encryption of the payment instrument data. Must be a valid, non-blank key. + + **Returns:** + - the order export XML + + **Throws:** + - IllegalStateException - If the method is called in a transaction with changes. + - IllegalStateException - If the order is not placed. This method can be called for placed orders only. + - IllegalStateException - If the order export XML could not be generated. + + **API Version:** +:::note +No longer available as of version 22.7. +undefined behaviour for invalid arguments (e.g. null) +::: + +--- + +### getOrderExportXML(String, String, Boolean) - Variant 1 +- ~~getOrderExportXML(encryptionAlgorithm: [String](TopLevel.String.md), encryptionKey: [String](TopLevel.String.md), encryptUsingEKID: [Boolean](TopLevel.Boolean.md)): [String](TopLevel.String.md)~~ + - : Returns the order export XML as String object, with payment instrument data re-encrypted using the given + encryption algorithm and key. + + + NOTE: If no encryption is needed or desired please always use [getOrderExportXML()](dw.order.Order.md#getorderexportxml) instead, which returns + the payment instrument data masked. Do **not** pass in any null arguments! + + + Example: + + + ``` + var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]", false ); + var orderXML : XML = new XML( orderXMLAsString ); + ``` + + + **Parameters:** + - encryptionAlgorithm - The encryption algorithm to be used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be a valid, non-null algorithm. Currently, only [ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_pkcs1padding) is supported, but this will be fixed and support for [ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_oaepwithsha_256andmgf1padding) will be added soon. + - encryptionKey - The Base64 encoded form of the public key to be used for the re-encryption of the payment instrument data. Must be a valid, non-blank key. + - encryptUsingEKID - ignored + + **Returns:** + - the order export XML + + **Throws:** + - IllegalStateException - If the method is called in a transaction with changes. + - IllegalStateException - If the order is not placed. This method can be called for placed orders only. + - IllegalStateException - If the order export XML could not be generated. + + **Deprecated:** +:::warning +This method will be removed soon. Please use the following methods instead: + +- [getOrderExportXML()](dw.order.Order.md#getorderexportxml)– if payment instrument data should be masked - [getOrderExportXML(String, String)](dw.order.Order.md#getorderexportxmlstring-string---variant-1)– if payment instrument data should be re-encrypted + +::: + **API Version:** +:::note +No longer available as of version 22.7. +undefined behaviour for invalid arguments (e.g. null) +::: + +--- + +### getOrderExportXML(String, String) - Variant 2 +- getOrderExportXML(encryptionAlgorithm: [String](TopLevel.String.md), encryptionKey: [String](TopLevel.String.md)): [String](TopLevel.String.md) + - : Returns the order export XML as String object, with payment instrument data re-encrypted using the given + encryption algorithm and key. + + + NOTE: If no encryption is needed or desired please always use [getOrderExportXML()](dw.order.Order.md#getorderexportxml) instead, which returns + the payment instrument data masked. + + + Example: + + + ``` + var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]" ); + var orderXML : XML = new XML( orderXMLAsString ); + ``` + + + **Parameters:** + - encryptionAlgorithm - The encryption algorithm used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be one of the following:
      • [ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_oaepwithsha_256andmgf1padding) – The current and preferred algorithm.
      • [ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING](dw.order.Order.md#encryption_algorithm_rsa_ecb_pkcs1padding) – This algorithm is outdated/deprecated and will be removed in a future release. Please do **not** use anymore.
      + - encryptionKey - The Base64 encoded form of the public key used for the re-encryption of the payment instrument data. Must be a valid, non-blank key. + + **Returns:** + - the order export XML + + **Throws:** + - IllegalArgumentException - If `encryptionAlgorithm` is not a valid known algorithm. + - IllegalArgumentException - If `encryptionKey` is a blank string. + - IllegalStateException - If the method is called in a transaction with changes. + - IllegalStateException - If the order is not placed. This method can be called for placed orders only. + - IllegalStateException - If the order export XML could not be generated. + + **API Version:** +:::note +Available from version 22.7. +strict encryption argument checks; no null or otherwise invalid values allowed +::: + +--- + +### getOrderItem(String) +- getOrderItem(itemID: [String](TopLevel.String.md)): [OrderItem](dw.order.OrderItem.md) + - : Returns the [OrderItem](dw.order.OrderItem.md) for the itemID. + An OrderItem will only exist for [ProductLineItem](dw.order.ProductLineItem.md)s or + [ShippingLineItem](dw.order.ShippingLineItem.md)s which belong to the order. + The method fails with an exception if no instance can be found. + + + **Parameters:** + - itemID - the itemID + + **Returns:** + - the order item for itemID + + **Throws:** + - IllegalArgumentException - if no instance is found + + **See Also:** + - [ProductLineItem.getOrderItem()](dw.order.ProductLineItem.md#getorderitem) + - [ShippingLineItem.getOrderItem()](dw.order.ShippingLineItem.md#getorderitem) + + +--- + +### getOrderNo() +- getOrderNo(): [String](TopLevel.String.md) + - : Returns the order number for this order. + + **Returns:** + - the order number for this order. + + +--- + +### getOrderToken() +- getOrderToken(): [String](TopLevel.String.md) + - : Returns the token for this order. The order token is a string (length 32 bytes) associated + with this one order. The order token is random. It reduces the capability of malicious + users to access an order through guessing. Order token can be used to **further** validate order + ownership, but should never be used to solely validate ownership. In addition, the storefront + should ensure authentication and authorization. See the [Security Best Practices for Developers](https://help.salesforce.com/s/articleView?id=cc.b2c\_developer\_authentication\_and\_authorization.htm) for details. + + + **Returns:** + - the token for this order. + + +--- + +### getOriginalOrder() +- getOriginalOrder(): [Order](dw.order.Order.md) + - : Returns the original order associated with + this order. The original order represents an order that was the + first ancestor in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order1 is still the + original representation of the order. If this order is the first + ancestor, this method returns this order. + + + **Returns:** + - the order number of the original order associated with + this order. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getOriginalOrderNo() +- getOriginalOrderNo(): [String](TopLevel.String.md) + - : Returns the order number of the original order associated with + this order. The original order represents an order that was the + first ancestor in a chain of orders. + For example, if Order1 was replaced by Order2, Order2 is the current + representation of the order and Order1 is the original representation + of the order. If you replace Order2 with Order3, Order1 is still the + original representation of the order. If this order is the first + ancestor, this method returns the value of getOrderNo(). + + + **Returns:** + - the order number of the original order associated with + this order. + + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getPaymentStatus() +- getPaymentStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the order payment status value. + + Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) + or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). + + + **Returns:** + - Order payment status + + +--- + +### getPaymentTransaction() +- ~~getPaymentTransaction(): [PaymentTransaction](dw.order.PaymentTransaction.md)~~ + - : Returns the payment transaction associated with this order. + It is possible that there are multiple payment transactions + associated with the order. In this case, this method returns + the transaction associated with the first PaymentInstrument + returned by `getPaymentInstruments()`. + + + **Returns:** + - the payment transaction or null if there is no transaction. + + **Deprecated:** +:::warning +Use [LineItemCtnr.getPaymentInstruments()](dw.order.LineItemCtnr.md#getpaymentinstruments) +to get the list of PaymentInstrument instances and then use +getPaymentTransaction() method on each PaymentInstrument to access +the individual transactions. + +::: + +--- + +### getRefundedAmount() +- getRefundedAmount(): [Money](dw.value.Money.md) + - : Returns the sum of the refunded amounts. The refunded amounts are + calculated on the fly. Associate a payment refund for an [PaymentInstrument](dw.order.PaymentInstrument.md) with an [Invoice](dw.order.Invoice.md) + using [Invoice.addRefundTransaction(OrderPaymentInstrument, Money)](dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money). + + + **Returns:** + - sum of refunded amounts + + +--- + +### getRemoteHost() +- getRemoteHost(): [String](TopLevel.String.md) + - : Returns the IP address of the remote host from which the order was created. + + + If the IP address was not captured for the order because order IP logging + was disabled at the time the order was created, null will be returned. + + + **Returns:** + - The IP address of the remote host captured for the order or null + + +--- + +### getReplaceCode() +- getReplaceCode(): [EnumValue](dw.value.EnumValue.md) + - : If this order was replaced by another order, + returns the value of the replace code. Otherwise. + returns null. + + + **Returns:** + - the replace code + + +--- + +### getReplaceDescription() +- getReplaceDescription(): [String](TopLevel.String.md) + - : If this order was replaced by another order, + returns the value of the replace description. Otherwise + returns null. + + + **Returns:** + - the value of the replace code or null. + + +--- + +### getReplacedOrder() +- getReplacedOrder(): [Order](dw.order.Order.md) + - : Returns the order that this order replaced or null. For example, if you + have three orders where Order1 was replaced by Order2 and Order2 was + replaced by Order3, calling this method on Order3 will return Order2. + Similarly, calling this method on Order1 will return null as Order1 was + the original order. + + + **Returns:** + - the order that replaced this order, or null. + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getReplacedOrderNo() +- getReplacedOrderNo(): [String](TopLevel.String.md) + - : Returns the order number that this order replaced or null if this order + did not replace an order. For example, if you have three orders + where Order1 was replaced by Order2 and Order2 was replaced by Order3, + calling this method on Order3 will return the order number for + Order2. Similarly, calling this method on Order1 will return null as + Order1 was the original order. + + + **Returns:** + - the order number of the order that this order replaced or null. + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacementOrderNo()](dw.order.Order.md#getreplacementorderno) + - [getReplacementOrder()](dw.order.Order.md#getreplacementorder) + + +--- + +### getReplacementOrder() +- getReplacementOrder(): [Order](dw.order.Order.md) + - : Returns the order that replaced this order, or null. + + **Returns:** + - the order that replaced this order, or null. + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + + +--- + +### getReplacementOrderNo() +- getReplacementOrderNo(): [String](TopLevel.String.md) + - : If this order was replaced by another order, + returns the order number that replaced this order. Otherwise + returns null. + + + **Returns:** + - the order that replaced this order, or null. + + **See Also:** + - [getCurrentOrderNo()](dw.order.Order.md#getcurrentorderno) + - [getCurrentOrder()](dw.order.Order.md#getcurrentorder) + - [getOriginalOrderNo()](dw.order.Order.md#getoriginalorderno) + - [getOriginalOrder()](dw.order.Order.md#getoriginalorder) + - [getReplacedOrderNo()](dw.order.Order.md#getreplacedorderno) + - [getReplacedOrder()](dw.order.Order.md#getreplacedorder) + + +--- + +### getReturn(String) +- getReturn(returnNumber: [String](TopLevel.String.md)): [Return](dw.order.Return.md) + - : Returns the [Return](dw.order.Return.md) associated with this order with the given returnNumber. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - returnNumber - the return number + + **Returns:** + - the return associated with the given returnNumber + + +--- + +### getReturnCase(String) +- getReturnCase(returnCaseNumber: [String](TopLevel.String.md)): [ReturnCase](dw.order.ReturnCase.md) + - : Returns the [ReturnCase](dw.order.ReturnCase.md) associated with this order with the given returnCaseNumber. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - returnCaseNumber - the return case number + + **Returns:** + - the return case associated with the given returnCaseNumber + + +--- + +### getReturnCaseItem(String) +- getReturnCaseItem(returnCaseItemID: [String](TopLevel.String.md)): [ReturnCaseItem](dw.order.ReturnCaseItem.md) + - : Returns the [ReturnCaseItem](dw.order.ReturnCaseItem.md) associated with this order with the given returnCaseItemID. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - returnCaseItemID - the ID + + **Returns:** + - the return case item associated with the given returnCaseItemID + + +--- + +### getReturnCaseItems() +- getReturnCaseItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [ReturnCaseItem](dw.order.ReturnCaseItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - return case items belonging to this order + + +--- + +### getReturnCases() +- getReturnCases(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [ReturnCase](dw.order.ReturnCase.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - return cases belonging to this order + + +--- + +### getReturnItem(String) +- getReturnItem(returnItemID: [String](TopLevel.String.md)): [ReturnItem](dw.order.ReturnItem.md) + - : Returns the [ReturnItem](dw.order.ReturnItem.md) associated with this order with the given ID. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - returnItemID - the ID + + **Returns:** + - the return item associated with the given returnItemID + + +--- + +### getReturnItems() +- getReturnItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [ReturnItem](dw.order.ReturnItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - return items belonging to this order + + +--- + +### getReturns() +- getReturns(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [Return](dw.order.Return.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - returns belonging to this order + + +--- + +### getShippingOrder(String) +- getShippingOrder(shippingOrderNumber: [String](TopLevel.String.md)): [ShippingOrder](dw.order.ShippingOrder.md) + - : Returns the [ShippingOrder](dw.order.ShippingOrder.md) associated with this order with the given shippingOrderNumber. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - shippingOrderNumber - the shipping order number + + **Returns:** + - the shipping order associated with the given shippingOrderNumber + + +--- + +### getShippingOrderItem(String) +- getShippingOrderItem(shippingOrderItemID: [String](TopLevel.String.md)): [ShippingOrderItem](dw.order.ShippingOrderItem.md) + - : Returns the [ShippingOrderItem](dw.order.ShippingOrderItem.md) associated with this order with the given shippingOrderItemID. + The method returns `null` if no instance can be found. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - shippingOrderItemID - the ID + + **Returns:** + - the shipping order item associated with the given shippingOrderItemID + + +--- + +### getShippingOrderItems() +- getShippingOrderItems(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [ShippingOrderItem](dw.order.ShippingOrderItem.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - shipping order items belonging to this order + + +--- + +### getShippingOrders() +- getShippingOrders(): [FilteringCollection](dw.util.FilteringCollection.md) + - : Returns the collection of [ShippingOrder](dw.order.ShippingOrder.md)s associated with this order. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Returns:** + - shipping orders belonging to this order + + +--- + +### getShippingStatus() +- getShippingStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the order shipping status. + + Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), + [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). + + + **Returns:** + - Order shipping status + + +--- + +### getSourceCode() +- getSourceCode(): [String](TopLevel.String.md) + - : Returns the source code stored with the order or `null` if no source code is attached to the order. + + **Returns:** + - the source code stored with the order or `null` if no source code is attached to the order. + + +--- + +### getSourceCodeGroup() +- getSourceCodeGroup(): [SourceCodeGroup](dw.campaign.SourceCodeGroup.md) + - : Returns the source code group attached to the order or `null` if no source code group is attached to + the order. + + + **Returns:** + - the source code group attached to the order or `null` if no source code group is attached to + the order. + + + +--- + +### getSourceCodeGroupID() +- getSourceCodeGroupID(): [String](TopLevel.String.md) + - : Returns the source code group id stored with the order or `null` if no source code group is attached + to the order. + + + **Returns:** + - the source code group id stored with the order or `null` if no source code group is attached + to the order. + + + +--- + +### getStatus() +- getStatus(): [EnumValue](dw.value.EnumValue.md) + - : Returns the status of the order. + + Possible values are: + + - [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created) + - [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new) + - [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) + - [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) + - [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled) + - [ORDER_STATUS_FAILED](dw.order.Order.md#order_status_failed) + - [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced) + + + + The order status usually changes when a process action is initiated. Most status changes have an action which + needs to executed in order to end having the order in a specific order status. When an order is created with e.g. + [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) the order status will be [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created). The usual + flow is that payment authorization will be added to the order. Once the order is considered as valid (payed, + fraud checked, ...) the order gets placed. This can be done by calling + [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder). The result of placing an order will be status + [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) (from a process standpoint [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new) which has the same meaning). + Status [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced) is related to functionality + [BasketMgr.createBasketFromOrder(Order)](dw.order.BasketMgr.md#createbasketfromorderorder). [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) has no meaning by + default but can be used by custom implementations but is a synonym for NEW/OPEN. Below you will find the most important status changes: + + + + | Status before | Action | Status after | Business meaning | + | --- |--- |--- |--- | + | - | [OrderMgr.createOrder(Basket)](dw.order.OrderMgr.md#createorderbasket) | CREATED | Order was created from a basket. | + | CREATED | [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder) | OPEN/NEW | Order was considered as valid. Order can now be exported to 3rd party systems. | + | CREATED | [OrderMgr.failOrder(Order)](dw.order.OrderMgr.md#failorderorder) | FAILED | Order was considered not valid. E.g. payment authorization was wrong or fraud check was not successful. | + | OPEN/NEW | [OrderMgr.cancelOrder(Order)](dw.order.OrderMgr.md#cancelorderorder) | CANCELLED | Order was cancelled. | + | CANCELLED | [OrderMgr.undoCancelOrder(Order)](dw.order.OrderMgr.md#undocancelorderorder) | OPEN/NEW | Order was cancelled by mistake and this needs to be undone. | + | FAILED | [OrderMgr.undoFailOrder(Order)](dw.order.OrderMgr.md#undofailorderorder) | CREATED | Order was failed by mistake and this needs to be undone. | + + + Every status change will trigger a change in the order journal which is the base for GMV calculations. + + + **Returns:** + - Status of the order. + + **See Also:** + - [LineItemCtnr](dw.order.LineItemCtnr.md) + + +--- + +### isImported() +- isImported(): [Boolean](TopLevel.Boolean.md) + - : Returns `true`, if the order is imported and `false` + otherwise. + + + **Returns:** + - true, if the order was imported, false otherwise. + + +--- + +### isTaxRoundedAtGroup() +- isTaxRoundedAtGroup(): [Boolean](TopLevel.Boolean.md) + - : Use this method to check if the Order was created with grouped taxation calculation. + + + If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate. + + + **Returns:** + - `true` if the Order was created with grouped taxation + + +--- + +### reauthorize() +- reauthorize(): [Status](dw.system.Status.md) + - : Ensures that the order is authorized. + + + Checks if the order is authorized by calling the hook + [PaymentHooks.validateAuthorization(Order)](dw.order.hooks.PaymentHooks.md#validateauthorizationorder). If the authorization + is not valid it reauthorizes the order by calling the + [PaymentHooks.reauthorize(Order)](dw.order.hooks.PaymentHooks.md#reauthorizeorder). + + + **Returns:** + - the status of the operation, will be Status.OK if the order is + authorized after this call + + + +--- + +### removeRemoteHost() +- removeRemoteHost(): void + - : Removes the IP address of the remote host if stored. + + + If IP logging was enabled during order creation the IP address of the customer will be stored and can be + retrieved using [getRemoteHost()](dw.order.Order.md#getremotehost). + + + **See Also:** + - [getRemoteHost()](dw.order.Order.md#getremotehost) + + +--- + +### setAffiliatePartnerID(String) +- setAffiliatePartnerID(affiliatePartnerID: [String](TopLevel.String.md)): void + - : Sets the affiliate partner ID value. + + **Parameters:** + - affiliatePartnerID - the affiliate partner ID value. + + +--- + +### setAffiliatePartnerName(String) +- setAffiliatePartnerName(affiliatePartnerName: [String](TopLevel.String.md)): void + - : Sets the affiliate partner name value. + + **Parameters:** + - affiliatePartnerName - the affiliate partner name value. + + +--- + +### setCancelCode(String) +- setCancelCode(cancelCode: [String](TopLevel.String.md)): void + - : Sets the cancel code value. + + **Parameters:** + - cancelCode - the cancel code value. + + +--- + +### setCancelDescription(String) +- setCancelDescription(cancelDescription: [String](TopLevel.String.md)): void + - : Sets the description as to why the order was cancelled. + + **Parameters:** + - cancelDescription - the description for why the order was cancelled. + + +--- + +### setConfirmationStatus(Number) +- setConfirmationStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the confirmation status value. + + Possible values are [CONFIRMATION_STATUS_NOTCONFIRMED](dw.order.Order.md#confirmation_status_notconfirmed) or + [CONFIRMATION_STATUS_CONFIRMED](dw.order.Order.md#confirmation_status_confirmed). + + + **Parameters:** + - status - Order confirmation status + + +--- + +### setCustomer(Customer) +- setCustomer(customer: [Customer](dw.customer.Customer.md)): void + - : This method is used to associate the order object with the specified customer object. + + + If the customer object represents a registered customer, the order will be assigned + to this registered customer and the order's customer number + ([LineItemCtnr.getCustomerNo()](dw.order.LineItemCtnr.md#getcustomerno)) will be updated. + + + If the customer object represents an unregistered (anonymous) customer, the + order will become an anonymous order and the order's customer number + will be set to null. + + + **Parameters:** + - customer - The customer to be associated with the order. + + **Throws:** + - NullArgumentException - If specified customer is null. + + +--- + +### setCustomerNo(String) +- setCustomerNo(customerNo: [String](TopLevel.String.md)): void + - : Sets the customer number associated with this order. + + + Note it is recommended to use ([setCustomer(Customer)](dw.order.Order.md#setcustomercustomer)) instead of this method. This method + only sets the customer number and should be used with care as it does _not re-link the order with a customer + profile object which can lead to an inconsistency! Ensure that the customer number used is not already taken + by a different customer profile. + + + **Parameters:** + - customerNo - the customer number associated with this order. + + +--- + +### setCustomerOrderReference(String) +- setCustomerOrderReference(reference: [String](TopLevel.String.md)): void + - : Sets the customer-specific reference information for the order. + + **Parameters:** + - reference - the customer-specific reference information for the order. + + +--- + +### setExportAfter(Date) +- setExportAfter(date: [Date](TopLevel.Date.md)): void + - : Sets the date after which an order can be exported. + + **Parameters:** + - date - the date after which an order can be exported. + + +--- + +### setExportStatus(Number) +- setExportStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the export status of the order. + + Possible values are: [EXPORT_STATUS_NOTEXPORTED](dw.order.Order.md#export_status_notexported), [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported), + [EXPORT_STATUS_READY](dw.order.Order.md#export_status_ready), and [EXPORT_STATUS_FAILED](dw.order.Order.md#export_status_failed). + + + Setting the status to [EXPORT_STATUS_EXPORTED](dw.order.Order.md#export_status_exported) will also trigger the finalization of on order inventory + transactions for this order meaning that all inventory transactions with type on order will be moved into final + inventory transactions. This is only relevant when On Order Inventory is turned on for the inventory list ordered + products are in. + + + + + In case of an exception the current transaction is marked as rollback only. + + + **Parameters:** + - status - Order export status + + +--- + +### setExternalOrderNo(String) +- setExternalOrderNo(externalOrderNo: [String](TopLevel.String.md)): void + - : Sets the value of an external order number associated + with this order + + + **Parameters:** + - externalOrderNo - the value of an external order number associated with this order. + + +--- + +### setExternalOrderStatus(String) +- setExternalOrderStatus(status: [String](TopLevel.String.md)): void + - : Sets the status of an external order associated + with this order + + + **Parameters:** + - status - the status of the external order. + + +--- + +### setExternalOrderText(String) +- setExternalOrderText(text: [String](TopLevel.String.md)): void + - : Sets the text describing the external order. + + **Parameters:** + - text - the text describing the external order. + + +--- + +### setInvoiceNo(String) +- setInvoiceNo(invoiceNumber: [String](TopLevel.String.md)): void + - : Sets the invoice number for this Order. + + + Notice that this value might be overwritten during order placement (e.g. with [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder)). + + + **Parameters:** + - invoiceNumber - the invoice number for this Order. + + **See Also:** + - [getInvoiceNo()](dw.order.Order.md#getinvoiceno) + + +--- + +### setOrderStatus(Number) +- ~~setOrderStatus(status: [Number](TopLevel.Number.md)): void~~ + - : Sets the order status. + + + Use this method when using Order Post Processing such as the creation of [shipping orders](dw.order.ShippingOrder.md). The only supported values are [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open), [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled). Setting the + status will adjust the order item status when applicable (item status not SHIPPED or CANCELLED). Note that the + order status and the status of the items are directly related and dependent on one another. + + + See [OrderItem.setStatus(String)](dw.order.OrderItem.md#setstatusstring) for more information about possible status transitions. + + + Warning: This method will _not_ undo coupon redemptions upon cancellation of an order. Re-opening such an + order later with [OrderMgr.undoCancelOrder(Order)](dw.order.OrderMgr.md#undocancelorderorder) or [OrderItem.setStatus(String)](dw.order.OrderItem.md#setstatusstring) + with [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) will result in an additional application of the same coupon code which in turn + might fail. + + + Order post-processing APIs (gillian) are now inactive by default and will throw + an exception if accessed. Activation needs preliminary approval by Product Management. + Please contact support in this case. Existing customers using these APIs are not + affected by this change and can use the APIs until further notice. + + + **Parameters:** + - status - the status to be set, use one of:
    • [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open)
    • [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled)
    + + **Throws:** + - IllegalArgumentException - on attempt to set an unsupported status value + + **Deprecated:** +:::warning +use [setStatus(Number)](dw.order.Order.md#setstatusnumber) instead +::: + +--- + +### setPaymentStatus(Number) +- setPaymentStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the order payment status. + + Possible values are [PAYMENT_STATUS_NOTPAID](dw.order.Order.md#payment_status_notpaid), [PAYMENT_STATUS_PARTPAID](dw.order.Order.md#payment_status_partpaid) + or [PAYMENT_STATUS_PAID](dw.order.Order.md#payment_status_paid). + + + **Parameters:** + - status - Order payment status + + +--- + +### setReplaceCode(String) +- setReplaceCode(replaceCode: [String](TopLevel.String.md)): void + - : Sets the value of the replace code. + + **Parameters:** + - replaceCode - the value of the replace code. + + +--- + +### setReplaceDescription(String) +- setReplaceDescription(replaceDescription: [String](TopLevel.String.md)): void + - : Sets the value of the replace description. + + **Parameters:** + - replaceDescription - the value of the replace description. + + +--- + +### setShippingStatus(Number) +- setShippingStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the order shipping status value. + + Possible values are [SHIPPING_STATUS_NOTSHIPPED](dw.order.Order.md#shipping_status_notshipped), + [SHIPPING_STATUS_PARTSHIPPED](dw.order.Order.md#shipping_status_partshipped) or [SHIPPING_STATUS_SHIPPED](dw.order.Order.md#shipping_status_shipped). + + + **Parameters:** + - status - Order shipping status + + +--- + +### setStatus(Number) +- setStatus(status: [Number](TopLevel.Number.md)): void + - : Sets the status of the order. + + + Possible values are: + + - [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new) + - [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) + - [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) + - [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled) + - [ORDER_STATUS_REPLACED](dw.order.Order.md#order_status_replaced) + + This method does not support order statuses [ORDER_STATUS_CREATED](dw.order.Order.md#order_status_created) or [ORDER_STATUS_FAILED](dw.order.Order.md#order_status_failed). Please + use [OrderMgr.placeOrder(Order)](dw.order.OrderMgr.md#placeorderorder) or [OrderMgr.failOrder(Order)](dw.order.OrderMgr.md#failorderorder). + + + Setting the order status to [ORDER_STATUS_CANCELLED](dw.order.Order.md#order_status_cancelled) will have the same effect as calling + [OrderMgr.cancelOrder(Order)](dw.order.OrderMgr.md#cancelorderorder). Setting a canceled order to [ORDER_STATUS_NEW](dw.order.Order.md#order_status_new), + [ORDER_STATUS_OPEN](dw.order.Order.md#order_status_open) or [ORDER_STATUS_COMPLETED](dw.order.Order.md#order_status_completed) will have the same effect as calling + [OrderMgr.undoCancelOrder(Order)](dw.order.OrderMgr.md#undocancelorderorder). It is recommended to use the methods in + [OrderMgr](dw.order.OrderMgr.md) directly to be able to do error processing with the return code. + + + **Parameters:** + - status - Order status + + **Throws:** + - IllegalArgumentException - on attempt to set status CREATED or FAILED, or status transition while cancel order or undo cancel order returns with an error code. + + +--- + +### trackOrderChange(String) +- trackOrderChange(text: [String](TopLevel.String.md)): [Note](dw.object.Note.md) + - : Tracks an order change. + + + This adds a history entry to the order. Focus of history entries are changes through business logic, both custom + and internal logic. Tracked order changes are read-only and can be accessed in the Business Manager order + history. The following attributes of the created [history entry](dw.object.Note.md) are initialized: + + - [Note.getCreatedBy()](dw.object.Note.md#getcreatedby)gets the current user assigned + - [Note.getCreationDate()](dw.object.Note.md#getcreationdate)gets the current date assigned + + + + + + This feature is intended to track important changes in custom order flow which should become visible in Business + Manager's history tab. It is NOT intended as auditing feature for every change to an order. A warning will be + produced after 600 notes are added to an order. The warning can be reviewed in Business Manager's Quota Status + screen. Attempting to add a note to an order which already has 1000 notes results in an exception. Please bear in + mind that internal changes, such as order status changes, also track changes. Avoid using this feature in + recurring jobs which may re-process orders multiple times as the limit needs to be considered each time a change + is tracked. The same limit on the number of notes added also applies when using method + [LineItemCtnr.addNote(String, String)](dw.order.LineItemCtnr.md#addnotestring-string) to add notes. + + + **Parameters:** + - text - the text of the history entry + + **Returns:** + - the created history entry + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderAddress.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderAddress.md new file mode 100644 index 00000000..04c8d622 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderAddress.md @@ -0,0 +1,624 @@ + +# Class OrderAddress + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.object.PersistentObject](dw.object.PersistentObject.md) + - [dw.object.ExtensibleObject](dw.object.ExtensibleObject.md) + - [dw.order.OrderAddress](dw.order.OrderAddress.md) + +The Address class represents a customer's address. + + +**Note:** this class allows access to sensitive personal and private information. +Pay attention to appropriate legal and regulatory requirements. + + + +## Property Summary + +| Property | Description | +| --- | --- | +| [address1](#address1): [String](TopLevel.String.md) | Returns the customer's first address. | +| [address2](#address2): [String](TopLevel.String.md) | Returns the customer's second address. | +| [city](#city): [String](TopLevel.String.md) | Returns the Customer's City. | +| [companyName](#companyname): [String](TopLevel.String.md) | Returns the Customer's company name. | +| [countryCode](#countrycode): [EnumValue](dw.value.EnumValue.md) | Returns the customer's country code. | +| [firstName](#firstname): [String](TopLevel.String.md) | Returns the Customer's first name. | +| [fullName](#fullname): [String](TopLevel.String.md) `(read-only)` | Returns a concatenation of the Customer's first, middle, and last names and it' suffix. | +| [jobTitle](#jobtitle): [String](TopLevel.String.md) | Returns the customer's job title. | +| [lastName](#lastname): [String](TopLevel.String.md) | Returns the customer's last name. | +| [phone](#phone): [String](TopLevel.String.md) | Returns the customer's phone number. | +| [postBox](#postbox): [String](TopLevel.String.md) | Returns the customer's post box. | +| [postalCode](#postalcode): [String](TopLevel.String.md) | Returns the customer's postal code. | +| [salutation](#salutation): [String](TopLevel.String.md) | Returns the customer's salutation. | +| [secondName](#secondname): [String](TopLevel.String.md) | Returns the customer's second name. | +| [stateCode](#statecode): [String](TopLevel.String.md) | Returns the customer's state. | +| [suffix](#suffix): [String](TopLevel.String.md) | Returns the customer's suffix. | +| [suite](#suite): [String](TopLevel.String.md) | Returns the customer's suite. | +| [title](#title): [String](TopLevel.String.md) | Returns the customer's title. | + +## Constructor Summary + +This class does not have a constructor, so you cannot create it directly. +## Method Summary + +| Method | Description | +| --- | --- | +| [getAddress1](dw.order.OrderAddress.md#getaddress1)() | Returns the customer's first address. | +| [getAddress2](dw.order.OrderAddress.md#getaddress2)() | Returns the customer's second address. | +| [getCity](dw.order.OrderAddress.md#getcity)() | Returns the Customer's City. | +| [getCompanyName](dw.order.OrderAddress.md#getcompanyname)() | Returns the Customer's company name. | +| [getCountryCode](dw.order.OrderAddress.md#getcountrycode)() | Returns the customer's country code. | +| [getFirstName](dw.order.OrderAddress.md#getfirstname)() | Returns the Customer's first name. | +| [getFullName](dw.order.OrderAddress.md#getfullname)() | Returns a concatenation of the Customer's first, middle, and last names and it' suffix. | +| [getJobTitle](dw.order.OrderAddress.md#getjobtitle)() | Returns the customer's job title. | +| [getLastName](dw.order.OrderAddress.md#getlastname)() | Returns the customer's last name. | +| [getPhone](dw.order.OrderAddress.md#getphone)() | Returns the customer's phone number. | +| [getPostBox](dw.order.OrderAddress.md#getpostbox)() | Returns the customer's post box. | +| [getPostalCode](dw.order.OrderAddress.md#getpostalcode)() | Returns the customer's postal code. | +| [getSalutation](dw.order.OrderAddress.md#getsalutation)() | Returns the customer's salutation. | +| [getSecondName](dw.order.OrderAddress.md#getsecondname)() | Returns the customer's second name. | +| [getStateCode](dw.order.OrderAddress.md#getstatecode)() | Returns the customer's state. | +| [getSuffix](dw.order.OrderAddress.md#getsuffix)() | Returns the customer's suffix. | +| [getSuite](dw.order.OrderAddress.md#getsuite)() | Returns the customer's suite. | +| [getTitle](dw.order.OrderAddress.md#gettitle)() | Returns the customer's title. | +| [isEquivalentAddress](dw.order.OrderAddress.md#isequivalentaddressobject)([Object](TopLevel.Object.md)) | Returns true if the specified address is equivalent to this address. | +| [setAddress1](dw.order.OrderAddress.md#setaddress1string)([String](TopLevel.String.md)) | Sets the customer's first address. | +| [setAddress2](dw.order.OrderAddress.md#setaddress2string)([String](TopLevel.String.md)) | Sets the customer's second address. | +| [setCity](dw.order.OrderAddress.md#setcitystring)([String](TopLevel.String.md)) | Sets the Customer's City. | +| [setCompanyName](dw.order.OrderAddress.md#setcompanynamestring)([String](TopLevel.String.md)) | Sets the Customer's company name. | +| [setCountryCode](dw.order.OrderAddress.md#setcountrycodestring)([String](TopLevel.String.md)) | Sets the Customer's country code. | +| [setFirstName](dw.order.OrderAddress.md#setfirstnamestring)([String](TopLevel.String.md)) | Sets the Customer's first name. | +| [setJobTitle](dw.order.OrderAddress.md#setjobtitlestring)([String](TopLevel.String.md)) | Sets the customer's job title. | +| [setLastName](dw.order.OrderAddress.md#setlastnamestring)([String](TopLevel.String.md)) | Sets the customer's last name. | +| [setPhone](dw.order.OrderAddress.md#setphonestring)([String](TopLevel.String.md)) | Sets the customer's phone number. | +| [setPostBox](dw.order.OrderAddress.md#setpostboxstring)([String](TopLevel.String.md)) | Sets the customer's post box. | +| [setPostalCode](dw.order.OrderAddress.md#setpostalcodestring)([String](TopLevel.String.md)) | Sets the customer's postal code. | +| ~~[setSaluation](dw.order.OrderAddress.md#setsaluationstring)([String](TopLevel.String.md))~~ | Sets the customer's salutation. | +| [setSalutation](dw.order.OrderAddress.md#setsalutationstring)([String](TopLevel.String.md)) | Sets the customer's salutation. | +| [setSecondName](dw.order.OrderAddress.md#setsecondnamestring)([String](TopLevel.String.md)) | Sets the customer's second name. | +| [setStateCode](dw.order.OrderAddress.md#setstatecodestring)([String](TopLevel.String.md)) | Sets the customer's state. | +| [setSuffix](dw.order.OrderAddress.md#setsuffixstring)([String](TopLevel.String.md)) | Sets the customer's suffix. | +| [setSuite](dw.order.OrderAddress.md#setsuitestring)([String](TopLevel.String.md)) | Sets the customer's suite. | +| [setTitle](dw.order.OrderAddress.md#settitlestring)([String](TopLevel.String.md)) | Sets the customer's title. | + +### Methods inherited from class ExtensibleObject + +[describe](dw.object.ExtensibleObject.md#describe), [getCustom](dw.object.ExtensibleObject.md#getcustom) +### Methods inherited from class PersistentObject + +[getCreationDate](dw.object.PersistentObject.md#getcreationdate), [getLastModified](dw.object.PersistentObject.md#getlastmodified), [getUUID](dw.object.PersistentObject.md#getuuid) +### Methods inherited from class Object + +[assign](TopLevel.Object.md#assignobject-object), [create](TopLevel.Object.md#createobject), [create](TopLevel.Object.md#createobject-object), [defineProperties](TopLevel.Object.md#definepropertiesobject-object), [defineProperty](TopLevel.Object.md#definepropertyobject-object-object), [entries](TopLevel.Object.md#entriesobject), [freeze](TopLevel.Object.md#freezeobject), [fromEntries](TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](TopLevel.Object.md#hasownpropertystring), [is](TopLevel.Object.md#isobject-object), [isExtensible](TopLevel.Object.md#isextensibleobject), [isFrozen](TopLevel.Object.md#isfrozenobject), [isPrototypeOf](TopLevel.Object.md#isprototypeofobject), [isSealed](TopLevel.Object.md#issealedobject), [keys](TopLevel.Object.md#keysobject), [preventExtensions](TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](TopLevel.Object.md#propertyisenumerablestring), [seal](TopLevel.Object.md#sealobject), [setPrototypeOf](TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](TopLevel.Object.md#tolocalestring), [toString](TopLevel.Object.md#tostring), [valueOf](TopLevel.Object.md#valueof), [values](TopLevel.Object.md#valuesobject) +## Property Details + +### address1 +- address1: [String](TopLevel.String.md) + - : Returns the customer's first address. + + +--- + +### address2 +- address2: [String](TopLevel.String.md) + - : Returns the customer's second address. + + +--- + +### city +- city: [String](TopLevel.String.md) + - : Returns the Customer's City. + + +--- + +### companyName +- companyName: [String](TopLevel.String.md) + - : Returns the Customer's company name. + + +--- + +### countryCode +- countryCode: [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's country code. + + +--- + +### firstName +- firstName: [String](TopLevel.String.md) + - : Returns the Customer's first name. + + +--- + +### fullName +- fullName: [String](TopLevel.String.md) `(read-only)` + - : Returns a concatenation of the Customer's first, middle, + and last names and it' suffix. + + + +--- + +### jobTitle +- jobTitle: [String](TopLevel.String.md) + - : Returns the customer's job title. + + +--- + +### lastName +- lastName: [String](TopLevel.String.md) + - : Returns the customer's last name. + + +--- + +### phone +- phone: [String](TopLevel.String.md) + - : Returns the customer's phone number. + + +--- + +### postBox +- postBox: [String](TopLevel.String.md) + - : Returns the customer's post box. + + +--- + +### postalCode +- postalCode: [String](TopLevel.String.md) + - : Returns the customer's postal code. + + +--- + +### salutation +- salutation: [String](TopLevel.String.md) + - : Returns the customer's salutation. + + +--- + +### secondName +- secondName: [String](TopLevel.String.md) + - : Returns the customer's second name. + + +--- + +### stateCode +- stateCode: [String](TopLevel.String.md) + - : Returns the customer's state. + + +--- + +### suffix +- suffix: [String](TopLevel.String.md) + - : Returns the customer's suffix. + + +--- + +### suite +- suite: [String](TopLevel.String.md) + - : Returns the customer's suite. + + +--- + +### title +- title: [String](TopLevel.String.md) + - : Returns the customer's title. + + +--- + +## Method Details + +### getAddress1() +- getAddress1(): [String](TopLevel.String.md) + - : Returns the customer's first address. + + **Returns:** + - the first address value. + + +--- + +### getAddress2() +- getAddress2(): [String](TopLevel.String.md) + - : Returns the customer's second address. + + **Returns:** + - the second address value. + + +--- + +### getCity() +- getCity(): [String](TopLevel.String.md) + - : Returns the Customer's City. + + **Returns:** + - the Customer's city. + + +--- + +### getCompanyName() +- getCompanyName(): [String](TopLevel.String.md) + - : Returns the Customer's company name. + + **Returns:** + - the company name. + + +--- + +### getCountryCode() +- getCountryCode(): [EnumValue](dw.value.EnumValue.md) + - : Returns the customer's country code. + + **Returns:** + - the country code. + + +--- + +### getFirstName() +- getFirstName(): [String](TopLevel.String.md) + - : Returns the Customer's first name. + + **Returns:** + - the Customer first name. + + +--- + +### getFullName() +- getFullName(): [String](TopLevel.String.md) + - : Returns a concatenation of the Customer's first, middle, + and last names and it' suffix. + + + **Returns:** + - a concatenation of the Customer's first, middle, + and last names and it' suffix. + + + +--- + +### getJobTitle() +- getJobTitle(): [String](TopLevel.String.md) + - : Returns the customer's job title. + + **Returns:** + - the job title. + + +--- + +### getLastName() +- getLastName(): [String](TopLevel.String.md) + - : Returns the customer's last name. + + **Returns:** + - the last name. + + +--- + +### getPhone() +- getPhone(): [String](TopLevel.String.md) + - : Returns the customer's phone number. + + **Returns:** + - the phone number. + + +--- + +### getPostBox() +- getPostBox(): [String](TopLevel.String.md) + - : Returns the customer's post box. + + **Returns:** + - the postBox. + + +--- + +### getPostalCode() +- getPostalCode(): [String](TopLevel.String.md) + - : Returns the customer's postal code. + + **Returns:** + - the postal code. + + +--- + +### getSalutation() +- getSalutation(): [String](TopLevel.String.md) + - : Returns the customer's salutation. + + **Returns:** + - the customer's salutation. + + +--- + +### getSecondName() +- getSecondName(): [String](TopLevel.String.md) + - : Returns the customer's second name. + + **Returns:** + - the second name. + + +--- + +### getStateCode() +- getStateCode(): [String](TopLevel.String.md) + - : Returns the customer's state. + + **Returns:** + - the state. + + +--- + +### getSuffix() +- getSuffix(): [String](TopLevel.String.md) + - : Returns the customer's suffix. + + **Returns:** + - the suffix. + + +--- + +### getSuite() +- getSuite(): [String](TopLevel.String.md) + - : Returns the customer's suite. + + **Returns:** + - the customer's suite. + + +--- + +### getTitle() +- getTitle(): [String](TopLevel.String.md) + - : Returns the customer's title. + + **Returns:** + - the title. + + +--- + +### isEquivalentAddress(Object) +- isEquivalentAddress(address: [Object](TopLevel.Object.md)): [Boolean](TopLevel.Boolean.md) + - : Returns true if the specified address is equivalent to + this address. An equivalent address is an address whose + core attributes contain the same values. The core attributes + are: + + - address1 + - address2 + - city + - companyName + - countryCode + - firstName + - lastName + - postalCode + - postBox + - stateCode + + + **Parameters:** + - address - the address to test. + + **Returns:** + - true if the specified address is equivalent to + this address, false otherwise. + + + +--- + +### setAddress1(String) +- setAddress1(value: [String](TopLevel.String.md)): void + - : Sets the customer's first address. + + **Parameters:** + - value - The value to set. + + +--- + +### setAddress2(String) +- setAddress2(value: [String](TopLevel.String.md)): void + - : Sets the customer's second address. + + **Parameters:** + - value - The value to set. + + +--- + +### setCity(String) +- setCity(city: [String](TopLevel.String.md)): void + - : Sets the Customer's City. + + **Parameters:** + - city - the Customer's city to set. + + +--- + +### setCompanyName(String) +- setCompanyName(companyName: [String](TopLevel.String.md)): void + - : Sets the Customer's company name. + + **Parameters:** + - companyName - the name of the company. + + +--- + +### setCountryCode(String) +- setCountryCode(countryCode: [String](TopLevel.String.md)): void + - : Sets the Customer's country code. + + **Parameters:** + - countryCode - the country code. + + +--- + +### setFirstName(String) +- setFirstName(firstName: [String](TopLevel.String.md)): void + - : Sets the Customer's first name. + + **Parameters:** + - firstName - the customer's first name to set. + + +--- + +### setJobTitle(String) +- setJobTitle(jobTitle: [String](TopLevel.String.md)): void + - : Sets the customer's job title. + + **Parameters:** + - jobTitle - The job title to set. + + +--- + +### setLastName(String) +- setLastName(lastName: [String](TopLevel.String.md)): void + - : Sets the customer's last name. + + **Parameters:** + - lastName - The last name to set. + + +--- + +### setPhone(String) +- setPhone(phoneNumber: [String](TopLevel.String.md)): void + - : Sets the customer's phone number. The length is restricted to 256 characters. + + **Parameters:** + - phoneNumber - The phone number to set. + + +--- + +### setPostBox(String) +- setPostBox(postBox: [String](TopLevel.String.md)): void + - : Sets the customer's post box. + + **Parameters:** + - postBox - The post box to set. + + +--- + +### setPostalCode(String) +- setPostalCode(postalCode: [String](TopLevel.String.md)): void + - : Sets the customer's postal code. + + **Parameters:** + - postalCode - The postal code to set. + + +--- + +### setSaluation(String) +- ~~setSaluation(value: [String](TopLevel.String.md)): void~~ + - : Sets the customer's salutation. + + **Parameters:** + - value - the customer's salutation. + + **Deprecated:** +:::warning +Use [setSalutation(String)](dw.order.OrderAddress.md#setsalutationstring) +::: + +--- + +### setSalutation(String) +- setSalutation(value: [String](TopLevel.String.md)): void + - : Sets the customer's salutation. + + **Parameters:** + - value - the customer's salutation. + + +--- + +### setSecondName(String) +- setSecondName(secondName: [String](TopLevel.String.md)): void + - : Sets the customer's second name. + + **Parameters:** + - secondName - The second name to set. + + +--- + +### setStateCode(String) +- setStateCode(state: [String](TopLevel.String.md)): void + - : Sets the customer's state. + + **Parameters:** + - state - The state to set. + + +--- + +### setSuffix(String) +- setSuffix(suffix: [String](TopLevel.String.md)): void + - : Sets the customer's suffix. + + **Parameters:** + - suffix - The suffix to set. + + +--- + +### setSuite(String) +- setSuite(value: [String](TopLevel.String.md)): void + - : Sets the customer's suite. The length is restricted to 256 characters. + + **Parameters:** + - value - the customer's suite. + + +--- + +### setTitle(String) +- setTitle(title: [String](TopLevel.String.md)): void + - : Sets the customer's title. + + **Parameters:** + - title - The title to set. + + +--- + + diff --git a/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderItem.md b/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderItem.md new file mode 100644 index 00000000..50ea9749 --- /dev/null +++ b/packages/b2c-tooling-sdk/data/script-api/dw.order.OrderItem.md @@ -0,0 +1,613 @@ + +# Class OrderItem + +- [TopLevel.Object](TopLevel.Object.md) + - [dw.order.OrderItem](dw.order.OrderItem.md) + +Defines _extensions_ to [ProductLineItem](dw.order.ProductLineItem.md)s and +[ShippingLineItem](dw.order.ShippingLineItem.md)s belonging to an [order](dw.order.Order.md). + + + +The order-item can be accessed using +[ProductLineItem.getOrderItem()](dw.order.ProductLineItem.md#getorderitem) or +[ShippingLineItem.getOrderItem()](dw.order.ShippingLineItem.md#getorderitem) - these methods return null +if the item is associated with a [basket](dw.order.Basket.md) rather than +an [order](dw.order.Order.md). Alternative access is available using +[Order.getOrderItem(String)](dw.order.Order.md#getorderitemstring) by passing the +[itemID](dw.order.OrderItem.md#getitemid) used to identify the +order-item in for example export files. The +associated order-item can also be accessed from +[invoice-items](dw.order.InvoiceItem.md), +[shipping-order-items](dw.order.ShippingOrderItem.md), +[return-items](dw.order.ReturnItem.md) and [return-case-items](dw.order.ReturnCaseItem.md) +using [AbstractItem.getOrderItem()](dw.order.AbstractItem.md#getorderitem). + + + +The order-item provides an item-level [status](dw.order.OrderItem.md#getstatus) and +[type](dw.order.OrderItem.md#gettype), methods for accessing and creating associated items, +and methods used to [allocate inventory](dw.order.OrderItem.md#allocateinventoryboolean) for [shipping-order](dw.order.ShippingOrder.md) creation. + + +Order post-processing APIs (gillian) are now inactive by default and will throw +an exception if accessed. Activation needs preliminary approval by Product Management. +Please contact support in this case. Existing customers using these APIs are not +affected by this change and can use the APIs until further notice. + + + +## Constant Summary + +| Constant | Description | +| --- | --- | +| [STATUS_BACKORDER](#status_backorder): [String](TopLevel.String.md) = "BACKORDER" | Constant for Order Item Status BACKORDER | +| [STATUS_CANCELLED](#status_cancelled): [String](TopLevel.String.md) = "CANCELLED" | Constant for Order Item Status CANCELLED | +| [STATUS_CONFIRMED](#status_confirmed): [String](TopLevel.String.md) = "CONFIRMED" | Constant for Order Item Status CONFIRMED | +| [STATUS_CREATED](#status_created): [String](TopLevel.String.md) = "CREATED" | Constant for Order Item Status CREATED | +| [STATUS_NEW](#status_new): [String](TopLevel.String.md) = "NEW" | Constant for Order Item Status NEW | +| [STATUS_OPEN](#status_open): [String](TopLevel.String.md) = "OPEN" | Constant for Order Item Status OPEN | +| [STATUS_SHIPPED](#status_shipped): [String](TopLevel.String.md) = "SHIPPED" | Constant for Order Item Status SHIPPED | +| [STATUS_WAREHOUSE](#status_warehouse): [String](TopLevel.String.md) = "WAREHOUSE" | Constant for Order Item Status WAREHOUSE | +| [TYPE_PRODUCT](#type_product): [String](TopLevel.String.md) = "PRODUCT" | Constant for Order Item Type PRODUCT | +| [TYPE_SERVICE](#type_service): [String](TopLevel.String.md) = "SERVICE" | Constant for Order Item Type SERVICE | + +## Property Summary + +| Property | Description | +| --- | --- | +| [appeasedAmount](#appeasedamount): [Money](dw.value.Money.md) `(read-only)` | Sum of amounts appeased for this item, calculated by iterating over invoice items associated with the item. | +| [capturedAmount](#capturedamount): [Money](dw.value.Money.md) `(read-only)` | Sum of amounts captured for this item, calculated by iterating over invoice items associated with the item. | +| [invoiceItems](#invoiceitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns all invoice items associated with this item, each [InvoiceItem](dw.order.InvoiceItem.md) will belong to a different [Invoice](dw.order.Invoice.md), which can also be accessed using [Order.getInvoices()](dw.order.Order.md#getinvoices) or [Order.getInvoice(String)](dw.order.Order.md#getinvoicestring). | +| [itemID](#itemid): [String](TopLevel.String.md) `(read-only)` | The itemID used to identify the OrderItem. | +| [lineItem](#lineitem): [LineItem](dw.order.LineItem.md) `(read-only)` | Returns the line item which is being extended by this instance. | +| [refundedAmount](#refundedamount): [Money](dw.value.Money.md) `(read-only)` | Sum of amounts refunded for this item, calculated by iterating over invoice items associated with the item. | +| [returnCaseItems](#returncaseitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns all return case items associated with this item, each [ReturnCaseItem](dw.order.ReturnCaseItem.md) will belong to a different [ReturnCase](dw.order.ReturnCase.md), which can also be accessed using [Order.getReturnCases()](dw.order.Order.md#getreturncases) or [Order.getReturnCase(String)](dw.order.Order.md#getreturncasestring). | +| [returnedQuantity](#returnedquantity): [Quantity](dw.value.Quantity.md) `(read-only)` | The quantity returned, dynamically sum of quantities held by associated ReturnItems. | +| ~~[shippingOrderItem](#shippingorderitem): [ShippingOrderItem](dw.order.ShippingOrderItem.md)~~ `(read-only)` | The last added non-cancelled shipping order item if one exists, otherwise `null`. | +| [shippingOrderItems](#shippingorderitems): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of the [ShippingOrderItem](dw.order.ShippingOrderItem.md)s created for this item. | +| [splitItems](#splititems): [Collection](dw.util.Collection.md) `(read-only)` | Returns a collection of all split [OrderItem](dw.order.OrderItem.md)s associated with this item. | +| [splitSourceItem](#splitsourceitem): [OrderItem](dw.order.OrderItem.md) `(read-only)` | Returns the split source item associated with this item, if existing. | +| [status](#status): [EnumValue](dw.value.EnumValue.md) | Gets the order item status.
    The possible values are: