Skip to content

Commit

Permalink
Merge pull request #28 from REAN-Foundation/authorization-02
Browse files Browse the repository at this point in the history
Authorization 02
  • Loading branch information
kiran-rean authored May 22, 2024
2 parents 66df744 + d3848f5 commit f46785a
Show file tree
Hide file tree
Showing 271 changed files with 3,161 additions and 3,024 deletions.
4 changes: 2 additions & 2 deletions src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';
import type { PageServerLoad } from './$types';
import { SessionManager } from './api/sessions/session.manager';
import { login } from './api/services/user';
import { getUserRoles } from './api/services/types';
import { login } from './api/services/reancare/user';
import { getUserRoles } from './api/services/reancare/types';

////////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/api-client/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteApiClient } from '../../services/api-clients';
import { deleteApiClient } from '../../services/reancare/api-clients';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/api-client/get-api-key/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { getCurrentApiKey } from '../../../services/api-clients';
import { getCurrentApiKey } from '../../../services/reancare/api-clients';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/api-client/renew-api-key/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { updateApiKey } from '../../../services/api-clients';
import { updateApiKey } from '../../../services/reancare/api-clients';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/api-client/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchApiClients } from '../../../services/api-clients';
import { searchApiClients } from '../../../services/reancare/api-clients';

//////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteAssessmentNode } from '../../../services/assessments/assessment-nodes';
import { deleteAssessmentNode } from '../../../services/reancare/assessments/assessment-nodes';

//////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchAssessmentNodes } from '../../../../services/assessments/assessment-nodes';
import { searchAssessmentNodes } from '../../../../services/reancare/assessments/assessment-nodes';

//////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { updateScoringCondition } from '../../../../services/assessments/assessment-nodes';
import { updateScoringCondition } from '../../../../services/reancare/assessments/assessment-nodes';

//////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteAssessmentTemplate } from '../../../services/assessments/assessment-templates';
import { deleteAssessmentTemplate } from '../../../services/reancare/assessments/assessment-templates';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchAssessmentTemplates } from '../../../../services/assessments/assessment-templates';
import { searchAssessmentTemplates } from '../../../../services/reancare/assessments/assessment-templates';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/cohorts/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteCohort } from '$routes/api/services/cohorts';
import { deleteCohort } from '$routes/api/services/reancare/cohorts';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/cohorts/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchCohorts } from '../../../services/cohorts';
import { searchCohorts } from '../../../services/reancare/cohorts';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/course-contents/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteCourseContent } from '../../services/course.contents';
import { deleteCourseContent } from '../../services/reancare/course.contents';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/course-contents/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchCourseContents } from '../../../services/course.contents';
import { searchCourseContents } from '../../../services/reancare/course.contents';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/courses/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteCourse } from '../../services/courses';
import { deleteCourse } from '../../services/reancare/courses';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/courses/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchCourses } from '../../../services/courses';
import { searchCourses } from '../../../services/reancare/courses';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/custom-query/delete/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteQuery } from '$routes/api/services/custom.query';
import { deleteQuery } from '$routes/api/services/reancare/custom.query';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { executeQuery } from '$routes/api/services/custom.query';
import { executeQuery } from '$routes/api/services/reancare/custom.query';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/custom-query/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchQueries } from '$routes/api/services/custom.query';
import { searchQueries } from '$routes/api/services/reancare/custom.query';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/custom-query/update-query/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { updateQuery } from '$routes/api/services/custom.query';
import { updateQuery } from '$routes/api/services/reancare/custom.query';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/drugs/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteDrug } from '../../services/drugs';
import { deleteDrug } from '../../services/reancare/drugs';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/drugs/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchDrugs } from '../../../services/drugs';
import { searchDrugs } from '../../../services/reancare/drugs';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/favicon-resource/upload/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uploadBinary } from '../../../services/file.resource';
import { uploadBinary } from '../../../services/reancare/file.resource';
import type { RequestEvent, RequestHandler } from './$types';
import * as fs from 'fs';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/file-resources/delete/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deleteFileResource } from '../../../services/file.resource';
import { deleteFileResource } from '../../../services/reancare/file.resource';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/file-resources/download/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { download } from '../../../services/file.resource';
import { download } from '../../../services/reancare/file.resource';

