Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ generator/openapitools.json

# Demo
demo/

# AI Rules
.cursor/
74 changes: 71 additions & 3 deletions generator/catalog-ingestion-openapi-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ tags:
- Updating existing category information
- Deleting categories from the catalog
- Associating categories with product families for enhanced organization
- Adding SEO meta tags (title, description, keywords) to categories
- Associating images with categories

Categories use a slug-based hierarchy format to represent parent-child relationships, for example, "men/clothing/pants'.
Categories use a slug-based hierarchy format to represent parent-child relationships, for example, "men/clothing/pants".

After you create categories and assign them to products, you can retrieve category data to render storefront menus and manage hierarchical category
trees using the GraphQL `navigation` and `categorytree` queries. See
Expand Down Expand Up @@ -318,6 +320,8 @@ paths:
description: |
Update existing product attribute metadata with new values.
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply changes for fields in an `array`.

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
operationId: updateProductMetadata
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -419,7 +423,10 @@ paths:
- A category `slug` string can contain only lowercase letters, numbers, and hyphens with `/` used as a separator for hierarchy.
- Create each category as a separate entity.
- Use the `name` field to define the display name for the category.
- Use the optional `description` field to provide a full-text description of the category.
- Use the optional `families` field to associate categories with product families for enhanced organization.
- Use the optional `metaTags` field to define SEO meta tags (title, description, keywords) for the category.
- Use the optional `images` field to associate images with the category.

