@aeriajs/builtins 0.0.215 → 0.0.217
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.
- package/dist/collections/file/download.d.ts +1 -1
- package/dist/collections/file/download.js +1 -1
- package/dist/collections/file/download.mjs +1 -1
- package/dist/collections/file/insert.js +3 -3
- package/dist/collections/file/insert.mjs +2 -2
- package/dist/collections/file/remove.js +1 -1
- package/dist/collections/file/remove.mjs +1 -1
- package/dist/collections/file/removeAll.js +1 -1
- package/dist/collections/file/removeAll.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Context } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
3
|
import { HTTPStatus, ACError } from '@aeriajs/types';
|
|
4
|
-
import * as fs from 'fs';
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
5
|
export declare enum DownloadError {
|
|
6
6
|
RangeNotSatisfiable = "RANGE_NOT_SATISFIABLE"
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.download = exports.DownloadError = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
5
|
const core_1 = require("@aeriajs/core");
|
|
6
|
-
const fs = require("fs");
|
|
6
|
+
const fs = require("node:fs");
|
|
7
7
|
var DownloadError;
|
|
8
8
|
(function (DownloadError) {
|
|
9
9
|
DownloadError["RangeNotSatisfiable"] = "RANGE_NOT_SATISFIABLE";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { HTTPStatus, ACError } from "@aeriajs/types";
|
|
3
3
|
import { ObjectId } from "@aeriajs/core";
|
|
4
|
-
import * as fs from "fs";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
export var DownloadError = /* @__PURE__ */ ((DownloadError2) => {
|
|
6
6
|
DownloadError2["RangeNotSatisfiable"] = "RANGE_NOT_SATISFIABLE";
|
|
7
7
|
return DownloadError2;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.insert = void 0;
|
|
4
|
-
const
|
|
5
|
-
const promises_1 = require("fs/promises");
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
6
|
const core_1 = require("@aeriajs/core");
|
|
7
7
|
const insert = async (payload, context) => {
|
|
8
8
|
if (!context.token.authenticated) {
|
|
@@ -33,7 +33,7 @@ const insert = async (payload, context) => {
|
|
|
33
33
|
if (oldFile && oldFile.absolute_path) {
|
|
34
34
|
await (0, promises_1.unlink)(oldFile.absolute_path).catch(console.trace);
|
|
35
35
|
}
|
|
36
|
-
const filenameHash = (0,
|
|
36
|
+
const filenameHash = (0, node_crypto_1.createHash)('sha1')
|
|
37
37
|
.update(what.name + Date.now())
|
|
38
38
|
.digest('hex');
|
|
39
39
|
what.absolute_path = `${tempPath}/${filenameHash}.${extension}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { createHash } from "crypto";
|
|
3
|
-
import { writeFile, unlink } from "fs/promises";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { writeFile, unlink } from "node:fs/promises";
|
|
4
4
|
import { insert as originalInsert } from "@aeriajs/core";
|
|
5
5
|
export const insert = async (payload, context) => {
|
|
6
6
|
if (!context.token.authenticated) {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.remove = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
5
|
const core_1 = require("@aeriajs/core");
|
|
6
|
-
const fs = require("fs/promises");
|
|
6
|
+
const fs = require("node:fs/promises");
|
|
7
7
|
const remove = async (payload, context) => {
|
|
8
8
|
const { error, result: file } = await (0, core_1.get)({
|
|
9
9
|
filters: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { Result } from "@aeriajs/types";
|
|
3
3
|
import { remove as originalRemove, get } from "@aeriajs/core";
|
|
4
|
-
import * as fs from "fs/promises";
|
|
4
|
+
import * as fs from "node:fs/promises";
|
|
5
5
|
export const remove = async (payload, context) => {
|
|
6
6
|
const { error, result: file } = await get({
|
|
7
7
|
filters: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeAll = void 0;
|
|
4
4
|
const core_1 = require("@aeriajs/core");
|
|
5
|
-
const fs = require("fs/promises");
|
|
5
|
+
const fs = require("node:fs/promises");
|
|
6
6
|
const removeAll = async (payload, context) => {
|
|
7
7
|
const files = context.collection.model.find(payload.filters, {
|
|
8
8
|
projection: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { removeAll as originalRemoveAll } from "@aeriajs/core";
|
|
3
|
-
import * as fs from "fs/promises";
|
|
3
|
+
import * as fs from "node:fs/promises";
|
|
4
4
|
export const removeAll = async (payload, context) => {
|
|
5
5
|
const files = context.collection.model.find(payload.filters, {
|
|
6
6
|
projection: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/builtins",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.217",
|
|
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.
|
|
49
|
-
"@aeriajs/common": "^0.0.
|
|
50
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
51
|
-
"@aeriajs/types": "^0.0.
|
|
52
|
-
"@aeriajs/validation": "^0.0.
|
|
48
|
+
"@aeriajs/core": "^0.0.217",
|
|
49
|
+
"@aeriajs/common": "^0.0.126",
|
|
50
|
+
"@aeriajs/entrypoint": "^0.0.129",
|
|
51
|
+
"@aeriajs/types": "^0.0.108",
|
|
52
|
+
"@aeriajs/validation": "^0.0.141"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "echo skipping",
|