@wix/wix-data-items-common 1.0.312 → 1.0.313

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 (152) hide show
  1. package/dist/cjs/api/PipelineBuilder.js +0 -12
  2. package/dist/cjs/api/PipelineBuilder.js.map +1 -1
  3. package/dist/cjs/api/WixDataAggregateOptionsBuilder.js +27 -3
  4. package/dist/cjs/api/WixDataAggregateOptionsBuilder.js.map +1 -1
  5. package/dist/cjs/api/WixDataApi.js +38 -38
  6. package/dist/cjs/api/WixDataApi.js.map +1 -1
  7. package/dist/cjs/api/WixDataAsyncPatchByFilterOptionsBuilder.js +24 -3
  8. package/dist/cjs/api/WixDataAsyncPatchByFilterOptionsBuilder.js.map +1 -1
  9. package/dist/cjs/api/WixDataAsyncRemoveByFilterOptionsBuilder.js +23 -3
  10. package/dist/cjs/api/WixDataAsyncRemoveByFilterOptionsBuilder.js.map +1 -1
  11. package/dist/cjs/api/WixDataBulkInsertOptionsBuilder.js +22 -3
  12. package/dist/cjs/api/WixDataBulkInsertOptionsBuilder.js.map +1 -1
  13. package/dist/cjs/api/WixDataBulkPatchOptionsBuilder.js +21 -3
  14. package/dist/cjs/api/WixDataBulkPatchOptionsBuilder.js.map +1 -1
  15. package/dist/cjs/api/WixDataBulkRemoveOptionsBuilder.js +21 -3
  16. package/dist/cjs/api/WixDataBulkRemoveOptionsBuilder.js.map +1 -1
  17. package/dist/cjs/api/WixDataBulkSaveOptionsBuilder.js +20 -3
  18. package/dist/cjs/api/WixDataBulkSaveOptionsBuilder.js.map +1 -1
  19. package/dist/cjs/api/WixDataBulkUpdateOptionsBuilder.js +24 -3
  20. package/dist/cjs/api/WixDataBulkUpdateOptionsBuilder.js.map +1 -1
  21. package/dist/cjs/api/WixDataCountOptionsBuilder.js +24 -3
  22. package/dist/cjs/api/WixDataCountOptionsBuilder.js.map +1 -1
  23. package/dist/cjs/api/WixDataDistinctOptionsBuilder.js +25 -23
  24. package/dist/cjs/api/WixDataDistinctOptionsBuilder.js.map +1 -1
  25. package/dist/cjs/api/WixDataFieldModificationsBuilder.js +2 -1
  26. package/dist/cjs/api/WixDataFieldModificationsBuilder.js.map +1 -1
  27. package/dist/cjs/api/WixDataGetOptionsBuilder.js +27 -3
  28. package/dist/cjs/api/WixDataGetOptionsBuilder.js.map +1 -1
  29. package/dist/cjs/api/WixDataInsertOptionsBuilder.js +20 -3
  30. package/dist/cjs/api/WixDataInsertOptionsBuilder.js.map +1 -1
  31. package/dist/cjs/api/WixDataIsReferencedOptionsBuilder.js +25 -3
  32. package/dist/cjs/api/WixDataIsReferencedOptionsBuilder.js.map +1 -1
  33. package/dist/cjs/api/WixDataPatchOptionsBuilder.js +21 -3
  34. package/dist/cjs/api/WixDataPatchOptionsBuilder.js.map +1 -1
  35. package/dist/cjs/api/WixDataQueryBuilder.js +12 -7
  36. package/dist/cjs/api/WixDataQueryBuilder.js.map +1 -1
  37. package/dist/cjs/api/WixDataQueryOptionsBuilder.js +30 -3
  38. package/dist/cjs/api/WixDataQueryOptionsBuilder.js.map +1 -1
  39. package/dist/cjs/api/WixDataQueryReferencedItemsOptionsBuilder.js +32 -3
  40. package/dist/cjs/api/WixDataQueryReferencedItemsOptionsBuilder.js.map +1 -1
  41. package/dist/cjs/api/WixDataRemoveOptionsBuilder.js +25 -3
  42. package/dist/cjs/api/WixDataRemoveOptionsBuilder.js.map +1 -1
  43. package/dist/cjs/api/WixDataSaveOptionsBuilder.js +24 -3
  44. package/dist/cjs/api/WixDataSaveOptionsBuilder.js.map +1 -1
  45. package/dist/cjs/api/WixDataSearchBuilder.js +8 -9
  46. package/dist/cjs/api/WixDataSearchBuilder.js.map +1 -1
  47. package/dist/cjs/api/WixDataSearchOptionsBuilder.js +28 -3
  48. package/dist/cjs/api/WixDataSearchOptionsBuilder.js.map +1 -1
  49. package/dist/cjs/api/WixDataUpdateOptionsBuilder.js +25 -3
  50. package/dist/cjs/api/WixDataUpdateOptionsBuilder.js.map +1 -1
  51. package/dist/cjs/api/types.js.map +1 -1
  52. package/dist/esm/api/PipelineBuilder.js +0 -11
  53. package/dist/esm/api/PipelineBuilder.js.map +1 -1
  54. package/dist/esm/api/WixDataAggregateOptionsBuilder.js +20 -1
  55. package/dist/esm/api/WixDataAggregateOptionsBuilder.js.map +1 -1
  56. package/dist/esm/api/WixDataApi.js +38 -38
  57. package/dist/esm/api/WixDataApi.js.map +1 -1
  58. package/dist/esm/api/WixDataAsyncPatchByFilterOptionsBuilder.js +18 -1
  59. package/dist/esm/api/WixDataAsyncPatchByFilterOptionsBuilder.js.map +1 -1
  60. package/dist/esm/api/WixDataAsyncRemoveByFilterOptionsBuilder.js +17 -1
  61. package/dist/esm/api/WixDataAsyncRemoveByFilterOptionsBuilder.js.map +1 -1
  62. package/dist/esm/api/WixDataBulkInsertOptionsBuilder.js +16 -1
  63. package/dist/esm/api/WixDataBulkInsertOptionsBuilder.js.map +1 -1
  64. package/dist/esm/api/WixDataBulkPatchOptionsBuilder.js +14 -1
  65. package/dist/esm/api/WixDataBulkPatchOptionsBuilder.js.map +1 -1
  66. package/dist/esm/api/WixDataBulkRemoveOptionsBuilder.js +14 -1
  67. package/dist/esm/api/WixDataBulkRemoveOptionsBuilder.js.map +1 -1
  68. package/dist/esm/api/WixDataBulkSaveOptionsBuilder.js +14 -1
  69. package/dist/esm/api/WixDataBulkSaveOptionsBuilder.js.map +1 -1
  70. package/dist/esm/api/WixDataBulkUpdateOptionsBuilder.js +17 -1
  71. package/dist/esm/api/WixDataBulkUpdateOptionsBuilder.js.map +1 -1
  72. package/dist/esm/api/WixDataCountOptionsBuilder.js +17 -1
  73. package/dist/esm/api/WixDataCountOptionsBuilder.js.map +1 -1
  74. package/dist/esm/api/WixDataDistinctOptionsBuilder.js +18 -19
  75. package/dist/esm/api/WixDataDistinctOptionsBuilder.js.map +1 -1
  76. package/dist/esm/api/WixDataFieldModificationsBuilder.js +2 -1
  77. package/dist/esm/api/WixDataFieldModificationsBuilder.js.map +1 -1
  78. package/dist/esm/api/WixDataGetOptionsBuilder.js +19 -1
  79. package/dist/esm/api/WixDataGetOptionsBuilder.js.map +1 -1
  80. package/dist/esm/api/WixDataInsertOptionsBuilder.js +13 -1
  81. package/dist/esm/api/WixDataInsertOptionsBuilder.js.map +1 -1
  82. package/dist/esm/api/WixDataIsReferencedOptionsBuilder.js +19 -1
  83. package/dist/esm/api/WixDataIsReferencedOptionsBuilder.js.map +1 -1
  84. package/dist/esm/api/WixDataPatchOptionsBuilder.js +14 -1
  85. package/dist/esm/api/WixDataPatchOptionsBuilder.js.map +1 -1
  86. package/dist/esm/api/WixDataQueryBuilder.js +12 -7
  87. package/dist/esm/api/WixDataQueryBuilder.js.map +1 -1
  88. package/dist/esm/api/WixDataQueryOptionsBuilder.js +23 -1
  89. package/dist/esm/api/WixDataQueryOptionsBuilder.js.map +1 -1
  90. package/dist/esm/api/WixDataQueryReferencedItemsOptionsBuilder.js +25 -1
  91. package/dist/esm/api/WixDataQueryReferencedItemsOptionsBuilder.js.map +1 -1
  92. package/dist/esm/api/WixDataRemoveOptionsBuilder.js +18 -1
  93. package/dist/esm/api/WixDataRemoveOptionsBuilder.js.map +1 -1
  94. package/dist/esm/api/WixDataSaveOptionsBuilder.js +17 -1
  95. package/dist/esm/api/WixDataSaveOptionsBuilder.js.map +1 -1
  96. package/dist/esm/api/WixDataSearchBuilder.js +6 -6
  97. package/dist/esm/api/WixDataSearchBuilder.js.map +1 -1
  98. package/dist/esm/api/WixDataSearchOptionsBuilder.js +21 -1
  99. package/dist/esm/api/WixDataSearchOptionsBuilder.js.map +1 -1
  100. package/dist/esm/api/WixDataUpdateOptionsBuilder.js +18 -1
  101. package/dist/esm/api/WixDataUpdateOptionsBuilder.js.map +1 -1
  102. package/dist/types/api/PipelineBuilder.d.ts +0 -11
  103. package/dist/types/api/PipelineBuilder.d.ts.map +1 -1
  104. package/dist/types/api/WixDataAggregateOptionsBuilder.d.ts +43 -3
  105. package/dist/types/api/WixDataAggregateOptionsBuilder.d.ts.map +1 -1
  106. package/dist/types/api/WixDataAsyncPatchByFilterOptionsBuilder.d.ts +36 -3
  107. package/dist/types/api/WixDataAsyncPatchByFilterOptionsBuilder.d.ts.map +1 -1
  108. package/dist/types/api/WixDataAsyncRemoveByFilterOptionsBuilder.d.ts +35 -3
  109. package/dist/types/api/WixDataAsyncRemoveByFilterOptionsBuilder.d.ts.map +1 -1
  110. package/dist/types/api/WixDataBulkInsertOptionsBuilder.d.ts +41 -3
  111. package/dist/types/api/WixDataBulkInsertOptionsBuilder.d.ts.map +1 -1
  112. package/dist/types/api/WixDataBulkPatchOptionsBuilder.d.ts +36 -3
  113. package/dist/types/api/WixDataBulkPatchOptionsBuilder.d.ts.map +1 -1
  114. package/dist/types/api/WixDataBulkRemoveOptionsBuilder.d.ts +36 -3
  115. package/dist/types/api/WixDataBulkRemoveOptionsBuilder.d.ts.map +1 -1
  116. package/dist/types/api/WixDataBulkSaveOptionsBuilder.d.ts +35 -3
  117. package/dist/types/api/WixDataBulkSaveOptionsBuilder.d.ts.map +1 -1
  118. package/dist/types/api/WixDataBulkUpdateOptionsBuilder.d.ts +42 -3
  119. package/dist/types/api/WixDataBulkUpdateOptionsBuilder.d.ts.map +1 -1
  120. package/dist/types/api/WixDataCountOptionsBuilder.d.ts +48 -3
  121. package/dist/types/api/WixDataCountOptionsBuilder.d.ts.map +1 -1
  122. package/dist/types/api/WixDataDistinctOptionsBuilder.d.ts +62 -8
  123. package/dist/types/api/WixDataDistinctOptionsBuilder.d.ts.map +1 -1
  124. package/dist/types/api/WixDataFieldModificationsBuilder.d.ts +1 -1
  125. package/dist/types/api/WixDataFieldModificationsBuilder.d.ts.map +1 -1
  126. package/dist/types/api/WixDataGetOptionsBuilder.d.ts +57 -3
  127. package/dist/types/api/WixDataGetOptionsBuilder.d.ts.map +1 -1
  128. package/dist/types/api/WixDataInsertOptionsBuilder.d.ts +39 -3
  129. package/dist/types/api/WixDataInsertOptionsBuilder.d.ts.map +1 -1
  130. package/dist/types/api/WixDataIsReferencedOptionsBuilder.d.ts +31 -3
  131. package/dist/types/api/WixDataIsReferencedOptionsBuilder.d.ts.map +1 -1
  132. package/dist/types/api/WixDataPatchOptionsBuilder.d.ts +36 -3
  133. package/dist/types/api/WixDataPatchOptionsBuilder.d.ts.map +1 -1
  134. package/dist/types/api/WixDataQueryBuilder.d.ts +12 -7
  135. package/dist/types/api/WixDataQueryBuilder.d.ts.map +1 -1
  136. package/dist/types/api/WixDataQueryOptionsBuilder.d.ts +62 -3
  137. package/dist/types/api/WixDataQueryOptionsBuilder.d.ts.map +1 -1
  138. package/dist/types/api/WixDataQueryReferencedItemsOptionsBuilder.d.ts +63 -3
  139. package/dist/types/api/WixDataQueryReferencedItemsOptionsBuilder.d.ts.map +1 -1
  140. package/dist/types/api/WixDataRemoveOptionsBuilder.d.ts +40 -3
  141. package/dist/types/api/WixDataRemoveOptionsBuilder.d.ts.map +1 -1
  142. package/dist/types/api/WixDataSaveOptionsBuilder.d.ts +43 -3
  143. package/dist/types/api/WixDataSaveOptionsBuilder.d.ts.map +1 -1
  144. package/dist/types/api/WixDataSearchBuilder.d.ts +8 -9
  145. package/dist/types/api/WixDataSearchBuilder.d.ts.map +1 -1
  146. package/dist/types/api/WixDataSearchOptionsBuilder.d.ts +39 -3
  147. package/dist/types/api/WixDataSearchOptionsBuilder.d.ts.map +1 -1
  148. package/dist/types/api/WixDataUpdateOptionsBuilder.d.ts +47 -3
  149. package/dist/types/api/WixDataUpdateOptionsBuilder.d.ts.map +1 -1
  150. package/dist/types/api/types.d.ts +0 -16
  151. package/dist/types/api/types.d.ts.map +1 -1
  152. package/package.json +2 -2
