Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: revocation list #147

Merged
merged 2 commits into from
Aug 18, 2023
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"test:packages-watch": "pnpm test:packages --watch --verbose",
"test:oa-renderer": "cd packages/vckit-oa-renderers && pnpm test",
"test:oa-renderer-ci": "pnpm test:oa-renderer -- --coverage=true",
"migrate:db": "pnpm -r --stream typeorm migration:run",
"rollback:db": "pnpm -r --stream typeorm migration:revert",
"watch": "pnpm -r exec --if-present 'pnpm run watch'",
"vckit": "cross-env NODE_NO_WARNINGS=1 ./packages/cli/bin/vckit.js",
"prettier": "prettier --write \"{packages,docs,__tests__,!build}/**/*.{ts,js,json,md,yml}\"",
Expand Down
3 changes: 3 additions & 0 deletions packages/encrypted-storage/.env.postgres.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/vckit"
DATABASE_TYPE="postgres"
DATABASE_DATABASE="vckit"
2 changes: 2 additions & 0 deletions packages/encrypted-storage/.env.sqlite.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_DATABASE="../../../database.sqlite"
DATABASE_TYPE="sqlite"
6 changes: 4 additions & 2 deletions packages/encrypted-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
"scripts": {
"build": "tsc",
"extract-api": "node ../cli/bin/vckit.js dev extract-api"
"extract-api": "node ../cli/bin/vckit.js dev extract-api",
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d ./build/data-source.js"
},
"license": "Apache-2.0",
"keywords": [],
Expand Down Expand Up @@ -41,6 +42,7 @@
"@veramo/utils": "5.2.0",
"express-interceptor": "^1.2.0",
"typeorm": "^0.3.10",
"uuid": "^9.0.0"
"uuid": "^9.0.0",
"dotenv": "^16.0.0"
}
}
15 changes: 15 additions & 0 deletions packages/encrypted-storage/src/data-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { DataSource, DataSourceOptions } from 'typeorm';
import { migrations, Entities } from './index.js';
import 'dotenv/config';

const dataSource = {
type: process.env.DATABASE_TYPE as string,
database: process.env.DATABASE_DATABASE as string,
url: process.env.DATABASE_URL as string,
entities: Entities,
synchronize: false,
logging: false,
migrations: migrations,
};

export default new DataSource(dataSource as DataSourceOptions);
3 changes: 3 additions & 0 deletions packages/revocation-list-2020/.env.postgres.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/vckit"
DATABASE_TYPE="postgres"
DATABASE_DATABASE="vckit"
2 changes: 2 additions & 0 deletions packages/revocation-list-2020/.env.sqlite.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_DATABASE="../../../database.sqlite"
DATABASE_TYPE="sqlite"
4 changes: 3 additions & 1 deletion packages/revocation-list-2020/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
"scripts": {
"build": "tsc",
"extract-api": "node ../cli/bin/vckit.js dev extract-api"
"extract-api": "node ../cli/bin/vckit.js dev extract-api",
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d ./build/data-source.js"
},
"license": "Apache-2.0",
"keywords": [],
Expand Down Expand Up @@ -47,6 +48,7 @@
"@veramo/data-store": "5.2.0",
"@veramo/utils": "5.2.0",
"credential-status": "^2.0.5",
"dotenv": "^16.0.0",
"express-interceptor": "^1.2.0",
"jsonld-signatures": "^11.2.1",
"typeorm": "^0.3.10",
Expand Down
15 changes: 15 additions & 0 deletions packages/revocation-list-2020/src/data-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { DataSource, DataSourceOptions } from 'typeorm';
import { migrations, Entities } from './index.js';
import 'dotenv/config';

const dataSource = {
type: process.env.DATABASE_TYPE as string,
database: process.env.DATABASE_DATABASE as string,
url: process.env.DATABASE_URL as string,
entities: Entities,
synchronize: false,
logging: false,
migrations: migrations,
};

export default new DataSource(dataSource as DataSourceOptions);
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
BaseEntity,
BeforeInsert,
BeforeUpdate,
Column,
Entity,
PrimaryColumn,
PrimaryGeneratedColumn,
} from 'typeorm';
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('revocation-data')
export class RevocationData extends BaseEntity {
Expand Down
Loading