-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
406 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
module.exports = { | ||
presets: [ | ||
"@babel/preset-env", | ||
["@babel/preset-react", { runtime: "automatic" }], | ||
"@babel/preset-typescript", | ||
], | ||
presets: ["@babel/preset-env", "@babel/preset-typescript"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import fetch from "node-fetch" | ||
|
||
if (!globalThis.fetch) { | ||
globalThis.fetch = fetch | ||
} | ||
import { Crypto } from "@peculiar/webcrypto" | ||
import "fake-indexeddb/auto" | ||
global.crypto = new Crypto() | ||
global.TextEncoder = require("text-encoding").TextEncoder | ||
global.TextDecoder = require("text-encoding").TextDecoder | ||
require("whatwg-fetch") | ||
global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
type AnonymousUserData = record { | ||
texts : vec nat64; | ||
created_at : nat64; | ||
decryption_key : opt vec nat8 | ||
}; | ||
type AuthenticatedSignature = record { | ||
signature : vec nat8; | ||
created_at : nat64 | ||
}; | ||
type LogEntry = record { | ||
counter : nat64; | ||
file : text; | ||
line : nat32; | ||
cycle : opt nat; | ||
version : text; | ||
message : text; | ||
timestamp : nat64; | ||
"variant" : LogVariant | ||
}; | ||
type LogVariant = variant { info; warn; error }; | ||
type OneTimeKey = record { | ||
tries : nat8; | ||
time_lock : nat64; | ||
public_key : vec nat8 | ||
}; | ||
type PartitionDetail = record { id : nat8; name : text; size : nat64 }; | ||
type Result = variant { Ok : record { vec nat8; vec nat8 }; Err : text }; | ||
type Task = variant { | ||
CleanUpKeys; | ||
SendText : record { body : text; phone_number : text }; | ||
CleanUpAnonymousUsers; | ||
SendEmail : record { subject : text; body : text; email : text }; | ||
Initialize | ||
}; | ||
type TaskTimerEntry = record { task : Task; time : nat64 }; | ||
type UserData = record { | ||
texts : vec nat64; | ||
signature : opt AuthenticatedSignature; | ||
public_key : vec nat8 | ||
}; | ||
type UserText = record { id : text; "text" : vec nat8 }; | ||
service : () -> { | ||
anonymous_user : (vec nat8) -> (AnonymousUserData) query; | ||
anonymous_user_notes : (vec nat8) -> (vec UserText) query; | ||
anonymous_users : () -> (vec record { vec nat8; AnonymousUserData }) query; | ||
edit_encrypted_text : (nat64, vec nat8, opt vec nat8) -> (); | ||
encrypted_ibe_decryption_key_for_caller : (vec nat8) -> (vec nat8); | ||
encrypted_symmetric_key_for_caller : (vec nat8) -> (vec nat8); | ||
encrypted_texts : () -> (vec UserText) query; | ||
get_one_time_key : (nat64) -> (vec nat8) query; | ||
get_one_time_key_details : (nat64) -> (OneTimeKey) query; | ||
ibe_encryption_key : () -> (vec nat8) query; | ||
partition_details : () -> (vec PartitionDetail) query; | ||
print_log_entries : () -> (vec LogEntry) query; | ||
print_log_entries_page : (nat64, opt nat64) -> (vec text) query; | ||
read_with_one_time_key : (nat64, vec nat8, vec nat8) -> (Result); | ||
request_two_factor_authentication : (vec nat8) -> (text); | ||
save_encrypted_text : (vec nat8, opt vec nat8) -> (nat64); | ||
set_one_time_key : (nat64, vec nat8) -> (); | ||
symmetric_key_verification_key : () -> (vec nat8) query; | ||
timers : () -> (vec TaskTimerEntry) query; | ||
two_factor_verification_key : () -> (text); | ||
user_data : () -> (UserData) query; | ||
user_notes : (opt vec nat8) -> (nat64, vec UserText) query; | ||
version : () -> (text) query | ||
} |
Oops, something went wrong.