@@ -36,18 +36,6 @@ class PipelineBuilderImpl {
36
36
  };
37
37
  }
38
38
  }
39
-
40
- /**
41
- * Builds an aggregation pipeline for use with [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline).
42
- *
43
- * Configure the pipeline by calling `pipelineBuilder()` and chaining [`PipelineBuilder`](https://dev.wix.com/docs/sdk/backend-modules/data/items/pipeline-builder/introduction) methods. Then, specify the pipeline as the `pipeline` parameter when calling the [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline) method.
44
- *
45
- * > **Note**: You can only build an aggregation pipeline for collections [created in the CMS](https://support.wix.com/en/article/cms-formerly-content-manager-creating-a-collection) or with the [Data Collections API](https://dev.wix.com/docs/sdk/backend-modules/data/collections/introduction). They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) or [external collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site).
46
- *
47
- * @public
48
- * @documentationMaturity preview
49
- * @returns PipelineBuilder object
50
- */
51
39
  function pipelineBuilder() {
52
40
  return new PipelineBuilderImpl();
53
41
  }
@@ -1 +1 @@
1
- {"version":3,"names":["PipelineBuilderImpl","constructor","_defineProperty2","default","withStages","stages","withPaging","paging","isCursor","cursorPaging","undefined","offsetPaging","build","map","stage","pipelineBuilder"],"sources":["../../../src/api/PipelineBuilder.ts"],"sourcesContent":["import { PipelineStage } from './stages/stages'\nimport { Paging, CursorPaging, AggregationPipeline } from '../types'\n\n/**\n * @builder\n */\nexport interface PipelineBuilder {\n /**\n * Adds [pipeline stages](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-stages/introduction) to the aggregation pipeline.\n *\n * Stages are processed sequentially in the order they are provided, with each stage's output becoming the input for the next stage.\n *\n * @public\n * @documentationMaturity preview\n * @param stages - Array of [pipeline stages](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-stages/introduction).\n * @returns PipelineBuilder object\n */\n withStages(stages: PipelineStage[]): PipelineBuilder\n\n /**\n * Configures pagination for the aggregation pipeline results.\n *\n * You can specify either [offset](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#offset-paging) or [cursor pagination](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#cursor-paging).\n *\n * @public\n * @documentationMaturity preview\n * @param paging - Pagination configuration.\n * @returns PipelineBuilder object\n */\n withPaging(paging: Paging | CursorPaging): PipelineBuilder\n\n /**\n * Builds the aggregation pipeline.\n *\n * Run this method after configuring stages and pagination to build the aggregation pipeline. Specify the pipeline as the `pipeline` parameter when calling the [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline) method.\n *\n * @public\n * @documentationMaturity preview\n * @returns AggregationPipeline object ready for running the aggregation pipeline.\n */\n build(): AggregationPipeline\n}\n\nclass PipelineBuilderImpl implements PipelineBuilder {\n private stages: PipelineStage[] = []\n private offsetPaging?: Paging\n private cursorPaging?: CursorPaging\n\n withStages(stages: PipelineStage[]) {\n this.stages = stages\n return this\n }\n\n withPaging(paging: Paging | CursorPaging) {\n const isCursor = 'cursor' in paging\n this.cursorPaging = isCursor ? paging : undefined\n this.offsetPaging = isCursor ? undefined : paging\n return this\n }\n\n build() {\n return {\n stages: this.stages.map((stage) => stage.build()),\n ...(this.offsetPaging && { paging: this.offsetPaging }),\n ...(this.cursorPaging && { cursorPaging: this.cursorPaging }),\n }\n }\n}\n\n/**\n * Builds an aggregation pipeline for use with [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline).\n *\n * Configure the pipeline by calling `pipelineBuilder()` and chaining [`PipelineBuilder`](https://dev.wix.com/docs/sdk/backend-modules/data/items/pipeline-builder/introduction) methods. Then, specify the pipeline as the `pipeline` parameter when calling the [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline) method.\n *\n * > **Note**: You can only build an aggregation pipeline for collections [created in the CMS](https://support.wix.com/en/article/cms-formerly-content-manager-creating-a-collection) or with the [Data Collections API](https://dev.wix.com/docs/sdk/backend-modules/data/collections/introduction). They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) or [external collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site).\n *\n * @public\n * @documentationMaturity preview\n * @returns PipelineBuilder object\n */\nexport function pipelineBuilder(): PipelineBuilder {\n return new PipelineBuilderImpl()\n}\n"],"mappings":";;;;;;AAGA;AACA;AACA;;AAsCA,MAAMA,mBAAmB,CAA4B;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACjB,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;EAAA;EAIpCC,UAAUA,CAACC,MAAuB,EAAE;IAClC,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,OAAO,IAAI;EACb;EAEAC,UAAUA,CAACC,MAA6B,EAAE;IACxC,MAAMC,QAAQ,GAAG,QAAQ,IAAID,MAAM;IACnC,IAAI,CAACE,YAAY,GAAGD,QAAQ,GAAGD,MAAM,GAAGG,SAAS;IACjD,IAAI,CAACC,YAAY,GAAGH,QAAQ,GAAGE,SAAS,GAAGH,MAAM;IACjD,OAAO,IAAI;EACb;EAEAK,KAAKA,CAAA,EAAG;IACN,OAAO;MACLP,MAAM,EAAE,IAAI,CAACA,MAAM,CAACQ,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACF,KAAK,CAAC,CAAC,CAAC;MACjD,IAAI,IAAI,CAACD,YAAY,IAAI;QAAEJ,MAAM,EAAE,IAAI,CAACI;MAAa,CAAC,CAAC;MACvD,IAAI,IAAI,CAACF,YAAY,IAAI;QAAEA,YAAY,EAAE,IAAI,CAACA;MAAa,CAAC;IAC9D,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,eAAeA,CAAA,EAAoB;EACjD,OAAO,IAAIf,mBAAmB,CAAC,CAAC;AAClC","ignoreList":[]}
1
+ {"version":3,"names":["PipelineBuilderImpl","constructor","_defineProperty2","default","withStages","stages","withPaging","paging","isCursor","cursorPaging","undefined","offsetPaging","build","map","stage","pipelineBuilder"],"sources":["../../../src/api/PipelineBuilder.ts"],"sourcesContent":["import { PipelineStage } from './stages/stages'\nimport { Paging, CursorPaging, AggregationPipeline } from '../types'\n\n/**\n * @builder\n */\nexport interface PipelineBuilder {\n /**\n * Adds [pipeline stages](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-stages/introduction) to the aggregation pipeline.\n *\n * Stages are processed sequentially in the order they are provided, with each stage's output becoming the input for the next stage.\n *\n * @public\n * @documentationMaturity preview\n * @param stages - Array of [pipeline stages](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-stages/introduction).\n * @returns PipelineBuilder object\n */\n withStages(stages: PipelineStage[]): PipelineBuilder\n\n /**\n * Configures pagination for the aggregation pipeline results.\n *\n * You can specify either [offset](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#offset-paging) or [cursor pagination](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#cursor-paging).\n *\n * @public\n * @documentationMaturity preview\n * @param paging - Pagination configuration.\n * @returns PipelineBuilder object\n */\n withPaging(paging: Paging | CursorPaging): PipelineBuilder\n\n /**\n * Builds the aggregation pipeline.\n *\n * Run this method after configuring stages and pagination to build the aggregation pipeline. Specify the pipeline as the `pipeline` parameter when calling the [`aggregatePipeline()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/aggregate-pipeline) method.\n *\n * @public\n * @documentationMaturity preview\n * @returns AggregationPipeline object ready for running the aggregation pipeline.\n */\n build(): AggregationPipeline\n}\n\nclass PipelineBuilderImpl implements PipelineBuilder {\n private stages: PipelineStage[] = []\n private offsetPaging?: Paging\n private cursorPaging?: CursorPaging\n\n withStages(stages: PipelineStage[]) {\n this.stages = stages\n return this\n }\n\n withPaging(paging: Paging | CursorPaging) {\n const isCursor = 'cursor' in paging\n this.cursorPaging = isCursor ? paging : undefined\n this.offsetPaging = isCursor ? undefined : paging\n return this\n }\n\n build() {\n return {\n stages: this.stages.map((stage) => stage.build()),\n ...(this.offsetPaging && { paging: this.offsetPaging }),\n ...(this.cursorPaging && { cursorPaging: this.cursorPaging }),\n }\n }\n}\n\nexport function pipelineBuilder(): PipelineBuilder {\n return new PipelineBuilderImpl()\n}\n"],"mappings":";;;;;;AAGA;AACA;AACA;;AAsCA,MAAMA,mBAAmB,CAA4B;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACjB,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;EAAA;EAIpCC,UAAUA,CAACC,MAAuB,EAAE;IAClC,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,OAAO,IAAI;EACb;EAEAC,UAAUA,CAACC,MAA6B,EAAE;IACxC,MAAMC,QAAQ,GAAG,QAAQ,IAAID,MAAM;IACnC,IAAI,CAACE,YAAY,GAAGD,QAAQ,GAAGD,MAAM,GAAGG,SAAS;IACjD,IAAI,CAACC,YAAY,GAAGH,QAAQ,GAAGE,SAAS,GAAGH,MAAM;IACjD,OAAO,IAAI;EACb;EAEAK,KAAKA,CAAA,EAAG;IACN,OAAO;MACLP,MAAM,EAAE,IAAI,CAACA,MAAM,CAACQ,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACF,KAAK,CAAC,CAAC,CAAC;MACjD,IAAI,IAAI,CAACD,YAAY,IAAI;QAAEJ,MAAM,EAAE,IAAI,CAACI;MAAa,CAAC,CAAC;MACvD,IAAI,IAAI,CAACF,YAAY,IAAI;QAAEA,YAAY,EAAE,IAAI,CAACA;MAAa,CAAC;IAC9D,CAAC;EACH;AACF;AAEO,SAASM,eAAeA,CAAA,EAAoB;EACjD,OAAO,IAAIf,mBAAmB,CAAC,CAAC;AAClC","ignoreList":[]}
@@ -3,8 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  exports.AggregateOptionsBuilder = void 0;
5
5
  /**
6
- * WixData aggregate options builder.
7
- * @internal
6
+ * Builder for aggregate options used by Wix Data aggregate operations.
7
+ *
8
+ * Use this builder to configure aggregation behavior such as language, consistent reads,
9
+ * and total counts.
10
+ * @public
11
+ * @builder
12
+ * @documentationMaturity preview
8
13
  */
