@wix/ditto-codegen-public 1.0.98 → 1.0.99

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 +359 -98
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -116670,78 +116670,16 @@ var require_types_impl2 = __commonJS({
116670
116670
  }
116671
116671
  });
116672
116672
 
116673
- // dist/cms/CMSSchema.js
116674
- var require_CMSSchema = __commonJS({
116675
- "dist/cms/CMSSchema.js"(exports2) {
116676
- "use strict";
116677
- Object.defineProperty(exports2, "__esModule", { value: true });
116678
- exports2.CmsCollectionSchema = void 0;
116679
- var types_1 = require_types_impl2();
116680
- var zod_1 = require_zod();
116681
- var FieldTypeEnum = zod_1.z.enum(Object.values(types_1.FieldType));
116682
- var AccessLevelEnum = zod_1.z.enum(Object.values(types_1.AccessLevel));
116683
- var ReferenceSchema = zod_1.z.object({
116684
- referencedCollectionId: zod_1.z.string().optional()
116685
- });
116686
- var MultiReferenceSchema = zod_1.z.object({
116687
- referencedCollectionId: zod_1.z.string().optional(),
116688
- referencingFieldKey: zod_1.z.string().optional()
116689
- });
116690
- var ObjectFieldSchema = zod_1.z.object({
116691
- key: zod_1.z.string().optional()
116692
- });
116693
- var ObjectSchema = zod_1.z.object({
116694
- fields: zod_1.z.array(ObjectFieldSchema).optional()
116695
- });
116696
- var ArraySchema = zod_1.z.object({
116697
- elementType: FieldTypeEnum.optional(),
116698
- typeMetadata: zod_1.z.any().optional()
116699
- // Recursive, simplified for now
116700
- });
116701
- var TypeMetadataSchema = zod_1.z.object({
116702
- reference: ReferenceSchema.optional(),
116703
- multiReference: MultiReferenceSchema.optional(),
116704
- object: ObjectSchema.optional(),
116705
- array: ArraySchema.optional()
116706
- }).optional();
116707
- var FieldSchema = zod_1.z.object({
116708
- key: zod_1.z.string().optional(),
116709
- displayName: zod_1.z.string().nullable().optional(),
116710
- type: FieldTypeEnum.optional(),
116711
- typeMetadata: TypeMetadataSchema,
116712
- encrypted: zod_1.z.boolean().optional(),
116713
- description: zod_1.z.string().nullable().optional()
116714
- });
116715
- var DataPermissionsSchema = zod_1.z.object({
116716
- itemRead: AccessLevelEnum.optional(),
116717
- itemInsert: AccessLevelEnum.optional(),
116718
- itemUpdate: AccessLevelEnum.optional(),
116719
- itemRemove: AccessLevelEnum.optional()
116720
- });
116721
- exports2.CmsCollectionSchema = zod_1.z.object({
116722
- id: zod_1.z.string().optional(),
116723
- displayName: zod_1.z.string().nullable().optional(),
116724
- displayField: zod_1.z.string().nullable().optional(),
116725
- fields: zod_1.z.array(FieldSchema).optional(),
116726
- dataPermissions: DataPermissionsSchema.optional(),
116727
- initialData: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.any())).optional()
116728
- });
116729
- }
116730
- });
116731
-
116732
116673
  // dist/system-prompts/planner/data.js
