@wix/ditto-codegen-public 1.0.50 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +183 -0
- package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +103 -0
- package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +118 -0
- package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +184 -0
- package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +130 -0
- package/dist/examples-apps/contact-created-logger/package-lock.json +15102 -0
- package/dist/examples-apps/contact-created-logger/package.json +37 -0
- package/dist/examples-apps/contact-created-logger/src/backend/events/contact-created-logger/event.ts +51 -0
- package/dist/examples-apps/contact-created-logger/tsconfig.json +5 -0
- package/dist/examples-apps/contact-created-logger/wix.config.json +4 -0
- package/dist/examples-apps/product-created-logger/package-lock.json +15102 -0
- package/dist/examples-apps/product-created-logger/package.json +37 -0
- package/dist/examples-apps/product-created-logger/src/backend/events/product-created-logger/event.ts +67 -0
- package/dist/examples-apps/product-created-logger/tsconfig.json +5 -0
- package/dist/examples-apps/product-created-logger/wix.config.json +4 -0
- package/dist/out.js +292 -36
- package/package.json +2 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<stores_products_updateProduct>
|
|
2
|
+
<purpose>Updates specified fields in a product. To update a single field across multiple products, use Bulk Update Product Property.</purpose>
|
|
3
|
+
<use_cases>
|
|
4
|
+
- Update product information such as name, description, or pricing
|
|
5
|
+
- Modify product visibility settings
|
|
6
|
+
- Update product inventory and stock tracking
|
|
7
|
+
- Change product media and images
|
|
8
|
+
- Update product SEO settings and metadata
|
|
9
|
+
- Modify product options and variants
|
|
10
|
+
- Update product collections and categories
|
|
11
|
+
- Change product shipping and tax settings
|
|
12
|
+
- Update product custom fields and properties
|
|
13
|
+
- Modify product discount and pricing rules
|
|
14
|
+
</use_cases>
|
|
15
|
+
<method_declaration>
|
|
16
|
+
products.updateProduct(_id, productUpdate)
|
|
17
|
+
</method_declaration>
|
|
18
|
+
<required_parameters>
|
|
19
|
+
- _id: string - Product ID (generated automatically by the catalog)
|
|
20
|
+
- product: UpdateProduct - Product info to update
|
|
21
|
+
</required_parameters>
|
|
22
|
+
<optional_parameters>
|
|
23
|
+
None
|
|
24
|
+
</optional_parameters>
|
|
25
|
+
<import>import { products } from '@wix/stores'</import>
|
|
26
|
+
<types>
|
|
27
|
+
|
|
28
|
+
**UpdateProduct**
|
|
29
|
+
Properties:
|
|
30
|
+
- additionalInfoSections: AdditionalInfoSections[] - Additional text that the store owner can assign to the product (e.g. shipping details, refund policy, etc.).
|
|
31
|
+
- brand: string - product brand.
|
|
32
|
+
- costAndProfitData: CostAndProfitData - Cost and profit data.
|
|
33
|
+
- description: string - description.
|
|
34
|
+
- manageVariants: boolean - Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. Once set to true, can be reset to false only if no variants exist. You cannot set manageVariants to true if more than 300 variants are defined.
|
|
35
|
+
- name: string - Product name. Min: 1 character Max: 80 characters
|
|
36
|
+
- priceData: PriceData - Price data.
|
|
37
|
+
- pricePerUnitData: PricePerUnitData - price per unit data
|
|
38
|
+
- productOptions: ProductOption[] - Options for this product.
|
|
39
|
+
- productType: ProductType - Currently, only creating physical products ( "productType": "physical" ) is supported via the API.
|
|
40
|
+
- ribbon: string - Product ribbon. Used to highlight relevant information about a product. For example, "Sale", "New Arrival", "Sold Out".
|
|
41
|
+
- seoData: SeoSchema - Custom SEO data for the product.
|
|
42
|
+
- sku: string - Stock keeping unit. If variant management is enabled, SKUs will be set per variant, and this field will be empty.
|
|
43
|
+
- slug: string - A friendly URL name (generated automatically by the catalog when a product is created), can be updated.
|
|
44
|
+
- visible: boolean - Whether the product is visible to site visitors.
|
|
45
|
+
- weight: number - Product weight. If variant management is enabled, weight will be set per variant, and this field will be empty.
|
|
46
|
+
|
|
47
|
+
**AdditionalInfoSections**
|
|
48
|
+
Properties:
|
|
49
|
+
- description: string - Product info section description
|
|
50
|
+
- title: string - Product info section title
|
|
51
|
+
|
|
52
|
+
**PriceData**
|
|
53
|
+
Properties:
|
|
54
|
+
- price: number - Product price
|
|
55
|
+
|
|
56
|
+
**PricePerUnitData**
|
|
57
|
+
Properties:
|
|
58
|
+
- baseMeasurementUnit: BaseMeasurementUnit - Base measurement unit
|
|
59
|
+
- baseQuantity: number - Base quantity
|
|
60
|
+
- totalMeasurementUnit: MeasurementUnit - Total measurement unit
|
|
61
|
+
- totalQuantity: number - Total quantity
|
|
62
|
+
|
|
63
|
+
**ProductOption**
|
|
64
|
+
Properties:
|
|
65
|
+
- choices: Choice[] - Choices available for this option.
|
|
66
|
+
- name: string - Option name
|
|
67
|
+
|
|
68
|
+
**Choice**
|
|
69
|
+
- description: string - Choice description.
|
|
70
|
+
- value: string - Choice value
|
|
71
|
+
|
|
72
|
+
**UpdateProductResponse**
|
|
73
|
+
Properties:
|
|
74
|
+
- product: Product - The updated product object.
|
|
75
|
+
</types>
|
|
76
|
+
<important_notes>
|
|
77
|
+
- This method updates specified fields in a product
|
|
78
|
+
- To update a single field across multiple products, use Bulk Update Product Property
|
|
79
|
+
- Only the fields you specify in the productUpdate parameter will be updated
|
|
80
|
+
- All other fields will remain unchanged
|
|
81
|
+
- The method returns the updated product object
|
|
82
|
+
- Product ID is required and cannot be updated
|
|
83
|
+
- This method doesn't return any custom errors, but may return standard errors
|
|
84
|
+
- **Required Permission**: In order to use this method, the app must have the permission scope named "SCOPE.STORES.PRODUCT_WRITE"
|
|
85
|
+
</important_notes>
|
|
86
|
+
|
|
87
|
+
<return_type>
|
|
88
|
+
Promise<UpdateProductResponse>
|
|
89
|
+
</return_type>
|
|
90
|
+
|
|
91
|
+
<example_usage>
|
|
92
|
+
```typescript
|
|
93
|
+
import { products } from '@wix/stores';
|
|
94
|
+
|
|
95
|
+
// Update a product
|
|
96
|
+
const updatedProduct = await products.updateProduct('product-id', {
|
|
97
|
+
name: 'Updated Product Name',
|
|
98
|
+
description: 'Updated product description',
|
|
99
|
+
price: {
|
|
100
|
+
price: 29.99,
|
|
101
|
+
currency: 'USD'
|
|
102
|
+
},
|
|
103
|
+
// Add a promotional ribbon
|
|
104
|
+
ribbon: 'New Arrival'
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Update product with different ribbon
|
|
108
|
+
const saleProduct = await products.updateProduct('product-id', {
|
|
109
|
+
ribbon: 'Sale'
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// Remove ribbon from product
|
|
113
|
+
const noRibbonProduct = await products.updateProduct('product-id', {
|
|
114
|
+
ribbon: '' // or null to remove ribbon
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
</example_usage>
|
|
118
|
+
|
|
119
|
+
<related_methods>
|
|
120
|
+
- products.createProduct() - Method to create new products
|
|
121
|
+
- products.getProduct() - Method to retrieve product details
|
|
122
|
+
- products.deleteProduct() - Method to delete products
|
|
123
|
+
- products.queryProducts() - Method to query products with filters
|
|
124
|
+
- products.bulkUpdateProductsProperty() - Method to update single field across multiple products
|
|
125
|
+
- products.addProductMedia() - Method to add media to products
|
|
126
|
+
- products.removeProductMedia() - Method to remove media from products
|
|
127
|
+
- products.addProductsToCollection() - Method to add products to collections
|
|
128
|
+
- products.removeProductsFromCollection() - Method to remove products from collections
|
|
129
|
+
</related_methods>
|
|
130
|
+
</stores_products_updateProduct>
|