9
14
 
10
15
  class WixDataAggregateOptionsBuilderImpl {
@@ -46,7 +51,26 @@ class WixDataAggregateOptionsBuilderImpl {
46
51
 
47
52
  /**
48
53
  * Creates a new WixData aggregate options builder.
49
- * @internal
54
+ * @public
55
+ * @documentationMaturity preview
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * import { items, AggregateOptionsBuilder } from '@wix/data'
60
+ *
61
+ *
62
+ * const options = AggregateOptionsBuilder()
63
+ * .withLanguage('en')
64
+ * .withConsistentRead(true)
65
+ * .withReturnTotalCount(true)
66
+ * .build()
67
+ *
68
+ * const result = await items.aggregate<MyItem>(
69
+ * 'myCollection',
70
+ * {},
71
+ * options
72
+ * )
73
+ * ```
50
74
  */
51
75
  const AggregateOptionsBuilder = () => new WixDataAggregateOptionsBuilderImpl();
52
76
  exports.AggregateOptionsBuilder = AggregateOptionsBuilder;
@@ -1 +1 @@
1
- {"version":3,"names":["WixDataAggregateOptionsBuilderImpl","constructor","options","withShowDrafts","value","copy","showDrafts","withLanguage","language","withConsistentRead","consistentRead","withReturnTotalCount","returnTotalCount","build","AggregateOptionsBuilder","exports"],"sources":["../../../src/api/WixDataAggregateOptionsBuilder.ts"],"sourcesContent":["import type { WixDataAggregateOptions } from './types'\n\n/**\n * WixData aggregate options builder.\n * @internal\n */\nexport interface WixDataAggregateOptionsBuilder {\n withShowDrafts(value: boolean): WixDataAggregateOptionsBuilder\n withLanguage(value: string): WixDataAggregateOptionsBuilder\n withConsistentRead(value: boolean): WixDataAggregateOptionsBuilder\n withReturnTotalCount(value: boolean): WixDataAggregateOptionsBuilder\n build(): WixDataAggregateOptions\n}\n\nclass WixDataAggregateOptionsBuilderImpl\n implements WixDataAggregateOptionsBuilder\n{\n constructor(private readonly options: WixDataAggregateOptions = {}) {}\n\n withShowDrafts(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ showDrafts: value })\n }\n\n withLanguage(value: string): WixDataAggregateOptionsBuilder {\n return this.copy({ language: value })\n }\n\n withConsistentRead(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ consistentRead: value })\n }\n\n withReturnTotalCount(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ returnTotalCount: value })\n }\n\n build(): WixDataAggregateOptions {\n return { ...this.options }\n }\n\n private copy(\n options: WixDataAggregateOptions\n ): WixDataAggregateOptionsBuilder {\n return new WixDataAggregateOptionsBuilderImpl({\n ...this.options,\n ...options,\n })\n }\n}\n\n/**\n * Creates a new WixData aggregate options builder.\n * @internal\n */\nexport const AggregateOptionsBuilder: () => WixDataAggregateOptionsBuilder =\n () => new WixDataAggregateOptionsBuilderImpl()\n"],"mappings":";;;;AAEA;AACA;AACA;AACA;;AASA,MAAMA,kCAAkC,CAExC;EACEC,WAAWA,CAAkBC,OAAgC,GAAG,CAAC,CAAC,EAAE;IAAA,KAAvCA,OAAgC,GAAhCA,OAAgC;EAAQ;EAErEC,cAAcA,CAACC,KAAc,EAAkC;IAC7D,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEC,UAAU,EAAEF;IAAM,CAAC,CAAC;EACzC;EAEAG,YAAYA,CAACH,KAAa,EAAkC;IAC1D,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEG,QAAQ,EAAEJ;IAAM,CAAC,CAAC;EACvC;EAEAK,kBAAkBA,CAACL,KAAc,EAAkC;IACjE,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEK,cAAc,EAAEN;IAAM,CAAC,CAAC;EAC7C;EAEAO,oBAAoBA,CAACP,KAAc,EAAkC;IACnE,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEO,gBAAgB,EAAER;IAAM,CAAC,CAAC;EAC/C;EAEAS,KAAKA,CAAA,EAA4B;IAC/B,OAAO;MAAE,GAAG,IAAI,CAACX;IAAQ,CAAC;EAC5B;EAEQG,IAAIA,CACVH,OAAgC,EACA;IAChC,OAAO,IAAIF,kCAAkC,CAAC;MAC5C,GAAG,IAAI,CAACE,OAAO;MACf,GAAGA;IACL,CAAC,CAAC;EACJ;AACF;;AAEA;AACA;AACA;AACA;AACO,MAAMY,uBAA6D,GACxEA,CAAA,KAAM,IAAId,kCAAkC,CAAC,CAAC;AAAAe,OAAA,CAAAD,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["WixDataAggregateOptionsBuilderImpl","constructor","options","withShowDrafts","value","copy","showDrafts","withLanguage","language","withConsistentRead","consistentRead","withReturnTotalCount","returnTotalCount","build","AggregateOptionsBuilder","exports"],"sources":["../../../src/api/WixDataAggregateOptionsBuilder.ts"],"sourcesContent":["import type { WixDataAggregateOptions } from './types'\n\n/**\n * Builder for aggregate options used by Wix Data aggregate operations.\n *\n * Use this builder to configure aggregation behavior such as language, consistent reads,\n * and total counts.\n * @public\n * @builder\n * @documentationMaturity preview\n */\nexport interface WixDataAggregateOptionsBuilder {\n /**\n * Sets whether draft items are included in aggregation results.\n * @internal\n */\n withShowDrafts(value: boolean): WixDataAggregateOptionsBuilder\n /**\n * Sets the language used for the aggregation.\n */\n withLanguage(value: string): WixDataAggregateOptionsBuilder\n /**\n * Sets whether the aggregation uses consistent read mode.\n */\n withConsistentRead(value: boolean): WixDataAggregateOptionsBuilder\n /**\n * Sets whether the total result count is returned with the aggregation response.\n */\n withReturnTotalCount(value: boolean): WixDataAggregateOptionsBuilder\n /**\n * Builds the aggregate options object.\n */\n build(): WixDataAggregateOptions\n}\n\nclass WixDataAggregateOptionsBuilderImpl\n implements WixDataAggregateOptionsBuilder\n{\n constructor(private readonly options: WixDataAggregateOptions = {}) {}\n\n withShowDrafts(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ showDrafts: value })\n }\n\n withLanguage(value: string): WixDataAggregateOptionsBuilder {\n return this.copy({ language: value })\n }\n\n withConsistentRead(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ consistentRead: value })\n }\n\n withReturnTotalCount(value: boolean): WixDataAggregateOptionsBuilder {\n return this.copy({ returnTotalCount: value })\n }\n\n build(): WixDataAggregateOptions {\n return { ...this.options }\n }\n\n private copy(\n options: WixDataAggregateOptions\n ): WixDataAggregateOptionsBuilder {\n return new WixDataAggregateOptionsBuilderImpl({\n ...this.options,\n ...options,\n })\n }\n}\n\n/**\n * Creates a new WixData aggregate options builder.\n * @public\n * @documentationMaturity preview\n *\n * @example\n * ```ts\n * import { items, AggregateOptionsBuilder } from '@wix/data'\n *\n *\n * const options = AggregateOptionsBuilder()\n * .withLanguage('en')\n * .withConsistentRead(true)\n * .withReturnTotalCount(true)\n * .build()\n *\n * const result = await items.aggregate<MyItem>(\n * 'myCollection',\n * {},\n * options\n * )\n * ```\n */\nexport const AggregateOptionsBuilder: () => WixDataAggregateOptionsBuilder =\n () => new WixDataAggregateOptionsBuilderImpl()\n"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBA,MAAMA,kCAAkC,CAExC;EACEC,WAAWA,CAAkBC,OAAgC,GAAG,CAAC,CAAC,EAAE;IAAA,KAAvCA,OAAgC,GAAhCA,OAAgC;EAAQ;EAErEC,cAAcA,CAACC,KAAc,EAAkC;IAC7D,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEC,UAAU,EAAEF;IAAM,CAAC,CAAC;EACzC;EAEAG,YAAYA,CAACH,KAAa,EAAkC;IAC1D,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEG,QAAQ,EAAEJ;IAAM,CAAC,CAAC;EACvC;EAEAK,kBAAkBA,CAACL,KAAc,EAAkC;IACjE,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEK,cAAc,EAAEN;IAAM,CAAC,CAAC;EAC7C;EAEAO,oBAAoBA,CAACP,KAAc,EAAkC;IACnE,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEO,gBAAgB,EAAER;IAAM,CAAC,CAAC;EAC/C;EAEAS,KAAKA,CAAA,EAA4B;IAC/B,OAAO;MAAE,GAAG,IAAI,CAACX;IAAQ,CAAC;EAC5B;EAEQG,IAAIA,CACVH,OAAgC,EACA;IAChC,OAAO,IAAIF,kCAAkC,CAAC;MAC5C,GAAG,IAAI,CAACE,OAAO;MACf,GAAGA;IACL,CAAC,CAAC;EACJ;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,uBAA6D,GACxEA,CAAA,KAAM,IAAId,kCAAkC,CAAC,CAAC;AAAAe,OAAA,CAAAD,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -298,7 +298,7 @@ class WixDataApi {
298
298
  }));
