@wix/ditto-codegen-public 1.0.52 → 1.0.53

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.
@@ -0,0 +1,84 @@
1
+ <ecom_cart_onCartCreated>
2
+ <purpose>Registers a callback function as an event handler. Triggered when a cart is created. This method registers a callback function as an event handler. When developing websites or building apps with Blocks, use a Velo backend event instead of this method. The way you call this method differs depending on the framework you are working in: When using the CLI, run the generate command to add an event extension, and then call this method within the extension code. When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server.</purpose>
3
+ <use_cases>
4
+ - Initialize cart tracking and analytics when a new cart is created
5
+ - Send welcome messages or onboarding communications to new cart owners
6
+ - Trigger automated workflows when a cart is first created
7
+ - Sync cart creation events with external systems or databases
8
+ - Apply initial cart settings or default configurations
9
+ - Send notifications when new shopping sessions begin
10
+ - Log new cart creation events for analytics and monitoring
11
+ - Initialize cart-specific features or personalization
12
+ </use_cases>
13
+
14
+ <method_declaration>
15
+ cart.onCartCreated(handler)
16
+ </method_declaration>
17
+ <required_parameters>
18
+ - handler: function - handler(event: CartCreatedEnvelope): void | Promise<void>
19
+ </required_parameters>
20
+ <optional_parameters>
21
+ None
22
+ </optional_parameters>
23
+ <import>import { cart } from '@wix/ecom'</import>
24
+ <types>
25
+ **CartCreatedEnvelope**
26
+ Properties:
27
+ - event: CartCreatedEnvelope - The cart update event envelope
28
+
29
+ **CartCreatedEnvelope**
30
+ Properties:
31
+ - entity: Cart - The updated cart entity
32
+ - metadata: EventMetadata - Event metadata
33
+
34
+ **Cart**
35
+ Properties:
36
+ - buyerInfo: BuyerInfo - Buyer information.
37
+
38
+ **BuyerInfo**
39
+ - contactId: string - Contact ID. For more information, see the Contacts API.
40
+ - email: string - Buyer email address.
41
+ - one of (id):
42
+ * visitorId: string - Visitor ID (format: GUID). If the buyer is not a site member.
43
+ * memberId: string - Member ID (format: GUID). If the buyer is a site member.
44
+ * userId: string - User ID (format: GUID). If the buyer, or cart owner, is a Wix user.
45
+ </types>
46
+ <important_notes>
47
+ - This method registers a callback function as an event handler
48
+ - When developing websites or building apps with Blocks, use a Velo backend event instead of this method
49
+ - The way you call this method differs depending on the framework you are working in:
50
+ - When using the CLI, run the generate command to add an event extension, and then call this method within the extension code
51
+ - When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server
52
+ - The handler function can be either synchronous (void) or asynchronous (Promise<void>)
53
+ - Triggered when a cart is created
54
+ - Required Permission: Read Orders
55
+ </important_notes>
56
+
57
+ <event_triggers>
58
+ - Cart Created: Triggered automatically when a new cart is successfully created
59
+ </event_triggers>
60
+ <example_usage>
61
+ ```typescript
62
+ import { cart } from '@wix/ecom';
63
+
64
+ // Register event handler for cart creation
65
+ cart.onCartCreated((event) => {
66
+ console.log('Cart created:', event);
67
+ });
68
+
69
+ // Async handler example
70
+ cart.onCartCreated(async (event) => {
71
+ await trackNewCart(event);
72
+ });
73
+ ```
74
+ </example_usage>
75
+ <related_methods>
76
+ - cart.onCartUpdated() - Event handler for cart updates
77
+ - cart.onCartDeleted() - Event handler for cart deletion
78
+ - cart.getCurrentCart() - Retrieve the current cart
79
+ - cart.createCurrentCart() - Create a new cart
80
+ - cart.updateCurrentCart() - Update cart properties
81
+ - cart.addToCurrentCart() - Add items to cart
82
+ - cart.removeLineItemsFromCurrentCart() - Remove items from cart
83
+ </related_methods>
84
+ </ecom_cart_onCartCreated>
@@ -0,0 +1,84 @@
1
+ <ecom_cart_onCartUpdated>
2
+ <purpose>Registers a callback function as an event handler. Triggered when a cart is updated. This method registers a callback function as an event handler. When developing websites or building apps with Blocks, use a Velo backend event instead of this method. The way you call this method differs depending on the framework you are working in: When using the CLI, run the generate command to add an event extension, and then call this method within the extension code. When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server.</purpose>
3
+ <use_cases>
4
+ - Track cart changes for analytics and monitoring
5
+ - Update inventory systems when cart contents change
6
+ - Apply dynamic pricing or discounts based on cart updates
7
+ - Sync cart data with external systems or databases
8
+ - Trigger automated workflows when cart items change
9
+ - Send notifications or alerts for specific cart updates
10
+ - Log cart modifications for compliance and auditing
11
+ - Update product recommendations based on cart changes
12
+ </use_cases>
13
+
14
+ <method_declaration>
15
+ cart.onCartUpdated(handler)
16
+ </method_declaration>
17
+ <required_parameters>
18
+ - handler: function - handler(event: CartUpdatedEnvelope): void | Promise<void>
19
+ </required_parameters>
20
+ <optional_parameters>
21
+ None
22
+ </optional_parameters>
23
+ <import>import { cart } from '@wix/ecom'</import>
24
+ <types>
25
+ **CartUpdatedEnvelope**
26
+ Properties:
27
+ - event: CartUpdatedEnvelope - The cart update event envelope
28
+
29
+ **CartUpdatedEnvelope**
30
+ Properties:
31
+ - entity: Cart - The updated cart entity
32
+ - metadata: EventMetadata - Event metadata
33
+
34
+ **Cart**
35
+ Properties:
36
+ - buyerInfo: BuyerInfo - Buyer information.
37
+
38
+ **BuyerInfo**
39
+ - contactId: string - Contact ID. For more information, see the Contacts API.
40
+ - email: string - Buyer email address.
41
+ - one of (id):
42
+ * visitorId: string - Visitor ID (format: GUID). If the buyer is not a site member.
43
+ * memberId: string - Member ID (format: GUID). If the buyer is a site member.
44
+ * userId: string - User ID (format: GUID). If the buyer, or cart owner, is a Wix user.
45
+ </types>
46
+ <important_notes>
47
+ - This method registers a callback function as an event handler
48
+ - When developing websites or building apps with Blocks, use a Velo backend event instead of this method
49
+ - The way you call this method differs depending on the framework you are working in:
50
+ - When using the CLI, run the generate command to add an event extension, and then call this method within the extension code
51
+ - When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server
52
+ - The handler function can be either synchronous (void) or asynchronous (Promise<void>)
53
+ - Triggered when a cart is updated
54
+ - Required Permission: Read Orders
55
+ </important_notes>
56
+
57
+ <event_triggers>
58
+ - Cart Updated: Triggered automatically when a cart's contents, quantities, or properties are modified
59
+ </event_triggers>
60
+ <example_usage>
61
+ ```typescript
62
+ import { cart } from '@wix/ecom';
63
+
64
+ // Register event handler for cart updates
65
+ cart.onCartUpdated((event) => {
66
+ console.log('Cart updated:', event);
67
+ });
68
+
69
+ // Async handler example
70
+ cart.onCartUpdated(async (event) => {
71
+ await trackCartChanges(event);
72
+ });
73
+ ```
74
+ </example_usage>
75
+ <related_methods>
76
+ - cart.onCartCreated() - Event handler for cart creation
77
+ - cart.onCartDeleted() - Event handler for cart deletion
78
+ - cart.getCurrentCart() - Retrieve the current cart
79
+ - cart.updateCurrentCart() - Update cart properties
80
+ - cart.addToCurrentCart() - Add items to cart
81
+ - cart.removeLineItemsFromCurrentCart() - Remove items from cart
82
+ - cart.updateCurrentCartLineItemQuantity() - Update line item quantities
83
+ </related_methods>
84
+ </ecom_cart_onCartUpdated>
package/dist/out.js CHANGED
@@ -124972,7 +124972,9 @@ var require_apiDocLoader = __commonJS({
124972
124972
  "stores.productsV3.updateProduct": "stores-productsV3-updateProduct-doc.txt",
124973
124973
  "stores.products.onProductCreated": "stores-productV3-onProductCreated-doc.txt",
124974
124974
  "data.items.onDataItemCreated": "data-items-onDataItemCreated.txt",
124975
- "crm.contacts.onContactCreated": "crm-contacts-onContactCreated-doc.txt"
124975
+ "crm.contacts.onContactCreated": "crm-contacts-onContactCreated-doc.txt",
124976
+ "ecom.cart.onCartCreated": "ecom-cart-onCartCreated-doc.txt",
124977
+ "ecom.cart.onCartUpdated": "ecom-cart-onCartUpdated-doc.txt"
124976
124978
  };
124977
124979
  function loadApiDocumentation(apiNames) {
124978
124980
  return (0, docLoader_1.loadDocumentation)(apiNames, API_TO_DOC_MAPPING, docLoader_1.DocType.API);
@@ -131287,7 +131289,9 @@ var require_extensionGenerators = __commonJS({
131287
131289
  ExtensionFactory.apiToSlug = {
131288
131290
  "stores.productsV3.onProductCreated": "wix.stores.catalog.v3.product_created",
131289
131291
  "crm.contacts.onContactCreated": "wix.contacts.v4.contact_created",
131290
- "data.items.onDataItemCreated": "wix.data.v2.data_item_created"
131292
+ "data.items.onDataItemCreated": "wix.data.v2.data_item_created",
131293
+ "ecom.cart.onCartCreated": "wix.ecom.v1.cart_created",
131294
+ "ecom.cart.onCartUpdated": "wix.ecom.v1.cart_updated"
131291
131295
  };
131292
131296
  function getScaffoldPath(scaffoldDir, file) {
131293
131297
  return "./" + path_1.default.join(scaffoldDir, file).replace(/^src\//, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.25.9"
26
26
  },
27
- "falconPackageHash": "bf6de5e13a14f7029750e395ec346c195270563482615efe9243447e"
27
+ "falconPackageHash": "d94dc48f341bb651a364e400fa9d529847f793aea1b16f60c544f13d"
28
28
  }