From 4ed143b7b2ca30203a8ff81a495c05a31df59fc8 Mon Sep 17 00:00:00 2001 From: Merul Dhiman Date: Tue, 1 Apr 2025 12:31:26 +0530 Subject: [PATCH 1/3] feat: add storage specification abstract class --- .../w3id/src/logs/storage/storage-spec.ts | 43 +++++++++++++++++++ infrastructure/w3id/src/logs/store.ts | 0 2 files changed, 43 insertions(+) create mode 100644 infrastructure/w3id/src/logs/storage/storage-spec.ts create mode 100644 infrastructure/w3id/src/logs/store.ts diff --git a/infrastructure/w3id/src/logs/storage/storage-spec.ts b/infrastructure/w3id/src/logs/storage/storage-spec.ts new file mode 100644 index 00000000..2d526e94 --- /dev/null +++ b/infrastructure/w3id/src/logs/storage/storage-spec.ts @@ -0,0 +1,43 @@ +/** + * SPECIFICATION + * + * Baseline Storage Specification, used for storing and managing logs + */ + +export declare class StorageSpec { + /** + * Build a new storage driver + * + * @param {...any[]} props + * @returns Promise + */ + + public static build(...props: any[]): Promise>; + + /** + * Create a new entry in the storage + * + * @param body + * @returns Promise + */ + + public create(body: T): Promise; + + /** + * Find one entry in the storage using partial of K + * + * @param {Partial} options + * @returns Promise + */ + + public findOne(options: Partial): Promise; + + /** + * Find many entities in the storage using partial of K + * + * @param {Partial} options + * @returns Promise + */ + + public findMany(options: Partial): Promise; +} diff --git a/infrastructure/w3id/src/logs/store.ts b/infrastructure/w3id/src/logs/store.ts new file mode 100644 index 00000000..e69de29b From 691b85c6250c11909768414993a5d57eb13f7e54 Mon Sep 17 00:00:00 2001 From: Merul Dhiman Date: Tue, 1 Apr 2025 12:45:56 +0530 Subject: [PATCH 2/3] chore: format and ignore lint --- .../w3id/src/logs/storage/storage-spec.ts | 71 ++++++++++--------- infrastructure/w3id/src/utils/uuid.ts | 6 +- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/infrastructure/w3id/src/logs/storage/storage-spec.ts b/infrastructure/w3id/src/logs/storage/storage-spec.ts index 2d526e94..ab66f9d7 100644 --- a/infrastructure/w3id/src/logs/storage/storage-spec.ts +++ b/infrastructure/w3id/src/logs/storage/storage-spec.ts @@ -5,39 +5,40 @@ */ export declare class StorageSpec { - /** - * Build a new storage driver - * - * @param {...any[]} props - * @returns Promise - */ - - public static build(...props: any[]): Promise>; - - /** - * Create a new entry in the storage - * - * @param body - * @returns Promise - */ - - public create(body: T): Promise; - - /** - * Find one entry in the storage using partial of K - * - * @param {Partial} options - * @returns Promise - */ - - public findOne(options: Partial): Promise; - - /** - * Find many entities in the storage using partial of K - * - * @param {Partial} options - * @returns Promise - */ - - public findMany(options: Partial): Promise; + /** + * Build a new storage driver + * + * @param {...any[]} props + * @returns Promise + */ + + // biome-ignore lint: lint/suspicious/noExplicitAny + public static build(...props: any[]): Promise>; + + /** + * Create a new entry in the storage + * + * @param body + * @returns Promise + */ + + public create(body: T): Promise; + + /** + * Find one entry in the storage using partial of K + * + * @param {Partial} options + * @returns Promise + */ + + public findOne(options: Partial): Promise; + + /** + * Find many entities in the storage using partial of K + * + * @param {Partial} options + * @returns Promise + */ + + public findMany(options: Partial): Promise; } diff --git a/infrastructure/w3id/src/utils/uuid.ts b/infrastructure/w3id/src/utils/uuid.ts index f3c663f3..1ffc1ae1 100644 --- a/infrastructure/w3id/src/utils/uuid.ts +++ b/infrastructure/w3id/src/utils/uuid.ts @@ -10,8 +10,8 @@ import { v4 as uuidv4, v5 as uuidv5 } from "uuid"; */ export function generateUuid( - entropy: string, - namespace: string = uuidv4(), + entropy: string, + namespace: string = uuidv4(), ): string { - return uuidv5(entropy, namespace); + return uuidv5(entropy, namespace); } From 776666b9c8c038bb54471271c5b8fda604f098a8 Mon Sep 17 00:00:00 2001 From: Merul Dhiman Date: Tue, 1 Apr 2025 12:57:44 +0530 Subject: [PATCH 3/3] chore: change format checker on w3id --- infrastructure/w3id/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/w3id/package.json b/infrastructure/w3id/package.json index 5d1709ee..8c415e51 100644 --- a/infrastructure/w3id/package.json +++ b/infrastructure/w3id/package.json @@ -5,7 +5,7 @@ "scripts": { "test": "vitest", "dev": "tsc --watch", - "check-format": "prettier --check \"src/**/*.ts\"", + "check-format": "npx @biomejs/biome format ./src", "format": "npx @biomejs/biome format --write ./src", "lint": "npx @biomejs/biome lint --write ./src", "check": "npx @biomejs/biome check --write ./src",