299
299
  (0, _defineProperty2.default)(this, "queryReferenced", withArgs(async (args, collectionName, holdingItem, relationshipAttribute, options) => {
300
300
  await apiValidator().arity('queryReferenced', args, 3, 4).collectionName(collectionName).referenceParameter(holdingItem).isNonEmptyString(relationshipAttribute, 'relationshipAttribute').options(options).validateAndReject();
301
- const id = itemId(holdingItem);
301
+ const id = toItemId(holdingItem);
302
302
  const fetch = (cursorOrOffset, returnTotalCount) => this.trace('queryReferenced', {
303
303
  collectionName,
304
304
  itemId: id,
@@ -465,8 +465,8 @@ class WixDataApi {
465
465
  return new _WixDataPatchImpl.WixDataPatchImpl({
466
466
  collectionName,
467
467
  itemId,
468
- onRun: async (_args, patchParams, options) => {
469
- const fieldModifications = patchParams.fieldModifications.map(this.toFieldModificationApi);
468
+ onRun: async (_args, patchParams, runOptions) => {
469
+ const apiFieldModifications = patchParams.fieldModifications.map(this.toFieldModificationApi);
470
470
  return this.trace('patch', {
471
471
  collectionName
472
472
  })(async env => {
@@ -475,9 +475,9 @@ class WixDataApi {
475
475
  dataCollectionId: patchParams.collectionName,
476
476
  patch: {
477
477
  dataItemId: patchParams.itemId,
478
- fieldModifications
478
+ fieldModifications: apiFieldModifications
479
479
  },
480
- ...toPatchOptions(options)
480
+ ...toPatchOptions(runOptions)
481
481
  });
482
482
  return result.dataItem ? toDataItem(result.dataItem) : null;
483
483
  });
@@ -519,8 +519,8 @@ class WixDataApi {
519
519
  return new _WixDataPatchImpl.WixDataBulkPatchImpl({
520
520
  collectionName,
521
521
  itemIds,
522
- onRun: async (_args, patchParams, options) => {
523
- const fieldModifications = patchParams.fieldModifications.map(this.toFieldModificationApi);
522
+ onRun: async (_args, patchParams, runOptions) => {
523
+ const apiFieldModifications = patchParams.fieldModifications.map(this.toFieldModificationApi);
524
524
  return this.trace('bulkPatch', {
525
525
  collectionName
526
526
  })(async env => {
@@ -531,9 +531,9 @@ class WixDataApi {
531
531
  dataCollectionId: patchParams.collectionName,
532
532
  patches: patchParams.itemIds.map(itemId => ({
533
533
  dataItemId: itemId,
534
- fieldModifications
534
+ fieldModifications: apiFieldModifications
535
535
  })),
536
- ...toBulkPatchOptions(options)
536
+ ...toBulkPatchOptions(runOptions)
537
537
  });
538
538
  return toBulkResult(itemIds, results, ['WDE0073']);
539
539
  });
@@ -591,8 +591,8 @@ class WixDataApi {
591
591
  };
592
592
  return new _WixDataQueryImpl.WixDataQueryImpl({
593
593
  collectionName,
594
- onCount: async (args, params, options) => {
595
- ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('count', args, 0, 1).options(options).validateAndReturn()]);
594
+ onCount: async (args, params, countOptions) => {
595
+ ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('count', args, 0, 1).options(countOptions).validateAndReturn()]);
596
596
  return this.trace('count', {
597
597
  collectionName
598
598
  })(async env => {
@@ -602,14 +602,14 @@ class WixDataApi {
602
602
  ...env,
603
603
  dataCollectionId: collectionName,
604
604
  filter: params.filterTree,
605
- ...toReadOptions(options)
605
+ ...toReadOptions(countOptions)
606
606
  });
607
607
  return totalCount;
608
608
  });
609
609
  },
610
- onDistinct: async (args, params, field, options) => {
610
+ onDistinct: async (args, params, field, distinctOptions) => {
611
611
  var _toSort$find;
612
- ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('distinct', args, 1, 2).fieldName(field).options(options).validateAndReturn()]);
612
+ ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('distinct', args, 1, 2).fieldName(field).options(distinctOptions).validateAndReturn()]);
613
613
  const order = (_toSort$find = toSort(params.orderBy).find(o => o.fieldName === field)) == null ? void 0 : _toSort$find.order;
614
614
  const fetch = (cursorOrOffset, returnTotalCount) => this.trace('distinct', {
615
615
  collectionName,
@@ -621,7 +621,7 @@ class WixDataApi {
621
621
  } = await this.client.queryDistinctValues({
622
622
  ...env,
623
623
  dataCollectionId: collectionName,
624
- ...toReadOptions(options),
624
+ ...toReadOptions(distinctOptions),
625
625
  ...toPaging(params.limitNumber, cursorOrOffset),
626
626
  ...(isOffset(cursorOrOffset) ? {
627
627
  fieldName: field,
@@ -632,11 +632,11 @@ class WixDataApi {
632
632
  });
633
633
  return [distinctValues, pagingMetadata];
634
634
  });
635
- const [items, paging] = await fetch(params.skipNumber, options == null ? void 0 : options.returnTotalCount);
635
+ const [items, paging] = await fetch(params.skipNumber, distinctOptions == null ? void 0 : distinctOptions.returnTotalCount);
636
636
  return new _WixDataResultImpl.WixDataResultImpl(items, paging, fetch, params);
637
637
  },
638
- onFind: async (args, params, options) => {
639
- ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('find', args, 0, 1).options(options).validateAndReturn()]);
638
+ onFind: async (args, params, findOptions) => {
639
+ ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).arity('find', args, 0, 1).options(findOptions).validateAndReturn()]);
640
640
  const fetch = (cursorOrOffset, returnTotalCount) => this.trace('query', {
641
641
  collectionName
642
642
  })(async env => {
@@ -655,7 +655,7 @@ class WixDataApi {
655
655
  } : {})
656
656
  },
657
657
  includeReferences: params.included,
658
- ...toReadOptions(options),
658
+ ...toReadOptions(findOptions),
659
659
  ...(isOffset(cursorOrOffset) ? {
660
660
  returnTotalCount
661
661
  } : {}),
@@ -671,7 +671,7 @@ class WixDataApi {
671
671
  });
672
672
  return [dataItems.map(toDataItem), pagingMetadata];
673
673
  });
674
- const [items, paging] = await fetch(params.skipNumber, options == null ? void 0 : options.returnTotalCount);
674
+ const [items, paging] = await fetch(params.skipNumber, findOptions == null ? void 0 : findOptions.returnTotalCount);
675
675
  return new _WixDataResultImpl.WixDataResultImpl(items, paging, fetch, params);
676
676
  }
677
677
  });
@@ -752,8 +752,8 @@ class WixDataApi {
752
752
  };
753
753
  return new _WixDataSearchImpl.WixDataSearchImpl({
754
754
  collectionName,
755
- onRun: async (params, options) => {
756
- ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).options(options).validateAndReturn()]);
755
+ onRun: async (params, searchOptions) => {
756
+ ensureValidQuery([...params.invalidArguments, ...apiValidator().collectionName(collectionName).options(searchOptions).validateAndReturn()]);
757
757
  const expression = params.queryText;
758
758
  const fetch = cursorOrOffset => this.trace('search', {
759
759
  collectionName,
@@ -774,7 +774,7 @@ class WixDataApi {
774
774
  ...toPaging(params.limitNumber, cursorOrOffset)
775
775
  },
776
776
  includeReferences: params.included,
777
- ...toReadOptions(options)
777
+ ...toReadOptions(searchOptions)
778
778
  };
779
779
  const {
780
780
  dataItems,
@@ -844,8 +844,8 @@ class WixDataApi {
844
844
  }
845
845
  return new _WixDataAggregateImpl.WixDataAggregateImpl({
846
846
  collectionName,
847
- onRun: async (args, params, options) => {
848
- const validationErrors = [...params.invalidArguments, ...apiValidator().arity('run', args, 0, 1).collectionName(collectionName).options(options).validateAndReturn()];
847
+ onRun: async (args, params, runOptions) => {
848
+ const validationErrors = [...params.invalidArguments, ...apiValidator().arity('run', args, 0, 1).collectionName(collectionName).options(runOptions).validateAndReturn()];
849
849
  if (validationErrors.length > 0) {
850
850
  throw (0, _errors.wdeValidationError)(_errors.messages.aggregateValidations.aggregateInvalid(collectionName, validationErrors));
851
851
  }
@@ -862,7 +862,7 @@ class WixDataApi {
862
862
  ...env,
863
863
  dataCollectionId: collectionName,
864
864
  ...toPaging(params.limitNumber, cursorOrOffset),
865
- ...toReadOptions(options),
865
+ ...toReadOptions(runOptions),
866
866
  ...(isOffset(cursorOrOffset) ? {
867
867
  initialFilter: params.filterTree,
868
868
  aggregation: {
@@ -883,7 +883,7 @@ class WixDataApi {
883
883
  });
884
884
  return [unwrapAggregationId(results), pagingMetadata];
885
885
  });
886
- const [items, paging] = await fetch(params.skipNumber, options == null ? void 0 : options.returnTotalCount);
886
+ const [items, paging] = await fetch(params.skipNumber, runOptions == null ? void 0 : runOptions.returnTotalCount);
887
887
  return new _WixDataResultImpl.WixDataResultImpl(items, paging, fetch, params);
888
888
  }
889
889
  });
@@ -983,7 +983,7 @@ class WixDataApi {
983
983
  }
984
984
  async queryReferencedItems(collectionName, referringItem, referringItemFieldName, options) {
985
985
  await apiValidator().arity('queryReferencedItems', arguments, 3, 4).collectionName(collectionName).referenceParameters(asArray(referringItem)).isNonEmptyString(referringItemFieldName, 'referringItemFieldName').options(options).validateAndReject();
986
- const referringItemIds = asArray(referringItem).map(itemId);
986
+ const referringItemIds = asArray(referringItem).map(toItemId);
987
987
  return this.trace('queryReferencedItems', {
988
988
  collectionName,
989
989
  referringItemIds,
@@ -1037,8 +1037,8 @@ class WixDataApi {
1037
1037
  dataCollectionId: collectionName,
1038
1038
  dataItemReferences: refs.map(r => ({
1039
1039
  referringItemFieldName: r.relationshipName,
1040
- referringItemId: itemId(r.left),
1041
- referencedItemId: itemId(r.right)
1040
+ referringItemId: toItemId(r.left),
1041
+ referencedItemId: toItemId(r.right)
1042
1042
  })),
1043
1043
  ...toOptions(opts)
1044
1044
  }));
@@ -1053,8 +1053,8 @@ class WixDataApi {
1053
1053
  ...env,
1054
1054
  dataCollectionId: collectionName,
1055
1055
  referringItemFieldName: relationshipAttribute,
1056
- referringItemId: itemId(left),
1057
- newReferencedItemIds: rights.map(itemId),
1056
+ referringItemId: toItemId(left),
1057
+ newReferencedItemIds: rights.map(toItemId),
1058
1058
  ...toOptions(options)
1059
1059
  }));
1060
1060
  }
@@ -1069,8 +1069,8 @@ class WixDataApi {
1069
1069
  dataCollectionId: collectionName,
1070
1070
  dataItemReferences: rights.map(r => ({
1071
1071
  referringItemFieldName: relationshipAttribute,
1072
- referringItemId: itemId(left),
1073
- referencedItemId: itemId(r)
1072
+ referringItemId: toItemId(left),
1073
+ referencedItemId: toItemId(r)
1074
1074
  })),
1075
1075
  ...toOptions(options)
1076
1076
  }));
@@ -1087,8 +1087,8 @@ class WixDataApi {
1087
1087
  ...env,
1088
1088
  dataCollectionId: collectionName,
1089
1089
  referringItemFieldName: relationshipAttribute,
1090
- referringItemId: itemId(left),
1091
- referencedItemId: itemId(right),
1090
+ referringItemId: toItemId(left),
1091
+ referencedItemId: toItemId(right),
1092
1092
  ...toReadOptions(options),
1093
1093
  consistentRead: options == null ? void 0 : options.consistentRead
1094
1094
  });
@@ -1197,7 +1197,7 @@ function toReadOptions(options) {
1197
1197
  };
1198
1198
  }
1199
1199
  function conditionOptions(condition) {
1200
- return condition != undefined ? {
1200
+ return condition !== undefined && condition !== null ? {
1201
1201
  condition: {
1202
1202
  filter: createFilter(condition)
1203
1203
  }
@@ -1348,7 +1348,7 @@ function toReferencedResults(results) {
1348
1348
  function notEmpty(value) {
1349
1349
  return value != null;
1350
1350
  }
1351
- function itemId(item) {
1351
+ function toItemId(item) {
1352
1352
  return typeof item === 'string' ? item : item._id;
1353
1353
  }
1354
1354
  function asArray(xOrXs) {