@wix/wix-data-items-common 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +8 -0
  2. package/dist/cjs/api/ApiClient.js +186 -0
  3. package/dist/cjs/api/ApiClient.js.map +1 -0
  4. package/dist/cjs/api/QueryBase.js +200 -0
  5. package/dist/cjs/api/QueryBase.js.map +1 -0
  6. package/dist/cjs/api/QueryValidator.js +36 -0
  7. package/dist/cjs/api/QueryValidator.js.map +1 -0
  8. package/dist/cjs/api/WixDataAggregate.js +4 -0
  9. package/dist/cjs/api/WixDataAggregate.js.map +1 -0
  10. package/dist/cjs/api/WixDataApi.js +800 -0
  11. package/dist/cjs/api/WixDataApi.js.map +1 -0
  12. package/dist/cjs/api/WixDataFilter.js +2 -0
  13. package/dist/cjs/api/WixDataFilter.js.map +1 -0
  14. package/dist/cjs/api/WixDataPatch.js +139 -0
  15. package/dist/cjs/api/WixDataPatch.js.map +1 -0
  16. package/dist/cjs/api/WixDataQuery.js +4 -0
  17. package/dist/cjs/api/WixDataQuery.js.map +1 -0
  18. package/dist/cjs/api/WixDataResult.js +4 -0
  19. package/dist/cjs/api/WixDataResult.js.map +1 -0
  20. package/dist/cjs/api/common.js +14 -0
  21. package/dist/cjs/api/common.js.map +1 -0
  22. package/dist/cjs/api/errors.js +67 -0
  23. package/dist/cjs/api/errors.js.map +1 -0
  24. package/dist/cjs/api/impl/WixDataAggregateImpl.js +193 -0
  25. package/dist/cjs/api/impl/WixDataAggregateImpl.js.map +1 -0
  26. package/dist/cjs/api/impl/WixDataQueryImpl.js +116 -0
  27. package/dist/cjs/api/impl/WixDataQueryImpl.js.map +1 -0
  28. package/dist/cjs/api/impl/WixDataResultImpl.js +111 -0
  29. package/dist/cjs/api/impl/WixDataResultImpl.js.map +1 -0
  30. package/dist/cjs/api/index.js +32 -0
  31. package/dist/cjs/api/index.js.map +1 -0
  32. package/dist/cjs/api/types.js +2 -0
  33. package/dist/cjs/api/types.js.map +1 -0
  34. package/dist/cjs/errors/base-validator.js +92 -0
  35. package/dist/cjs/errors/base-validator.js.map +1 -0
  36. package/dist/cjs/errors/errors.js +155 -0
  37. package/dist/cjs/errors/errors.js.map +1 -0
  38. package/dist/cjs/errors/index.js +15 -0
  39. package/dist/cjs/errors/index.js.map +1 -0
  40. package/dist/cjs/errors/validations.js +91 -0
  41. package/dist/cjs/errors/validations.js.map +1 -0
  42. package/dist/cjs/external-types.d.js +2 -0
  43. package/dist/cjs/external-types.d.js.map +1 -0
  44. package/dist/cjs/filter/FilterTree.js +154 -0
  45. package/dist/cjs/filter/FilterTree.js.map +1 -0
  46. package/dist/cjs/filter/WithFilter.js +2 -0
  47. package/dist/cjs/filter/WithFilter.js.map +1 -0
  48. package/dist/cjs/filter/filterBuilder.js +53 -0
  49. package/dist/cjs/filter/filterBuilder.js.map +1 -0
  50. package/dist/cjs/filter/filterMixin.js +144 -0
  51. package/dist/cjs/filter/filterMixin.js.map +1 -0
  52. package/dist/cjs/filter/index.js +16 -0
  53. package/dist/cjs/filter/index.js.map +1 -0
  54. package/dist/cjs/index.js +120 -0
  55. package/dist/cjs/index.js.map +1 -0
  56. package/dist/cjs/sort/sortMixin.js +79 -0
  57. package/dist/cjs/sort/sortMixin.js.map +1 -0
  58. package/dist/cjs/test-types.d.js +2 -0
  59. package/dist/cjs/test-types.d.js.map +1 -0
  60. package/dist/cjs/types/api.js +4 -0
  61. package/dist/cjs/types/api.js.map +1 -0
  62. package/dist/cjs/types/data-item-types.js +46 -0
  63. package/dist/cjs/types/data-item-types.js.map +1 -0
  64. package/dist/cjs/types/error.js +2 -0
  65. package/dist/cjs/types/error.js.map +1 -0
  66. package/dist/cjs/types/index.js +16 -0
  67. package/dist/cjs/types/index.js.map +1 -0
  68. package/dist/cjs/utils/base64url.js +51 -0
  69. package/dist/cjs/utils/base64url.js.map +1 -0
  70. package/dist/cjs/utils/clone.js +21 -0
  71. package/dist/cjs/utils/clone.js.map +1 -0
  72. package/dist/cjs/utils/codec.js +64 -0
  73. package/dist/cjs/utils/codec.js.map +1 -0
  74. package/dist/cjs/utils/field-key-utils.js +18 -0
  75. package/dist/cjs/utils/field-key-utils.js.map +1 -0
  76. package/dist/cjs/utils/index.js +25 -0
  77. package/dist/cjs/utils/index.js.map +1 -0
  78. package/dist/cjs/utils/type-utils.js +54 -0
  79. package/dist/cjs/utils/type-utils.js.map +1 -0
  80. package/dist/esm/api/ApiClient.js +174 -0
  81. package/dist/esm/api/ApiClient.js.map +1 -0
  82. package/dist/esm/api/QueryBase.js +117 -0
  83. package/dist/esm/api/QueryBase.js.map +1 -0
  84. package/dist/esm/api/QueryValidator.js +32 -0
  85. package/dist/esm/api/QueryValidator.js.map +1 -0
  86. package/dist/esm/api/WixDataAggregate.js +2 -0
  87. package/dist/esm/api/WixDataAggregate.js.map +1 -0
  88. package/dist/esm/api/WixDataApi.js +829 -0
  89. package/dist/esm/api/WixDataApi.js.map +1 -0
  90. package/dist/esm/api/WixDataFilter.js +2 -0
  91. package/dist/esm/api/WixDataFilter.js.map +1 -0
  92. package/dist/esm/api/WixDataPatch.js +134 -0
  93. package/dist/esm/api/WixDataPatch.js.map +1 -0
  94. package/dist/esm/api/WixDataQuery.js +2 -0
  95. package/dist/esm/api/WixDataQuery.js.map +1 -0
  96. package/dist/esm/api/WixDataResult.js +2 -0
  97. package/dist/esm/api/WixDataResult.js.map +1 -0
  98. package/dist/esm/api/common.js +10 -0
  99. package/dist/esm/api/common.js.map +1 -0
  100. package/dist/esm/api/errors.js +52 -0
  101. package/dist/esm/api/errors.js.map +1 -0
  102. package/dist/esm/api/impl/WixDataAggregateImpl.js +214 -0
  103. package/dist/esm/api/impl/WixDataAggregateImpl.js.map +1 -0
  104. package/dist/esm/api/impl/WixDataQueryImpl.js +119 -0
  105. package/dist/esm/api/impl/WixDataQueryImpl.js.map +1 -0
  106. package/dist/esm/api/impl/WixDataResultImpl.js +100 -0
  107. package/dist/esm/api/impl/WixDataResultImpl.js.map +1 -0
  108. package/dist/esm/api/index.js +5 -0
  109. package/dist/esm/api/index.js.map +1 -0
  110. package/dist/esm/api/types.js +2 -0
  111. package/dist/esm/api/types.js.map +1 -0
  112. package/dist/esm/errors/base-validator.js +71 -0
  113. package/dist/esm/errors/base-validator.js.map +1 -0
  114. package/dist/esm/errors/errors.js +147 -0
  115. package/dist/esm/errors/errors.js.map +1 -0
  116. package/dist/esm/errors/index.js +5 -0
  117. package/dist/esm/errors/index.js.map +1 -0
  118. package/dist/esm/errors/validations.js +114 -0
  119. package/dist/esm/errors/validations.js.map +1 -0
  120. package/dist/esm/filter/FilterTree.js +148 -0
  121. package/dist/esm/filter/FilterTree.js.map +1 -0
  122. package/dist/esm/filter/WithFilter.js +2 -0
  123. package/dist/esm/filter/WithFilter.js.map +1 -0
  124. package/dist/esm/filter/filterBuilder.js +43 -0
  125. package/dist/esm/filter/filterBuilder.js.map +1 -0
  126. package/dist/esm/filter/filterMixin.js +137 -0
  127. package/dist/esm/filter/filterMixin.js.map +1 -0
  128. package/dist/esm/filter/index.js +5 -0
  129. package/dist/esm/filter/index.js.map +1 -0
  130. package/dist/esm/index.js +9 -0
  131. package/dist/esm/index.js.map +1 -0
  132. package/dist/esm/sort/sortMixin.js +74 -0
  133. package/dist/esm/sort/sortMixin.js.map +1 -0
  134. package/dist/esm/types/api.js +2 -0
  135. package/dist/esm/types/api.js.map +1 -0
  136. package/dist/esm/types/data-item-types.js +35 -0
  137. package/dist/esm/types/data-item-types.js.map +1 -0
  138. package/dist/esm/types/error.js +2 -0
  139. package/dist/esm/types/error.js.map +1 -0
  140. package/dist/esm/types/index.js +3 -0
  141. package/dist/esm/types/index.js.map +1 -0
  142. package/dist/esm/utils/base64url.js +57 -0
  143. package/dist/esm/utils/base64url.js.map +1 -0
  144. package/dist/esm/utils/clone.js +18 -0
  145. package/dist/esm/utils/clone.js.map +1 -0
  146. package/dist/esm/utils/codec.js +60 -0
  147. package/dist/esm/utils/codec.js.map +1 -0
  148. package/dist/esm/utils/field-key-utils.js +14 -0
  149. package/dist/esm/utils/field-key-utils.js.map +1 -0
  150. package/dist/esm/utils/index.js +7 -0
  151. package/dist/esm/utils/index.js.map +1 -0
  152. package/dist/esm/utils/type-utils.js +40 -0
  153. package/dist/esm/utils/type-utils.js.map +1 -0
  154. package/dist/types/api/ApiClient.d.ts +30 -0
  155. package/dist/types/api/ApiClient.d.ts.map +1 -0
  156. package/dist/types/api/QueryBase.d.ts +111 -0
  157. package/dist/types/api/QueryBase.d.ts.map +1 -0
  158. package/dist/types/api/QueryValidator.d.ts +12 -0
  159. package/dist/types/api/QueryValidator.d.ts.map +1 -0
  160. package/dist/types/api/WixDataAggregate.d.ts +320 -0
  161. package/dist/types/api/WixDataAggregate.d.ts.map +1 -0
  162. package/dist/types/api/WixDataApi.d.ts +52 -0
  163. package/dist/types/api/WixDataApi.d.ts.map +1 -0
  164. package/dist/types/api/WixDataFilter.d.ts +424 -0
  165. package/dist/types/api/WixDataFilter.d.ts.map +1 -0
  166. package/dist/types/api/WixDataPatch.d.ts +80 -0
  167. package/dist/types/api/WixDataPatch.d.ts.map +1 -0
  168. package/dist/types/api/WixDataQuery.d.ts +702 -0
  169. package/dist/types/api/WixDataQuery.d.ts.map +1 -0
  170. package/dist/types/api/WixDataResult.d.ts +144 -0
  171. package/dist/types/api/WixDataResult.d.ts.map +1 -0
  172. package/dist/types/api/common.d.ts +3 -0
  173. package/dist/types/api/common.d.ts.map +1 -0
  174. package/dist/types/api/errors.d.ts +12 -0
  175. package/dist/types/api/errors.d.ts.map +1 -0
  176. package/dist/types/api/impl/WixDataAggregateImpl.d.ts +76 -0
  177. package/dist/types/api/impl/WixDataAggregateImpl.d.ts.map +1 -0
  178. package/dist/types/api/impl/WixDataQueryImpl.d.ts +72 -0
  179. package/dist/types/api/impl/WixDataQueryImpl.d.ts.map +1 -0
  180. package/dist/types/api/impl/WixDataResultImpl.d.ts +34 -0
  181. package/dist/types/api/impl/WixDataResultImpl.d.ts.map +1 -0
  182. package/dist/types/api/index.d.ts +11 -0
  183. package/dist/types/api/index.d.ts.map +1 -0
  184. package/dist/types/api/types.d.ts +163 -0
  185. package/dist/types/api/types.d.ts.map +1 -0
  186. package/dist/types/errors/base-validator.d.ts +28 -0
  187. package/dist/types/errors/base-validator.d.ts.map +1 -0
  188. package/dist/types/errors/errors.d.ts +108 -0
  189. package/dist/types/errors/errors.d.ts.map +1 -0
  190. package/dist/types/errors/index.d.ts +5 -0
  191. package/dist/types/errors/index.d.ts.map +1 -0
  192. package/dist/types/errors/validations.d.ts +25 -0
  193. package/dist/types/errors/validations.d.ts.map +1 -0
  194. package/dist/types/filter/FilterTree.d.ts +56 -0
  195. package/dist/types/filter/FilterTree.d.ts.map +1 -0
  196. package/dist/types/filter/WithFilter.d.ts +470 -0
  197. package/dist/types/filter/WithFilter.d.ts.map +1 -0
  198. package/dist/types/filter/filterBuilder.d.ts +105 -0
  199. package/dist/types/filter/filterBuilder.d.ts.map +1 -0
  200. package/dist/types/filter/filterMixin.d.ts +61 -0
  201. package/dist/types/filter/filterMixin.d.ts.map +1 -0
  202. package/dist/types/filter/index.d.ts +8 -0
  203. package/dist/types/filter/index.d.ts.map +1 -0
  204. package/dist/types/index.d.ts +13 -0
  205. package/dist/types/index.d.ts.map +1 -0
  206. package/dist/types/sort/sortMixin.d.ts +46 -0
  207. package/dist/types/sort/sortMixin.d.ts.map +1 -0
  208. package/dist/types/types/api.d.ts +36 -0
  209. package/dist/types/types/api.d.ts.map +1 -0
  210. package/dist/types/types/data-item-types.d.ts +1448 -0
  211. package/dist/types/types/data-item-types.d.ts.map +1 -0
  212. package/dist/types/types/error.d.ts +23 -0
  213. package/dist/types/types/error.d.ts.map +1 -0
  214. package/dist/types/types/index.d.ts +4 -0
  215. package/dist/types/types/index.d.ts.map +1 -0
  216. package/dist/types/utils/base64url.d.ts +2 -0
  217. package/dist/types/utils/base64url.d.ts.map +1 -0
  218. package/dist/types/utils/clone.d.ts +2 -0
  219. package/dist/types/utils/clone.d.ts.map +1 -0
  220. package/dist/types/utils/codec.d.ts +3 -0
  221. package/dist/types/utils/codec.d.ts.map +1 -0
  222. package/dist/types/utils/field-key-utils.d.ts +2 -0
  223. package/dist/types/utils/field-key-utils.d.ts.map +1 -0
  224. package/dist/types/utils/index.d.ts +7 -0
  225. package/dist/types/utils/index.d.ts.map +1 -0
  226. package/dist/types/utils/type-utils.d.ts +11 -0
  227. package/dist/types/utils/type-utils.d.ts.map +1 -0
  228. package/package.json +89 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_typeUtils","filterTreeValidations","errors","messages","validateFilterOrThrow","tree","failures","validateFilterTree","length","validationError","join","path","isObject","objectType","collectedErrors","key","Object","keys","value","at","isArray","push","arrayType","flatMap","x","arrayLength","startsWith","validateOperatorOrValue","isComparableValue","some","op","validateOperator","operator","comparisonOperatorType","isString","stringOperatorType","isBoolean","every","setOperatorItems","ignoreCase","matchesOperatorIgnoreCase","spec","validSpec","type","invalid","find","undefined","matchesOperatorSpecItems","regexNotAllowed","isDate","isNumber","$date","prefix","next"],"sources":["../../../src/filter/FilterTree.ts"],"sourcesContent":["import { messages, validationError } from '../errors/errors'\nimport {\n isArray,\n isObject,\n isString,\n isDate,\n isNumber,\n isBoolean,\n} from '../utils/type-utils'\n\nexport type FilterTree =\n | FieldFilter\n | { $and?: FilterTree[] }\n | { $or?: FilterTree[] }\n | { $not?: FilterTree | [FilterTree] } // [FilterTree] is old format\n\nexport type FieldFilter = {\n // just value is equivalent $eq operator\n [field: string]: Operator | Value\n}\n\ntype DateValue = Date | { $date: string }\n\ntype ComparableValue = string | number | DateValue\n\ntype Value = any\n\nexport type Operator =\n | { $eq?: Value }\n | { $ne?: Value }\n | { $gt?: ComparableValue }\n | { $gte?: ComparableValue }\n | { $lt?: ComparableValue }\n | { $lte?: ComparableValue }\n | { $startsWith?: string }\n | { $endsWith?: string }\n | { $contains?: string }\n | { $exists?: boolean }\n | { $hasSome?: ComparableValue[] }\n | { $in?: ComparableValue[] }\n | { $hasAll?: ComparableValue[] }\n | {\n $matches?: {\n specs: {\n type: 'literal' | 'anyOf'\n value: string\n }[]\n ignoreCase: true\n }\n }\n | { $not?: Operator }\n\nconst { filterTreeValidations: errors } = messages\n\nexport function validateFilterOrThrow(tree: unknown): tree is FilterTree {\n const failures = validateFilterTree(tree)\n if (failures.length === 0) {\n return true\n }\n throw validationError(`Invalid filter:${failures.join('\\n')}`)\n}\n\nexport function validateFilterTree(tree: unknown, path?: string): string[] {\n if (!isObject(tree)) {\n return [errors.objectType('Filter Model', tree)]\n }\n const collectedErrors = [] as string[]\n for (const key of Object.keys(tree)) {\n const value = tree[key]\n const at = join(path, key)\n switch (key) {\n case '$and':\n case '$or':\n if (!isArray(value)) {\n collectedErrors.push(errors.arrayType(at, value))\n }\n if (isArray(value)) {\n collectedErrors.push(\n ...value.flatMap((x) => validateFilterTree(x, at))\n )\n }\n break\n case '$not':\n if (!isArray(value)) {\n collectedErrors.push(...validateFilterTree(value, at))\n }\n if (isArray(value) && value.length !== 1) {\n collectedErrors.push(errors.arrayLength(at, 1, value))\n }\n if (isArray(value) && value.length > 0) {\n collectedErrors.push(...validateFilterTree(value[0], at))\n }\n break\n default:\n if (key.startsWith('$')) {\n collectedErrors.push(`Unexpected operator ${at}`)\n } else {\n collectedErrors.push(...validateOperatorOrValue(value, at))\n }\n }\n }\n return collectedErrors\n}\n\nfunction validateOperatorOrValue(value: unknown, path: string): string[] {\n if (\n isObject(value) &&\n !isComparableValue(value) &&\n Object.keys(value).some((op) => op.startsWith('$'))\n ) {\n return validateOperator(value, path)\n }\n return []\n}\n\nfunction validateOperator(operator: unknown, path: string): string[] {\n if (!isObject(operator)) {\n return [errors.objectType(path, operator)]\n }\n const collectedErrors = [] as string[]\n for (const key of Object.keys(operator)) {\n const at = join(path, key)\n const value = operator[key]\n switch (key) {\n case '$eq':\n case '$ne':\n break\n case '$gt':\n case '$gte':\n case '$lt':\n case '$lte':\n if (!isComparableValue(value)) {\n collectedErrors.push(errors.comparisonOperatorType(at, value))\n }\n break\n case '$startsWith':\n case '$endsWith':\n case '$contains':\n if (!isString(value)) {\n collectedErrors.push(errors.stringOperatorType(at, value))\n }\n break\n case '$exists':\n if (!isBoolean(value)) {\n collectedErrors.push(`${at} should be a Boolean`)\n }\n break\n case '$hasSome':\n case '$hasAll':\n case '$in':\n if (!isArray(value)) {\n collectedErrors.push(errors.arrayType(at, value))\n }\n if (isArray(value) && !value.every(isComparableValue)) {\n collectedErrors.push(errors.setOperatorItems(at, value))\n }\n break\n case '$matches':\n if (!isObject(value)) {\n collectedErrors.push(errors.objectType(at, value))\n }\n if (isObject(value) && value.ignoreCase !== true) {\n collectedErrors.push(errors.matchesOperatorIgnoreCase(value))\n }\n if (isObject(value) && !isArray(value.spec)) {\n collectedErrors.push(errors.arrayType(`${at}.spec`, value.spec))\n }\n if (isArray(value?.spec)) {\n const validSpec = (spec: any) => {\n if (!isObject(spec)) {\n return false\n }\n if (spec.type === 'anyOf' && spec.value === ' \\t\\n-') {\n return true\n }\n return spec.type === 'literal' && isString(spec.value)\n }\n const invalid = value.spec.find((x: any) => !validSpec(x))\n if (invalid !== undefined) {\n collectedErrors.push(errors.matchesOperatorSpecItems(invalid))\n }\n }\n break\n case '$regex':\n collectedErrors.push(errors.regexNotAllowed())\n break\n case '$not':\n collectedErrors.push(...validateOperator(value, at))\n break\n default:\n collectedErrors.push(`Unknown operator ${at}`)\n }\n }\n return collectedErrors\n}\n\nfunction isComparableValue(x: unknown): x is ComparableValue {\n if (isDate(x) || isString(x) || isNumber(x)) {\n return true\n }\n return isObject(x) && isString(x.$date) && Object.keys(x).length === 1\n}\n\nfunction join(prefix: string | undefined, next: string) {\n return prefix === undefined ? next : `${prefix}.${next}`\n}\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAayC;;AAsCzC,MAAM;EAAEE,qBAAqB,EAAEC;AAAO,CAAC,GAAGC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,OAAO,CAAC,CAAC;UAChE;QACF;QACA;MACF,KAAK,QAAQ;QACX9B,eAAe,CAACO,IAAI,CAACnB,MAAM,CAAC8C,eAAe,CAAC,CAAC,CAAC;QAC9C;MACF,KAAK,MAAM;QACTlC,eAAe,CAACO,IAAI,CAAC,GAAGU,gBAAgB,CAACb,KAAK,EAAEC,EAAE,CAAC,CAAC;QACpD;MACF;QACEL,eAAe,CAACO,IAAI,CAAE,oBAAmBF,EAAG,EAAC,CAAC;IAClD;EACF;EACA,OAAOL,eAAe;AACxB;AAEA,SAASc,iBAAiBA,CAACJ,CAAU,EAAwB;EAC3D,IAAI,IAAAyB,iBAAM,EAACzB,CAAC,CAAC,IAAI,IAAAU,mBAAQ,EAACV,CAAC,CAAC,IAAI,IAAA0B,mBAAQ,EAAC1B,CAAC,CAAC,EAAE;IAC3C,OAAO,IAAI;EACb;EACA,OAAO,IAAAZ,mBAAQ,EAACY,CAAC,CAAC,IAAI,IAAAU,mBAAQ,EAACV,CAAC,CAAC2B,KAAK,CAAC,IAAInC,MAAM,CAACC,IAAI,CAACO,CAAC,CAAC,CAAChB,MAAM,KAAK,CAAC;AACxE;AAEA,SAASE,IAAIA,CAAC0C,MAA0B,EAAEC,IAAY,EAAE;EACtD,OAAOD,MAAM,KAAKN,SAAS,GAAGO,IAAI,GAAI,GAAED,MAAO,IAAGC,IAAK,EAAC;AAC1D"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=WithFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/filter/WithFilter.ts"],"sourcesContent":["type Comparable = string | number | Date\n\n/**\n * Type that allow filter construction.\n * All construction methods return copy of self\n */\nexport default interface WithFilter<Self extends WithFilter<Self>> {\n /**\n * Filter JSON, possibly invalid\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * Validation errors, if empty filterTree is valid\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Refines a query or filter to match items whose specified property value equals the specified value.\n *\n * The `eq()` function refines this filter to only\n * match items where the value of the specified property equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type Array, `eq()` includes the item\n * as long as at least one Array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n eq(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` function refines this filter to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an Array, `ne()` includes items\n * in which none of the elements of the Array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ne(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` function refines this filter to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ge(field: string, value: Comparable): Self\n\n /**\n * Alias for `ge()`\n * @internal\n */\n gte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` function refines this filter to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n gt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` function refines this filter to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n le(field: string, value: Comparable): Self\n\n /**\n * Alias for `le()`\n * @internal\n */\n lte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than the specified value.\n *\n * The `lt()` function refines this filter to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n lt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property has any value.\n *\n * The `isNotEmpty()` function refines this filter to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isNotEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property does not exist or does not have any value.\n *\n * The `isEmpty()` function refines this filter to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value starts with a specified string.\n *\n * The `startsWith()` function refines this filter to\n * only match items where the value of the specified property starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with the `value` parameter.\n * @requiredField field\n * @param value - The string to look for at the beginning of the specified property value.\n * @requiredField value\n * @returns A `WixDataQuery` object representing the refined query.\n */\n startsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value ends with a specified string.\n *\n * The `endsWith()` function refines this filter to only\n * match items where the value of the specified property ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with the string.\n * @requiredField field\n * @param value - The string to look for at the end of the specified property value.\n * @requiredField value\n * @returns A `WixDataQuery` object representing the refined query.\n */\n endsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value contains a specified string.\n *\n * The `contains()` function refines this filter to\n * only match items where the value of the specified property contains the\n * specified `string`. Matching with `contains()` is not case sensitive, so\n * `\"text\"` does contain `\"Tex\"`.\n *\n * You can use `contains()` with a property whose value is a String or a Reference.\n * For properties of type reference it is recommended that you use the [`eq()`](#eq)\n * function instead of `contains()`. With properties that are References, `contains()`\n * matches by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n contains(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` function refines this filter to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasSome(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, ...values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, values: Comparable[]): Self\n\n /**\n * Refines a query or filter to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` function refines this filter to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasAll(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): Self\n\n /**\n * Exists filter.\n * @returns `current $and (field $exists value)`\n * @internal\n */\n exists(field: string, value: boolean): Self\n\n /**\n * Adds an `or` condition to the query or filter.\n *\n * The `or()` function adds an inclusive `or` condition to this filter. A query or filter\n * with an `or` returns all the items that match the query or filter as defined up to\n * the `or` function, the items that match the query or filter passed to the `or`\n * function, and the items that match both.\n *\n * The collections used by both the initial query and the query passed\n * to the `or` function must be the same.\n *\n * The 'or()' function is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - A filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns An object representing the refined query.\n */\n or(filter: WithFilter<any>): Self\n\n /**\n * Adds an `and` condition to the query or filter.\n *\n * The `and()` function adds an and condition to this query. A query or filter with an `and` returns all the items\n * that match the query or filter as defined up to the `and` function and also match the query or filter passed to\n * the `and` function.\n *\n * Note that when chaining multiple `WixDataFilter` functions to a query an and condition is assumed. In such cases,\n * you do not need to add a call to the `and()` function. For example, this query returns results where status is\n * active **and** age is greater than 25.\n * ```js\n * wixData.query(\"myCollection\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` function is needed when performing compound queries. For example, the final query in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```js\n * let statusQuery = wixData\n * .query(\"myCollection\")\n * .eq(\"status\", \"pending\")\n * .or(wixData.query(\"myCollection\").eq(\"status\", \"rejected\"));\n *\n * let ageQuery = wixData\n * .query(\"myCollection\")\n * .lt(\"age\", 25)\n * .or(wixData.query(\"myCollection\").gt(\"age\", 65));\n *\n * let statusAndAgeQuery = statusQuery.and(ageQuery);\n * ```\n *\n * The collections referenced by both the initial query and the query passed to the `and` function must be the same.\n *\n * The `and()` function is designed to work with 2 or more queries or filters. If you use it on its own, it will\n * return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - A filter to add to the initial query as an `and` condition.\n * @requiredField filter\n * @returns An object representing the refined query.\n */\n and(filter: WithFilter<any>): Self\n\n /**\n * Adds a `not` condition to the query or filter.\n *\n * The `not()` function adds a `not` condition to this filter. A query or filter with a `not`\n * returns all the items that match the query or filter as defined up to the `not`\n * function, but don't match the query or filter passed to the `not` function.\n *\n * If the query or filter only contains a `not()` function, it returns all the items\n * that don't match the query defined by the `not` method.\n *\n * The collections referenced by both the initial query and the query passed\n * to the `not` function must be the same.\n * @public\n * @documentationMaturity preview\n * @param filter - A filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns An object representing the refined query.\n */\n not(filter: WithFilter<any>): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is within a specified range.\n *\n * The `between()` function refines this query to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * It only matches values of the same type. For example, a number value stored as a String type does not match the\n * same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared alphabetically and not numerically. Items\n * that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - The beginning value of the range to match against.\n * @requiredField rangeStart\n * @param rangeEnd - The ending value of the range to match against.\n * @requiredField rangeEnd\n * @returns An object representing the refined query.\n */\n between<T extends Comparable>(field: string, rangeStart: T, rangeEnd: T): Self\n}\n"],"mappings":""}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.default = exports.PlatformizedFilterBuilder = exports.FilterBuilder = void 0;
