Skip to content

Commit

Permalink
fix: stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Mar 7, 2024
1 parent 26e5698 commit 85a94bd
Show file tree
Hide file tree
Showing 25 changed files with 609 additions and 537 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
&& pnpm --no-bail --filter='./packages/builtins' build \
&& pnpm --no-bail --filter='./packages/server' build \
&& pnpm --no-bail --filter='./packages/aeria' build \
&& pnpm --no-bail --filter='./packages/aeria-sdk' build \
&& pnpm --no-bail --filter='./packages/aeria-build' build:build
- name: Patch node_modules
Expand Down
7 changes: 7 additions & 0 deletions packages/aeria-build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# aeria-build

## 0.0.7

### Patch Changes

- @aeriajs/api@0.0.6
- @aeriajs/builtins@0.0.6

## 0.0.6

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/aeria-build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aeria-build",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -46,8 +46,8 @@
"tslib": "^2.5.0"
},
"peerDependencies": {
"@aeriajs/api": "^0.0.5",
"@aeriajs/builtins": "^0.0.5",
"@aeriajs/api": "^0.0.6",
"@aeriajs/builtins": "^0.0.6",
"@aeriajs/common": "^0.0.1",
"@aeriajs/types": "^0.0.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/aeria-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# aeria-sdk

## 0.0.20

### Patch Changes

- aeria-sdk exports

## 0.0.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/aeria-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aeria-sdk",
"version": "0.0.19",
"version": "0.0.20",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
10 changes: 9 additions & 1 deletion packages/aeria-sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export * from '@aeriajs/common/either'
export {
left,
right,
isLeft,
isRight,
unwrapEither,
unsafe,
} from '@aeriajs/common/either'

export {
topLevel as Aeria,
} from './topLevel.js'
Expand Down
13 changes: 13 additions & 0 deletions packages/aeria/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# aeria

## 0.0.6

### Patch Changes

- Updated dependencies
- @aeriajs/validation@0.0.4
- @aeriajs/api@0.0.6
- @aeriajs/builtins@0.0.6
- @aeriajs/http@0.0.4
- @aeriajs/security@0.0.6
- @aeriajs/server@0.0.6
- @aeriajs/node-http@0.0.4

## 0.0.5

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions packages/aeria/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aeria",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -34,15 +34,15 @@
],
"peerDependencies": {
"@aeriajs/access-control": "^0.0.1",
"@aeriajs/api": "^0.0.5",
"@aeriajs/api": "^0.0.6",
"@aeriajs/common": "^0.0.1",
"@aeriajs/entrypoint": "^0.0.1",
"@aeriajs/http": "^0.0.3",
"@aeriajs/node-http": "^0.0.3",
"@aeriajs/security": "^0.0.5",
"@aeriajs/server": "^0.0.5",
"@aeriajs/builtins": "^0.0.5",
"@aeriajs/http": "^0.0.4",
"@aeriajs/node-http": "^0.0.4",
"@aeriajs/security": "^0.0.6",
"@aeriajs/server": "^0.0.6",
"@aeriajs/builtins": "^0.0.6",
"@aeriajs/types": "^0.0.0",
"@aeriajs/validation": "^0.0.3"
"@aeriajs/validation": "^0.0.4"
}
}
10 changes: 10 additions & 0 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @aeriajs/api

## 0.0.6

### Patch Changes

- Updated dependencies
- @aeriajs/validation@0.0.4
- @aeriajs/builtins@0.0.6
- @aeriajs/http@0.0.4
- @aeriajs/security@0.0.6

## 0.0.5

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/api",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -45,11 +45,11 @@
"@aeriajs/access-control": "^0.0.1",
"@aeriajs/common": "^0.0.1",
"@aeriajs/entrypoint": "^0.0.1",
"@aeriajs/http": "^0.0.3",
"@aeriajs/security": "^0.0.5",
"@aeriajs/builtins": "^0.0.5",
"@aeriajs/http": "^0.0.4",
"@aeriajs/security": "^0.0.6",
"@aeriajs/builtins": "^0.0.6",
"@aeriajs/types": "^0.0.0",
"@aeriajs/validation": "^0.0.3",
"@aeriajs/validation": "^0.0.4",
"jsonwebtoken": "^8.5.1",
"mongodb": "^6.1.0"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/builtins/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @aeriajs/builtins

## 0.0.6

### Patch Changes

- Updated dependencies
- @aeriajs/validation@0.0.4
- @aeriajs/api@0.0.6

## 0.0.5

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/builtins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/builtins",
"version": "0.0.5",
"version": "0.0.6",
"description": "## Installation",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -51,11 +51,11 @@
"mongodb": "^6.1.0"
},
"peerDependencies": {
"@aeriajs/api": "^0.0.5",
"@aeriajs/api": "^0.0.6",
"@aeriajs/access-control": "^0.0.1",
"@aeriajs/entrypoint": "^0.0.1",
"@aeriajs/common": "^0.0.1",
"@aeriajs/types": "^0.0.0",
"@aeriajs/validation": "^0.0.3"
"@aeriajs/validation": "^0.0.4"
}
}
7 changes: 7 additions & 0 deletions packages/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @aeriajs/http