116733
116674
  var require_data = __commonJS({
116734
116675
  "dist/system-prompts/planner/data.js"(exports2) {
116735
116676
  "use strict";
116736
116677
  Object.defineProperty(exports2, "__esModule", { value: true });
116737
116678
  exports2.cmsPlannerPrompt = void 0;
116738
- var zod_1 = require_zod();
116739
- var CMSSchema_1 = require_CMSSchema();
116740
116679
  var types_impl_1 = require_types_impl2();
116741
- var CollectionsArraySchema = zod_1.z.array(CMSSchema_1.CmsCollectionSchema);
116742
116680
  var handlingFeesExample = [
116743
116681
  {
116744
- id: "handling-fees-rules",
116682
+ idSuffix: "handling-fees-rules",
116745
116683
  displayName: "Handling Fees Rules",
116746
116684
  displayField: "productId",
116747
116685
  fields: [
@@ -116749,10 +116687,8 @@ var require_data = __commonJS({
116749
116687
  key: "productId",
116750
116688
  displayName: "Product",
116751
116689
  type: "REFERENCE",
116752
- typeMetadata: {
116753
- reference: {
116754
- referencedCollectionId: "Stores/Products"
116755
- }
116690
+ referenceOptions: {
116691
+ referencedCollectionId: "Stores/Products"
116756
116692
  }
116757
116693
  },
116758
116694
  { key: "oversizedFee", displayName: "Oversized Fee", type: "NUMBER" },
@@ -116783,7 +116719,6 @@ Your output must be strictly JSON that conforms to the provided schema (no markd
116783
116719
  - productId, product \u2192 REFERENCE to "Stores/Products"
116784
116720
  - categoryId, category \u2192 REFERENCE to "Stores/Collections"
116785
116721
  - orderId, order \u2192 REFERENCE to "Stores/Orders"
116786
- - When using REFERENCE/MULTI_REFERENCE fields, they MUST include a "typeMetadata" object.
116787
116722
  - 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.
116788
116723
  - Permissions: For each collection, specify the permissions for each operation (insert, update, remove, read) using one of the following access levels:
116789
116724
  - UNDEFINED: Not set.
@@ -116819,6 +116754,28 @@ ${JSON.stringify(handlingFeesExample, null, 2)}
116819
116754
  - NEVER create CMS collections that duplicate these parameters (colors, messages, positions, display settings, etc.)
116820
116755
  - CMS collections should ONLY be created for additional business data that is NOT covered by embeddedScriptParameters
116821
116756
  - Only create CMS collections if there's genuinely new data needed beyond what's in embeddedScriptParameters (e.g., user-generated content, analytics, logs if explicitly requested)
116757
+ 6) Initial Data Assessment:
116758
+ - After defining the collection schema, evaluate if initial/seed data can be implied from the blueprint
116759
+ - Consider if the blueprint describes example data, default configurations, sample content, or starter records that would help demonstrate the app's functionality
116760
+ - Initial data is appropriate when:
116761
+ * The blueprint mentions example items, sample data, or default configurations
116762
+ * The collection represents configuration or reference data that needs default values
116763
+ * The blueprint describes a demo or example use case that requires sample records
116764
+ - Initial data is NOT appropriate when:
116765
+ * The collection is for user-generated content that starts empty
116766
+ * The blueprint doesn't mention any example or default data
116767
+ * The collection is for transactional/log data that accumulates over time
116768
+ 7) Initial Data Compliance:
116769
+ - If initial data is needed, include an "initialData" array in the collection definition
116770
+ - Each item in initialData MUST strictly comply with the collection schema:
116771
+ * Use the exact field keys defined in the schema (lowerCamelCase)
116772
+ * Match field types exactly (TEXT \u2192 string, NUMBER \u2192 number, BOOLEAN \u2192 boolean, DATE/DATETIME \u2192 ISO 8601 string, etc.)
116773
+ * For REFERENCE fields: provide valid reference IDs or leave empty if referencing external collections (Stores/Products, etc.)
116774
+ * For required fields: always provide values
116775
+ * For optional fields: may omit if not needed for the example
116776
+ - Initial data should be realistic and representative of actual usage
116777
+ - Provide 1-3 example items unless the blueprint specifies more
116778
+ - Ensure initial data demonstrates the key features described in the blueprint
116822
116779
  </approach>
116823
116780
 
116824
116781
  </CMS_PLANNER_SYSTEM_PROMPT>
@@ -117244,7 +117201,7 @@ ${contextSections.join("\n")}`;
117244
117201
  };
117245
117202
  exports2.buildUserPromptForCodeGenerationAgent = buildUserPromptForCodeGenerationAgent;
117246
117203
  var formatCollections = (operations) => {
117247
- const deleteIds = operations.filter((op) => op.operation === "delete").map((op) => op.data.id).filter(Boolean).join(", ");
117204
+ const deleteIds = operations.filter((op) => op.operation === "delete").map((op) => op.data.idSuffix).filter(Boolean).join(", ");
117248
117205
  const deleteNote = deleteIds ? ` (IDs to remove: ${deleteIds})` : "";
117249
117206
  const instructions = `
117250
117207
  Operations Guide:
@@ -117385,6 +117342,312 @@ var require_EmbeddedScriptSchema = __commonJS({
117385
117342
  }
117386
117343
  });
117387
117344
 
117345
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/FieldSchema.js
117346
+ var require_FieldSchema = __commonJS({
117347
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/FieldSchema.js"(exports2) {
117348
+ "use strict";
117349
+ Object.defineProperty(exports2, "__esModule", { value: true });
117350
+ exports2.FieldSchema = exports2.FieldArrayOptionsSchema = exports2.FieldObjectOptionsSchema = exports2.FieldObjectFieldSchema = exports2.FieldMultiReferenceOptionsSchema = exports2.FieldReferenceOptionsSchema = exports2.FieldTypeSchema = void 0;
117351
+ var zod_1 = require_zod();
117352
+ exports2.FieldTypeSchema = zod_1.z.enum([
117353
+ "TEXT",
117354
+ "NUMBER",
117355
+ "DATE",
117356
+ "DATETIME",
117357
+ "IMAGE",
117358
+ "BOOLEAN",
117359
+ "DOCUMENT",
117360
+ "URL",
117361
+ "RICH_TEXT",
117362
+ "VIDEO",
117363
+ "ANY",
117364
+ "ARRAY_STRING",
117365
+ "ARRAY_DOCUMENT",
117366
+ "AUDIO",
117367
+ "TIME",
117368
+ "LANGUAGE",
117369
+ "RICH_CONTENT",
117370
+ "MEDIA_GALLERY",
117371
+ "ADDRESS",
117372
+ "REFERENCE",
117373
+ "MULTI_REFERENCE",
117374
+ "OBJECT",
117375
+ "ARRAY"
117376
+ ]).meta({
117377
+ description: "Field's data type."
117378
+ });
117379
+ exports2.FieldReferenceOptionsSchema = zod_1.z.object({
117380
+ referencedCollectionId: zod_1.z.string().min(1).max(256).meta({ description: "Referenced collection ID." })
117381
+ }).meta({
117382
+ description: "Metadata for a reference field."
117383
+ });
117384
+ exports2.FieldMultiReferenceOptionsSchema = zod_1.z.object({
117385
+ referencedCollectionId: zod_1.z.string().min(1).max(256).meta({ description: "Referenced collection ID." })
117386
+ }).meta({
117387
+ description: "Metadata for a multi-reference field."
117388
+ });
117389
+ exports2.FieldObjectFieldSchema = zod_1.z.object({
117390
+ key: zod_1.z.string().min(1).max(1e3).meta({ description: "Field ID." }),
117391
+ displayName: zod_1.z.string().min(1).max(1e3).optional().meta({ description: "Display name for the field." }),
117392
+ type: exports2.FieldTypeSchema.meta({
117393
+ description: "Field type. Learn more about data types in Wix Data."
117394
+ }),
117395
+ // type_options (object/array only)
117396
+ objectOptions: zod_1.z.lazy(() => exports2.FieldObjectOptionsSchema).optional().meta({ description: "Metadata for an object field." }),
117397
+ arrayOptions: zod_1.z.lazy(() => exports2.FieldArrayOptionsSchema).optional().meta({ description: "Metadata for an array field." })
117398
+ }).meta({
117399
+ description: "Field within an object."
117400
+ });
117401
+ exports2.FieldObjectOptionsSchema = zod_1.z.object({
117402
+ // repeated ObjectField fields = 1 [(wix.api.maxSize) = 1000];
117403
+ fields: zod_1.z.array(zod_1.z.lazy(() => exports2.FieldObjectFieldSchema)).max(1e3).meta({ description: "Fields within the object." })
117404
+ }).meta({
117405
+ description: "Metadata for an object field."
117406
+ });
117407
+ exports2.FieldArrayOptionsSchema = zod_1.z.object({
117408
+ elementType: exports2.FieldTypeSchema.meta({
117409
+ description: "Element's data type."
117410
+ }),
117411
+ objectOptions: zod_1.z.lazy(() => exports2.FieldObjectOptionsSchema).optional().meta({ description: "Metadata for an object field." }),
117412
+ arrayOptions: zod_1.z.lazy(() => exports2.FieldArrayOptionsSchema).optional().meta({ description: "Metadata for an array field." })
117413
+ }).meta({
117414
+ description: "Metadata for an array field. Contains element type and, for complex types, nested options."
117415
+ });
117416
+ var FieldBaseSchema = zod_1.z.object({
117417
+ key: zod_1.z.string().min(1).max(1e3).meta({
117418
+ description: "Unique identifier for the field. For example, `firstName`."
117419
+ }),
117420
+ displayName: zod_1.z.string().min(1).max(1e3).optional().meta({
117421
+ description: "Field's display name when displayed in the CMS. For example, `First Name`."
117422
+ }),
117423
+ encrypted: zod_1.z.boolean().optional().meta({ description: "Whether the field is encrypted." }),
117424
+ description: zod_1.z.string().max(16e3).optional().meta({ description: "Field description." })
117425
+ });
117426
+ var primitiveTypes = [
117427
+ "TEXT",
117428
+ "NUMBER",
117429
+ "DATE",
117430
+ "DATETIME",
117431
+ "IMAGE",
117432
+ "BOOLEAN",
117433
+ "DOCUMENT",
117434
+ "URL",
117435
+ "RICH_TEXT",
117436
+ "VIDEO",
117437
+ "ANY",
117438
+ "ARRAY_STRING",
117439
+ "ARRAY_DOCUMENT",
117440
+ "AUDIO",
117441
+ "TIME",
117442
+ "LANGUAGE",
117443
+ "RICH_CONTENT",
117444
+ "MEDIA_GALLERY",
117445
+ "ADDRESS"
117446
+ ];
117447
+ var PrimitiveLiteralSchemas = primitiveTypes.map((t) => FieldBaseSchema.extend({
117448
+ type: zod_1.z.literal(t).meta({
117449
+ description: "Field's data type. Learn more about data types in Wix Data."
117450
+ }),
117451
+ referenceOptions: zod_1.z.never().optional(),
117452
+ multiReferenceOptions: zod_1.z.never().optional(),
117453
+ objectOptions: zod_1.z.never().optional(),
117454
+ arrayOptions: zod_1.z.never().optional()
117455
+ }));
117456
+ var ReferenceFieldSchema = FieldBaseSchema.extend({
117457
+ type: zod_1.z.literal("REFERENCE").meta({
117458
+ description: "Field's data type. Learn more about data types in Wix Data."
117459
+ }),
117460
+ referenceOptions: zod_1.z.lazy(() => exports2.FieldReferenceOptionsSchema).meta({ description: "Metadata for a reference field." }),
117461
+ multiReferenceOptions: zod_1.z.never().optional(),
117462
+ objectOptions: zod_1.z.never().optional(),
117463
+ arrayOptions: zod_1.z.never().optional()
117464
+ });
117465
+ var MultiReferenceFieldSchema = FieldBaseSchema.extend({
117466
+ type: zod_1.z.literal("MULTI_REFERENCE").meta({
117467
+ description: "Field's data type. Learn more about data types in Wix Data."
117468
+ }),
117469
+ multiReferenceOptions: zod_1.z.lazy(() => exports2.FieldMultiReferenceOptionsSchema).meta({ description: "Metadata for a multi-reference field." }),
117470
+ referenceOptions: zod_1.z.never().optional(),
117471
+ objectOptions: zod_1.z.never().optional(),
117472
+ arrayOptions: zod_1.z.never().optional()
117473
+ });
117474
+ var ObjectFieldSchema = FieldBaseSchema.extend({
117475
+ type: zod_1.z.literal("OBJECT").meta({
117476
+ description: "Field's data type. Learn more about data types in Wix Data."
117477
+ }),
117478
+ objectOptions: zod_1.z.lazy(() => exports2.FieldObjectOptionsSchema).meta({ description: "Metadata for an object field." }),
117479
+ referenceOptions: zod_1.z.never().optional(),
117480
+ multiReferenceOptions: zod_1.z.never().optional(),
117481
+ arrayOptions: zod_1.z.never().optional()
117482
+ });
117483
+ var ArrayFieldSchema = FieldBaseSchema.extend({
117484
+ type: zod_1.z.literal("ARRAY").meta({
117485
+ description: "Field's data type. Learn more about data types in Wix Data."
117486
+ }),
117487
+ arrayOptions: zod_1.z.lazy(() => exports2.FieldArrayOptionsSchema).meta({ description: "Metadata for an array field." }),
117488
+ referenceOptions: zod_1.z.never().optional(),
117489
+ multiReferenceOptions: zod_1.z.never().optional(),
117490
+ objectOptions: zod_1.z.never().optional()
117491
+ });
117492
+ exports2.FieldSchema = zod_1.z.discriminatedUnion("type", [
117493
+ ReferenceFieldSchema,
117494
+ MultiReferenceFieldSchema,
117495
+ ObjectFieldSchema,
117496
+ ArrayFieldSchema,
117497
+ ...PrimitiveLiteralSchemas
117498
+ ]).meta({
117499
+ description: "Defines a CMS field, including type and optional metadata for complex types."
117500
+ });
117501
+ }
117502
+ });
117503
+
117504
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/DataPermissionsSchema.js
117505
+ var require_DataPermissionsSchema = __commonJS({
117506
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/DataPermissionsSchema.js"(exports2) {
117507
+ "use strict";
117508
+ Object.defineProperty(exports2, "__esModule", { value: true });
117509
+ exports2.DataPermissionsSchema = exports2.AccessLevelSchema = void 0;
117510
+ var zod_1 = require_zod();
117511
+ exports2.AccessLevelSchema = zod_1.z.enum([
117512
+ "ANYONE",
117513
+ "SITE_MEMBER",
117514
+ "SITE_MEMBER_AUTHOR",
117515
+ "CMS_EDITOR",
117516
+ "PRIVILEGED"
117517
+ ]).meta({
117518
+ description: "Describes who can perform certain action. Each level includes all levels below it."
117519
+ });
117520
+ exports2.DataPermissionsSchema = zod_1.z.object({
117521
+ itemRead: exports2.AccessLevelSchema.meta({
117522
+ description: "Access level required to read data items."
117523
+ }),
117524
+ itemInsert: exports2.AccessLevelSchema.meta({
117525
+ description: "Access level required to insert data items."
117526
+ }),
117527
+ itemUpdate: exports2.AccessLevelSchema.meta({
117528
+ description: "Access level required to update data items."
117529
+ }),
117530
+ itemRemove: exports2.AccessLevelSchema.meta({
117531
+ description: "Access level required to remove data items."
117532
+ })
117533
+ }).meta({
117534
+ description: "DataPermissions"
117535
+ });
117536
+ }
117537
+ });
117538
+
117539
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/IndexSchema.js
117540
+ var require_IndexSchema = __commonJS({
117541
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/IndexSchema.js"(exports2) {
117542
+ "use strict";
117543
+ Object.defineProperty(exports2, "__esModule", { value: true });
117544
+ exports2.IndexSchema = exports2.IndexFieldSchema = exports2.OrderEnum = void 0;
117545
+ var zod_1 = require_zod();
117546
+ exports2.OrderEnum = zod_1.z.enum(["ASC", "DESC"]).meta({
117547
+ description: "Order determines how values are ordered in the index. This is important when\nordering and/or range querying by indexed fields."
117548
+ });
117549
+ exports2.IndexFieldSchema = zod_1.z.object({
117550
+ path: zod_1.z.string().min(1).max(128).meta({
117551
+ description: "Path of the field to index. For example: `title` or `options.price`."
117552
+ }),
117553
+ order: exports2.OrderEnum.meta({
117554
+ description: "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
117555
+ })
117556
+ });
117557
+ exports2.IndexSchema = zod_1.z.object({
117558
+ fields: zod_1.z.array(exports2.IndexFieldSchema).min(1).max(3).meta({
117559
+ description: "Fields for which the index is defined.\n\nMax: 3 fields (for a unique index: 1 field)"
117560
+ }),
117561
+ unique: zod_1.z.boolean().optional().meta({
117562
+ description: "Whether the index enforces uniqueness of values in the field for which it is defined.\nIf `true`, the index can have only one field.\n\nDefault: `false`"
117563
+ })
117564
+ });
117565
+ }
117566
+ });
117567
+
117568
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/CollectionSchema.js
117569
+ var require_CollectionSchema = __commonJS({
117570
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/CollectionSchema.js"(exports2) {
117571
+ "use strict";
117572
+ Object.defineProperty(exports2, "__esModule", { value: true });
117573
+ exports2.CollectionSchema = void 0;
117574
+ var zod_1 = require_zod();
117575
+ var FieldSchema_1 = require_FieldSchema();
117576
+ var DataPermissionsSchema_1 = require_DataPermissionsSchema();
117577
+ var IndexSchema_1 = require_IndexSchema();
117578
+ exports2.CollectionSchema = zod_1.z.object({
117579
+ idSuffix: zod_1.z.string().max(256).meta({
117580
+ description: "Collection ID suffix. The app namespace is automatically prepended in the CMS. For example, the full ID for `my-products-1` becomes `@company/app-name/my-products-1`."
117581
+ }),
117582
+ displayName: zod_1.z.string().min(1).max(1e3).optional().meta({
117583
+ description: "Collection's display name as shown in the CMS. For example, `My First Collection`."
117584
+ }),
117585
+ displayField: zod_1.z.string().min(1).max(1e3).optional().meta({
117586
+ description: "Field whose value the CMS displays to represent the collection item when referenced in a different collection."
117587
+ }),
117588
+ fields: zod_1.z.array(FieldSchema_1.FieldSchema).min(1).max(1e3).meta({
117589
+ description: "Collection's field structure."
117590
+ }),
117591
+ dataPermissions: DataPermissionsSchema_1.DataPermissionsSchema.meta({
117592
+ description: "Levels of permission for accessing and modifying data, defined by the lowest role needed to perform each action."
117593
+ }),
117594
+ indexes: zod_1.z.array(IndexSchema_1.IndexSchema).max(3).optional().meta({
117595
+ description: "Indexes defined for the collection. An index is a map of a collection's data, organized according to specific fields to increase query speed."
117596
+ }),
117597
+ initialData: zod_1.z.array(zod_1.z.looseObject({})).max(1e3).optional().meta({
117598
+ description: "Optional initial data to populate the collection with."
117599
+ })
117600
+ });
117601
+ }
117602
+ });
117603
+
117604
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/DataCollectionsExtensionSchema.js
117605
+ var require_DataCollectionsExtensionSchema = __commonJS({
117606
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/DataCollectionsExtensionSchema.js"(exports2) {
117607
+ "use strict";
117608
+ Object.defineProperty(exports2, "__esModule", { value: true });
117609
+ exports2.DataCollectionsExtensionSchema = void 0;
117610
+ var zod_1 = require_zod();
117611
+ var CollectionSchema_1 = require_CollectionSchema();
117612
+ exports2.DataCollectionsExtensionSchema = zod_1.z.object({
117613
+ collections: zod_1.z.array(CollectionSchema_1.CollectionSchema).max(100).meta({
117614
+ description: "Data collections automatically added to a site when the app is installed."
117615
+ })
117616
+ }).meta({
117617
+ description: "An extension for adding data collections to a site when an app is installed."
117618
+ });
117619
+ }
117620
+ });
117621
+
117622
+ // ../../node_modules/@wix/wix-data-collections-extension-schema/dist/index.js
117623
+ var require_dist11 = __commonJS({
117624
+ "../../node_modules/@wix/wix-data-collections-extension-schema/dist/index.js"(exports2) {
117625
+ "use strict";
117626
+ Object.defineProperty(exports2, "__esModule", { value: true });
117627
+ exports2.DataPermissionsSchema = exports2.IndexFieldSchema = exports2.DataCollectionsExtensionSchema = exports2.FieldTypeSchema = exports2.CollectionSchema = void 0;
117628
+ var CollectionSchema_1 = require_CollectionSchema();
117629
+ Object.defineProperty(exports2, "CollectionSchema", { enumerable: true, get: function() {
117630
+ return CollectionSchema_1.CollectionSchema;
117631
+ } });
117632
+ var FieldSchema_1 = require_FieldSchema();
117633
+ Object.defineProperty(exports2, "FieldTypeSchema", { enumerable: true, get: function() {
117634
+ return FieldSchema_1.FieldTypeSchema;
117635
+ } });
117636
+ var DataCollectionsExtensionSchema_1 = require_DataCollectionsExtensionSchema();
117637
+ Object.defineProperty(exports2, "DataCollectionsExtensionSchema", { enumerable: true, get: function() {
117638
+ return DataCollectionsExtensionSchema_1.DataCollectionsExtensionSchema;
117639
+ } });
117640
+ var IndexSchema_1 = require_IndexSchema();
117641
+ Object.defineProperty(exports2, "IndexFieldSchema", { enumerable: true, get: function() {
117642
+ return IndexSchema_1.IndexFieldSchema;
117643
+ } });
117644
+ var DataPermissionsSchema_1 = require_DataPermissionsSchema();
117645
+ Object.defineProperty(exports2, "DataPermissionsSchema", { enumerable: true, get: function() {
117646
+ return DataPermissionsSchema_1.DataPermissionsSchema;
117647
+ } });
117648
+ }
117649
+ });
117650
+
117388
117651
  // dist/agents/PlannerAgent.js
117389
117652
  var require_PlannerAgent = __commonJS({
117390
117653
  "dist/agents/PlannerAgent.js"(exports2) {
@@ -117396,15 +117659,15 @@ var require_PlannerAgent = __commonJS({
117396
117659
  var ai_1 = require_dist10();
117397
117660
  var zod_1 = require_zod();
117398
117661
  var planner_1 = require_planner();
117399
- var CMSSchema_1 = require_CMSSchema();
117400
117662
  var utils_1 = require_utils11();
117401
117663
  var ApiSpecSchema_1 = require_ApiSpecSchema();
117402
117664
  var EmbeddedScriptSchema_1 = require_EmbeddedScriptSchema();
117403
117665
  var ditto_codegen_types_12 = require_dist();
117666
+ var wix_data_collections_extension_schema_1 = require_dist11();
117404
117667
  var OperationEnum = zod_1.z.enum(["insert", "update", "delete"]).describe("Operation: insert (create new), update (modify existing), delete (remove existing)").default("insert");
117405
117668
  exports2.CollectionOperationSchema = zod_1.z.object({
117406
117669
  operation: OperationEnum,
117407
- data: CMSSchema_1.CmsCollectionSchema.describe("The collection data")
117670
+ data: wix_data_collections_extension_schema_1.CollectionSchema.describe("The collection data")
117408
117671
  });
117409
117672
  exports2.EmbeddedScriptParametersOperationSchema = zod_1.z.object({
117410
117673
  operation: OperationEnum,
@@ -119794,7 +120057,7 @@ var require_DashboardModals = __commonJS({
119794
120057
  });
119795
120058
 
119796
120059
  // ../codegen-common-logic/dist/index.js
119797
- var require_dist11 = __commonJS({
120060
+ var require_dist12 = __commonJS({
119798
120061
  "../codegen-common-logic/dist/index.js"(exports2) {
119799
120062
  "use strict";
119800
120063
  var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -119839,7 +120102,7 @@ var require_DashboardPageAgent2 = __commonJS({
119839
120102
  var ai_1 = require_dist10();
119840
120103
  var utils_1 = require_utils11();
119841
120104
  var load_examples_1 = require_load_examples();
119842
- var codegen_common_logic_1 = require_dist11();
120105
+ var codegen_common_logic_1 = require_dist12();
119843
120106
  var DashboardPageAgent = class {
119844
120107
  constructor(apiKey, useIteration = false) {
119845
120108
  this.apiKey = apiKey;
@@ -119960,7 +120223,7 @@ var require_SiteComponentAgent2 = __commonJS({
119960
120223
  var ai_1 = require_dist10();
119961
120224
  var utils_1 = require_utils11();
119962
120225
  var siteComponentPrompt_1 = require_siteComponentPrompt();
119963
- var codegen_common_logic_1 = require_dist11();
120226
+ var codegen_common_logic_1 = require_dist12();
119964
120227
  var SiteComponentAgent = class {
119965
120228
  constructor(apiKey) {
119966
120229
  this.apiKey = apiKey;
@@ -120110,7 +120373,7 @@ var require_CustomElementAgent2 = __commonJS({
120110
120373
  var utils_1 = require_utils11();
120111
120374
  var customElementPrompt_1 = require_customElementPrompt();
120112
120375
  var load_examples_1 = __importStar2(require_load_examples());
120113
- var codegen_common_logic_1 = require_dist11();
120376
+ var codegen_common_logic_1 = require_dist12();
120114
120377
  var CustomElementAgent = class {
120115
120378
  constructor(apiKey) {
120116
120379
  this.apiKey = apiKey;
@@ -120380,7 +120643,7 @@ var require_SPIAgent2 = __commonJS({
120380
120643
  var ai_1 = require_dist10();
120381
120644
  var utils_1 = require_utils11();
120382
120645
  var load_examples_1 = require_load_examples();
120383
- var codegen_common_logic_1 = require_dist11();
120646
+ var codegen_common_logic_1 = require_dist12();
120384
120647
  var SPIAgent = class {
120385
120648
  constructor(apiKey, useIteration = false) {
120386
120649
  this.apiKey = apiKey;
@@ -120541,7 +120804,7 @@ var require_BackendEventAgent2 = __commonJS({
120541
120804
  var utils_1 = require_utils11();
120542
120805
  var backendEventPrompt_1 = require_backendEventPrompt();
120543
120806
  var load_examples_1 = __importStar2(require_load_examples());
120544
- var codegen_common_logic_1 = require_dist11();
120807
+ var codegen_common_logic_1 = require_dist12();
120545
120808
  var BackendEventAgent = class {
120546
120809
  constructor(apiKey, useIteration = false) {
120547
120810
  this.apiKey = apiKey;
@@ -120699,7 +120962,7 @@ var require_BackendApiAgent2 = __commonJS({
120699
120962
  var backendApi_1 = require_backendApi();
120700
120963
  var utils_1 = require_utils11();
120701
120964
  var ai_1 = require_dist10();
120702
- var codegen_common_logic_1 = require_dist11();
120965
+ var codegen_common_logic_1 = require_dist12();
120703
120966
  var BackendApiAgent = class {
120704
120967
  constructor(apiKey) {
120705
120968
  this.apiKey = apiKey;
@@ -120989,7 +121252,7 @@ var require_EmbeddedScriptAgent2 = __commonJS({
120989
121252
  var load_examples_1 = require_load_examples();
120990
121253
  var zod_1 = __importDefault3(require_zod());
120991
121254
  var embededScript_1 = require_embededScript();
120992
- var codegen_common_logic_1 = require_dist11();
121255
+ var codegen_common_logic_1 = require_dist12();
120993
121256
  var EmbeddedScriptPlacement;
120994
121257
  (function(EmbeddedScriptPlacement2) {
120995
121258
  EmbeddedScriptPlacement2["HEAD"] = "HEAD";
@@ -121841,7 +122104,7 @@ var require_scaffolding = __commonJS({
121841
122104
  });
121842
122105
 
121843
122106
  // ../scaffolding/dist/index.js
121844
- var require_dist12 = __commonJS({
122107
+ var require_dist13 = __commonJS({
121845
122108
  "../scaffolding/dist/index.js"(exports2) {
121846
122109
  "use strict";
121847
122110
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -121873,7 +122136,7 @@ var require_AutoPatternsGenerator = __commonJS({
121873
122136
  "use strict";
121874
122137
  Object.defineProperty(exports2, "__esModule", { value: true });
121875
122138
  exports2.AutoPatternsGenerator = void 0;
121876
- var ditto_scaffolding_1 = require_dist12();
122139
+ var ditto_scaffolding_1 = require_dist13();
121877
122140
  var ditto_codegen_types_12 = require_dist();
121878
122141
  var AutoPatternsGenerator = class {
121879
122142
  constructor() {
@@ -122006,7 +122269,7 @@ var require_AutoPatternsGenerator = __commonJS({
122006
122269
  type: "create",
122007
122270
  label: contentResult.schema?.content.actionButtonLabel,
122008
122271
  collection: {
122009
- collectionId: collection.id,
122272
+ collectionId: collection.idSuffix,
122010
122273
  entityTypeSource: "cms"
122011
122274
  },
122012
122275
  create: {
@@ -122025,7 +122288,7 @@ var require_AutoPatternsGenerator = __commonJS({
122025
122288
  layout,
122026
122289
  entityPageId: `${collectionRouteId}-entity`,
122027
122290
  collection: {
122028
- collectionId: collection.id,
122291
+ collectionId: collection.idSuffix,
122029
122292
  entityTypeSource: "cms"
122030
122293
  },
122031
122294
  toolbarTitle: {
@@ -122140,7 +122403,7 @@ var require_AutoPatternsGenerator = __commonJS({
122140
122403
  },
122141
122404
  parentPageId: `${collectionRouteId}-collection`,
122142
122405
  layout: this.generateEntityPageLayout(contentResult.schema?.layout),
122143
- collectionId: collection.id,
122406
+ collectionId: collection.idSuffix,
122144
122407
  entityTypeSource: "cms"
122145
122408
  }
122146
122409
  }
@@ -131543,9 +131806,9 @@ var require_extensionGenerators = __commonJS({
131543
131806
  var path_1 = __importDefault3(require("path"));
131544
131807
  var fs_extra_1 = __importDefault3(require_lib());
131545
131808
  var crypto_1 = require("crypto");
131546
- var ditto_scaffolding_1 = require_dist12();
131809
+ var ditto_scaffolding_1 = require_dist13();
131547
131810
  var types_1 = require_types_impl();
131548
- var ditto_scaffolding_2 = require_dist12();
131811
+ var ditto_scaffolding_2 = require_dist13();
131549
131812
  var EmbeddedScriptAgent_1 = require_EmbeddedScriptAgent2();
131550
131813
  var ditto_codegen_types_12 = require_dist();
131551
131814
  var ExtensionFactory = class {
@@ -131901,7 +132164,7 @@ var require_extensionHelpers = __commonJS({
131901
132164
  var extensionGenerators_1 = require_extensionGenerators();
131902
132165
  var file_collector_1 = require_file_collector();
131903
132166
  var orchestrator_error_helpers_1 = require_orchestrator_error_helpers();
131904
- var ditto_scaffolding_1 = require_dist12();
132167
+ var ditto_scaffolding_1 = require_dist13();
131905
132168
  var ditto_codegen_types_12 = require_dist();
131906
132169
  function finalizeExtensionGeneration(options, eventEmitter) {
131907
132170
  const { extension, agentName, agentFiles, scaffolds = [], scaffoldPath, outputPath, generatedConfig } = options;
@@ -132315,12 +132578,10 @@ var require_cms = __commonJS({
132315
132578
  }
132316
132579
  const files = [];
132317
132580
  const collectionsData = plan.collections.map((collection) => {
132318
- const { data: { id: _id, ...rest } } = collection;
132319
132581
  return {
132320
- idSuffix: _id ?? "no-collection-id",
132321
132582
  schemaUrl: `https://www.wix.com/`,
132322
132583
  // TODO: remove once Wix Data are deprecating it
132323
- ...rest
132584
+ ...collection
132324
132585
  };
132325
132586
  });
132326
132587
  const generatedCode = `
@@ -132351,7 +132612,7 @@ export const dataExtension = extensions.genericExtension(${JSON.stringify({
132351
132612
  ...collection,
132352
132613
  data: {
132353
132614
  ...collection?.data ?? {},
132354
- id: path_1.default.join(appNamespace, collection?.data?.id ?? "no-collection-id")
132615
+ idSuffix: path_1.default.join(appNamespace, collection?.data?.idSuffix ?? "no-collection-id")
132355
132616
  }
132356
132617
  };
132357
132618
  }) || [];
@@ -135925,7 +136186,7 @@ var require_helpers2 = __commonJS({
135925
136186
  });
135926
136187
 
135927
136188
  // ../../node_modules/agent-base/dist/index.js
135928
- var require_dist13 = __commonJS({
136189
+ var require_dist14 = __commonJS({
135929
136190
  "../../node_modules/agent-base/dist/index.js"(exports2) {
135930
136191
  "use strict";
135931
136192
  var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -136081,7 +136342,7 @@ var require_dist13 = __commonJS({
136081
136342
  });
136082
136343
 
136083
136344
  // ../../node_modules/http-proxy-agent/dist/index.js
136084
- var require_dist14 = __commonJS({
136345
+ var require_dist15 = __commonJS({
136085
136346
  "../../node_modules/http-proxy-agent/dist/index.js"(exports2) {
136086
136347
  "use strict";
136087
136348
  var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -136120,7 +136381,7 @@ var require_dist14 = __commonJS({
136120
136381
  var tls = __importStar2(require("tls"));
136121
136382
  var debug_1 = __importDefault3(require_src9());
136122
136383
  var events_1 = require("events");
136123
- var agent_base_1 = require_dist13();
136384
+ var agent_base_1 = require_dist14();
136124
136385
  var url_1 = require("url");
136125
136386
  var debug = (0, debug_1.default)("http-proxy-agent");
136126
136387
  var HttpProxyAgent = class extends agent_base_1.Agent {
@@ -136307,7 +136568,7 @@ var require_parse_proxy_response = __commonJS({
136307
136568
  });
136308
136569
 
136309
136570
  // ../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js
136310
- var require_dist15 = __commonJS({
136571
+ var require_dist16 = __commonJS({
136311
136572
  "../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js"(exports2) {
136312
136573
  "use strict";
136313
136574
  var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -136346,7 +136607,7 @@ var require_dist15 = __commonJS({
136346
136607
  var tls = __importStar2(require("tls"));
136347
136608
  var assert_1 = __importDefault3(require("assert"));
136348
136609
  var debug_1 = __importDefault3(require_src9());
136349
- var agent_base_1 = require_dist13();
136610
+ var agent_base_1 = require_dist14();
136350
136611
  var url_1 = require("url");
136351
136612
  var parse_proxy_response_1 = require_parse_proxy_response();
136352
136613
  var debug = (0, debug_1.default)("https-proxy-agent");
@@ -137718,8 +137979,8 @@ var require_http_client_node = __commonJS({
137718
137979
  exports2.HttpClient = exports2.createHttpClient = void 0;
137719
137980
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
137720
137981
  var http_1 = tslib_1.__importDefault(require_http());
137721
- var http_proxy_agent_1 = require_dist14();
137722
- var https_proxy_agent_1 = require_dist15();
137982
+ var http_proxy_agent_1 = require_dist15();
137983
+ var https_proxy_agent_1 = require_dist16();
137723
137984
  var env_util_1 = require_env_util();
137724
137985
  var http_client_1 = require_http_client();
137725
137986
  var MAX_NUMBER_OF_REPORTING_PROXY_METRICS_ATTEMPTS = 3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
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": "134708d426becb9b076659aaa0c469c208cff9b11a296d25304518ca"
27
+ "falconPackageHash": "f4fb3671f4f73bcad127d894533e42135af68b3a00a6d0bbde30fc78"
28
28
  }