@wix/wix-data-items-common 1.0.307 → 1.0.308

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.
@@ -213,32 +213,27 @@ class WixDataApi {
213
213
  };
214
214
  }
215
215
  });
216
- (0, _defineProperty2.default)(this, "asyncPatchByFilter", (collectionName, filter) => {
216
+ (0, _defineProperty2.default)(this, "asyncPatchByFilter", withArgs(async (args, collectionName, filter, fieldModifications, options) => {
217
+ await apiValidator().arity('asyncPatchByFilter', args, 3, 4).collectionName(collectionName).options(options).validateAndReject();
217
218
  const apiFilter = createExplicitFilter(filter);
218
- return new _WixDataPatchImpl.WixDataPatchByFilterImpl({
219
- collectionName,
220
- filter: apiFilter,
221
- onRun: async (_args, patchParams, options) => {
222
- const fieldModifications = patchParams.fieldModifications.map(this.toFieldModificationApi);
223
- return this.trace('asyncPatchByFilter', {
224
- collectionName
225
- })(async env => {
226
- const {
227
- jobId
228
- } = await this.client.asyncPatchDataItemsByFilter({
229
- ...env,
230
- dataCollectionId: patchParams.collectionName,
231
- filter: patchParams.filter,
232
- fieldModifications,
233
- ...toAsyncByFilterOptions(options)
234
- });
235
- return {
236
- jobId: jobId
237
- };
238
- });
239
- }
219
+ const apiFieldModifications = fieldModifications.map(this.toFieldModificationApi);
220
+ return this.trace('asyncPatchByFilter', {
221
+ collectionName
222
+ })(async env => {
223
+ const {
224
+ jobId
225
+ } = await this.client.asyncPatchDataItemsByFilter({
226
+ ...env,
227
+ dataCollectionId: collectionName,
228
+ filter: apiFilter,
229
+ fieldModifications: apiFieldModifications,
230
+ ...toAsyncPatchByFilterOptions(options)
231
+ });
232
+ return {
233
+ jobId: jobId
234
+ };
240
235
  });
241
- });
236
+ }));
242
237
  (0, _defineProperty2.default)(this, "asyncRemoveByFilter", withArgs(async (args, collectionName, filter, options) => {
243
238
  await apiValidator().arity('asyncRemoveByFilter', args, 2, 3).collectionName(collectionName).options(options).validateAndReject();
244
239
  const apiFilter = createExplicitFilter(filter);
@@ -1129,10 +1124,10 @@ function toBulkPatchOptions(options) {
1129
1124
  ...conditionOptions(options == null ? void 0 : options.condition)
1130
1125
  };
1131
1126
  }
1132
- function toAsyncByFilterOptions(options) {
1127
+ function toAsyncRemoveByFilterOptions(options) {
1133
1128
  return toAsyncOptions(options);
1134
1129
  }
1135
- function toAsyncRemoveByFilterOptions(options) {
1130
+ function toAsyncPatchByFilterOptions(options) {
1136
1131
  return toAsyncOptions(options);
1137
1132
  }
1138
1133
  function toAsyncOptions(options) {