Skip to content

Commit

Permalink
feat(drive): use prisma storage adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Jan 31, 2024
1 parent 70220a4 commit cdebd25
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"document-drive": "powerhouse-inc/document-drive#f139afc",
"document-drive": "^0.0.27",
"document-model": "^1.0.24",
"document-model-libs": "^1.1.37",
"dotenv": "^16.0.3",
Expand Down
3 changes: 1 addition & 2 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["clientExtensions"]
provider = "prisma-client-js"
}

datasource db {
Expand Down
6 changes: 3 additions & 3 deletions api/src/modules/DocumentDrive/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getDocumentDriveCRUD(prisma: Prisma.TransactionClient) {

const driveServer = new DocumentDriveServer(
documentModels,
new MemoryStorage()
new PrismaStorage(prisma)
);

return {
Expand Down Expand Up @@ -188,9 +188,9 @@ export function getDocumentDriveCRUD(prisma: Prisma.TransactionClient) {
system: false,
};
let drive = await driveServer.getDrive(driveId);
drive = reducer(drive,actions.addListener({ listener }))
drive = reducer(drive, actions.addListener({ listener }));
const operation = drive.operations.local.slice().pop();

await driveServer.addDriveOperations(driveId, [operation]);
return listener;
},
Expand Down
27 changes: 6 additions & 21 deletions api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@
"@graphql-typed-document-node/core" "^3.1.1"
tslib "^2.4.0"

"@graphql-typed-document-node/core@^3.1.1", "@graphql-typed-document-node/core@^3.2.0":
"@graphql-typed-document-node/core@^3.1.1":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==
Expand Down Expand Up @@ -989,11 +989,6 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@prisma/[email protected]":
version "5.7.1"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.7.1.tgz#a124afd05663267f7255a639a81d28303684a063"
integrity sha512-TUSa4nUcC4nf/e7X3jyO1pEd6XcI/TLRCA0KjkA46RDIpxUaRsBYEOqITwXRW2c0bMFyKcCRXrH4f7h4q9oOlg==

"@prisma/client@^5.7.1":
version "5.8.1"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.8.1.tgz#7815ec51c0ca2a6de219c02e7846701ae3baf240"
Expand Down Expand Up @@ -1973,13 +1968,11 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

document-drive@powerhouse-inc/document-drive#f139afc:
version "0.0.23"
resolved "https://codeload.github.com/powerhouse-inc/document-drive/tar.gz/f139afc2f5b0245de1866ea849221f6ab1ae27d2"
document-drive@^0.0.27:
version "0.0.27"
resolved "https://registry.yarnpkg.com/document-drive/-/document-drive-0.0.27.tgz#6e49320b5740592c9a8cb5fecdcab931150dae27"
integrity sha512-QT2THZh605AFlzLYSCVFSAEE08KXAO8W8hEqx5+KaSiEjVkr/9U5LOc0A+h5f/dryh+qB2960whESNqcIT1Nww==
dependencies:
"@prisma/client" "5.7.1"
graphql "^16.8.1"
graphql-request "^6.1.0"
sanitize-filename "^1.6.3"

document-model-libs@^1.1.37:
Expand Down Expand Up @@ -2690,15 +2683,7 @@ graphql-request@^5.2.0:
extract-files "^9.0.0"
form-data "^3.0.0"

graphql-request@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.1.0.tgz#f4eb2107967af3c7a5907eb3131c671eac89be4f"
integrity sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw==
dependencies:
"@graphql-typed-document-node/core" "^3.2.0"
cross-fetch "^3.1.5"

graphql@^16.7.1, graphql@^16.8.1:
graphql@^16.7.1:
version "16.8.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07"
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==
Expand Down

0 comments on commit cdebd25

Please sign in to comment.