Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/check-lint.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

const [logsData, detailsData] = await Promise.all([
EVaultService.getEVaultLogs(namespace, podName),
EVaultService.getEVaultDetails(namespace, podName)
EVaultService.getEVaultMetrics(namespace, podName)
]);

logs = logsData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { KeyManager } from "./types";
import { KeyManagerError, KeyManagerErrorCodes } from "./types";
import {
exists as hwExists,
generate as hwGenerate,
getPublicKey as hwGetPublicKey,
signPayload as hwSignPayload,
verifySignature as hwVerifySignature,
} from "@auvo/tauri-plugin-crypto-hw-api";
import type { KeyManager } from "./types";
import { KeyManagerError, KeyManagerErrorCodes } from "./types";

/**
* Hardware key manager implementation using Tauri crypto hardware API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { KeyManager, KeyManagerConfig } from "./types";
import { HardwareKeyManager } from "./HardwareKeyManager";
import { SoftwareKeyManager } from "./SoftwareKeyManager";
import type { KeyManager, KeyManagerConfig } from "./types";
import { KeyManagerError, KeyManagerErrorCodes } from "./types";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { PUBLIC_REGISTRY_URL } from "$env/static/public";
import type { Store } from "@tauri-apps/plugin-store";
import axios from "axios";
import { GraphQLClient } from "graphql-request";
import type { UserController } from "./user";
import NotificationService from "../../services/NotificationService";
import type { UserController } from "./user";

const STORE_META_ENVELOPE = `
mutation StoreMetaEnvelope($input: MetaEnvelopeInput!) {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/eid-wallet/src/lib/global/state.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Store } from "@tauri-apps/plugin-store";
import NotificationService from "../services/NotificationService";
import { VaultController } from "./controllers/evault";
import { SecurityController } from "./controllers/security";
import { UserController } from "./controllers/user";
import NotificationService from "../services/NotificationService";
/**
* @author SoSweetHam <soham@auvo.io>
* @description A centralized state that can be used to control the global state of the application, meant to be used as a singleton through the main layout component.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PUBLIC_PROVISIONER_URL } from "$env/static/public";
import { invoke } from "@tauri-apps/api/core";
import {
requestPermission,
isPermissionGranted,
requestPermission,
sendNotification,
} from "@tauri-apps/plugin-notification";
import { invoke } from "@tauri-apps/api/core";
import { PUBLIC_PROVISIONER_URL } from "$env/static/public";

export interface DeviceRegistration {
eName: string;
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/eid-wallet/src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { page } from "$app/state";
import { goto } from "$app/navigation";
import type { Snippet } from "svelte";
import type { LayoutData } from "./$types";
import { page } from "$app/state";
import type { GlobalState } from "$lib/global";
import type { Snippet } from "svelte";
import { getContext, onMount } from "svelte";
import type { LayoutData } from "./$types";

let { data, children }: { data: LayoutData; children: Snippet } = $props();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ $effect(() => {
<div class="w-full py-10 text-center">
<button
class="text-gray-500 hover:text-gray-700 transition-colors cursor-pointer select-none"
on:click={handleVersionTap}
onclick={handleVersionTap}
disabled={isRetrying}
>
Version v0.3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
PUBLIC_PROVISIONER_URL,
PUBLIC_REGISTRY_URL,
} from "$env/static/public";
import { type KeyManager, KeyManagerFactory } from "$lib/crypto";
import { Hero } from "$lib/fragments";
import { GlobalState } from "$lib/global";
import { ButtonAction, Drawer } from "$lib/ui";
import { capitalize } from "$lib/utils";
import { KeyManagerFactory, type KeyManager } from "$lib/crypto";
import * as falso from "@ngneat/falso";
import axios from "axios";
import { getContext, onMount } from "svelte";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import {
PUBLIC_PROVISIONER_URL,
PUBLIC_REGISTRY_URL,
} from "$env/static/public";
import { type KeyManager, KeyManagerFactory } from "$lib/crypto";
import { Hero } from "$lib/fragments";
import { GlobalState } from "$lib/global";
import { ButtonAction } from "$lib/ui";
import Drawer from "$lib/ui/Drawer/Drawer.svelte";
import { capitalize } from "$lib/utils";
import { KeyManagerFactory, type KeyManager } from "$lib/crypto";
import axios from "axios";
import { getContext, onMount } from "svelte";
import { Shadow } from "svelte-loading-spinners";
Expand All @@ -18,8 +18,8 @@ import DocumentType from "./steps/document-type.svelte";
import Passport from "./steps/passport.svelte";
import Selfie from "./steps/selfie.svelte";
import {
DocFront,
DocBack,
DocFront,
Selfie as SelfiePic,
reason,
status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import axios from "axios";
import { onMount } from "svelte";
import { writable } from "svelte/store";
import {
DocFront,
DocBack,
DocFront,
documentType,
permissionGranted,
verifStep,
verificaitonId,
documentType,
} from "../store";

let error: string | undefined;
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/eid-wallet/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import SplashScreen from "$lib/fragments/SplashScreen/SplashScreen.svelte";
import { onMount, setContext, getContext, onDestroy } from "svelte";
import { getContext, onDestroy, onMount, setContext } from "svelte";
import "../app.css";
import { onNavigate, goto } from "$app/navigation";
import { goto, onNavigate } from "$app/navigation";
import { GlobalState } from "$lib/global/state";

import { runtime } from "$lib/global/runtime.svelte";
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/web3-adapter/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["**/*.js", "**/*.d.ts", "**/*.js.map", "**/*.d.ts.map", "dist/**"]
}
}

116 changes: 58 additions & 58 deletions infrastructure/web3-adapter/src/__tests__/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,72 @@ import { beforeEach, describe, expect, it } from "vitest";
import { Web3Adapter } from "../adapter.js";

describe("Web3Adapter", () => {
let adapter: Web3Adapter;
let adapter: Web3Adapter;

beforeEach(() => {
adapter = new Web3Adapter();
});
beforeEach(() => {
adapter = new Web3Adapter();
});

it("should transform platform data to universal format", () => {
// Register mappings for a platform
adapter.registerMapping("twitter", [
{ sourceField: "tweet", targetField: "content" },
{ sourceField: "likes", targetField: "reactions" },
{ sourceField: "replies", targetField: "comments" },
]);
it("should transform platform data to universal format", () => {
// Register mappings for a platform
adapter.registerMapping("twitter", [
{ sourceField: "tweet", targetField: "content" },
{ sourceField: "likes", targetField: "reactions" },
{ sourceField: "replies", targetField: "comments" },
]);

const twitterData = {
tweet: "Hello world!",
likes: 42,
replies: ["user1", "user2"],
};
const twitterData = {
tweet: "Hello world!",
likes: 42,
replies: ["user1", "user2"],
};

const universalData = adapter.toUniversal("twitter", twitterData);
expect(universalData).toEqual({
content: "Hello world!",
reactions: 42,
comments: ["user1", "user2"],
});
});
const universalData = adapter.toUniversal("twitter", twitterData);
expect(universalData).toEqual({
content: "Hello world!",
reactions: 42,
comments: ["user1", "user2"],
});
});

it("should transform universal data to platform format", () => {
// Register mappings for a platform
adapter.registerMapping("instagram", [
{ sourceField: "caption", targetField: "content" },
{ sourceField: "hearts", targetField: "reactions" },
{ sourceField: "comments", targetField: "comments" },
]);
it("should transform universal data to platform format", () => {
// Register mappings for a platform
adapter.registerMapping("instagram", [
{ sourceField: "caption", targetField: "content" },
{ sourceField: "hearts", targetField: "reactions" },
{ sourceField: "comments", targetField: "comments" },
]);

const universalData = {
content: "Hello world!",
reactions: 42,
comments: ["user1", "user2"],
};
const universalData = {
content: "Hello world!",
reactions: 42,
comments: ["user1", "user2"],
};

const instagramData = adapter.fromUniversal("instagram", universalData);
expect(instagramData).toEqual({
caption: "Hello world!",
hearts: 42,
comments: ["user1", "user2"],
});
});
const instagramData = adapter.fromUniversal("instagram", universalData);
expect(instagramData).toEqual({
caption: "Hello world!",
hearts: 42,
comments: ["user1", "user2"],
});
});

it("should handle field transformations", () => {
adapter.registerMapping("custom", [
{
sourceField: "timestamp",
targetField: "date",
transform: (value: number) => new Date(value).toISOString(),
},
]);
it("should handle field transformations", () => {
adapter.registerMapping("custom", [
{
sourceField: "timestamp",
targetField: "date",
transform: (value: number) => new Date(value).toISOString(),
},
]);

const customData = {
timestamp: 1677721600000,
};
const customData = {
timestamp: 1677721600000,
};

const universalData = adapter.toUniversal("custom", customData);
expect(universalData).toEqual({
date: "2023-03-02T01:46:40.000Z",
});
});
const universalData = adapter.toUniversal("custom", customData);
expect(universalData).toEqual({
date: "2023-03-02T01:46:40.000Z",
});
});
});
Loading