//////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getFileResourceById } from '../../../services/file.resource';
import { getFileResourceById } from '../../../services/reancare/file.resource';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/file-resources/upload/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uploadBinary } from '../../../services/file.resource';
import { uploadBinary } from '../../../services/reancare/file.resource';
import type { RequestEvent, RequestHandler } from './$types';
import * as fs from 'fs';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteBadgeCategory } from '$routes/api/services/gamification/badge.category';
import { deleteBadgeCategory } from '$routes/api/services/awards/gamification/badge.category';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand All @@ -22,4 +22,4 @@ export const DELETE = async (event: RequestEvent) => {
successMessage(response.Message),
event
);
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchBadgeCategories } from '$routes/api/services/gamification/badge.category';
import { searchBadgeCategories } from '$routes/api/services/awards/gamification/badge.category';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/gamification/badges/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteBadge } from '$routes/api/services/gamification/badge';
import { deleteBadge } from '$routes/api/services/awards/gamification/badge';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchBadges } from '$routes/api/services/gamification/badge';
import { searchBadges } from '$routes/api/services/awards/gamification/badge';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/server/gamification/event-types/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteEventType } from '$routes/api/services/gamification/event.types';
import { deleteEventType } from '$routes/api/services/awards/gamification/event.types';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand All @@ -22,4 +22,4 @@ export const DELETE = async (event: RequestEvent) => {
successMessage(response.Message),
event
);
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchEventTypes } from '$routes/api/services/gamification/event.types';
import { searchEventTypes } from '$routes/api/services/awards/gamification/event.types';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/server/gamification/nodes/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deleteNode } from '$routes/api/services/gamification/node';
import { deleteNode } from '$routes/api/services/awards/gamification/node';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand All @@ -14,4 +14,4 @@ export const DELETE = async (event: RequestEvent) => {
console.error(`Error deleting node: ${err.message}`);
return new Response(err.message);
}
};
};
2 changes: 1 addition & 1 deletion src/routes/api/server/gamification/nodes/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchNodes } from '$routes/api/services/gamification/node';
import { searchNodes } from '$routes/api/services/awards/gamification/node';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/server/gamification/schemas/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { deleteSchema } from '$routes/api/services/gamification/schema';
import { deleteSchema } from '$routes/api/services/awards/gamification/schema';
import type { RequestEvent } from '@sveltejs/kit';
import { redirect } from 'sveltekit-flash-message/server';

Expand All @@ -22,4 +22,4 @@ export const DELETE = async (event: RequestEvent) => {
successMessage(response.Message),
event
);
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchSchemas } from '$routes/api/services/gamification/schema';
import { searchSchemas } from '$routes/api/services/awards/gamification/schema';
import type { RequestEvent } from '@sveltejs/kit';

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/goals/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteGoal } from '../../services/goals';
import { deleteGoal } from '../../services/reancare/goals';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/goals/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchGoals } from '../../../services/goals';
import { searchGoals } from '../../../services/reancare/goals';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/health-systems/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from "$lib/utils/message.utils";
import { deleteHealthSystem } from "$routes/api/services/health.systems";
import { deleteHealthSystem } from "$routes/api/services/reancare/health.systems";
import type { RequestEvent } from "@sveltejs/kit";
import { redirect } from "sveltekit-flash-message/server";

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/health-systems/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchHealthSystems } from "$routes/api/services/health.systems";
import { searchHealthSystems } from "$routes/api/services/reancare/health.systems";
import type { RequestEvent } from "@sveltejs/kit";

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/hospitals/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, successMessage } from "$lib/utils/message.utils";
import { deleteHospital } from "$routes/api/services/hospitals";
import { deleteHospital } from "$routes/api/services/reancare/hospitals";
import type { RequestEvent } from "@sveltejs/kit";
import { redirect } from "sveltekit-flash-message/server";

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/hospitals/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { searchHospitals } from "$routes/api/services/hospitals";
import { searchHospitals } from "$routes/api/services/reancare/hospitals";
import type { RequestEvent } from "@sveltejs/kit";

//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/knowledge-nuggets/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteKnowledgeNugget } from '../../services/knowledge-nuggets';
import { deleteKnowledgeNugget } from '../../services/reancare/knowledge-nuggets';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/knowledge-nuggets/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchKnowledgeNuggets } from '../../../services/knowledge-nuggets';
import { searchKnowledgeNuggets } from '../../../services/reancare/knowledge-nuggets';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/lab-record-types/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteLabRecordType } from '../../services/lab-record-types';
import { deleteLabRecordType } from '../../services/reancare/lab-record-types';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/learning-journeys/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteLearningJourney } from '../../services/learning-journeys';
import { deleteLearningJourney } from '../../services/reancare/learning-journeys';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/learning-journeys/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchLearningJourneys } from '../../../services/learning-journeys';
import { searchLearningJourneys } from '../../../services/reancare/learning-journeys';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/logout/+server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CookieUtils } from '$lib/utils/cookie.utils';
import { SessionManager } from '../../sessions/session.manager';
import { redirect, type RequestEvent } from '@sveltejs/kit';
import { logout } from '../../services/user';
import { logout } from '../../services/reancare/user';

////////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/modules/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteModule } from '../../services/modules';
import { deleteModule } from '../../services/reancare/modules';
import { errorMessage, successMessage } from '$lib/utils/message.utils';
import { redirect } from 'sveltekit-flash-message/server';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/modules/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestEvent } from '@sveltejs/kit';
import { page } from '$app/stores';
import { searchModules } from '../../../services/modules';
import { searchModules } from '../../../services/reancare/modules';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/newsfeed-items/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { deleteNewsfeedItem } from '../../services/newsfeed-items';
import { deleteNewsfeedItem } from '../../services/reancare/newsfeed-items';

//////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/server/newsfeed-items/search/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RequestEvent } from '@sveltejs/kit';
import { searchNewsfeedItems } from '../../../../api/services/newsfeed-items';
import { searchNewsfeedItems } from '../../../services/reancare/newsfeed-items';

//////////////////////////////////////////////////////////////

Expand Down
Loading

0 comments on commit f46785a

Please sign in to comment.