## 0.0.4

### Patch Changes

- Updated dependencies
- @aeriajs/validation@0.0.4

## 0.0.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/http",
"version": "0.0.3",
"version": "0.0.4",
"description": "## Installation",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -35,6 +35,6 @@
"@aeriajs/access-control": "^0.0.1",
"@aeriajs/common": "^0.0.1",
"@aeriajs/types": "^0.0.0",
"@aeriajs/validation": "^0.0.3"
"@aeriajs/validation": "^0.0.4"
}
}
6 changes: 6 additions & 0 deletions packages/node-http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @aeriajs/node-http

## 0.0.4

### Patch Changes

- @aeriajs/http@0.0.4

## 0.0.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/node-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/node-http",
"version": "0.0.3",
"version": "0.0.4",
"description": "## Installation",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -32,6 +32,6 @@
"dist"
],
"peerDependencies": {
"@aeriajs/http": "^0.0.3"
"@aeriajs/http": "^0.0.4"
}
}
6 changes: 6 additions & 0 deletions packages/security/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @aeriajs/security

## 0.0.6

### Patch Changes

- @aeriajs/api@0.0.6

## 0.0.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/security/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/security",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -32,7 +32,7 @@
"dist"
],
"peerDependencies": {
"@aeriajs/api": "^0.0.5",
"@aeriajs/api": "^0.0.6",
"@aeriajs/common": "^0.0.1",
"@aeriajs/types": "^0.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/security/src/immutability.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Context } from '@aeriajs/types'
import type { SecurityCheckProps, SecurityCheckReadPayload, SecurityCheckWritePayload } from './types.js'

import { ACErrors, ObjectId } from '@aeriajs/types'
import { left, right, isLeft } from '@aeriajs/common'

Expand Down Expand Up @@ -33,13 +32,14 @@ const internalCheckImmutability = async (
const currentDocument: Record<string, any> | null = await context.collection.model.findOne({
_id: new ObjectId(parentId),
})

if( !currentDocument ) {
return left(ACErrors.ImmutabilityParentNotFound)
}

if( childId ) {
if(
(Array.isArray(currentDocument[propertyName]) && !currentDocument[propertyName].some((child) => child.toString() === childId))
(Array.isArray(currentDocument[propertyName]) && !currentDocument[propertyName].some((child: any) => child.toString() === childId))
|| (!Array.isArray(currentDocument[propertyName]) && currentDocument[propertyName] && currentDocument[propertyName] !== childId.toString())
) {
return left(ACErrors.ImmutabilityIncorrectChild)
Expand Down
9 changes: 9 additions & 0 deletions packages/server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @aeriajs/server

## 0.0.6

### Patch Changes

- @aeriajs/api@0.0.6
- @aeriajs/builtins@0.0.6
- @aeriajs/http@0.0.4
- @aeriajs/server@0.0.6

## 0.0.5

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/server",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -33,17 +33,17 @@
],
"peerDependencies": {
"@aeriajs/access-control": "^0.0.1",
"@aeriajs/api": "^0.0.5",
"@aeriajs/api": "^0.0.6",
"@aeriajs/common": "^0.0.1",
"@aeriajs/entrypoint": "^0.0.1",
"@aeriajs/http": "^0.0.3",
"@aeriajs/server": "^0.0.5",
"@aeriajs/builtins": "^0.0.5",
"@aeriajs/http": "^0.0.4",
"@aeriajs/server": "^0.0.6",
"@aeriajs/builtins": "^0.0.6",
"@aeriajs/types": "^0.0.0",
"mongodb": "^6.1.0"
},
"optionalDependencies": {
"@aeriajs/node-http": "^0.0.3"
"@aeriajs/node-http": "^0.0.4"
},
"devDependencies": {
"mongodb": "^6.1.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/validation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @aeriajs/validation

## 0.0.4

### Patch Changes

- aeria-sdk exports

## 0.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/validation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeriajs/validation",
"version": "0.0.3",
"version": "0.0.4",
"description": "## Installation",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
4 changes: 2 additions & 2 deletions packages/validation/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export const validator = <const TJsonSchema extends Omit<Description, '$id'> | P

return <const>[
{} as InferSchema<TJsonSchema>,
<TWhat extends Record<string, any>>(what: TWhat) => {
<TWhat>(what: TWhat) => {
return validate(what, schema, options)
},
]
Expand All @@ -338,7 +338,7 @@ export const silentValidator = <const TJsonSchema extends Omit<Description, '$id

return <const>[
{} as InferSchema<TJsonSchema>,
<TWhat extends Record<string, any>>(what: TWhat) => {
<TWhat>(what: TWhat) => {
return validateSilently(what, schema, options)
},
]
Expand Down
Loading

0 comments on commit 85a94bd

Please sign in to comment.