Skip to content

Commit

Permalink
Merge pull request #4692 from alkem-io/release/homepage
Browse files Browse the repository at this point in the history
Release: Homepage & Fixes
  • Loading branch information
valentinyanakiev authored Nov 11, 2024
2 parents 4c2b574 + 5094ada commit 02752f7
Show file tree
Hide file tree
Showing 189 changed files with 3,296 additions and 19,478 deletions.
12 changes: 1 addition & 11 deletions alkemio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ hosting:
port: ${WHITEBOARD_RT_PORT}:4001

max_json_payload_size: ${HOSTING_MAX_JSON_PAYLOAD_SIZE}:64mb
## bootstrap ##
# Used to determine the the information that is used to to initialize a functional Alkemio instance.
bootstrap:
# The bootstrap authorization file specifies the minimum set of users and their associated credentials that are always available
# in the Alkemio instance.
#
# Default: the default file that is picked up is: src/services/configuraiton/templates/authorization-bootstrap.json.
authorization:
enabled: ${BOOTSTRAP_AUTHORIZATION_ENABLED}:true
file: ${BOOTSTRAP_AUTHORIZATION_FILE}
# Settings related to the authorization framework
authorization:
# amount of authorization policies saved in a single chunk
Expand Down Expand Up @@ -285,7 +275,7 @@ communications:
enabled: ${COMMUNICATIONS_DISCUSSIONS_ENABLED}:true