After you create categories, link a product to a category using the `path` value for the [routes](#operation/createProducts!path=routes&t=request) field. When you create or update products. The value of `path` in the route must match the `slug` value for the category.

Expand Down Expand Up @@ -460,12 +467,27 @@ paths:
"slug": "men",
"source": { "locale": "en-US" },
"name": "Men",
"families": ["apparel", "accessories"]
"description": "Men's clothing, shoes, and accessories",
"families": ["apparel", "accessories"],
"metaTags": {
"title": "Men's Collection",
"description": "Shop men's clothing, shoes, and accessories",
"keywords": ["men", "clothing", "accessories"]
},
"images": [
{
"url": "https://example.com/images/men-category.png",
"label": "Men's Category",
"roles": ["SMALL"],
"customRoles": []
}
]
},
{
"slug": "men/clothing",
"source": { "locale": "en-US" },
"name": "Men's Clothing",
"description": "Men's clothing and apparel",
"families": ["apparel"]
},
{
Expand All @@ -482,6 +504,8 @@ paths:
description: |
Update existing product categories with new values.
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply changes for fields in an `array`.

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
operationId: updateCategories
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -514,13 +538,29 @@ paths:
The example below updates the following:
* `name` - Change the category display name.
* `families` - Replace the product families associated with the category.
* `metaTags` - Update the SEO meta tags for the category.
* `images` - Replace the images associated with the category.
value:
[
{
"slug": "men/clothing",
"source": { "locale": "en-US" },
"name": "Men's Apparel",
"families": ["clothing", "fashion"]
"description": "Updated collection of men's apparel and fashion",
"families": ["clothing", "fashion"],
"metaTags": {
"title": "Men's Apparel - Updated",
"description": "Updated collection of men's apparel",
"keywords": ["men", "apparel", "fashion"]
},
"images": [
{
"url": "https://example.com/images/mens-apparel.png",
"label": "Men's Apparel",
"roles": ["SMALL"],
"customRoles": []
}
]
}
]
/v1/catalog/categories/delete:
Expand Down Expand Up @@ -1101,6 +1141,7 @@ paths:
* `configurations` match on `type` and `attributeCode`
* `externalIds` match on `type` and `origin`

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
operationId: updateProducts
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -1591,6 +1632,8 @@ paths:
* **Base Price Books**: Update name and currency as needed
* **Child Price Books**: Include correct `parentId` in request (will be ignored if different)
* **Hierarchy Restructuring**: Delete child price book and recreate with new parent reference

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
operationId: updatePriceBooks
parameters:
- name: Content-Type
Expand Down Expand Up @@ -2006,6 +2049,7 @@ paths:
* Ensure tier quantities are in ascending order
* Test updates in a development environment first

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
operationId: updatePrices
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -2377,6 +2421,11 @@ components:
maxLength: 128
description: Display name of the category
example: "Men's Pants"
description:
type: string
nullable: true
description: Full-text description of the category.
example: "Men's clothing, shoes, and accessories"
families:
type: array
nullable: true
Expand All @@ -2386,6 +2435,13 @@ components:
Optional array of product family identifiers that this category is associated with.
Used for enhanced product organization and filtering.
example: ["apparel", "clothing"]
metaTags:
$ref: "#/components/schemas/ProductMetaAttribute"
images:
type: array
description: A list of category images.
items:
$ref: "#/components/schemas/ProductImage"
additionalProperties: false
FeedCategoryUpdate:
title: FeedCategoryUpdate
Expand Down Expand Up @@ -2413,6 +2469,11 @@ components:
maxLength: 128
description: Display name of the category
example: "Men's Pants"
description:
type: string
nullable: true
description: Full-text description of the category.
example: "Men's clothing, shoes, and accessories"
families:
type: array
nullable: true
Expand All @@ -2424,6 +2485,13 @@ components:
you can associate it with the "apparel" family.
Note: This field uses the replace strategy to replace the entire array with the new values.
example: ["apparel", "clothing"]
metaTags:
$ref: "#/components/schemas/ProductMetaAttribute"
images:
type: array
description: A list of category images.
items:
$ref: "#/components/schemas/ProductImage"
additionalProperties: false
FeedCategoryDelete:
title: Delete category
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe-commerce/aco-ts-sdk",
"version": "1.2.2",
"version": "1.2.3",
"description": "TypeScript Client SDK for the Adobe Commerce Optimizer API",
"type": "module",
"license": "Apache-2.0",
Expand Down
33 changes: 23 additions & 10 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ export interface Client {
* unique `slug` and `source`. - To create parent-child relationships, create the `slug` field in a hierarchical
* format, for example `men/clothing/pants\'. - A category `slug`string can contain only lowercase letters, numbers,
* and hyphens with`/`used as a separator for hierarchy. - Create each category as a separate entity. - Use
* the`name`field to define the display name for the category. - Use the optional`families`field to associate
* categories with product families for enhanced organization. After you create categories, link a product to a
* category using the`path`value for the [routes](#operation/createProducts!path=routes&t=request) field. When you
* create or update products. The value of`path`in the route must match the`slug` value for the category. To update
* existing categories, use the update operation.
* the`name`field to define the display name for the category. - Use the optional`description`field to provide a
* full-text description of the category. - Use the optional`families`field to associate categories with product
* families for enhanced organization. - Use the optional`metaTags`field to define SEO meta tags (title, description,
* keywords) for the category. - Use the optional`images`field to associate images with the category. After you create
* categories, link a product to a category using the`path`value for the
* [routes](#operation/createProducts!path=routes&t=request) field. When you create or update products. The value
* of`path`in the route must match the`slug` value for the category. To update existing categories, use the update
* operation.
*
* @param data - FeedCategory[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand All @@ -75,7 +78,9 @@ export interface Client {
/**
* Update categories Update existing product categories with new values. When the update is processed, the merge
* strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply
* changes for fields in an `array`.
* changes for fields in an `array`. > **Note:** Before submitting an update request, verify that the target entity
* already exists. Update operations do not validate the existence of the entity — if it does not exist, the request
* is accepted, but the update is silently ignored.
*
* @param data - FeedCategoryUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -110,7 +115,9 @@ export interface Client {
/**
* Update product attribute metadata Update existing product attribute metadata with new values. When the update is
* processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy
* is used to apply changes for fields in an `array`.
* is used to apply changes for fields in an `array`. > **Note:** Before submitting an update request, verify that the
* target entity already exists. Update operations do not validate the existence of the entity — if it does not exist,
* the request is accepted, but the update is silently ignored.
*
* @param data - FeedMetadataUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -169,7 +176,9 @@ export interface Client {
* validates that `parentId` references exist and hierarchy depth is maintained <h3>Update Strategies</h3> * **Base
* Price Books**: Update name and currency as needed * **Child Price Books**: Include correct `parentId` in request
* (will be ignored if different) * **Hierarchy Restructuring**: Delete child price book and recreate with new
* parent reference
* parent reference > **Note:** Before submitting an update request, verify that the target entity already exists.
* Update operations do not validate the existence of the entity — if it does not exist, the request is accepted,
* but the update is silently ignored.
*
* @param data - FeedPricebook[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -216,7 +225,9 @@ export interface Client {
* discounts/tiers, send an empty array * To add new discounts/tiers, include both existing and new items <h3>Best
* practices</h3> * Always include the complete array of discounts/tiers when updating * Use descriptive discount
* codes for easier management * Ensure tier quantities are in ascending order * Test updates in a development
* environment first
* environment first > **Note:** Before submitting an update request, verify that the target entity already exists.
* Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but
* the update is silently ignored.
*
* @param data - FeedPricesUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -333,7 +344,9 @@ export interface Client {
* list, you can update a specific object by matching on a key field. The following fields are supported: *
* `attributes` - match on `code` * `images` - match on `url` * `routes` - match on `path` * `links` - match on `type`
* and `sku` * `bundles` match on `type` and `group` * `configurations` match on `type` and `attributeCode` *
* `externalIds` match on `type` and `origin`
* `externalIds` match on `type` and `origin` > **Note:** Before submitting an update request, verify that the target
* entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the
* request is accepted, but the update is silently ignored.
*
* @param data - FeedProductUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down
38 changes: 38 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export interface FeedCategory {
* @type {string}
*/
name: string;
/**
* Full-text description of the category.
*
* @memberof FeedCategory
* @type {string}
*/
description?: string;
/**
* Optional array of product family identifiers that this category is associated with. Used for enhanced product
* organization and filtering.
Expand All @@ -98,6 +105,18 @@ export interface FeedCategory {
* @type {string[]}
*/
families?: string[];
/**
* @memberof FeedCategory
* @type {ProductMetaAttribute}
*/
metaTags?: ProductMetaAttribute;
/**
* A list of category images.
*
* @memberof FeedCategory
* @type {ProductImage[]}
*/
images?: ProductImage[];
}
/**
* Delete category information for removing categories from the catalog.
Expand Down Expand Up @@ -147,6 +166,13 @@ export interface FeedCategoryUpdate {
* @type {string}
*/
name?: string;
/**
* Full-text description of the category.
*
* @memberof FeedCategoryUpdate
* @type {string}
*/
description?: string;
/**
* Optional array of product family identifiers that this category is associated with. Used for enhanced product
* organization and filtering. For example, for a clothing category, you can associate it with the "apparel" family.
Expand All @@ -156,6 +182,18 @@ export interface FeedCategoryUpdate {
* @type {string[]}
*/
families?: string[];
/**
* @memberof FeedCategoryUpdate
* @type {ProductMetaAttribute}
*/
metaTags?: ProductMetaAttribute;
/**
* A list of category images.
*
* @memberof FeedCategoryUpdate
* @type {ProductImage[]}
*/
images?: ProductImage[];
}
/**
* @export
Expand Down
Loading