@wix/ditto-codegen-public 1.0.142 → 1.0.143

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.
Files changed (2) hide show
  1. package/dist/out.js +47 -21
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -114863,14 +114863,6 @@ var require_data = __commonJS({
114863
114863
  displayName: "Handling Fees Rules",
114864
114864
  displayField: "productId",
114865
114865
  fields: [
114866
- {
114867
- key: "productId",
114868
- displayName: "Product",
114869
- type: "REFERENCE",
114870
- referenceOptions: {
114871
- referencedCollectionId: "Stores/Products"
114872
- }
114873
- },
114874
114866
  { key: "oversizedFee", displayName: "Oversized Fee", type: "NUMBER" },
114875
114867
  { key: "fragileFee", displayName: "Fragile Fee", type: "NUMBER" }
114876
114868
  ],
@@ -114893,12 +114885,10 @@ Your output must be strictly JSON that conforms to the provided schema (no markd
114893
114885
 
114894
114886
  <constraints>
114895
114887
  - Field definitions must use supported FieldType enums exactly as strings: TEXT, NUMBER, DATE, DATETIME, IMAGE, BOOLEAN, DOCUMENT, URL, RICH_TEXT, VIDEO, ANY, ARRAY_STRING, ARRAY_DOCUMENT, AUDIO, TIME, LANGUAGE, RICH_CONTENT, MEDIA_GALLERY, ADDRESS, PAGE_LINK, REFERENCE, MULTI_REFERENCE, OBJECT, ARRAY.
114896
- - ALWAYS use REFERENCE fields when creating relationships between different CMS collections. ALL related fields must use REFERENCE type.
114897
- - ALWAYS use REFERENCE fields when the blueprint indicates relationships to Stores entities (products, categories, orders). Use TEXT fields for all other relationships.
114898
- - MANDATORY REFERENCE scenarios (you MUST use REFERENCE type):
114899
- - productId, product \u2192 REFERENCE to "Stores/Products"
114900
- - categoryId, category \u2192 REFERENCE to "Stores/Collections"
114901
- - orderId, order \u2192 REFERENCE to "Stores/Orders"
114888
+ - REFERENCE and MULTI_REFERENCE fields:
114889
+ * ONLY use REFERENCE/MULTI_REFERENCE fields when linking between custom CMS collections defined within this app
114890
+ * The "referencedCollectionId" MUST be the "idSuffix" of another collection you are creating in the same plan
114891
+ * NEVER use REFERENCE fields to link to Wix business entities (Products, Orders, Contacts, Members, etc.)
114902
114892
  - Permissions must use AccessLevel enums exactly as strings: UNDEFINED, ANYONE, SITE_MEMBER, SITE_MEMBER_AUTHOR, CMS_EDITOR, PRIVILEGED. Prefer read: ANYONE, insert/update/remove: PRIVILEGED unless the blueprint implies otherwise.
114903
114893
  - Permissions: For each collection, specify the permissions for each operation (insert, update, remove, read) using one of the following access levels:
114904
114894
  - UNDEFINED: Not set.
@@ -114940,9 +114930,8 @@ For the collections field, return:
114940
114930
  <approach>
114941
114931
  1) Read the blueprint name and summary to infer the domain nouns and essential attributes.
114942
114932
  2) Propose collections only when the blueprint clearly requires persistent data. Define only the fields that are strictly required to fulfill the blueprint's functionality.
114943
- 3) For any field that references products, categories, or orders: ALWAYS use REFERENCE type with proper typeMetadata.
114944
- 4) Pick clear collection ids derived from the domain, lower-kebab or lower_underscore; avoid spaces.
114945
- 5) Avoid Duplicate Data Storage - EMBEDDED SCRIPT CONFIGURATION:
114933
+ 3) Pick clear collection ids derived from the domain, lower-kebab or lower_underscore; avoid spaces.
114934
+ 4) Avoid Duplicate Data Storage - EMBEDDED SCRIPT CONFIGURATION:
114946
114935
  - Embedded script parameters (defined in embeddedScriptParameters) are ALREADY saved and persisted via the embeddedScripts
114947
114936
  - NEVER create CMS collections that duplicate these parameters (colors, messages, positions, display settings, coupon codes, headlines, etc.)
114948
114937
  - CMS collections should ONLY be created for additional business data that is NOT covered by embeddedScriptParameters
@@ -114953,7 +114942,7 @@ For the collections field, return:
114953
114942
  - Example (WRONG):
114954
114943
  * Creating both embeddedScriptParameters AND a "popup-configurations" CMS collection - this is duplicate storage
114955
114944
  - Only create CMS collections if there's genuinely new data needed beyond what's in embeddedScriptParameters (e.g., user-generated content, event logs if explicitly requested, business entities)
114956
- 6) Initial Data Assessment:
114945
+ 5) Initial Data Assessment:
114957
114946
  - After defining the collection schema, evaluate if initial/seed data can be implied from the blueprint
114958
114947
  - Consider if the blueprint describes example data, default configurations, sample content, or starter records that would help demonstrate the app's functionality
114959
114948
  - Initial data is appropriate when:
@@ -114964,12 +114953,12 @@ For the collections field, return:
114964
114953
  * The collection is for user-generated content that starts empty
114965
114954
  * The blueprint doesn't mention any example or default data