## storage ##
# Alkemio uses multiple types of persistent storage, including SQL database and IPFS.
# Alkemio uses multiple types of persistent storage, including SQL database, postgres database, file storage, redis.
storage:
file:
# 20MB
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-server",
"version": "0.95.2",
"version": "0.95.3",
"description": "Alkemio server, responsible for managing the shared Alkemio platform",
"author": "Alkemio Foundation",
"private": false,
Expand Down
2 changes: 0 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import { ChatGuidanceModule } from '@services/api/chat-guidance/chat.guidance.mo
import { LookupModule } from '@services/api/lookup';
import { AuthResetSubscriberModule } from '@services/auth-reset/subscriber/auth-reset.subscriber.module';
import { APP_ID_PROVIDER } from '@common/app.id.provider';
import { IpfsLogModule } from '@services/api-rest/ipfs-log/ipfs.log.module';
import { ContributionMoveModule } from '@domain/collaboration/callout-contribution/callout.contribution.move.module';
import { TaskGraphqlModule } from '@domain/task/task.module';
import { ActivityFeedModule } from '@domain/activity-feed';
Expand Down Expand Up @@ -279,7 +278,6 @@ import { AdminUsersModule } from '@platform/admin/users/admin.users.module';
InnovationHubModule,
SsiCredentialFlowModule,
StorageAccessModule,
IpfsLogModule,
MeModule,
ExcalidrawServerModule,
ChatGuidanceModule,
Expand Down
5 changes: 0 additions & 5 deletions src/common/enums/alkemio.error.status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export enum AlkemioErrorStatus {
NOT_SUPPORTED = 'NOT_SUPPORTED',
NOT_ENABLED = 'NOT_ENABLED',
USER_NOT_REGISTERED = 'USER_NOT_REGISTERED',
IPFS_UPLOAD_FAILED = 'IPFS_UPLOAD_FAILED',
IPFS_DELETE_FAILED = 'IPFS_DELETE_FAILED',
IPFS_GARBAGE_COLLECTION_FAILED = 'IPFS_GARBAGE_COLLECTION_FAILED',
LICENSE_NOT_FOUND = 'LICENSE_NOT_FOUND',
MATRIX_ENTITY_NOT_FOUND_ERROR = 'MATRIX_ENTITY_NOT_FOUND_ERROR',
BOOTSTRAP_FAILED = 'BOOTSTRAP_FAILED',
Expand All @@ -41,7 +38,6 @@ export enum AlkemioErrorStatus {
STORAGE_BUCKET_NOT_FOUND = 'STORAGE_BUCKET_NOT_FOUND',
TAGSET_NOT_FOUND = 'TAGSET_NOT_FOUND',
MIME_TYPE_NOT_FOUND = 'MIME_TYPE_NOT_FOUND',
IPFS_FILE_NOT_FOUND = 'IPFS_FILE_NOT_FOUND',
SUBSCRIPTION_USER_NOT_AUTHENTICATED = 'SUBSCRIPTION_USER_NOT_AUTHENTICATED',
PAGINATION_INPUT_OUT_OF_BOUND = 'PAGINATION_INPUT_OUT_OF_BOUND',
PAGINATION_NOT_FOUND = 'PAGINATION_NOT_FOUND',
Expand All @@ -62,7 +58,6 @@ export enum AlkemioErrorStatus {
FORUM_DISCUSSION_CATEGORY = 'FORUM_DISCUSSION_CATEGORY',
OPERATION_NOT_ALLOWED = 'OPERATION_NOT_ALLOWED',
NOT_FOUND = 'NOT_FOUND',
IPFS_NOT_FOUND = 'IPFS_NOT_FOUND',
EXCALIDRAW_AMQP_RESULT_ERROR = 'EXCALIDRAW_AMQP_RESULT_ERROR',
EXCALIDRAW_REDIS_ADAPTER_INIT = 'EXCALIDRAW_REDIS_INIT',
EXCALIDRAW_SERVER_INIT = 'EXCALIDRAW_SERVER_INIT',
Expand Down
3 changes: 3 additions & 0 deletions src/common/enums/authorization.policy.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum AuthorizationPolicyType {
COMMUNICATION = 'communication',
ROOM = 'room',
AI_PERSONA = 'ai-persona',
AI_SERVER = 'ai-server',
APPLICATION = 'application',
ROLE_SET = 'role-set',
COMMUNITY = 'community',
Expand Down Expand Up @@ -50,8 +51,10 @@ export enum AuthorizationPolicyType {
CALENDAR = 'calendar',
CALENDAR_EVENT = 'calendar-event',
TIMELINE = 'timeline',
LIBRARY = 'library',
IN_MEMORY = 'in-memory',
LICENSING = 'licensing',
LICENSE_POLICY = 'license-policy',
UNKNOWN = 'unknown',
AI_PERSONA_SERVICE = 'ai-persona-service',
}
Expand Down
3 changes: 0 additions & 3 deletions src/common/enums/authorization.privilege.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ export enum AuthorizationPrivilege {
CREATE_INNOVATION_HUB = 'create-innovation-hub',
FILE_UPLOAD = 'file-upload',
FILE_DELETE = 'file-delete',
UPDATE_WHITEBOARD = 'update-whiteboard',
UPDATE_INNOVATION_FLOW = 'update-innovation-flow',
COMMUNITY_JOIN = 'community-join',
COMMUNITY_APPLY = 'community-apply',
COMMUNITY_APPLY_ACCEPT = 'community-apply-accept',
COMMUNITY_INVITE = 'community-invite',
COMMUNITY_INVITE_ACCEPT = 'community-invite-accept',
COMMUNITY_ADD_MEMBER = 'community-add-member', // only for global admins
Expand All @@ -43,7 +41,6 @@ export enum AuthorizationPrivilege {
MOVE_CONTRIBUTION = 'move-contribution',
ACCESS_INTERACTIVE_GUIDANCE = 'access-interactive-guidance',
ACCESS_VIRTUAL_CONTRIBUTOR = 'access-virtual-contributor',
ACCESS_DASHBOARD_REFRESH = 'access-dashboard-refresh',
UPDATE_CONTENT = 'update-content',
SAVE_AS_TEMPLATE = 'save-as-template',
TRANSFER_RESOURCE = 'transfer-resource',
Expand Down
1 change: 0 additions & 1 deletion src/common/enums/logging.context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export enum LogContext {
SEARCH_EXTRACT = 'search-extract',
SEARCH_RESULT = 'search-result',
OPPORTUNITY = 'opportunity',
IPFS = 'ipfs',
LIFECYCLE = 'lifecycle',
UNSPECIFIED = 'not_specified',
NOTIFICATIONS = 'notifications',
Expand Down
1 change: 0 additions & 1 deletion src/common/exceptions/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export * from './base.http.exception';

export * from './forbidden.http.exception';
export * from './not.found.http.exception';
export * from './ipfs.not.found.http.exception';
14 changes: 0 additions & 14 deletions src/common/exceptions/http/ipfs.not.found.http.exception.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/common/exceptions/ipfs.file.not.found.exception.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/common/exceptions/ipfs/ipfs.delete.exception.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/common/exceptions/ipfs/ipfs.gc.exception.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/common/exceptions/ipfs/ipfs.upload.exception.ts

This file was deleted.

39 changes: 39 additions & 0 deletions src/common/utils/convert-to-entity/convert.to.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { PrefixKeys } from '@src/types';

/**
* Expects a raw entity as input and converts it to a full typeorm entity.
* The raw input is returned as a result from building typerom queries
* and returned the result as raw data.
* The entity usually is prefixed with the alias of the joined table.
*
* Example:
* await this.calendarRepository
* .createQueryBuilder('calendar')
* .where({ id: calendarId })
* .leftJoinAndSelect(
* 'space',
* 'space',
* 'space.collaborationId = collaboration.id'
* )
* .getRawOne<PrefixKeys<Space, 'space_'>>();
*
* const space = convertToEntity(rawSpace, 'space_');
*
* @param prefixedEntity
* @param prefix
*/
export const convertToEntity = <
T extends Record<string, any>,
P extends string,
>(
prefixedEntity: PrefixKeys<T, P>,
prefix: P
): T => {
return Object.keys(prefixedEntity).reduce((acc, key) => {
const newKey = key.replace(prefix, '') as keyof T;
acc[newKey] = prefixedEntity[
key as keyof PrefixKeys<T, P>
] as unknown as T[keyof T];
return acc;
}, {} as T);
};
1 change: 1 addition & 0 deletions src/common/utils/convert-to-entity/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './convert.to.entity';
46 changes: 46 additions & 0 deletions src/common/utils/get-differences/get.diff.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { getDiff } from './get.diff';

describe('getDiff', () => {
it('returns null when objects are identical', () => {
const obj1 = { a: 1, b: 2 };
const obj2 = { a: 1, b: 2 };
const result = getDiff(obj1, obj2);
expect(result).toBeNull();
});

it('returns differences when objects have different values', () => {
const obj1 = { a: 1, b: 2 };
const obj2 = { a: 1, b: 3 };
const result = getDiff(obj1, obj2);
expect(result).toEqual({ b: 3 });
});

it('returns differences when objects have some different nested values', () => {
const obj1 = { a: 1, b: { c: 2, d: 3 } };
const obj2 = { a: 1, b: { c: 2, d: 4 } };
const result = getDiff(obj1, obj2);
expect(result).toEqual({ b: { d: 4 } });
});

it('returns differences when objects have all different nested values', () => {
const obj1 = { a: 1, b: { c: 2, d: 3 } };
const obj2 = { a: 1, b: { c: 4, d: 5 } };
const result = getDiff(obj1, obj2);
expect(result).toEqual({ b: { c: 4, d: 5 } });
});

it('returns null when nested objects are identical', () => {
const obj1 = { a: 1, b: { c: 2, d: 3 } };
const obj2 = { a: 1, b: { c: 2, d: 3 } };
const result = getDiff(obj1, obj2);
expect(result).toBeNull();
});

it('returns null when objects have different keys', () => {
type Type = { a: number; b?: number; c?: number };
const obj1: Type = { a: 1, b: 2 };
const obj2: Type = { a: 1, c: 3 };
const result = getDiff(obj1, obj2);
expect(result).toBeNull();
});
});
39 changes: 39 additions & 0 deletions src/common/utils/get-differences/get.diff.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Compares the first object to the second and returns the differences.
* Comparison is done against the keys in obj1.
* Return __null__ if no differences are found.
*
* @template T - The type of the objects being compared.
* @param {T} obj1 - The first object to compare.
* @param {T} obj2 - The second object to compare.
* @returns {Partial<T> | null} - A partial object containing the differences, or null if no differences are found.
*/
export const getDiff = <T extends Record<string, any>>(
obj1: T,
obj2: T
): Partial<T> | null => {
const result: Partial<T> = {};

for (const key in obj1) {
if (obj1.hasOwnProperty(key) && obj2.hasOwnProperty(key)) {
const value1 = obj1[key];
const value2 = obj2[key];

if (
typeof value1 === 'object' &&
typeof value2 === 'object' &&
value1 !== null &&
value2 !== null
) {
const nestedDiff = getDiff(value1, value2);
if (nestedDiff !== null) {
result[key] = nestedDiff as T[Extract<keyof T, string>];
}
} else if (value1 !== value2) {
result[key] = value2;
}
}
}

return Object.keys(result).length ? result : null;
};
1 change: 1 addition & 0 deletions src/common/utils/get-differences/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './get.diff';
Loading

0 comments on commit 02752f7

Please sign in to comment.