🌟 Data migration from nextcloud (#302)

- Files upload to Twake Drive
- New logger
This commit is contained in:
Anton Shepilov
2024-01-02 17:09:43 +03:00
committed by GitHub
parent 75dffb1c7a
commit 6f7f714fe8
14 changed files with 261 additions and 57 deletions
+1 -1
View File
@@ -1 +1 @@
18
20
+14
View File
@@ -2311,6 +2311,11 @@
"color-convert": "^1.9.0"
}
},
"any-base": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz",
"integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg=="
},
"anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
@@ -8982,6 +8987,15 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"short-uuid": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-4.2.2.tgz",
"integrity": "sha512-IE7hDSGV2U/VZoCsjctKX6l5t5ak2jE0+aeGJi3KtvjIUNuZVmHVYUjNBhmo369FIWGDtaieRaO8A83Lvwfpqw==",
"requires": {
"any-base": "^1.1.0",
"uuid": "^8.3.2"
}
},
"signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
@@ -21,6 +21,7 @@ import {
ConfigureRequest,
} from "../types";
import { ConsoleHookUser } from "src/services/console/types";
import User from "src/services/user/entities/user";
export class ApplicationsApiController {
async token(
@@ -174,9 +175,9 @@ export class ApplicationsApiController {
last_name: string;
};
}>,
): Promise<any> {
): Promise<User> {
try {
await gr.services.console.getClient().updateLocalUserFromConsole({
return await gr.services.console.getClient().updateLocalUserFromConsole({
email: request.body.email.trim().toLocaleLowerCase(),
name: request.body.first_name,
surname: request.body.last_name,
@@ -185,7 +186,6 @@ export class ApplicationsApiController {
logger.error(err);
throw err;
}
return {};
}
}
@@ -179,7 +179,7 @@ export const getAccessLevel = async (
}
if (id.startsWith("user_")) {
if (await isCompanyApplication(context)) return "read";
if (await isCompanyApplication(context)) return "manage";
}
if (context?.user?.id) {
@@ -432,7 +432,9 @@ export const getItemScope = async (
{},
context,
);
scope = driveItemParent.scope;
//when application is creating document, there is not user in the context, so there is not scope as well
//TODO [ASH] do not forget tofix it when the context will be emulated during the application rework
scope = driveItemParent?.scope || item.scope;
}
return scope;
};