@wix/agent-skills 1.0.0
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/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Dashboard Plugin Slots Reference
|
|
2
|
+
|
|
3
|
+
Slots are UI placeholders on dashboard pages of Wix first-party business apps. Each slot has a unique ID used in the `extends` field of a dashboard plugin.
|
|
4
|
+
|
|
5
|
+
**Key behaviors:**
|
|
6
|
+
- Some slots with the same ID appear on different pages. A plugin targeting such a slot is displayed on all pages containing it.
|
|
7
|
+
- Slots can host multiple plugins. Ordering varies by slot (see each entry).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Wix Blog
|
|
12
|
+
|
|
13
|
+
### Overview Page
|
|
14
|
+
|
|
15
|
+
**Slot ID:** `65fae040-bbeb-4c62-ba14-e0ecb5e08661`
|
|
16
|
+
|
|
17
|
+
- **Dashboard path:** Blog > Overview
|
|
18
|
+
- **Location:** Top of page
|
|
19
|
+
- **Parameters:** None
|
|
20
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
21
|
+
- **Use case:** Display blog analytics or quick-access management tools on the overview page.
|
|
22
|
+
|
|
23
|
+
### Categories Page
|
|
24
|
+
|
|
25
|
+
**Slot ID:** `0a208a9f-3b45-449c-ba8e-13a842ea5b84`
|
|
26
|
+
|
|
27
|
+
- **Dashboard path:** Blog > Categories
|
|
28
|
+
- **Location:** Top of page
|
|
29
|
+
- **Parameters:** None
|
|
30
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
31
|
+
- **Use case:** Display category analytics or bulk category management tools.
|
|
32
|
+
|
|
33
|
+
### Posts Page
|
|
34
|
+
|
|
35
|
+
**Slot ID:** `46035d51-2ea9-4128-a216-1dba68664ffe`
|
|
36
|
+
|
|
37
|
+
- **Dashboard path:** Blog > Posts
|
|
38
|
+
- **Location:** Top of page
|
|
39
|
+
- **Parameters:** None
|
|
40
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
41
|
+
- **Use case:** Display post analytics or quick-access post management tools.
|
|
42
|
+
|
|
43
|
+
### Tags Page
|
|
44
|
+
|
|
45
|
+
**Slot ID:** `0e336381-34a3-4f12-86f7-f98ab928f950`
|
|
46
|
+
|
|
47
|
+
- **Dashboard path:** Blog > Tags
|
|
48
|
+
- **Location:** Top of page
|
|
49
|
+
- **Parameters:** None
|
|
50
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
51
|
+
- **Use case:** Display tag analytics or bulk tag management tools.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Wix Bookings
|
|
56
|
+
|
|
57
|
+
### Staff Page
|
|
58
|
+
|
|
59
|
+
**Slot ID:** `261e84a2-31d0-4258-a035-10544d251108`
|
|
60
|
+
|
|
61
|
+
- **Dashboard path:** Settings > Booking Settings > Staff
|
|
62
|
+
- **Location:** Top of page
|
|
63
|
+
- **Parameters:**
|
|
64
|
+
| Name | Type | Description |
|
|
65
|
+
|------|------|-------------|
|
|
66
|
+
| `staffResourceId` | String | Staff resource ID |
|
|
67
|
+
| `scheduleId` | String | Schedule ID |
|
|
68
|
+
| `timezone` | String | Time zone |
|
|
69
|
+
- **Multi-plugin:** Vertical, newest at top
|
|
70
|
+
- **Use case:** Display staff availability analytics or performance metrics.
|
|
71
|
+
|
|
72
|
+
### Edit Staff Profile Page
|
|
73
|
+
|
|
74
|
+
**Slot ID:** `049fb0fe-cc4a-4e33-b0a9-d8cda8e7a79f`
|
|
75
|
+
|
|
76
|
+
- **Dashboard path:** Settings > Booking Settings > Staff > Edit or Add staff member
|
|
77
|
+
- **Location:** Top of page
|
|
78
|
+
- **Parameters:**
|
|
79
|
+
| Name | Type | Description |
|
|
80
|
+
|------|------|-------------|
|
|
81
|
+
| `staffId` | String | Staff member ID |
|
|
82
|
+
| `staffResourceId` | String | Staff resource ID |
|
|
83
|
+
- **Multi-plugin:** Vertical, newest at top
|
|
84
|
+
- **Use case:** Extend the staff profile editing experience with custom functionality.
|
|
85
|
+
|
|
86
|
+
### Services Page
|
|
87
|
+
|
|
88
|
+
**Slot ID:** `78cc4a47-8f47-489b-acc2-fd9e4208c8bd`
|
|
89
|
+
|
|
90
|
+
- **Dashboard path:** Booking Calendar > Services
|
|
91
|
+
- **Location:** Between "Business setup recommendations" and "Service list"
|
|
92
|
+
- **Parameters:** None
|
|
93
|
+
- **Multi-plugin:** Horizontal, newest furthest left
|
|
94
|
+
- **Use case:** Display service analytics or integrate third-party booking tools.
|
|
95
|
+
|
|
96
|
+
### Calendar Page — Pre-Collect Payment Modal
|
|
97
|
+
|
|
98
|
+
**Slot ID:** `b92f0e25-535f-4bef-b130-8e5abc85b2fe`
|
|
99
|
+
|
|
100
|
+
- **Dashboard path:** Booking Calendar > Calendar
|
|
101
|
+
- **Location:** Custom modal displayed before the default Collect Payment modal
|
|
102
|
+
- **Parameters:**
|
|
103
|
+
| Name | Type | Description |
|
|
104
|
+
|------|------|-------------|
|
|
105
|
+
| `orderId` | String | Order ID |
|
|
106
|
+
| `onSuccess()` | `() => Promise<void>` | Progresses to the next modal after successful order update |
|
|
107
|
+
| `onCancel()` | `() => void` | Progresses to the next modal without changes |
|
|
108
|
+
| `menuOption` | Object | Data for the selected menu item |
|
|
109
|
+
| `menuOption.key` | String | `CHARGE_WITH_CREDIT_CARD`, `RECORD_ORDER_MANUAL_PAYMENT`, `CHARGE_WITH_INVOICE`, or `EXTENSION` |
|
|
110
|
+
| `menuOption.componentId` | String | Component ID when `EXTENSION` key is triggered |
|
|
111
|
+
- **Multi-plugin:** Sequential modals, each appearing before the default modal
|
|
112
|
+
- **Use case:** Add items to an order such as additional services, notes, or booking fees like insurance.
|
|
113
|
+
|
|
114
|
+
> **Note:** This slot also appears on the Wix eCommerce Order Page.
|
|
115
|
+
|
|
116
|
+
### Booking List Page
|
|
117
|
+
|
|
118
|
+
**Slot ID:** `0f756363-1659-4929-b4ef-5ff2c458eb7d`
|
|
119
|
+
|
|
120
|
+
- **Dashboard path:** Booking Calendar > Booking List
|
|
121
|
+
- **Location:** Top of page
|
|
122
|
+
- **Parameters:** None
|
|
123
|
+
- **Multi-plugin:** Horizontal, newest furthest left
|
|
124
|
+
- **Use case:** Add custom widgets or tools at the top of the booking list.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Wix eCommerce
|
|
129
|
+
|
|
130
|
+
### Order Page
|
|
131
|
+
|
|
132
|
+
**Slot ID:** `cb16162e-42aa-41bd-a644-dc570328c6cc`
|
|
133
|
+
|
|
134
|
+
- **Dashboard path:** Sales > Orders > Order
|
|
135
|
+
- **Location:** Right side of page, under the "Order info" (customer details) card
|
|
136
|
+
- **Parameters:**
|
|
137
|
+
| Name | Type | Description |
|
|
138
|
+
|------|------|-------------|
|
|
139
|
+
| `orderId` | String | Order ID |
|
|
140
|
+
| `onOrderUpdate()` | `() => Promise<void>` | Callback that notifies the host page about an order update, prompting a UI refresh |
|
|
141
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
142
|
+
- **Use case:** Display a map with the delivery courier's location for the order.
|
|
143
|
+
|
|
144
|
+
### Order Page — Pre-Collect Payment Modal
|
|
145
|
+
|
|
146
|
+
**Slot ID:** `b92f0e25-535f-4bef-b130-8e5abc85b2fe`
|
|
147
|
+
|
|
148
|
+
- **Dashboard path:** Sales > Orders > Order > Collect Payment
|
|
149
|
+
- **Location:** Custom modal displayed before the default Collect Payment modal
|
|
150
|
+
- **Parameters:**
|
|
151
|
+
| Name | Type | Description |
|
|
152
|
+
|------|------|-------------|
|
|
153
|
+
| `orderId` | String | Order ID |
|
|
154
|
+
| `onSuccess()` | `() => Promise<void>` | Progresses to the next modal after successful order update |
|
|
155
|
+
| `onCancel()` | `() => void` | Progresses to the next modal without changes |
|
|
156
|
+
| `menuOption` | Object | Data for the selected menu item |
|
|
157
|
+
| `menuOption.key` | String | `CHARGE_WITH_CREDIT_CARD`, `RECORD_ORDER_MANUAL_PAYMENT`, `CHARGE_WITH_INVOICE`, or `EXTENSION` |
|
|
158
|
+
| `menuOption.componentId` | String | Component ID when `EXTENSION` key is triggered |
|
|
159
|
+
- **Multi-plugin:** Sequential modals, each appearing before the default modal
|
|
160
|
+
- **Use case:** Add items to an order such as additional items, notes, or extra fees.
|
|
161
|
+
|
|
162
|
+
> **Note:** This slot also appears on the Wix Bookings Calendar Page.
|
|
163
|
+
|
|
164
|
+
### Edit Order Page — Additional Fees
|
|
165
|
+
|
|
166
|
+
**Slot ID:** `057f1726-f0b3-40ef-8903-1bd104e18369`
|
|
167
|
+
|
|
168
|
+
- **Dashboard path:** Sales > Orders > Order > More Actions > Edit Order
|
|
169
|
+
- **Location:** Right side of page, in the "Order summary" card
|
|
170
|
+
- **Parameters:**
|
|
171
|
+
| Name | Type | Description |
|
|
172
|
+
|------|------|-------------|
|
|
173
|
+
| `draftOrderId` | String | ID of the order being edited |
|
|
174
|
+
| `onDraftOrderUpdate()` | `() => Promise<void>` | Callback that notifies the host page about a draft order update, prompting a UI refresh |
|
|
175
|
+
- **Multi-plugin:** Vertical, newest at bottom
|
|
176
|
+
- **Use case:** Manage custom fees for orders — add or remove order fees according to custom business logic.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Wix Events
|
|
181
|
+
|
|
182
|
+
### Event Page — Overview Tab
|
|
183
|
+
|
|
184
|
+
**Slot ID:** `d2c6965a-7d50-47a0-881a-beb184135df3`
|
|
185
|
+
|
|
186
|
+
- **Dashboard path:** Events > Published or Drafts > Event > Overview tab
|
|
187
|
+
- **Location:** Bottom of page
|
|
188
|
+
- **Parameters:**
|
|
189
|
+
| Name | Type | Description |
|
|
190
|
+
|------|------|-------------|
|
|
191
|
+
| `eventId` | String | Event ID |
|
|
192
|
+
- **Multi-plugin:** Vertical at bottom, newest at top
|
|
193
|
+
- **Use case:** Display earnings for each ticket type so the site owner can easily compare them.
|
|
194
|
+
|
|
195
|
+
### Event Page — Features Tab
|
|
196
|
+
|
|
197
|
+
**Slot ID:** `5566727b-e5a2-4a43-a26d-961aa4fe0898`
|
|
198
|
+
|
|
199
|
+
- **Dashboard path:** Events > Published or Drafts > Event > Features tab
|
|
200
|
+
- **Location:** Features grid (displayed as cards)
|
|
201
|
+
- **Parameters:**
|
|
202
|
+
| Name | Type | Description |
|
|
203
|
+
|------|------|-------------|
|
|
204
|
+
| `eventId` | String | Event ID |
|
|
205
|
+
- **Multi-plugin:** Cards next to each other in the features grid, newest at top
|
|
206
|
+
- **Use case:** Add an FAQ section to the event details.
|
|
207
|
+
|
|
208
|
+
### Event Page — Promotion Tab
|
|
209
|
+
|
|
210
|
+
**Slot ID:** `bc3b9b99-7a3a-4fb5-946f-078022277b6b`
|
|
211
|
+
|
|
212
|
+
- **Dashboard path:** Events > Published or Drafts > Event > Promotion tab
|
|
213
|
+
- **Location:** Bottom of page
|
|
214
|
+
- **Parameters:**
|
|
215
|
+
| Name | Type | Description |
|
|
216
|
+
|------|------|-------------|
|
|
217
|
+
| `eventId` | String | Event ID |
|
|
218
|
+
- **Multi-plugin:** Vertical at bottom, newest at top
|
|
219
|
+
- **Use case:** Send promotional emails to customers with abandoned checkouts.
|
|
220
|
+
|
|
221
|
+
### Event Page — Settings Tab
|
|
222
|
+
|
|
223
|
+
**Slot ID:** `c478b36b-7ce2-4564-afba-c2b0ca14bdea`
|
|
224
|
+
|
|
225
|
+
- **Dashboard path:** Events > Published or Drafts > Event > Settings tab
|
|
226
|
+
- **Location:** Bottom of page
|
|
227
|
+
- **Parameters:**
|
|
228
|
+
| Name | Type | Description |
|
|
229
|
+
|------|------|-------------|
|
|
230
|
+
| `eventId` | String | Event ID |
|
|
231
|
+
- **Multi-plugin:** Vertical at bottom, newest at top
|
|
232
|
+
- **Use case:** Set up event reminder emails to customers.
|
|
233
|
+
|
|
234
|
+
### Event Page — Tickets and Seating Tab
|
|
235
|
+
|
|
236
|
+
**Slot ID:** `80b95e22-26db-4063-a31f-76d4bb8797ba`
|
|
237
|
+
|
|
238
|
+
- **Dashboard path:** Events > Published or Drafts > Event > Tickets and Seating tab
|
|
239
|
+
- **Location:** Right side of page, below "Settings and discounts"
|
|
240
|
+
- **Parameters:**
|
|
241
|
+
| Name | Type | Description |
|
|
242
|
+
|------|------|-------------|
|
|
243
|
+
| `eventId` | String | Event ID |
|
|
244
|
+
- **Multi-plugin:** Vertical, newest at top
|
|
245
|
+
- **Use case:** Add a ticket sales scheduler to review current ticket sale status and set up start/end dates for all ticket sales.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Wix Stores
|
|
250
|
+
|
|
251
|
+
### Products Page
|
|
252
|
+
|
|
253
|
+
**Slot ID:** `3ca518a6-8ae7-45aa-8cb9-afb3da945081`
|
|
254
|
+
|
|
255
|
+
- **Dashboard path:** Catalog > Store Products > Products
|
|
256
|
+
- **Location:** Top of page
|
|
257
|
+
- **Parameters:** None
|
|
258
|
+
- **Multi-plugin:** Horizontal, newest furthest right
|
|
259
|
+
- **Use case:** Add custom panels for external service integration or custom analytics tools.
|
|
260
|
+
|
|
261
|
+
### Inventory Page
|
|
262
|
+
|
|
263
|
+
**Slot ID:** `c9b19070-3e25-4f3d-9d27-4e0f74164835`
|
|
264
|
+
|
|
265
|
+
- **Dashboard path:** Catalog > Store Products > Inventory
|
|
266
|
+
- **Location:** Above inventory list
|
|
267
|
+
- **Parameters:** None
|
|
268
|
+
- **Multi-plugin:** Horizontal, newest furthest left
|
|
269
|
+
- **Use case:** Sum the total number of available items in each product category.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Wix Restaurants
|
|
274
|
+
|
|
275
|
+
### Table Reservations Page
|
|
276
|
+
|
|
277
|
+
**Slot ID:** `7f71aacd-0cbf-4b73-9ea5-482e073ea237`
|
|
278
|
+
|
|
279
|
+
- **Dashboard path:** Table Reservations
|
|
280
|
+
- **Location:** Top of page
|
|
281
|
+
- **Parameters:**
|
|
282
|
+
| Name | Type | Description |
|
|
283
|
+
|------|------|-------------|
|
|
284
|
+
| `currentReservationLocation` | Object | Object containing information about the reservation location |
|
|
285
|
+
| `reservations` | Array | Array of objects with information about each reservation |
|
|
286
|
+
| `requests` | Array | Array of objects with information about requested reservations |
|
|
287
|
+
- **Multi-plugin:** Horizontal, newest furthest right
|
|
288
|
+
- **Use case:** Display statistics for the currently selected reservation location.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Wix CRM
|
|
293
|
+
|
|
294
|
+
No dashboard plugin slots available. CRM only exposes dashboard menu plugin slots.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Wix Data SDK Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for working with Wix Data collections.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
**IMPORTANT**: The `@wix/data` package must be installed as a dependency before use.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @wix/data
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Troubleshooting
|
|
14
|
+
|
|
15
|
+
**If you encounter: `Cannot find module '@wix/data'`**
|
|
16
|
+
|
|
17
|
+
❌ **WRONG**: Do not create mock implementations or workarounds
|
|
18
|
+
✅ **CORRECT**: Install the package using `npm install @wix/data`
|
|
19
|
+
|
|
20
|
+
The `@wix/data` package is a real npm package that provides access to Wix Data collections.
|
|
21
|
+
It must be installed before TypeScript compilation will succeed.
|
|
22
|
+
|
|
23
|
+
## SDK Methods & Interfaces
|
|
24
|
+
|
|
25
|
+
| Method Call | Import | TypeScript Signature | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `items.get()` | `import { items } from '@wix/data'` | `(collectionId: string, itemId: string, options?: WixDataGetOptions) => Promise<WixDataItem \| null>` | Get a single item by ID |
|
|
28
|
+
| `items.query()` | `import { items } from '@wix/data'` | `(collectionId: string) => WixDataQuery` | Build a chainable query (call `.find()` to execute) |
|
|
29
|
+
| `items.insert()` | `import { items } from '@wix/data'` | `(collectionId: string, item: Partial<WixDataItem>, options?: WixDataInsertOptions) => Promise<WixDataItem>` | Add a new item to a collection |
|
|
30
|
+
| `items.update()` | `import { items } from '@wix/data'` | `(collectionId: string, item: WixDataItem, options?: WixDataUpdateOptions) => Promise<WixDataItem>` | Replace an existing item (item MUST include `_id`) |
|
|
31
|
+
| `items.save()` | `import { items } from '@wix/data'` | `(collectionId: string, item: Partial<WixDataItem>, options?: WixDataSaveOptions) => Promise<WixDataItem>` | Insert or update (upsert) based on `_id` |
|
|
32
|
+
| `items.remove()` | `import { items } from '@wix/data'` | `(collectionId: string, itemId: string, options?: WixDataRemoveOptions) => Promise<WixDataItem \| null>` | Remove an item by ID |
|
|
33
|
+
| `items.bulkInsert()` | `import { items } from '@wix/data'` | `(collectionId: string, items: Partial<WixDataItem>[], options?: WixDataOptions) => Promise<WixDataBulkResult>` | Insert multiple items (max 1000) |
|
|
34
|
+
| `items.bulkUpdate()` | `import { items } from '@wix/data'` | `(collectionId: string, items: WixDataItem[], options?: WixDataBulkUpdateOptions) => Promise<WixDataBulkResult>` | Update multiple items (max 1000) |
|
|
35
|
+
| `items.bulkRemove()` | `import { items } from '@wix/data'` | `(collectionId: string, itemIds: string[], options?: WixDataBulkRemoveOptions) => Promise<WixDataBulkResult>` | Remove multiple items (max 1000) |
|
|
36
|
+
| `items.filter()` | `import { items } from '@wix/data'` | `() => WixDataFilter` | Create a standalone filter (for use with `.or()`, `.and()`, `.not()`) |
|
|
37
|
+
|
|
38
|
+
## ⚠️ Common Wrong Method Names (DO NOT USE)
|
|
39
|
+
|
|
40
|
+
| ❌ WRONG (does not exist) | ✅ CORRECT |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `items.queryDataItems()` | `items.query("Collection").find()` |
|
|
43
|
+
| `items.insertDataItem()` | `items.insert("Collection", data)` |
|
|
44
|
+
| `items.updateDataItem()` | `items.update("Collection", data)` |
|
|
45
|
+
| `items.removeDataItem()` | `items.remove("Collection", id)` |
|
|
46
|
+
| `items.getDataItem()` | `items.get("Collection", itemId)` |
|
|
47
|
+
| `items.bulkInsertDataItems()` | `items.bulkInsert("Collection", items)` |
|
|
48
|
+
|
|
49
|
+
If you see any method with `DataItem` in the name, it is **wrong**.
|
|
50
|
+
|
|
51
|
+
## Full Type Definitions
|
|
52
|
+
|
|
53
|
+
### WixDataItem
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
interface WixDataItem {
|
|
57
|
+
_id: string;
|
|
58
|
+
_createdDate?: Date; // read-only, set by Wix on insert
|
|
59
|
+
_updatedDate?: Date; // read-only, set by Wix on insert/update
|
|
60
|
+
_owner?: string; // ID of the user who created the item
|
|
61
|
+
[key: string]: any; // custom fields from your collection schema
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### WixDataResult (returned by `query().find()`)
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
interface WixDataResult {
|
|
69
|
+
readonly items: WixDataItem[];
|
|
70
|
+
readonly totalCount: number | undefined; // only when returnTotalCount: true
|
|
71
|
+
readonly totalPages: number | undefined; // only when returnTotalCount: true
|
|
72
|
+
readonly pageSize: number | undefined;
|
|
73
|
+
readonly currentPage: number | undefined;
|
|
74
|
+
readonly length: number;
|
|
75
|
+
hasNext(): boolean;
|
|
76
|
+
hasPrev(): boolean;
|
|
77
|
+
next(): Promise<WixDataResult>;
|
|
78
|
+
prev(): Promise<WixDataResult>;
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### WixDataQuery (returned by `items.query()`)
|
|
83
|
+
|
|
84
|
+
Chainable query builder. Build filters, then call `.find()`, `.count()`, or `.distinct()`.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
interface WixDataQuery {
|
|
88
|
+
// --- Filters ---
|
|
89
|
+
eq(field: string, value: any): WixDataQuery;
|
|
90
|
+
ne(field: string, value: any): WixDataQuery;
|
|
91
|
+
gt(field: string, value: string | number | Date): WixDataQuery;
|
|
92
|
+
ge(field: string, value: string | number | Date): WixDataQuery;
|
|
93
|
+
lt(field: string, value: string | number | Date): WixDataQuery;
|
|
94
|
+
le(field: string, value: string | number | Date): WixDataQuery;
|
|
95
|
+
between(field: string, rangeStart: string | number | Date, rangeEnd: string | number | Date): WixDataQuery;
|
|
96
|
+
contains(field: string, value: string): WixDataQuery;
|
|
97
|
+
startsWith(field: string, value: string): WixDataQuery;
|
|
98
|
+
endsWith(field: string, value: string): WixDataQuery;
|
|
99
|
+
hasSome(field: string, values: string[] | number[] | Date[]): WixDataQuery;
|
|
100
|
+
hasAll(field: string, values: string[] | number[] | Date[]): WixDataQuery;
|
|
101
|
+
isEmpty(field: string): WixDataQuery;
|
|
102
|
+
isNotEmpty(field: string): WixDataQuery;
|
|
103
|
+
|
|
104
|
+
// --- Logical operators ---
|
|
105
|
+
or(filter: WixDataFilter): WixDataQuery;
|
|
106
|
+
and(filter: WixDataFilter): WixDataQuery;
|
|
107
|
+
not(filter: WixDataFilter): WixDataQuery;
|
|
108
|
+
|
|
109
|
+
// --- Sorting ---
|
|
110
|
+
ascending(...fields: string[]): WixDataQuery;
|
|
111
|
+
descending(...fields: string[]): WixDataQuery;
|
|
112
|
+
|
|
113
|
+
// --- Pagination ---
|
|
114
|
+
limit(limitNumber: number): WixDataQuery; // default 50, max 1000
|
|
115
|
+
skip(skipCount: number): WixDataQuery;
|
|
116
|
+
|
|
117
|
+
// --- Projection ---
|
|
118
|
+
fields(...fields: string[]): WixDataQuery;
|
|
119
|
+
include(...fields: string[]): WixDataQuery; // include referenced items
|
|
120
|
+
|
|
121
|
+
// --- Execute ---
|
|
122
|
+
find(options?: WixDataQueryOptions): Promise<WixDataResult>;
|
|
123
|
+
count(options?: WixDataReadOptions): Promise<number>;
|
|
124
|
+
distinct(field: string, options?: WixDataQueryOptions): Promise<WixDataResult<any>>;
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Options Types
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
interface WixDataOptions {
|
|
132
|
+
suppressHooks?: boolean; // skip beforeX/afterX hooks
|
|
133
|
+
showDrafts?: boolean; // include draft items
|
|
134
|
+
appOptions?: Record<string, any>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface WixDataReadOptions extends WixDataOptions {
|
|
138
|
+
language?: string; // IETF BCP 47 language tag
|
|
139
|
+
consistentRead?: boolean; // read from primary DB (slower but up-to-date)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface WixDataQueryOptions extends WixDataReadOptions {
|
|
143
|
+
returnTotalCount?: boolean; // populate totalCount/totalPages in results
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface WixDataGetOptions extends WixDataReadOptions {
|
|
147
|
+
fields?: string[]; // fields to return
|
|
148
|
+
includeReferences?: { field: string; limit?: number }[];
|
|
149
|
+
includeFieldGroups?: string[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface WixDataInsertOptions extends WixDataOptions {}
|
|
153
|
+
|
|
154
|
+
interface WixDataUpdateOptions extends WixDataOptions {
|
|
155
|
+
condition?: WixDataFilter; // only update if condition is met
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface WixDataSaveOptions extends WixDataOptions {}
|
|
159
|
+
|
|
160
|
+
interface WixDataRemoveOptions extends WixDataOptions {
|
|
161
|
+
condition?: WixDataFilter; // only remove if condition is met
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
interface WixDataBulkUpdateOptions extends WixDataOptions {
|
|
165
|
+
condition?: WixDataFilter;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface WixDataBulkRemoveOptions extends WixDataOptions {
|
|
169
|
+
condition?: WixDataFilter;
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### WixDataBulkResult (returned by bulk operations)
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
interface WixDataBulkResult {
|
|
177
|
+
inserted: number;
|
|
178
|
+
updated: number;
|
|
179
|
+
removed: number;
|
|
180
|
+
skipped: number;
|
|
181
|
+
errors: WixDataBulkError[];
|
|
182
|
+
insertedItemIds: string[];
|
|
183
|
+
updatedItemIds: string[];
|
|
184
|
+
removedItemIds: string[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface WixDataBulkError extends Error {
|
|
188
|
+
message: string;
|
|
189
|
+
code: string;
|
|
190
|
+
originalIndex: number; // index in the request array
|
|
191
|
+
item: WixDataItem | string; // the failed item or ID
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Usage Examples
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { items } from "@wix/data";
|
|
199
|
+
|
|
200
|
+
// --- Get by ID ---
|
|
201
|
+
const item = await items.get("MyCollection", "item-id-123");
|
|
202
|
+
// Returns WixDataItem | null
|
|
203
|
+
|
|
204
|
+
// --- Query with filters ---
|
|
205
|
+
const result = await items.query("MyCollection")
|
|
206
|
+
.eq("status", "active")
|
|
207
|
+
.gt("price", 10)
|
|
208
|
+
.ascending("name")
|
|
209
|
+
.limit(20)
|
|
210
|
+
.find();
|
|
211
|
+
// result.items: WixDataItem[]
|
|
212
|
+
|
|
213
|
+
// --- Compound query with or/and ---
|
|
214
|
+
const filter1 = items.filter().eq("status", "pending");
|
|
215
|
+
const filter2 = items.filter().eq("status", "active");
|
|
216
|
+
const result = await items.query("MyCollection")
|
|
217
|
+
.or(filter1)
|
|
218
|
+
.or(filter2)
|
|
219
|
+
.find();
|
|
220
|
+
|
|
221
|
+
// --- Insert ---
|
|
222
|
+
const created = await items.insert("MyCollection", {
|
|
223
|
+
title: "New Item",
|
|
224
|
+
price: 29.99,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// --- Update (MUST include _id) ---
|
|
228
|
+
await items.update("MyCollection", {
|
|
229
|
+
_id: "item-id-123",
|
|
230
|
+
title: "Updated Title",
|
|
231
|
+
price: 39.99,
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// ❌ WRONG — three args
|
|
235
|
+
await items.update("MyCollection", "item-id", { title: "x" });
|
|
236
|
+
// ✅ CORRECT — _id inside data object
|
|
237
|
+
await items.update("MyCollection", { _id: "item-id", title: "x" });
|
|
238
|
+
|
|
239
|
+
// --- Remove ---
|
|
240
|
+
await items.remove("MyCollection", "item-id-123");
|
|
241
|
+
|
|
242
|
+
// --- Bulk Insert ---
|
|
243
|
+
const bulkResult = await items.bulkInsert("MyCollection", [
|
|
244
|
+
{ title: "Item 1" },
|
|
245
|
+
{ title: "Item 2" },
|
|
246
|
+
]);
|
|
247
|
+
// bulkResult.inserted: 2, bulkResult.insertedItemIds: [...]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Collection Schema Rules
|
|
251
|
+
|
|
252
|
+
- Always use the exact field keys defined in your collection schema
|
|
253
|
+
- Use the collection ID exactly as defined in the schema
|
|
254
|
+
- Use the schema's exact field types for all operations
|
|
255
|
+
- Custom fields are stored in the `[key: string]: any` part of `WixDataItem`
|
|
256
|
+
|
|
257
|
+
## Permissions
|
|
258
|
+
|
|
259
|
+
| Operation | Required Scope |
|
|
260
|
+
| --- | --- |
|
|
261
|
+
| `get`, `query`, `count`, `distinct` | `SCOPE.DC-DATA.READ` |
|
|
262
|
+
| `insert`, `update`, `save`, `remove`, `bulkInsert`, `bulkUpdate`, `bulkRemove` | `SCOPE.DC-DATA.WRITE` |
|
|
263
|
+
|
|
264
|
+
## Date/Time Handling
|
|
265
|
+
|
|
266
|
+
- **Date (date-only)**: Store as a string in "YYYY-MM-DD" format (as returned by `<input type="date" />`).
|
|
267
|
+
- **DateTime (date + time)**: Store as a Date object. Accept the YYYY-MM-DDTHH:mm format returned by `<input type="datetime-local" />` and convert to a Date object using `new Date()`.
|
|
268
|
+
- **Time (time-only)**: Store as a string in HH:mm or HH:mm:ss 24-hour format (as returned by `<input type="time" />`).
|
|
269
|
+
- Use native JavaScript Date methods for parsing, formatting, and manipulating dates/times (e.g., `new Date()`, `toISOString()`, `toLocaleString()`, `toLocaleDateString()`).
|
|
270
|
+
- Always validate incoming date/time values and provide graceful fallback or explicit error handling when values are invalid.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template for src/extensions/data/extensions.ts
|
|
3
|
+
*
|
|
4
|
+
* This file defines all CMS collections for your Wix CLI app.
|
|
5
|
+
* All collections are defined in a single file using extensions.genericExtension().
|
|
6
|
+
*
|
|
7
|
+
* Replace the example collection with your actual collections.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { extensions } from '@wix/astro/builders';
|
|
11
|
+
|
|
12
|
+
export const dataExtension = extensions.genericExtension({
|
|
13
|
+
// IMPORTANT: Replace with a freshly generated UUID v4 string
|
|
14
|
+
// Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
|
|
15
|
+
// Do NOT use randomUUID() - the UUID must be a static string
|
|
16
|
+
compId: '{{GENERATE_UUID}}',
|
|
17
|
+
|
|
18
|
+
// Always 'data-extension' for CMS collections
|
|
19
|
+
compName: 'data-extension',
|
|
20
|
+
|
|
21
|
+
// Always 'DATA_COMPONENT' for CMS collections
|
|
22
|
+
compType: 'DATA_COMPONENT',
|
|
23
|
+
|
|
24
|
+
compData: {
|
|
25
|
+
dataComponent: {
|
|
26
|
+
// Array of all collections
|
|
27
|
+
collections: [
|
|
28
|
+
{
|
|
29
|
+
// Legacy field - will be removed in future
|
|
30
|
+
schemaUrl: 'https://www.wix.com/',
|
|
31
|
+
|
|
32
|
+
// Collection identifier (lower-kebab-case or lower_underscore)
|
|
33
|
+
// This will be scoped with app namespace automatically
|
|
34
|
+
idSuffix: 'example-collection',
|
|
35
|
+
|
|
36
|
+
// Human-readable name shown in CMS
|
|
37
|
+
displayName: 'Example Collection',
|
|
38
|
+
|
|
39
|
+
// Field used for display (optional)
|
|
40
|
+
displayField: 'title',
|
|
41
|
+
|
|
42
|
+
// Array of field definitions
|
|
43
|
+
fields: [
|
|
44
|
+
{
|
|
45
|
+
// Field identifier (lowerCamelCase, ASCII only)
|
|
46
|
+
key: 'title',
|
|
47
|
+
|
|
48
|
+
// Human-readable label
|
|
49
|
+
displayName: 'Title',
|
|
50
|
+
|
|
51
|
+
// Field type - see SKILL.md Field Types section for all types
|
|
52
|
+
type: 'TEXT',
|
|
53
|
+
|
|
54
|
+
// Optional: Help text
|
|
55
|
+
description: 'The title of the item'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: 'amount',
|
|
59
|
+
displayName: 'Amount',
|
|
60
|
+
type: 'NUMBER'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'isActive',
|
|
64
|
+
displayName: 'Is Active',
|
|
65
|
+
type: 'BOOLEAN'
|
|
66
|
+
}
|
|
67
|
+
// Add more fields as needed
|
|
68
|
+
],
|
|
69
|
+
|
|
70
|
+
// Permission configuration
|
|
71
|
+
// See SKILL.md Permissions section for all access levels
|
|
72
|
+
dataPermissions: {
|
|
73
|
+
// Who can read items
|
|
74
|
+
itemRead: 'ANYONE',
|
|
75
|
+
|
|
76
|
+
// Who can create items
|
|
77
|
+
itemInsert: 'PRIVILEGED',
|
|
78
|
+
|
|
79
|
+
// Who can update items
|
|
80
|
+
itemUpdate: 'PRIVILEGED',
|
|
81
|
+
|
|
82
|
+
// Who can delete items
|
|
83
|
+
itemRemove: 'PRIVILEGED'
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// Optional: Initial seed data
|
|
87
|
+
// Only include if blueprint mentions example data
|
|
88
|
+
initialData: [
|
|
89
|
+
{
|
|
90
|
+
// Must match field keys exactly (lowerCamelCase)
|
|
91
|
+
title: 'Example Item 1',
|
|
92
|
+
amount: 10,
|
|
93
|
+
isActive: true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: 'Example Item 2',
|
|
97
|
+
amount: 20,
|
|
98
|
+
isActive: false
|
|
99
|
+
}
|
|
100
|
+
// Add more initial items as needed
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
// Add more collections as needed
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|