@wix/ditto-codegen-public 1.0.50 → 1.0.52
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 +431 -92
- package/package.json +2 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-custom-app",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"astro": "astro",
|
|
7
|
+
"dev": "wix dev",
|
|
8
|
+
"build": "wix build",
|
|
9
|
+
"wix": "wix",
|
|
10
|
+
"preview": "wix preview",
|
|
11
|
+
"release": "wix release",
|
|
12
|
+
"generate": "wix generate",
|
|
13
|
+
"env": "wix env"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@wix/astro": "0.0.4-experimental-react-component",
|
|
17
|
+
"@wix/crm": "^1.0.1071",
|
|
18
|
+
"@wix/dashboard": "^1.3.36",
|
|
19
|
+
"@wix/data": "^1.0.290",
|
|
20
|
+
"@wix/design-system": "^1.111.0",
|
|
21
|
+
"@wix/ecom": "^1.0.1354",
|
|
22
|
+
"@wix/essentials": "^0.1.23",
|
|
23
|
+
"@wix/sdk": "^1.15.23",
|
|
24
|
+
"@wix/stores": "^1.0.533",
|
|
25
|
+
"astro": "^5.8.0",
|
|
26
|
+
"typescript": "^5.8.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@astrojs/cloudflare": "^12.5.3",
|
|
30
|
+
"@astrojs/react": "^4.3.0",
|
|
31
|
+
"@types/react": "^18.3.1",
|
|
32
|
+
"@types/react-dom": "^18.3.1",
|
|
33
|
+
"@wix/cli": "^1.1.92",
|
|
34
|
+
"react": "18.3.1",
|
|
35
|
+
"react-dom": "18.3.1"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/examples-apps/contact-created-logger/src/backend/events/contact-created-logger/event.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
This file contains:
|
|
3
|
+
|
|
4
|
+
- The relevant import statement for the event.
|
|
5
|
+
- An event function where you can implement your custom logic. Wix calls this function when the given event occurs, passing the event object and its metadata.
|
|
6
|
+
|
|
7
|
+
This file implements a Contact Creation Logger that logs whenever a new contact is created in the Wix CRM.
|
|
8
|
+
To run this example please add the relevant permission (https://wix.to/APN0tpK) and install the `@wix/crm` dependency
|
|
9
|
+
SDK modules and their available events are documented here: https://dev.wix.com/docs/sdk
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { contacts } from '@wix/crm';
|
|
13
|
+
|
|
14
|
+
contacts.onContactCreated(async (event) => {
|
|
15
|
+
try {
|
|
16
|
+
console.log('🎉 New contact created event received!');
|
|
17
|
+
|
|
18
|
+
// Log the entire event for debugging purposes
|
|
19
|
+
console.log('Event data:', JSON.stringify(event, null, 2));
|
|
20
|
+
|
|
21
|
+
// Access contact information from the event
|
|
22
|
+
const contactData = event.entity;
|
|
23
|
+
const eventMetadata = event.metadata;
|
|
24
|
+
|
|
25
|
+
if (contactData) {
|
|
26
|
+
console.log(`📝 Contact Creation Details:`);
|
|
27
|
+
console.log(`- Contact ID: ${contactData._id || 'N/A'}`);
|
|
28
|
+
console.log(`- Email: ${contactData.info?.emails?.items?.[0]?.email || 'N/A'}`);
|
|
29
|
+
console.log(`- First Name: ${contactData.info?.name?.first || 'N/A'}`);
|
|
30
|
+
console.log(`- Last Name: ${contactData.info?.name?.last || 'N/A'}`);
|
|
31
|
+
console.log(`- Phone: ${contactData.info?.phones?.items?.[0]?.phone || 'N/A'}`);
|
|
32
|
+
console.log(`- Created Date: ${contactData._createdDate || 'N/A'}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (eventMetadata) {
|
|
36
|
+
console.log(`📊 Event Metadata:`);
|
|
37
|
+
console.log(`- Event ID: ${eventMetadata.entityId || 'N/A'}`);
|
|
38
|
+
console.log(`- Event Time: ${eventMetadata.eventTime || 'N/A'}`);
|
|
39
|
+
console.log(`- Triggered By: ${eventMetadata.triggeredByAnonymizeRequest ? 'Anonymize Request' : 'Normal Creation'}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('✅ Contact creation logging completed successfully');
|
|
43
|
+
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('❌ Error processing contact creation event:', error);
|
|
46
|
+
console.error('Error details:', {
|
|
47
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
48
|
+
stack: error instanceof Error ? error.stack : undefined
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|