114966
114955
  * The collection is for transactional/log data that accumulates over time
114967
- 7) Initial Data Compliance:
114956
+ 6) Initial Data Compliance:
114968
114957
  - If initial data is needed, include an "initialData" array in the collection definition
114969
114958
  - Each item in initialData MUST strictly comply with the collection schema:
114970
114959
  * Use the exact field keys defined in the schema (lowerCamelCase)
114971
114960
  * Match field types exactly (TEXT \u2192 string, NUMBER \u2192 number, BOOLEAN \u2192 boolean, DATE/DATETIME \u2192 ISO 8601 string, etc.)
114972
- * For REFERENCE fields: provide valid reference IDs or leave empty if referencing external collections (Stores/Products, etc.)
114961
+ * For REFERENCE fields: provide valid reference ID of idSuffix of the referenced collection
114973
114962
  * For required fields: always provide values
114974
114963
  * For optional fields: may omit if not needed for the example
114975
114964
  - Initial data should be realistic and representative of actual usage
@@ -118576,11 +118565,47 @@ var require_prompt_selectors = __commonJS({
118576
118565
  "use strict";
118577
118566
  Object.defineProperty(exports2, "__esModule", { value: true });
118578
118567
  exports2.shouldUseDataPrompt = shouldUseDataPrompt;
118568
+ exports2.hasUnsupportedCollectionFieldsTypes = hasUnsupportedCollectionFieldsTypes;
118569
+ exports2.hasUnsupportedCollectionTypes = hasUnsupportedCollectionTypes;
118579
118570
  exports2.shouldUseDynamicParametersPrompt = shouldUseDynamicParametersPrompt;
118571
+ var types_1 = require_types_impl2();
118572
+ var ditto_codegen_types_1 = require_dist();
118580
118573
  function shouldUseDataPrompt(params) {
118581
118574
  const { plan, previousResources } = params;
118582
118575
  return Boolean(plan?.collections?.length || previousResources?.collections?.length);
118583
118576
  }
118577
+ var unsupportedCollectionTypesInAutoPatterns = [
118578
+ types_1.FieldType.MULTI_REFERENCE,
118579
+ types_1.FieldType.OBJECT,
118580
+ types_1.FieldType.ARRAY,
118581
+ types_1.FieldType.DOCUMENT,
118582
+ types_1.FieldType.RICH_TEXT,
118583
+ types_1.FieldType.VIDEO,
118584
+ types_1.FieldType.ANY,
118585
+ types_1.FieldType.ARRAY_DOCUMENT,
118586
+ types_1.FieldType.AUDIO,
118587
+ types_1.FieldType.TIME,
118588
+ types_1.FieldType.LANGUAGE,
118589
+ types_1.FieldType.RICH_CONTENT,
118590
+ types_1.FieldType.MEDIA_GALLERY,
118591
+ types_1.FieldType.ADDRESS
118592
+ ];
118593
+ function hasUnsupportedCollectionFieldsTypes(collection) {
118594
+ return unsupportedCollectionTypesInAutoPatterns.some((type) => collection.fields?.some((field) => field.type === type));
118595
+ }
118596
+ function hasUnsupportedCollectionTypes(params) {
118597
+ const { plan, previousResources } = params;
118598
+ const hasUnsupportedInPreviousCollections = previousResources?.collections?.some((collection) => hasUnsupportedCollectionFieldsTypes(collection));
118599
+ if (hasUnsupportedInPreviousCollections)
118600
+ return true;
118601
+ const hasUnsupportedInPlanCollections = plan?.collections?.some((collection) => {
118602
+ if (collection.operation === ditto_codegen_types_1.ExtensionGenerationOperation.DELETE) {
118603
+ return false;
118604
+ }
118605
+ return hasUnsupportedCollectionFieldsTypes(collection.data);
118606
+ });
118607
+ return Boolean(hasUnsupportedInPlanCollections);
118608
+ }
118584
118609
  function shouldUseDynamicParametersPrompt(params) {
118585
118610
  const { plan, previousResources } = params;
118586
118611
  return Boolean(plan?.embeddedScriptParameters?.length || previousResources?.embeddedScriptParameters?.length);
@@ -120775,7 +120800,8 @@ var require_DashboardDecisionAgent = __commonJS({
120775
120800
  const hasOneDashboardPageExtension = blueprint?.extensions?.filter((ext) => ext.type === types_1.ExtensionType.DASHBOARD_PAGE).length === 1;
120776
120801
  const shouldImplementEmbeddedScriptParameters = hasOneDashboardPageExtension && hasEmbeddedScriptExtension;
120777
120802
  const hasCollections = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
120778
- if (!hasCollections || shouldImplementEmbeddedScriptParameters) {
120803
+ const hasUnsupportedCollectionFieldsTypes = (0, prompt_selectors_1.hasUnsupportedCollectionTypes)(params);
120804
+ if (!hasCollections || shouldImplementEmbeddedScriptParameters || hasUnsupportedCollectionFieldsTypes) {
120779
120805
  return true;
120780
120806
  }
120781
120807
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
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": "2ab41eb85f48c5fa0300400982acd53f1ea7d736736189c67108359a"
27
+ "falconPackageHash": "e6533be2dac590d9bf241e372b818aac3ebb29c78842c2a142d6e2bd"
28
28
  }