Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: "npm"
- name: Install deps
run: npm ci --include=optional
# - name: Lint check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install deps
run: npm ci --include=optional
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: 22
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install deps
run: npm ci --include=optional
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ export default tseslint.config(
}
]
}
},
{
ignores: ["**/dist"]
}
)
10,076 changes: 6,870 additions & 3,206 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"jest-environment-node": "^29.4.1",
"markdownlint-cli2": "^0.15.0",
"mongodb": "^6.21.0",
"mongodb-client-encryption": "^6.5.0",
"nx": "19.4.1",
"prettier": "^3.2.5",
"rimraf": "^5.0.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"database": "flowerbase-demo",
"collection": "todos",
"schema": {
"title": "todo",
"bsonType": "object",
"encryptMetadata": {
"keyAlias": "prod-data-key"
},
"properties": {
"title": {
"encrypt": {
"bsonType": "string",
"algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random",
"keyAlias": "dev-data-key"
}
},
"secureNote": {
"encrypt": {
"bsonType": "string",
"algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
}
}
}
}
}
34 changes: 32 additions & 2 deletions packages/demo/packages/backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
import { initialize } from '@flowerforce/flowerbase';
import { initialize, InitializeConfig } from '@flowerforce/flowerbase';

const projectId = process.env.PROJECT_ID ?? "my-project-id"
const port = process.env.PORT ? Number(process.env.PORT) : undefined
const mongodbUrl = process.env.DB_CONNECTION_STRING
const jwtSecret = process.env.APP_SECRET
const host = process.env.HOST

// Pass `mongodbEncryptionConfig` to `initialize` to enable Client-Side Field Level Encryption
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const mongodbEncryptionConfig: InitializeConfig["mongodbEncryptionConfig"] = {
extraOptions: {
cryptSharedLibPath: "__path_to_crypt_shared__",
cryptSharedLibRequired: true
},
kmsProviders: [
{
provider: "aws",
keyAlias: "prod-data-key",
config: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
},
masterKey: {
key: "arn:aws:kms:eu-central-1:123456789:key/123456789",
region: "eu-central-1"
}
},
{
provider: "local",
keyAlias: "dev-data-key",
config: {
key: "DE1+JeO3S2BTXar3FScBFsSnuz1TjhppXfqi9IBNA2JmVJx9lkBtcDu13/uzzL78r16iVeKKKLgzfOrXLrU+OqfjbaqzugOSbF/1I1q8pZP29vMzl625Thb2s1QEgMlF"
},
}
]
}

initialize({
projectId,
port,
mongodbUrl,
jwtSecret,
host
host,
})
Loading