@aeriajs/builtins 0.0.242 → 0.0.244

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.
@@ -13,8 +13,7 @@ const removeAll = async (payload, context) => {
13
13
  absolute_path: 1,
14
14
  },
15
15
  });
16
- let file;
17
- while (file = await files.next()) {
16
+ for await (const file of files) {
18
17
  try {
19
18
  await fs.unlink(file.absolute_path);
20
19
  }
@@ -11,8 +11,7 @@ export const removeAll = async (payload, context) => {
11
11
  absolute_path: 1
12
12
  }
13
13
  });
14
- let file;
15
- while (file = await files.next()) {
14
+ for await (const file of files) {
16
15
  try {
17
16
  await fs.unlink(file.absolute_path);
18
17
  } catch (err) {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.activate = exports.ActivationError = void 0;
4
4
  const core_1 = require("@aeriajs/core");
5
5
  const types_1 = require("@aeriajs/types");
6
- const bcrypt = require("bcrypt");
6
+ const bcrypt = require("bcryptjs");
7
7
  exports.ActivationError = {
8
8
  UserNotFound: 'USER_NOT_FOUND',
9
9
  AlreadyActiveUser: 'ALREADY_ACTIVE_USER',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  import { decodeToken, ObjectId } from "@aeriajs/core";
3
3
  import { Result, ACError, HTTPStatus } from "@aeriajs/types";
4
- import * as bcrypt from "bcrypt";
4
+ import * as bcrypt from "bcryptjs";
5
5
  export const ActivationError = {
6
6
  UserNotFound: "USER_NOT_FOUND",
7
7
  AlreadyActiveUser: "ALREADY_ACTIVE_USER",
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authenticate = void 0;
4
4
  const types_1 = require("@aeriajs/types");
5
- const bcrypt_1 = require("bcrypt");
5
+ const bcryptjs_1 = require("bcryptjs");
6
6
  const core_1 = require("@aeriajs/core");
7
7
  const common_1 = require("@aeriajs/common");
8
8
  const authentication_js_1 = require("../../authentication.js");
@@ -50,7 +50,7 @@ const authenticate = async (props, context) => {
50
50
  active: 1,
51
51
  },
52
52
  });
53
- if (!user || !user.password || !await (0, bcrypt_1.compare)(props.password, user.password)) {
53
+ if (!user || !user.password || !await (0, bcryptjs_1.compare)(props.password, user.password)) {
54
54
  return context.error(types_1.HTTPStatus.Unauthorized, {
55
55
  code: authentication_js_1.AuthenticationError.InvalidCredentials,
56
56
  });
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  import { Result, HTTPStatus, ACError } from "@aeriajs/types";
3
- import { compare as bcryptCompare } from "bcrypt";
3
+ import { compare as bcryptCompare } from "bcryptjs";
4
4
  import { decodeToken, get } from "@aeriajs/core";
5
5
  import { throwIfError } from "@aeriajs/common";
6
6
  import { successfulAuthentication, defaultSuccessfulAuthentication, AuthenticationError } from "../../authentication.mjs";
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAccount = exports.CreateAccountError = void 0;
4
4
  const types_1 = require("@aeriajs/types");
5
5
  const validation_1 = require("@aeriajs/validation");
6
- const bcrypt = require("bcrypt");
6
+ const bcrypt = require("bcryptjs");
7
7
  const core_1 = require("@aeriajs/core");
8
8
  exports.CreateAccountError = {
9
9
  SignupDisallowed: 'SIGNUP_DISALLOWED',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  import { HTTPStatus, ACError } from "@aeriajs/types";
3
3
  import { validate } from "@aeriajs/validation";
4
- import * as bcrypt from "bcrypt";
4
+ import * as bcrypt from "bcryptjs";
5
5
  import { insert as originalInsert } from "@aeriajs/core";
6
6
  export const CreateAccountError = {
7
7
  SignupDisallowed: "SIGNUP_DISALLOWED"
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.editProfile = void 0;
4
4
  const types_1 = require("@aeriajs/types");
5
5
  const core_1 = require("@aeriajs/core");
6
- const bcrypt = require("bcrypt");
6
+ const bcrypt = require("bcryptjs");
7
7
  const editProfile = async (payload, context) => {
8
8
  const mutableProperties = context.config.security.mutableUserProperties;
9
9
  if (!context.token.sub) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  import { HTTPStatus, ACError } from "@aeriajs/types";
3
3
  import { insert as originalInsert } from "@aeriajs/core";
4
- import * as bcrypt from "bcrypt";
4
+ import * as bcrypt from "bcryptjs";
5
5
  export const editProfile = async (payload, context) => {
6
6
  const mutableProperties = context.config.security.mutableUserProperties;
7
7
  if (!context.token.sub) {
@@ -4,7 +4,7 @@ exports.insert = void 0;
4
4
  const types_1 = require("@aeriajs/types");
5
5
  const common_1 = require("@aeriajs/common");
6
6
  const core_1 = require("@aeriajs/core");
7
- const bcrypt = require("bcrypt");
7
+ const bcrypt = require("bcryptjs");
8
8
  const isRoleAllowed = (targetRole, context) => {
9
9
  if (!context.config.security.rolesHierarchy) {
10
10
  return true;
@@ -2,7 +2,7 @@
2
2
  import { HTTPStatus, ACError } from "@aeriajs/types";
3
3
  import { arraysIntersect } from "@aeriajs/common";
4
4
  import { ObjectId, insert as originalInsert } from "@aeriajs/core";
5
- import * as bcrypt from "bcrypt";
5
+ import * as bcrypt from "bcryptjs";
6
6
  const isRoleAllowed = (targetRole, context) => {
7
7
  if (!context.config.security.rolesHierarchy) {
8
8
  return true;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.redefinePassword = exports.ActivationError = void 0;
4
4
  const core_1 = require("@aeriajs/core");
5
5
  const types_1 = require("@aeriajs/types");
6
- const bcrypt = require("bcrypt");
6
+ const bcrypt = require("bcryptjs");
7
7
  exports.ActivationError = {
8
8
  UserNotFound: 'USER_NOT_FOUND',
9
9
  UserNotActive: 'USER_NOT_ACTIVE',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  import { decodeToken, ObjectId } from "@aeriajs/core";
3
3
  import { Result, ACError, HTTPStatus } from "@aeriajs/types";
4
- import * as bcrypt from "bcrypt";
4
+ import * as bcrypt from "bcryptjs";
5
5
  export const ActivationError = {
6
6
  UserNotFound: "USER_NOT_FOUND",
7
7
  UserNotActive: "USER_NOT_ACTIVE",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.242",
3
+ "version": "0.0.244",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "bcrypt": "^5.1.1"
36
+ "bcryptjs": "^3.0.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@aeriajs/common": "link:../common",
@@ -41,12 +41,11 @@
41
41
  "@aeriajs/entrypoint": "link:../entrypoint",
42
42
  "@aeriajs/types": "link:../types",
43
43
  "@aeriajs/validation": "link:../validation",
44
- "@types/bcrypt": "^5.0.2",
45
44
  "mongodb": "^6.5.0"
46
45
  },
47
46
  "peerDependencies": {
48
- "@aeriajs/core": "^0.0.242",
49
47
  "@aeriajs/common": "^0.0.136",
48
+ "@aeriajs/core": "^0.0.244",
50
49
  "@aeriajs/entrypoint": "^0.0.140",
51
50
  "@aeriajs/types": "^0.0.118",
52
51
  "@aeriajs/validation": "^0.0.152"