6
+ exports.filterBuilderFactory = filterBuilderFactory;
7
+ exports.platformizedFilterBuilder = platformizedFilterBuilder;
8
+ var _filterMixin = _interopRequireDefault(require("./filterMixin"));
9
+ class FilterBuilder extends (0, _filterMixin.default)() {
10
+ get constructorName() {
11
+ return 'FilterBuilder';
12
+ }
13
+ _build() {
14
+ return this.getFilterModel();
15
+ }
16
+ }
17
+ exports.FilterBuilder = FilterBuilder;
18
+ class PlatformizedFilterBuilder extends (0, _filterMixin.default)() {
19
+ in(...args) {
20
+ return this._AndSetOperand('$in', '.in', args);
21
+ }
22
+ exists(...args) {
23
+ return this._binaryAnd('$exists', '.exists', args);
24
+ }
25
+ gte(field, value) {
26
+ return this.ge(field, value);
27
+ }
28
+ lte(field, value) {
29
+ return this.le(field, value);
30
+ }
31
+ build() {
32
+ return this.getFilterModel();
33
+ }
34
+ hasAnyFilter() {
35
+ var _this$filterTree;
36
+ if (this.filterTree === null || this.filterTree === undefined) {
37
+ return false;
38
+ }
39
+ if (!Object.keys(this.filterTree).every(x => x === '$and')) {
40
+ return false;
41
+ }
42
+ return (((_this$filterTree = this.filterTree) == null || (_this$filterTree = _this$filterTree.$and) == null ? void 0 : _this$filterTree.length) ?? 0) > 0;
43
+ }
44
+ }
45
+ exports.PlatformizedFilterBuilder = PlatformizedFilterBuilder;
46
+ function platformizedFilterBuilder(options = {}) {
47
+ return new PlatformizedFilterBuilder(options);
48
+ }
49
+ function filterBuilderFactory() {
50
+ return new FilterBuilder({});
51
+ }
52
+ var _default = exports.default = filterBuilderFactory;
53
+ //# sourceMappingURL=filterBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_filterMixin","_interopRequireDefault","require","FilterBuilder","filterMixin","constructorName","_build","getFilterModel","exports","PlatformizedFilterBuilder","in","args","_AndSetOperand","exists","_binaryAnd","gte","field","value","ge","lte","le","build","hasAnyFilter","_this$filterTree","filterTree","undefined","Object","keys","every","x","$and","length","platformizedFilterBuilder","options","filterBuilderFactory","_default","default"],"sources":["../../../src/filter/filterBuilder.ts"],"sourcesContent":["import filterMixin from './filterMixin'\nimport WithFilter from './WithFilter'\n\nexport class FilterBuilder extends filterMixin() {\n get constructorName() {\n return 'FilterBuilder'\n }\n\n _build() {\n return this.getFilterModel()\n }\n}\n\nexport class PlatformizedFilterBuilder\n extends filterMixin()\n implements WithFilter<PlatformizedFilterBuilder>\n{\n in(...args: any[]) {\n return this._AndSetOperand('$in', '.in', args)\n }\n\n exists(...args: any[]) {\n return this._binaryAnd('$exists', '.exists', args)\n }\n\n gte(field: any, value: any) {\n return this.ge(field, value)\n }\n\n lte(field: any, value: any) {\n return this.le(field, value)\n }\n\n build() {\n return this.getFilterModel()\n }\n\n hasAnyFilter(): boolean {\n if (this.filterTree === null || this.filterTree === undefined) {\n return false\n }\n if (!Object.keys(this.filterTree).every((x) => x === '$and')) {\n return false\n }\n return (this.filterTree?.$and?.length ?? 0) > 0\n }\n}\n\nexport function platformizedFilterBuilder(options = {}) {\n return new PlatformizedFilterBuilder(options)\n}\n\nexport function filterBuilderFactory() {\n return new FilterBuilder({})\n}\n\nexport default filterBuilderFactory\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGO,MAAMC,aAAa,SAAS,IAAAC,oBAAW,EAAC,CAAC,CAAC;EAC/C,IAAIC,eAAeA,CAAA,EAAG;IACpB,OAAO,eAAe;EACxB;EAEAC,MAAMA,CAAA,EAAG;IACP,OAAO,IAAI,CAACC,cAAc,CAAC,CAAC;EAC9B;AACF;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAEM,MAAMM,yBAAyB,SAC5B,IAAAL,oBAAW,EAAC,CAAC,CAEvB;EACEM,EAAEA,CAAC,GAAGC,IAAW,EAAE;IACjB,OAAO,IAAI,CAACC,cAAc,CAAC,KAAK,EAAE,KAAK,EAAED,IAAI,CAAC;EAChD;EAEAE,MAAMA,CAAC,GAAGF,IAAW,EAAE;IACrB,OAAO,IAAI,CAACG,UAAU,CAAC,SAAS,EAAE,SAAS,EAAEH,IAAI,CAAC;EACpD;EAEAI,GAAGA,CAACC,KAAU,EAAEC,KAAU,EAAE;IAC1B,OAAO,IAAI,CAACC,EAAE,CAACF,KAAK,EAAEC,KAAK,CAAC;EAC9B;EAEAE,GAAGA,CAACH,KAAU,EAAEC,KAAU,EAAE;IAC1B,OAAO,IAAI,CAACG,EAAE,CAACJ,KAAK,EAAEC,KAAK,CAAC;EAC9B;EAEAI,KAAKA,CAAA,EAAG;IACN,OAAO,IAAI,CAACd,cAAc,CAAC,CAAC;EAC9B;EAEAe,YAAYA,CAAA,EAAY;IAAA,IAAAC,gBAAA;IACtB,IAAI,IAAI,CAACC,UAAU,KAAK,IAAI,IAAI,IAAI,CAACA,UAAU,KAAKC,SAAS,EAAE;MAC7D,OAAO,KAAK;IACd;IACA,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACH,UAAU,CAAC,CAACI,KAAK,CAAEC,CAAC,IAAKA,CAAC,KAAK,MAAM,CAAC,EAAE;MAC5D,OAAO,KAAK;IACd;IACA,OAAO,CAAC,EAAAN,gBAAA,OAAI,CAACC,UAAU,cAAAD,gBAAA,GAAfA,gBAAA,CAAiBO,IAAI,qBAArBP,gBAAA,CAAuBQ,MAAM,KAAI,CAAC,IAAI,CAAC;EACjD;AACF;AAACvB,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAEM,SAASuB,yBAAyBA,CAACC,OAAO,GAAG,CAAC,CAAC,EAAE;EACtD,OAAO,IAAIxB,yBAAyB,CAACwB,OAAO,CAAC;AAC/C;AAEO,SAASC,oBAAoBA,CAAA,EAAG;EACrC,OAAO,IAAI/B,aAAa,CAAC,CAAC,CAAC,CAAC;AAC9B;AAAC,IAAAgC,QAAA,GAAA3B,OAAA,CAAA4B,OAAA,GAEcF,oBAAoB"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.default = exports.FilterValidator = void 0;
6
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _typeUtils = require("../utils/type-utils");
8
+ var _baseValidator = require("../errors/base-validator");
9
+ var _errors = require("../errors/errors");
10
+ var _filterBuilder = require("@wix/filter-builder");
11
+ const filterMixin = (Base = class {}) => class extends (0, _filterBuilder.filterMixin)(Base) {
12
+ constructor(origin) {
13
+ super(origin);
14
+ (0, _defineProperty2.default)(this, "validateCollectionName", void 0);
15
+ this.validateCollectionName = (origin == null ? void 0 : origin.validateCollectionName) ?? true;
16
+ }
17
+ or(otherQuery) {
18
+ const orQuery = super.or.apply(this, arguments);
19
+ return this._validateCollectionName(orQuery, otherQuery, '.or');
20
+ }
21
+ and(otherQuery) {
22
+ const andQuery = super.and.apply(this, arguments);
23
+ return this._validateCollectionName(andQuery, otherQuery, '.and');
24
+ }
25
+ not(otherQuery) {
26
+ const notQuery = super.not.apply(this, arguments);
27
+ return this._validateCollectionName(notQuery, otherQuery, '.not');
28
+ }
29
+ _validateCollectionName(query, originalQuery, operationName) {
30
+ if (query.invalidArguments.length > 0 || !this.validateCollectionName) {
31
+ return query;
32
+ }
33
+ const withCollectionName = withCollectionNameIfUnset(originalQuery, this.collectionName);
34
+ const [newInvalidArguments, valid] = new FilterValidator(operationName, query.invalidArguments, this.constructor, this.constructorName ?? this.constructor.name).isForCollection(withCollectionName, this.collectionName).validateAndAggregate();
35
+ if (!valid) {
36
+ return this._copy(this.filterTree, newInvalidArguments);
37
+ }
38
+ return query;
39
+ }
40
+
41
+ // used only from data binding router internally
42
+ _matchesUrlized(field, operand) {
43
+ const [newInvalidArguments, valid] = this._filterValidator('._matchesUrlized').arityIsTwo(arguments).validFieldName(field).typeIsString(operand).validateAndAggregate();
44
+ if (valid) {
45
+ const newFilterTree = this._makeNewFilter(field,
46
+ // @ts-ignore-next-line
47
+ ...createMatchesOrInFilter(operand));
48
+ return this._copy(newFilterTree, newInvalidArguments);
49
+ }
50
+ return this._copy(this.filterTree, newInvalidArguments);
51
+ }
52
+ getFilterModel() {
53
+ if (this.invalidArguments.length > 0) {
54
+ throw (0, _errors.validationError)(_errors.messages.filterBuilderInvalid(this.invalidArguments));
55
+ }
56
+ return super.getFilterModel();
57
+ }
58
+ _filterValidator(filterOperatorName) {
59
+ return new FilterValidator(filterOperatorName, this.invalidArguments, this.constructor, this.constructorName ?? this.constructor.name);
60
+ }
61
+ };
62
+ function createMatchesOrInFilter(operand) {
63
+ if (looksLikeAnInteger(operand)) {
64
+ // eslint-disable-next-line radix
65
+ return ['$in', [operand, Number.parseInt(operand)]];
66
+ } else {
67
+ return ['$matches', {
68
+ ignoreCase: true,
69
+ spec: createMatchSpec(operand)
70
+ }];
71
+ }
72
+ function looksLikeAnInteger(str) {
73
+ return /^-?[0-9]{1,16}$/.test(str);
74
+ }
75
+ }
76
+ function createMatchSpec(fieldValue) {
77
+ const literals = fieldValue.split('-');
78
+ const result = [];
79
+ for (let i = 0; i < literals.length - 1; i++) {
80
+ appendLiteralSegment(result, literals[i]);
81
+ appendAnyOfSegment(result);
82
+ }
83
+ appendLiteralSegment(result, literals[literals.length - 1]);
84
+ return result;
85
+ function appendLiteralSegment(res, literalValue) {
86
+ if (literalValue.length !== 0) {
87
+ res.push({
88
+ type: 'literal',
89
+ value: literalValue
90
+ });
91
+ }
92
+ }
93
+ function appendAnyOfSegment(res) {
94
+ res.push({
95
+ type: 'anyOf',
96
+ value: ' \t\n-'
97
+ });
98
+ }
99
+ }
100
+ class FilterValidator extends _baseValidator.AggregatingValidator {
101
+ constructor(operatorName, previousInvalidArguments, ctor, constructorName) {
102
+ super(previousInvalidArguments);
103
+ this.operatorName = operatorName;
104
+ this.ctor = ctor;
105
+ this.constructorName = constructorName;
106
+ }
107
+ typeIsString(value) {
108
+ return this.addValidation(() => (0, _typeUtils.isString)(value), () => _errors.messages.filterValidations.typeIsString(this.operatorName, value));
109
+ }
110
+ typeIsStringNumberOrDate(value) {
111
+ return this.addValidation(() => isDateStringOrNumber(value), () => _errors.messages.filterValidations.typeIsStringNumberOrDate(this.operatorName, value));
112
+ }
113
+ sameType(first, second) {
114
+ return this.addValidation(() => (0, _typeUtils.typeForDisplay)(first) === (0, _typeUtils.typeForDisplay)(second), () => _errors.messages.filterValidations.sameType(this.operatorName, first, second));
115
+ }
116
+ typeIsStringNumberOrDateForAll(values) {
117
+ return this.addValidation(() => values.every(isDateStringOrNumber), () => _errors.messages.filterValidations.typeIsStringNumberOrDateForAll(this.operatorName));
118
+ }
119
+ validFieldName(field) {
120
+ return this.addValidation(() => (0, _typeUtils.isString)(field), () => _errors.messages.filterValidations.validFieldName(this.operatorName, field));
121
+ }
122
+ isInstanceOfSameClass(obj) {
123
+ return this.addValidation(() => obj instanceof this.ctor, () => _errors.messages.filterValidations.isInstanceOfSameClass(this.operatorName, this.constructorName, obj));
124
+ }
125
+ isForCollection(otherFilterBuilder, expectedCollectionName) {
126
+ return this.addValidation(() => otherFilterBuilder.collectionName === expectedCollectionName, () => _errors.messages.filterValidations.isForCollection(this.operatorName, this.constructorName, otherFilterBuilder.collectionName));
127
+ }
128
+ }
129
+ exports.FilterValidator = FilterValidator;
130
+ function isDateStringOrNumber(value) {
131
+ return (0, _typeUtils.isString)(value) || (0, _typeUtils.isNumber)(value) || (0, _typeUtils.isDate)(value);
132
+ }
133
+ function withCollectionNameIfUnset(filter, name) {
134
+ if (!filter || !filter.constructor) {
135
+ return filter;
136
+ }
137
+ const collectionName = filter.collectionName ? filter.collectionName : name;
138
+ return new filter.constructor({
139
+ ...filter,
140
+ collectionName
141
+ });
142
+ }
143
+ var _default = exports.default = filterMixin;
144
+ //# sourceMappingURL=filterMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_typeUtils","require","_baseValidator","_errors","_filterBuilder","filterMixin","Base","genericFilterMixin","constructor","origin","_defineProperty2","default","validateCollectionName","or","otherQuery","orQuery","apply","arguments","_validateCollectionName","and","andQuery","not","notQuery","query","originalQuery","operationName","invalidArguments","length","withCollectionName","withCollectionNameIfUnset","collectionName","newInvalidArguments","valid","FilterValidator","constructorName","name","isForCollection","validateAndAggregate","_copy","filterTree","_matchesUrlized","field","operand","_filterValidator","arityIsTwo","validFieldName","typeIsString","newFilterTree","_makeNewFilter","createMatchesOrInFilter","getFilterModel","validationError","messages","filterBuilderInvalid","filterOperatorName","looksLikeAnInteger","Number","parseInt","ignoreCase","spec","createMatchSpec","str","test","fieldValue","literals","split","result","i","appendLiteralSegment","appendAnyOfSegment","res","literalValue","push","type","value","AggregatingValidator","operatorName","previousInvalidArguments","ctor","addValidation","isString","filterValidations","typeIsStringNumberOrDate","isDateStringOrNumber","sameType","first","second","typeForDisplay","typeIsStringNumberOrDateForAll","values","every","isInstanceOfSameClass","obj","otherFilterBuilder","expectedCollectionName","exports","isNumber","isDate","filter","_default"],"sources":["../../../src/filter/filterMixin.ts"],"sourcesContent":["import { typeForDisplay, isDate, isString, isNumber } from '../utils/type-utils'\nimport { AggregatingValidator } from '../errors/base-validator'\nimport { messages, validationError } from '../errors/errors'\nimport {\n filterMixin as genericFilterMixin,\n Validator,\n} from '@wix/filter-builder'\n\nconst filterMixin = (Base: any = class {}) =>\n class extends genericFilterMixin(Base) {\n readonly validateCollectionName: boolean\n\n constructor(origin?: {\n validateCollectionName?: boolean\n filterTree?: object\n invalidArguments?: string[]\n encoder?: Function\n }) {\n super(origin)\n this.validateCollectionName = origin?.validateCollectionName ?? true\n }\n\n or(otherQuery: any) {\n const orQuery = super.or.apply(this, arguments as any)\n return this._validateCollectionName(orQuery, otherQuery, '.or')\n }\n\n and(otherQuery: any) {\n const andQuery = super.and.apply(this, arguments as any)\n return this._validateCollectionName(andQuery, otherQuery, '.and')\n }\n\n not(otherQuery: any) {\n const notQuery = super.not.apply(this, arguments as any)\n return this._validateCollectionName(notQuery, otherQuery, '.not')\n }\n\n _validateCollectionName(\n query: any,\n originalQuery: any,\n operationName: string\n ) {\n if (query.invalidArguments.length > 0 || !this.validateCollectionName) {\n return query\n }\n const withCollectionName = withCollectionNameIfUnset(\n originalQuery,\n this.collectionName\n )\n const [newInvalidArguments, valid] = new FilterValidator(\n operationName,\n query.invalidArguments,\n this.constructor,\n this.constructorName ?? this.constructor.name\n )\n .isForCollection(withCollectionName, this.collectionName)\n .validateAndAggregate()\n\n if (!valid) {\n return this._copy(this.filterTree, newInvalidArguments)\n }\n return query\n }\n\n // used only from data binding router internally\n _matchesUrlized(field: any, operand: any) {\n const [newInvalidArguments, valid] = this._filterValidator(\n '._matchesUrlized'\n )\n .arityIsTwo(arguments)\n .validFieldName(field)\n .typeIsString(operand)\n .validateAndAggregate()\n\n if (valid) {\n const newFilterTree = this._makeNewFilter(\n field,\n // @ts-ignore-next-line\n ...createMatchesOrInFilter(operand)\n )\n return this._copy(newFilterTree, newInvalidArguments)\n }\n\n return this._copy(this.filterTree, newInvalidArguments)\n }\n\n getFilterModel() {\n if (this.invalidArguments.length > 0) {\n throw validationError(\n messages.filterBuilderInvalid(this.invalidArguments)\n )\n }\n return super.getFilterModel()\n }\n\n _filterValidator(filterOperatorName: string): Validator {\n return new FilterValidator(\n filterOperatorName,\n this.invalidArguments,\n this.constructor,\n this.constructorName ?? this.constructor.name\n )\n }\n }\n\nfunction createMatchesOrInFilter(operand: string) {\n if (looksLikeAnInteger(operand)) {\n // eslint-disable-next-line radix\n return ['$in', [operand, Number.parseInt(operand)]]\n } else {\n return [\n '$matches',\n {\n ignoreCase: true,\n spec: createMatchSpec(operand),\n },\n ]\n }\n\n function looksLikeAnInteger(str: string) {\n return /^-?[0-9]{1,16}$/.test(str)\n }\n}\ninterface MatchSpec {\n type: string\n value: string\n}\n\nfunction createMatchSpec(fieldValue: string) {\n const literals = fieldValue.split('-')\n const result: MatchSpec[] = []\n\n for (let i = 0; i < literals.length - 1; i++) {\n appendLiteralSegment(result, literals[i])\n appendAnyOfSegment(result)\n }\n appendLiteralSegment(result, literals[literals.length - 1])\n\n return result\n\n function appendLiteralSegment(res: MatchSpec[], literalValue: string) {\n if (literalValue.length !== 0) {\n res.push({ type: 'literal', value: literalValue })\n }\n }\n\n function appendAnyOfSegment(res: MatchSpec[]) {\n res.push({ type: 'anyOf', value: ' \\t\\n-' })\n }\n}\n\nexport class FilterValidator extends AggregatingValidator {\n constructor(\n public operatorName: string,\n previousInvalidArguments: string[],\n private ctor: any,\n private constructorName: string\n ) {\n super(previousInvalidArguments)\n }\n\n typeIsString(value: any) {\n return this.addValidation(\n () => isString(value),\n () => messages.filterValidations.typeIsString(this.operatorName, value)\n )\n }\n\n typeIsStringNumberOrDate(value: any) {\n return this.addValidation(\n () => isDateStringOrNumber(value),\n () =>\n messages.filterValidations.typeIsStringNumberOrDate(\n this.operatorName,\n value\n )\n )\n }\n\n sameType(first: any, second: any) {\n return this.addValidation(\n () => typeForDisplay(first) === typeForDisplay(second),\n () =>\n messages.filterValidations.sameType(this.operatorName, first, second)\n )\n }\n\n typeIsStringNumberOrDateForAll(values: any) {\n return this.addValidation(\n () => values.every(isDateStringOrNumber),\n () =>\n messages.filterValidations.typeIsStringNumberOrDateForAll(\n this.operatorName\n )\n )\n }\n\n validFieldName(field: any) {\n return this.addValidation(\n () => isString(field),\n () => messages.filterValidations.validFieldName(this.operatorName, field)\n )\n }\n\n isInstanceOfSameClass(obj: any) {\n return this.addValidation(\n () => obj instanceof this.ctor,\n () =>\n messages.filterValidations.isInstanceOfSameClass(\n this.operatorName,\n this.constructorName,\n obj\n )\n )\n }\n\n isForCollection(otherFilterBuilder: any, expectedCollectionName: any) {\n return this.addValidation(\n () => otherFilterBuilder.collectionName === expectedCollectionName,\n () =>\n messages.filterValidations.isForCollection(\n this.operatorName,\n this.constructorName,\n otherFilterBuilder.collectionName\n )\n )\n }\n}\n\nfunction isDateStringOrNumber(value: any) {\n return isString(value) || isNumber(value) || isDate(value)\n}\n\nfunction withCollectionNameIfUnset(filter: any, name: string) {\n if (!filter || !filter.constructor) {\n return filter\n }\n\n const collectionName = filter.collectionName ? filter.collectionName : name\n\n return new filter.constructor({ ...filter, collectionName })\n}\n\nexport default filterMixin\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAKA,MAAMI,WAAW,GAAGA,CAACC,IAAS,GAAG,MAAM,EAAE,KACvC,cAAc,IAAAC,0BAAkB,EAACD,IAAI,CAAC,CAAC;EAGrCE,WAAWA,CAACC,MAKX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAAA,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AAG0F,MAAM;IAAEpE;EAAe,CAAC,CAAC;AAC9D;AAAC,IAAAqE,QAAA,GAAAJ,OAAA,CAAApF,OAAA,GAEcN,WAAW"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ var _FilterTree = require("./FilterTree");
6
+ exports.validateFilterTree = _FilterTree.validateFilterTree;
7
+ exports.validateFilterOrThrow = _FilterTree.validateFilterOrThrow;
8
+ var _WithFilter = _interopRequireDefault(require("./WithFilter"));
9
+ exports.WithFilter = _WithFilter.default;
10
+ var _filterBuilder = require("./filterBuilder");
11
+ exports.filterBuilderFactory = _filterBuilder.filterBuilderFactory;
12
+ exports.platformizedFilterBuilder = _filterBuilder.platformizedFilterBuilder;
13
+ exports.PlatformizedFilterBuilder = _filterBuilder.PlatformizedFilterBuilder;
14
+ var _filterMixin = _interopRequireDefault(require("./filterMixin"));
15
+ exports.filterMixin = _filterMixin.default;
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FilterTree","require","exports","validateFilterTree","validateFilterOrThrow","_WithFilter","_interopRequireDefault","WithFilter","default","_filterBuilder","filterBuilderFactory","platformizedFilterBuilder","PlatformizedFilterBuilder","_filterMixin","filterMixin"],"sources":["../../../src/filter/index.ts"],"sourcesContent":["import { validateFilterTree, validateFilterOrThrow } from './FilterTree'\nimport type { FilterTree } from './FilterTree'\nimport WithFilter from './WithFilter'\nimport {\n filterBuilderFactory,\n platformizedFilterBuilder,\n PlatformizedFilterBuilder,\n} from './filterBuilder'\nimport filterMixin from './filterMixin'\n\nexport type { FilterTree }\nexport {\n validateFilterTree,\n validateFilterOrThrow,\n WithFilter,\n filterBuilderFactory,\n platformizedFilterBuilder,\n PlatformizedFilterBuilder,\n filterMixin,\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAwEC,OAAA,CAAAC,kBAAA,GAAAH,WAAA,CAAAG,kBAAA;AAAAD,OAAA,CAAAE,qBAAA,GAAAJ,WAAA,CAAAI,qBAAA;AAExE,IAAAC,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAqCC,OAAA,CAAAK,UAAA,GAAAF,WAAA,CAAAG,OAAA;AACrC,IAAAC,cAAA,GAAAR,OAAA;AAIwBC,OAAA,CAAAQ,oBAAA,GAAAD,cAAA,CAAAC,oBAAA;AAAAR,OAAA,CAAAS,yBAAA,GAAAF,cAAA,CAAAE,yBAAA;AAAAT,OAAA,CAAAU,yBAAA,GAAAH,cAAA,CAAAG,yBAAA;AACxB,IAAAC,YAAA,GAAAP,sBAAA,CAAAL,OAAA;AAAuCC,OAAA,CAAAY,WAAA,GAAAD,YAAA,CAAAL,OAAA"}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ var _exportNames = {
6
+ encode: true,
7
+ decode: true,
8
+ isObject: true,
9
+ isArray: true,
10
+ isDate: true,
11
+ isNumber: true,
12
+ isBoolean: true,
13
+ isString: true,
14
+ isFunction: true,
15
+ typeForDisplay: true,
16
+ isUndefined: true,
17
+ isNull: true,
18
+ clone: true,
19
+ base64url: true,
20
+ filterBuilderFactory: true,
21
+ platformizedFilterBuilder: true,
22
+ PlatformizedFilterBuilder: true,
23
+ filterMixin: true,
24
+ validateFilterTree: true,
25
+ validateFilterOrThrow: true,
26
+ WithFilter: true,
27
+ optimiseQuery: true,
28
+ wixDataEncoder: true,
29
+ messages: true,
30
+ codes: true,
31
+ wixDataError: true,
32
+ validationError: true,
33
+ BulkError: true,
34
+ apiValidator: true,
35
+ AggregatingValidator: true,
36
+ RejectingValidator: true,
37
+ sortMixin: true,
38
+ WixDataApi: true,
39
+ WixDataBulkPatch: true,
40
+ WixDataQuery: true,
41
+ WixDataPatch: true,
42
+ WixDataResult: true,
43
+ QueryValidator: true,
44
+ WixDataOptions: true,
45
+ WixDataReadOptions: true,
46
+ WixDataReadWithProjectionOptions: true,
47
+ WixDataUpdateOptions: true,
48
+ WixDataQueryOptions: true,
49
+ WixDataItem: true,
50
+ WixDataReference: true,
51
+ WixDataBulkError: true,
52
+ WixDataBulkResult: true,
53
+ WixDataAggregate: true,
54
+ QueryBase: true,
55
+ WixDataFilter: true
56
+ };
57
+ var _utils = require("./utils");
58
+ exports.encode = _utils.encode;
59
+ exports.decode = _utils.decode;
60
+ exports.isObject = _utils.isObject;
61
+ exports.isArray = _utils.isArray;
62
+ exports.isDate = _utils.isDate;
63
+ exports.isNumber = _utils.isNumber;
64
+ exports.isBoolean = _utils.isBoolean;
65
+ exports.isString = _utils.isString;
66
+ exports.isFunction = _utils.isFunction;
67
+ exports.typeForDisplay = _utils.typeForDisplay;
68
+ exports.isUndefined = _utils.isUndefined;
69
+ exports.isNull = _utils.isNull;
70
+ exports.clone = _utils.clone;
71
+ exports.base64url = _utils.base64url;
72
+ var _filter = require("./filter");
73
+ exports.filterBuilderFactory = _filter.filterBuilderFactory;
74
+ exports.platformizedFilterBuilder = _filter.platformizedFilterBuilder;
75
+ exports.PlatformizedFilterBuilder = _filter.PlatformizedFilterBuilder;
76
+ exports.filterMixin = _filter.filterMixin;
77
+ exports.validateFilterTree = _filter.validateFilterTree;
78
+ exports.validateFilterOrThrow = _filter.validateFilterOrThrow;
79
+ exports.WithFilter = _filter.WithFilter;
80
+ var _filterBuilder = require("@wix/filter-builder");
81
+ exports.optimiseQuery = _filterBuilder.optimiseQuery;
82
+ exports.wixDataEncoder = _filterBuilder.wixDataEncoder;
83
+ var _errors = require("./errors");
84
+ exports.messages = _errors.messages;
85
+ exports.codes = _errors.codes;
86
+ exports.wixDataError = _errors.wixDataError;
87
+ exports.validationError = _errors.validationError;
88
+ exports.BulkError = _errors.BulkError;
89
+ exports.apiValidator = _errors.apiValidator;
90
+ exports.AggregatingValidator = _errors.AggregatingValidator;
91
+ exports.RejectingValidator = _errors.RejectingValidator;
92
+ var _sortMixin = _interopRequireDefault(require("./sort/sortMixin"));
93
+ exports.sortMixin = _sortMixin.default;
94
+ var _api = require("./api");
95
+ exports.WixDataApi = _api.WixDataApi;
96
+ exports.WixDataBulkPatch = _api.WixDataBulkPatch;
97
+ exports.WixDataQuery = _api.WixDataQuery;
98
+ exports.WixDataPatch = _api.WixDataPatch;
99
+ exports.WixDataResult = _api.WixDataResult;
100
+ exports.QueryValidator = _api.QueryValidator;
101
+ exports.WixDataOptions = _api.WixDataOptions;
102
+ exports.WixDataReadOptions = _api.WixDataReadOptions;
103
+ exports.WixDataReadWithProjectionOptions = _api.WixDataReadWithProjectionOptions;
104
+ exports.WixDataUpdateOptions = _api.WixDataUpdateOptions;
105
+ exports.WixDataQueryOptions = _api.WixDataQueryOptions;
106
+ exports.WixDataItem = _api.WixDataItem;
107
+ exports.WixDataReference = _api.WixDataReference;
108
+ exports.WixDataBulkError = _api.WixDataBulkError;
109
+ exports.WixDataBulkResult = _api.WixDataBulkResult;
110
+ exports.WixDataAggregate = _api.WixDataAggregate;
111
+ exports.QueryBase = _api.QueryBase;
112
+ exports.WixDataFilter = _api.WixDataFilter;
113
+ var _types = require("./types");
114
+ Object.keys(_types).forEach(function (key) {
115
+ if (key === "default" || key === "__esModule") return;
116
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
117
+ if (key in exports && exports[key] === _types[key]) return;
118
+ exports[key] = _types[key];
119
+ });
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","exports","encode","decode","isObject","isArray","isDate","isNumber","isBoolean","isString","isFunction","typeForDisplay","isUndefined","isNull","clone","base64url","_filter","filterBuilderFactory","platformizedFilterBuilder","PlatformizedFilterBuilder","filterMixin","validateFilterTree","validateFilterOrThrow","WithFilter","_filterBuilder","optimiseQuery","wixDataEncoder","_errors","messages","codes","wixDataError","validationError","BulkError","apiValidator","AggregatingValidator","RejectingValidator","_sortMixin","_interopRequireDefault","sortMixin","default","_api","WixDataApi","WixDataBulkPatch","WixDataQuery","WixDataPatch","WixDataResult","QueryValidator","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WixDataUpdateOptions","WixDataQueryOptions","WixDataItem","WixDataReference","WixDataBulkError","WixDataBulkResult","WixDataAggregate","QueryBase","WixDataFilter","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames"],"sources":["../../src/index.ts"],"sourcesContent":["import {\n encode,\n decode,\n isObject,\n isArray,\n isDate,\n isNumber,\n isBoolean,\n isString,\n isFunction,\n typeForDisplay,\n isUndefined,\n isNull,\n clone,\n base64url,\n} from './utils'\nimport type { FilterTree } from './filter'\nimport {\n filterBuilderFactory,\n platformizedFilterBuilder,\n PlatformizedFilterBuilder,\n filterMixin,\n validateFilterTree,\n validateFilterOrThrow,\n WithFilter,\n} from './filter'\nimport { optimiseQuery, wixDataEncoder } from '@wix/filter-builder'\nimport {\n messages,\n codes,\n wixDataError,\n validationError,\n BulkError,\n apiValidator,\n AggregatingValidator,\n RejectingValidator,\n} from './errors'\nimport sortMixin from './sort/sortMixin'\nimport {\n WixDataApi,\n WixDataBulkPatch,\n WixDataQuery,\n WixDataPatch,\n WixDataResult,\n QueryValidator,\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataAggregate,\n QueryBase,\n WixDataFilter,\n} from './api'\nimport type { HttpApiClientFactory, RequestInterceptor } from './types'\nimport type { WixDataItemOrId } from './api'\n\nexport type {\n FilterTree,\n HttpApiClientFactory,\n RequestInterceptor,\n WixDataItemOrId,\n}\nexport * from './types'\nexport {\n encode,\n decode,\n isObject,\n isArray,\n isDate,\n isNumber,\n isBoolean,\n isString,\n isFunction,\n typeForDisplay,\n isUndefined,\n isNull,\n clone,\n base64url,\n filterMixin,\n filterBuilderFactory,\n platformizedFilterBuilder,\n PlatformizedFilterBuilder,\n optimiseQuery,\n validateFilterOrThrow,\n validateFilterTree,\n wixDataEncoder,\n WithFilter,\n messages,\n codes,\n wixDataError,\n validationError,\n BulkError,\n apiValidator,\n AggregatingValidator,\n RejectingValidator,\n sortMixin,\n WixDataApi,\n WixDataBulkPatch,\n WixDataQuery,\n WixDataPatch,\n WixDataResult,\n QueryValidator,\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataAggregate,\n QueryBase,\n WixDataFilter,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAegBC,OAAA,CAAAC,MAAA,GAAAH,MAAA,CAAAG,MAAA;AAAAD,OAAA,CAAAE,MAAA,GAAAJ,MAAA,CAAAI,MAAA;AAAAF,OAAA,CAAAG,QAAA,GAAAL,MAAA,CAAAK,QAAA;AAAAH,OAAA,CAAAI,OAAA,GAAAN,MAAA,CAAAM,OAAA;AAAAJ,OAAA,CAAAK,MAAA,GAAAP,MAAA,CAAAO,MAAA;AAAAL,OAAA,CAAAM,QAAA,GAAAR,MAAA,CAAAQ,QAAA;AAAAN,OAAA,CAAAO,SAAA,GAAAT,MAAA,CAAAS,SAAA;AAAAP,OAAA,CAAAQ,QAAA,GAAAV,MAAA,CAAAU,QAAA;AAAAR,OAAA,CAAAS,UAAA,GAAAX,MAAA,CAAAW,UAAA;AAAAT,OAAA,CAAAU,cAAA,GAAAZ,MAAA,CAAAY,cAAA;AAAAV,OAAA,CAAAW,WAAA,GAAAb,MAAA,CAAAa,WAAA;AAAAX,OAAA,CAAAY,MAAA,GAAAd,MAAA,CAAAc,MAAA;AAAAZ,OAAA,CAAAa,KAAA,GAAAf,MAAA,CAAAe,KAAA;AAAAb,OAAA,CAAAc,SAAA,GAA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AAA;EAAA,IAAAA,GAAA,IAAA9D,OAAA,IAAAA,OAAA,CAAA8D,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAA9D,OAAA,CAAA8D,GAAA,IAAAJ,MAAA,CAAAI,GAAA;AAAA"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.default = exports.SortValidator = exports.Sort = void 0;
6
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _utils = require("../utils");
8
+ var _errors = require("../errors");
9
+ const sortMixin = (Base = class {}) => class extends Base {
10
+ constructor(obj = {}) {
11
+ super(obj);
12
+ (0, _defineProperty2.default)(this, "orderBy", void 0);
13
+ (0, _defineProperty2.default)(this, "invalidArguments", void 0);
14
+ this.orderBy = obj.orderBy || [];
15
+ this.invalidArguments = obj.invalidArguments || [];
16
+ }
17
+ ascending(...fields) {
18
+ return this._sortClause('asc', '.ascending', fields);
19
+ }
20
+ descending(...fields) {
21
+ return this._sortClause('desc', '.descending', fields);
22
+ }
23
+ getSortModel() {
24
+ if (this.invalidArguments.length > 0) {
25
+ throw (0, _errors.validationError)(_errors.messages.sortBuilderInvalid(this.invalidArguments));
26
+ }
27
+ return this.orderBy;
28
+ }
29
+ setSortModel(sortModel) {
30
+ return this._copySort(sortModel, []);
31
+ }
32
+ _sortClause(operatorSymbol, operatorName, args) {
33
+ let orderBy = [];
34
+ if (this.orderBy) {
35
+ orderBy = (0, _utils.clone)(this.orderBy);
36
+ }
37
+ const appendClause = createAppendClauseFn(orderBy, operatorSymbol);
38
+ const effectiveArgs = (0, _utils.isArray)(args[0]) && args.length === 1 ? args[0] : Array.prototype.slice.call(args, 0);
39
+ const [newInvalidArguments, valid] = this._sortValidator(operatorName).arityIsAtLeastOne(args).allStrings(effectiveArgs).validateAndAggregate();
40
+ if (valid) {
41
+ effectiveArgs.forEach(appendClause);
42
+ }
43
+ return this._copySort(orderBy, newInvalidArguments);
44
+ }
45
+ _sortValidator(operatorName) {
46
+ return new SortValidator(operatorName, this.invalidArguments);
47
+ }
48
+ _copySort(orderBy, invalidArguments) {
49
+ return new this.constructor({
50
+ ...this,
51
+ orderBy,
52
+ invalidArguments
53
+ });
54
+ }
55
+ };
56
+ function createAppendClauseFn(destination, direction) {
57
+ return field => {
58
+ const spec = {
59
+ [field]: direction
60
+ };
61
+ destination.push(spec);
62
+ };
63
+ }
64
+ class SortValidator extends _errors.AggregatingValidator {
65
+ constructor(operatorName, previousInvalidArguments) {
66
+ super(previousInvalidArguments);
67
+ this.operatorName = operatorName;
68
+ }
69
+ allStrings(effectiveArgs) {
70
+ return this.addValidation(() => effectiveArgs.every(_utils.isString), () => {
71
+ return _errors.messages.sortValidations.typeIsStringOrArrayOfStrings(this.operatorName, effectiveArgs);
72
+ });
73
+ }
74
+ }
75
+ exports.SortValidator = SortValidator;
76
+ class Sort extends sortMixin() {}
77
+ exports.Sort = Sort;
78
+ var _default = exports.default = sortMixin;
79
+ //# sourceMappingURL=sortMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","_errors","sortMixin","Base","constructor","obj","_defineProperty2","default","orderBy","invalidArguments","ascending","fields","_sortClause","descending","getSortModel","length","validationError","messages","sortBuilderInvalid","setSortModel","sortModel","_copySort","operatorSymbol","operatorName","args","clone","appendClause","createAppendClauseFn","effectiveArgs","isArray","Array","prototype","slice","call","newInvalidArguments","valid","_sortValidator","arityIsAtLeastOne","allStrings","validateAndAggregate","forEach","SortValidator","destination","direction","field","spec","push","AggregatingValidator","previousInvalidArguments","addValidation","every","isString","sortValidations","typeIsStringOrArrayOfStrings","exports","Sort","_default"],"sources":["../../../src/sort/sortMixin.ts"],"sourcesContent":["import { clone, isString, isArray } from '../utils'\nimport { AggregatingValidator, messages, validationError } from '../errors'\n\nexport type Direction = 'asc' | 'desc'\nexport interface OrderBySpec {\n [field: string]: Direction\n}\nexport type OrderBy = OrderBySpec[]\n\ninterface WithConstructor {\n // eslint-disable-next-line @typescript-eslint/prefer-function-type\n new (...args: any): any\n}\n\nconst sortMixin = (Base: WithConstructor = class {}) =>\n class extends Base {\n orderBy: OrderBy\n invalidArguments: string[]\n\n constructor(obj: any = {}) {\n super(obj)\n this.orderBy = obj.orderBy || []\n this.invalidArguments = obj.invalidArguments || []\n }\n\n ascending(...fields: any[]) {\n return this._sortClause('asc', '.ascending', fields)\n }\n\n descending(...fields: any[]) {\n return this._sortClause('desc', '.descending', fields)\n }\n\n getSortModel() {\n if (this.invalidArguments.length > 0) {\n throw validationError(\n messages.sortBuilderInvalid(this.invalidArguments)\n )\n }\n return this.orderBy\n }\n\n setSortModel(sortModel: any[]) {\n return this._copySort(sortModel, [])\n }\n\n _sortClause(operatorSymbol: Direction, operatorName: string, args: any[]) {\n let orderBy: OrderBy = []\n if (this.orderBy) {\n orderBy = clone(this.orderBy)\n }\n\n const appendClause = createAppendClauseFn(orderBy, operatorSymbol)\n const effectiveArgs =\n isArray(args[0]) && args.length === 1\n ? args[0]\n : Array.prototype.slice.call(args, 0)\n const [newInvalidArguments, valid] = this._sortValidator(operatorName)\n .arityIsAtLeastOne(args)\n .allStrings(effectiveArgs)\n .validateAndAggregate()\n\n if (valid) {\n effectiveArgs.forEach(appendClause)\n }\n\n return this._copySort(orderBy, newInvalidArguments)\n }\n\n _sortValidator(operatorName: string) {\n return new SortValidator(operatorName, this.invalidArguments)\n }\n\n _copySort(orderBy: OrderBy, invalidArguments: string[]) {\n return new (this.constructor as WithConstructor)({\n ...this,\n orderBy,\n invalidArguments,\n })\n }\n }\n\nfunction createAppendClauseFn(destination: OrderBy, direction: Direction) {\n return (field: string) => {\n const spec: OrderBySpec = { [field]: direction }\n destination.push(spec)\n }\n}\n\nexport class SortValidator extends AggregatingValidator {\n constructor(public operatorName: string, previousInvalidArguments: string[]) {\n super(previousInvalidArguments)\n }\n\n allStrings(effectiveArgs: any[]) {\n return this.addValidation(\n () => effectiveArgs.every(isString),\n () => {\n return messages.sortValidations.typeIsStringOrArrayOfStrings(\n this.operatorName,\n effectiveArgs\n )\n }\n )\n }\n}\n\nexport class Sort extends sortMixin() {}\n\nexport default sortMixin\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAaA,MAAME,SAAS,GAAGA,CAACC,IAAqB,GAAG,MAAM,EAAE,KACjD,cAAcA,IAAI,CAAC;EAIjBC,WAAWA,CAACC,GAAQ,GAAG,CAAC,CAAC,EAAE;IACzB,KAAK,CAACA,GAAG,CAAC;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACV,IAAI,CAACC,OAAO,GAAGH,GAAG,CAACG,OAAO,IAAI,EAAE;IAChC,IAAI,CAACC,gBAAgB,GAAGJ,GAAG,CAACI,gBAAgB,IAAI,EAAE;EACpD;EAEAC,SAASA,CAAC,GAAGC,MAAa,EAAE;IAC1B,OAAO,IAAI,CAACC,WAAW,CAAC,KAAK,EAAE,YAAY,EAAED,MAAM,CAAC;EACtD;EAEAE,UAAUA,CAAC,GAAGF,MAAa,EAAE;IAC3B,OAAO,IAAI,CAACC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAED,MAAM,CAAC;EACxD;EAEAG,YAAYA,CAAA,EAAG;IACb,IAAI,IAAI,CAACL,gBAAgB,CAACM,MAAM,GAAG,CAAC,EAAE;MACpC,MAAM,IAAAC,uBAAe,EACnBC,gBAAQ,CAACC,kBAAkB,CAAC,IAAI,CAACT,gBAAgB,CACnD,CAAC;IACH;IACA,OAAO,IAAI,CAACD,OAAO;EACrB;EAEAW,YAAYA,CAACC,SAAgB,EAAE;IAC7B,OAAO,IAAI,CAACC,SAAS,CAACD,SAAS,EAAE,EAAE,CAAC;EACtC;EAEAR,WAAWA,CAACU,cAAyB,EAAEC,YAAoB,EAAEC,IAAW,EAAE;IACxE,IAAIhB,OAAgB,GAAG,EAAE;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,4BAAoB,CAAC;EACtD3C,WAAWA,CAAQmB,YAAoB,EAAEyB,wBAAkC,EAAE;IAC3E,KAAK,CAACA,wBAAwB,CAAC;IAAA,KADdzB,YAAoB,GAApBA,YAAoB;EAEvC;EAEAe,UAAUA,CAACV,aAAoB,EAAE;IAC/B,OAAO,IAAI,CAACqB,aAAa,CACvB,MAAMrB,aAAa,CAACsB,KAAK,CAACC,eAAQ,CAAC,EACnC,MAAM;MACJ,OAAOlC,gBAAQ,CAACmC,eAAe,CAACC,4BAA4B,CAC1D,IAAI,CAAC9B,YAAY,EACjBK,aACF,CAAC;IACH,CACF,CAAC;EACH;AACF;AAAC0B,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAEM,MAAMc,IAAI,SAASrD,SAAS,CAAC,CAAC,CAAC;AAAEoD,OAAA,CAAAC,IAAA,GAAAA,IAAA;AAAA,IAAAC,QAAA,GAAAF,OAAA,CAAA/C,OAAA,GAEzBL,SAAS"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="@wix/jest-yoshi-preset/types" />
2
+ //# sourceMappingURL=test-types.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/test-types.d.ts"],"sourcesContent":["/// <reference types=\"@wix/jest-yoshi-preset/types\" />\n"],"mappings":"AAAA"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/types/api.ts"],"sourcesContent":["import {\n AggregateDataItemsRequest,\n AggregateDataItemsResponse,\n BulkInsertDataItemReferencesRequest,\n BulkInsertDataItemReferencesResponse,\n BulkInsertDataItemsRequest,\n BulkInsertDataItemsResponse,\n BulkPatchDataItemsRequest,\n BulkPatchDataItemsResponse,\n BulkRemoveDataItemReferencesRequest,\n BulkRemoveDataItemReferencesResponse,\n BulkRemoveDataItemsRequest,\n BulkRemoveDataItemsResponse,\n BulkSaveDataItemsRequest,\n BulkSaveDataItemsResponse,\n BulkUpdateDataItemsRequest,\n BulkUpdateDataItemsResponse,\n CountDataItemsRequest,\n CountDataItemsResponse,\n GetDataItemRequest,\n GetDataItemResponse,\n InsertDataItemRequest,\n InsertDataItemResponse,\n IsReferencedDataItemRequest,\n IsReferencedDataItemResponse,\n PatchDataItemRequest,\n PatchDataItemResponse,\n QueryDataItemsRequest,\n QueryDataItemsResponse,\n QueryDistinctValuesRequest,\n QueryDistinctValuesResponse,\n QueryReferencedDataItemsRequest,\n QueryReferencedDataItemsResponse,\n RemoveDataItemRequest,\n RemoveDataItemResponse,\n ReplaceDataItemReferencesRequest,\n ReplaceDataItemReferencesResponse,\n SaveDataItemRequest,\n SaveDataItemResponse,\n TruncateDataItemsRequest,\n TruncateDataItemsResponse,\n UpdateDataItemRequest,\n UpdateDataItemResponse,\n} from './data-item-types'\n\nexport interface HttpApiClient {\n getDataItem(r: GetDataItemRequest): Promise<HttpResponse<GetDataItemResponse>>\n\n insertDataItem(\n r: InsertDataItemRequest\n ): Promise<HttpResponse<InsertDataItemResponse>>\n\n saveDataItem(\n r: SaveDataItemRequest\n ): Promise<HttpResponse<SaveDataItemResponse>>\n\n updateDataItem(\n r: UpdateDataItemRequest\n ): Promise<HttpResponse<UpdateDataItemResponse>>\n\n patchDataItem(\n r: PatchDataItemRequest\n ): Promise<HttpResponse<PatchDataItemResponse>>\n\n removeDataItem(\n r: RemoveDataItemRequest\n ): Promise<HttpResponse<RemoveDataItemResponse>>\n\n countDataItems(\n r: CountDataItemsRequest\n ): Promise<HttpResponse<CountDataItemsResponse>>\n\n queryDistinctValues(\n r: QueryDistinctValuesRequest\n ): Promise<HttpResponse<QueryDistinctValuesResponse>>\n\n queryDataItems(\n r: QueryDataItemsRequest\n ): Promise<HttpResponse<QueryDataItemsResponse>>\n\n aggregateDataItems(\n r: AggregateDataItemsRequest\n ): Promise<HttpResponse<AggregateDataItemsResponse>>\n\n bulkInsertDataItems(\n r: BulkInsertDataItemsRequest\n ): Promise<HttpResponse<BulkInsertDataItemsResponse>>\n\n bulkUpdateDataItems(\n r: BulkUpdateDataItemsRequest\n ): Promise<HttpResponse<BulkUpdateDataItemsResponse>>\n\n bulkPatchDataItems(\n r: BulkPatchDataItemsRequest\n ): Promise<HttpResponse<BulkPatchDataItemsResponse>>\n\n bulkSaveDataItems(\n r: BulkSaveDataItemsRequest\n ): Promise<HttpResponse<BulkSaveDataItemsResponse>>\n\n bulkRemoveDataItems(\n r: BulkRemoveDataItemsRequest\n ): Promise<HttpResponse<BulkRemoveDataItemsResponse>>\n\n queryReferencedDataItems(\n r: QueryReferencedDataItemsRequest\n ): Promise<HttpResponse<QueryReferencedDataItemsResponse>>\n\n bulkInsertDataItemReferences(\n r: BulkInsertDataItemReferencesRequest\n ): Promise<HttpResponse<BulkInsertDataItemReferencesResponse>>\n\n replaceDataItemReferences(\n r: ReplaceDataItemReferencesRequest\n ): Promise<HttpResponse<ReplaceDataItemReferencesResponse>>\n\n bulkRemoveDataItemReferences(\n r: BulkRemoveDataItemReferencesRequest\n ): Promise<HttpResponse<BulkRemoveDataItemReferencesResponse>>\n\n isReferencedDataItem(\n r: IsReferencedDataItemRequest\n ): Promise<HttpResponse<IsReferencedDataItemResponse>>\n\n truncateDataItems(\n r: TruncateDataItemsRequest\n ): Promise<HttpResponse<TruncateDataItemsResponse>>\n}\n\nexport interface HttpResponse<T> {\n data: T\n}\n\nexport interface Request {\n data?: any\n url?: string\n methodFqn?: string\n method?: string\n}\n\nexport type RequestInterceptor<R extends Request> = (req: R) => R\n\nexport type HttpApiClientFactory<R extends Request> = (\n requestInterceptor: RequestInterceptor<R>\n) => HttpApiClient\n"],"mappings":""}