Skip to content

Commit ecaa8f3

Browse files
authored
feat: add storage specification abstract class (#92)
* feat: add storage specification abstract class * chore: format and ignore lint * chore: change format checker on w3id
1 parent e018910 commit ecaa8f3

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

infrastructure/w3id/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"test": "vitest",
77
"dev": "tsc --watch",
8-
"check-format": "prettier --check \"src/**/*.ts\"",
8+
"check-format": "npx @biomejs/biome format ./src",
99
"format": "npx @biomejs/biome format --write ./src",
1010
"lint": "npx @biomejs/biome lint --write ./src",
1111
"check": "npx @biomejs/biome check --write ./src",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* SPECIFICATION
3+
*
4+
* Baseline Storage Specification, used for storing and managing logs
5+
*/
6+
7+
export declare class StorageSpec<T, K> {
8+
/**
9+
* Build a new storage driver
10+
*
11+
* @param {...any[]} props
12+
* @returns Promise<StorageSpec>
13+
*/
14+
15+
// biome-ignore lint: lint/suspicious/noExplicitAny
16+
public static build<T, K>(...props: any[]): Promise<StorageSpec<T, K>>;
17+
18+
/**
19+
* Create a new entry in the storage
20+
*
21+
* @param body
22+
* @returns Promise<K>
23+
*/
24+
25+
public create(body: T): Promise<K>;
26+
27+
/**
28+
* Find one entry in the storage using partial of K
29+
*
30+
* @param {Partial<K>} options
31+
* @returns Promise<K>
32+
*/
33+
34+
public findOne(options: Partial<K>): Promise<K>;
35+
36+
/**
37+
* Find many entities in the storage using partial of K
38+
*
39+
* @param {Partial<K>} options
40+
* @returns Promise<K[]>
41+
*/
42+
43+
public findMany(options: Partial<K>): Promise<K[]>;
44+
}

infrastructure/w3id/src/logs/store.ts

Whitespace-only changes.

infrastructure/w3id/src/utils/uuid.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { v4 as uuidv4, v5 as uuidv5 } from "uuid";
1010
*/
1111

1212
export function generateUuid(
13-
entropy: string,
14-
namespace: string = uuidv4(),
13+
entropy: string,
14+
namespace: string = uuidv4(),
1515
): string {
16-
return uuidv5(entropy, namespace);
16+
return uuidv5(entropy, namespace);
1717
}

0 commit comments

Comments
 (0)