@aeriajs/builtins 0.0.239 → 0.0.241

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.
@@ -293,7 +293,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
293
293
  }, never>>;
294
294
  readonly result: undefined;
295
295
  }>;
296
- removeAll: (payload: import("@aeriajs/types").RemoveAllPayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
296
+ removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
297
297
  readonly _tag: "Result";
298
298
  readonly error: undefined;
299
299
  readonly result: import("mongodb").DeleteResult;
@@ -1,6 +1,6 @@
1
- import type { Context, SchemaWithId, RemoveAllPayload } from '@aeriajs/types';
1
+ import type { Context, RemoveAllPayload } from '@aeriajs/types';
2
2
  import type { description } from './description.js';
3
- export declare const removeAll: (payload: RemoveAllPayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<{
3
+ export declare const removeAll: (payload: RemoveAllPayload, context: Context<typeof description>) => Promise<{
4
4
  readonly _tag: "Result";
5
5
  readonly error: undefined;
6
6
  readonly result: import("mongodb").DeleteResult;
@@ -4,7 +4,11 @@ exports.removeAll = void 0;
4
4
  const core_1 = require("@aeriajs/core");
5
5
  const fs = require("node:fs/promises");
6
6
  const removeAll = async (payload, context) => {
7
- const files = context.collection.model.find(payload.filters, {
7
+ const files = context.collection.model.find({
8
+ _id: {
9
+ $in: payload.filters.map((oid) => new core_1.ObjectId(oid)),
10
+ },
11
+ }, {
8
12
  projection: {
9
13
  absolute_path: 1,
10
14
  },
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
- import { removeAll as originalRemoveAll } from "@aeriajs/core";
2
+ import { ObjectId, removeAll as originalRemoveAll } from "@aeriajs/core";
3
3
  import * as fs from "node:fs/promises";
4
4
  export const removeAll = async (payload, context) => {
5
- const files = context.collection.model.find(payload.filters, {
5
+ const files = context.collection.model.find({
6
+ _id: {
7
+ $in: payload.filters.map((oid) => new ObjectId(oid))
8
+ }
9
+ }, {
6
10
  projection: {
7
11
  absolute_path: 1
8
12
  }
package/dist/index.d.ts CHANGED
@@ -237,7 +237,7 @@ export declare const collections: {
237
237
  }, never>>;
238
238
  readonly result: undefined;
239
239
  }>;
240
- removeAll: (payload: import("@aeriajs/types").RemoveAllPayload<import("@aeriajs/types").SchemaWithId<typeof import("./collections/file/description.js").description>>, context: import("@aeriajs/types").Context<typeof import("./collections/file/description.js").description>) => Promise<{
240
+ removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<typeof import("./collections/file/description.js").description>) => Promise<{
241
241
  readonly _tag: "Result";
242
242
  readonly error: undefined;
243
243
  readonly result: import("mongodb").DeleteResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.239",
3
+ "version": "0.0.241",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -45,11 +45,11 @@
45
45
  "mongodb": "^6.5.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@aeriajs/core": "^0.0.239",
49
- "@aeriajs/common": "^0.0.135",
50
- "@aeriajs/entrypoint": "^0.0.139",
51
- "@aeriajs/types": "^0.0.117",
52
- "@aeriajs/validation": "^0.0.151"
48
+ "@aeriajs/core": "^0.0.241",
49
+ "@aeriajs/common": "^0.0.136",
50
+ "@aeriajs/entrypoint": "^0.0.140",
51
+ "@aeriajs/types": "^0.0.118",
52
+ "@aeriajs/validation": "^0.0.152"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",