@aeriajs/builtins 0.0.243 → 0.0.245

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,6 +3,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<never>, "func
3
3
  readonly $id: "log";
4
4
  readonly icon: "magnifying-glass";
5
5
  readonly required: readonly ["context", "message"];
6
+ readonly table: readonly ["owner", "context", "message", "created_at"];
6
7
  readonly properties: {
7
8
  readonly owner: {
8
9
  readonly $ref: "user";
@@ -30,6 +31,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<never>, "func
30
31
  readonly $id: "log";
31
32
  readonly icon: "magnifying-glass";
32
33
  readonly required: readonly ["context", "message"];
34
+ readonly table: readonly ["owner", "context", "message", "created_at"];
33
35
  readonly properties: {
34
36
  readonly owner: {
35
37
  readonly $ref: "user";
@@ -10,6 +10,12 @@ exports.log = (0, core_1.defineCollection)({
10
10
  'context',
11
11
  'message',
12
12
  ],
13
+ table: [
14
+ 'owner',
15
+ 'context',
16
+ 'message',
17
+ 'created_at',
18
+ ],
13
19
  properties: {
14
20
  owner: {
15
21
  // don't use "owned: true", we want it this way
@@ -8,6 +8,12 @@ export const log = defineCollection({
8
8
  "context",
9
9
  "message"
10
10
  ],
11
+ table: [
12
+ "owner",
13
+ "context",
14
+ "message",
15
+ "created_at"
16
+ ],
11
17
  properties: {
12
18
  owner: {
13
19
  // don't use "owned: true", we want it this way
@@ -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/dist/index.d.ts CHANGED
@@ -326,6 +326,7 @@ export declare const collections: {
326
326
  readonly $id: "log";
327
327
  readonly icon: "magnifying-glass";
328
328
  readonly required: readonly ["context", "message"];
329
+ readonly table: readonly ["owner", "context", "message", "created_at"];
329
330
  readonly properties: {
330
331
  readonly owner: {
331
332
  readonly $ref: "user";
@@ -353,6 +354,7 @@ export declare const collections: {
353
354
  readonly $id: "log";
354
355
  readonly icon: "magnifying-glass";
355
356
  readonly required: readonly ["context", "message"];
357
+ readonly table: readonly ["owner", "context", "message", "created_at"];
356
358
  readonly properties: {
357
359
  readonly owner: {
358
360
  readonly $ref: "user";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.243",
3
+ "version": "0.0.245",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -13,19 +13,19 @@
13
13
  "license": "ISC",
14
14
  "exports": {
15
15
  ".": {
16
+ "types": "./dist/index.d.ts",
16
17
  "import": "./dist/index.mjs",
17
- "require": "./dist/index.js",
18
- "types": "./dist/index.d.ts"
18
+ "require": "./dist/index.js"
19
19
  },
20
20
  "./collections": {
21
+ "types": "./dist/collections/index.d.ts",
21
22
  "import": "./dist/collections/index.mjs",
22
- "require": "./dist/collections/index.js",
23
- "types": "./dist/collections/index.d.ts"
23
+ "require": "./dist/collections/index.js"
24
24
  },
25
25
  "./icons": {
26
+ "types": "./dist/icons.d.ts",
26
27
  "import": "./dist/icons.mjs",
27
- "require": "./dist/icons.cjs",
28
- "types": "./dist/icons.d.ts"
28
+ "require": "./dist/icons.cjs"
29
29
  },
30
30
  "./*": "./dist/*"
31
31
  },
@@ -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.243",
49
47
  "@aeriajs/common": "^0.0.136",
48
+ "@aeriajs/core": "^0.0.245",
50
49
  "@aeriajs/entrypoint": "^0.0.140",
51
50
  "@aeriajs/types": "^0.0.118",
52
51
  "@aeriajs/validation": "^0.0.152"