mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
refactor: set up @libsem/types dep
Former-commit-id: afffa7e5a928db57bf3d87c8afd6a8f8b70d5dfd [formerly 5ea76cb8f1]
Former-commit-id: fedd6b143c2883ea0c121f53418e2d9814811b2f
This commit is contained in:
5080
packages/identity/package-lock.json
generated
5080
packages/identity/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"description": "work with zk identites",
|
||||
"main": "dist/identity/index.mjs",
|
||||
"types": "dist/types/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.node.js"
|
||||
@@ -18,20 +19,17 @@
|
||||
"email": "akinovak@gmail.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/appliedzkp/libsemaphore/identity",
|
||||
"homepage": "https://github.com/appliedzkp/libsemaphore",
|
||||
"dependencies": {
|
||||
"bigint-conversion": "^2.1.12",
|
||||
"circomlibjs": "^0.0.8",
|
||||
"@libsem/types": "../types",
|
||||
"crypto": "^1.0.1",
|
||||
"js-sha256": "^0.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.10.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.58.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.30.0",
|
||||
"ts-node": "^10.3.0",
|
||||
"typescript": "^4.4.4"
|
||||
"rollup": "^2.56.2",
|
||||
"rollup-plugin-typescript2": "^0.30.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
import * as fs from 'fs';
|
||||
import typescript from "rollup-plugin-typescript2";
|
||||
import * as fs from "fs";
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"));
|
||||
|
||||
const banner = `/**
|
||||
@@ -9,14 +9,14 @@ const banner = `/**
|
||||
* @copyright ${pkg.author.name} ${new Date().getFullYear()}
|
||||
* @license ${pkg.license}
|
||||
* @see [Github]{@link ${pkg.homepage}}
|
||||
*/`
|
||||
*/`;
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
output: [
|
||||
{ file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
|
||||
{ file: pkg.exports.import, format: "es", banner }
|
||||
],
|
||||
external: Object.keys(pkg.dependencies),
|
||||
plugins: [typescript({ useTsconfigDeclarationDir: true })]
|
||||
}
|
||||
input: "src/index.ts",
|
||||
output: [
|
||||
{ file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
|
||||
{ file: pkg.exports.import, format: "es", banner },
|
||||
],
|
||||
external: Object.keys(pkg.dependencies),
|
||||
plugins: [typescript({ useTsconfigDeclarationDir: true })],
|
||||
};
|
||||
|
||||
@@ -1,54 +1,49 @@
|
||||
import { genRandomIdentity, genIdentityFromSignedMessage, genRandomNumber } from './strategies';
|
||||
import * as bigintConversion from 'bigint-conversion';
|
||||
import * as ciromlibjs from 'circomlibjs';
|
||||
import { Identity } from '../../types';
|
||||
|
||||
import { genRandomIdentity, genIdentityFromSignedMessage, genRandomNumber } from "./strategies";
|
||||
import * as bigintConversion from "bigint-conversion";
|
||||
import * as ciromlibjs from "circomlibjs";
|
||||
import { Identity } from "@libsem/types";
|
||||
|
||||
const poseidonHash = (data: Array<bigint>): bigint => {
|
||||
return ciromlibjs.poseidon(data);
|
||||
}
|
||||
return ciromlibjs.poseidon(data);
|
||||
};
|
||||
|
||||
class ZkIdentity {
|
||||
genIdentity(strategy = 'random', metadata: any = {}): Identity {
|
||||
if(strategy === 'random') return genRandomIdentity();
|
||||
else if (strategy === 'signedMessage') return genIdentityFromSignedMessage(metadata)
|
||||
genIdentity(strategy = "random", metadata: any = {}): Identity {
|
||||
if (strategy === "random") return genRandomIdentity();
|
||||
else if (strategy === "signedMessage") return genIdentityFromSignedMessage(metadata);
|
||||
|
||||
throw new Error('provided strategy is not supported');
|
||||
}
|
||||
throw new Error("provided strategy is not supported");
|
||||
}
|
||||
|
||||
genSecretFromIdentity(identity: Identity): bigint[] {
|
||||
return [identity.identityNullifier, identity.identityTrapdoor];
|
||||
}
|
||||
genSecretFromIdentity(identity: Identity): bigint[] {
|
||||
return [identity.identityNullifier, identity.identityTrapdoor];
|
||||
}
|
||||
|
||||
genRandomSecret(parts = 2): bigint[] {
|
||||
const secret: bigint[] = [];
|
||||
for(let i = 0; i< parts; i++) {
|
||||
secret.push(genRandomNumber());
|
||||
}
|
||||
return secret
|
||||
genRandomSecret(parts = 2): bigint[] {
|
||||
const secret: bigint[] = [];
|
||||
for (let i = 0; i < parts; i++) {
|
||||
secret.push(genRandomNumber());
|
||||
}
|
||||
return secret;
|
||||
}
|
||||
|
||||
genIdentityCommitment(secret: bigint[]): bigint {
|
||||
const secretHash = poseidonHash(secret);
|
||||
return poseidonHash([secretHash]);
|
||||
}
|
||||
genIdentityCommitment(secret: bigint[]): bigint {
|
||||
const secretHash = poseidonHash(secret);
|
||||
return poseidonHash([secretHash]);
|
||||
}
|
||||
|
||||
serializeIdentity(identity: Identity): string {
|
||||
const data = [identity.identityNullifier.toString(16), identity.identityTrapdoor.toString(16)];
|
||||
return JSON.stringify(data);
|
||||
}
|
||||
|
||||
serializeIdentity(identity: Identity): string {
|
||||
const data = [
|
||||
identity.identityNullifier.toString(16),
|
||||
identity.identityTrapdoor.toString(16),
|
||||
]
|
||||
return JSON.stringify(data)
|
||||
}
|
||||
|
||||
unSerializeIdentity(serialisedIdentity: string): Identity {
|
||||
const data = JSON.parse(serialisedIdentity)
|
||||
return {
|
||||
identityNullifier: bigintConversion.hexToBigint(data[0]),
|
||||
identityTrapdoor: bigintConversion.hexToBigint(data[1]),
|
||||
}
|
||||
}
|
||||
unSerializeIdentity(serialisedIdentity: string): Identity {
|
||||
const data = JSON.parse(serialisedIdentity);
|
||||
return {
|
||||
identityNullifier: bigintConversion.hexToBigint(data[0]),
|
||||
identityTrapdoor: bigintConversion.hexToBigint(data[1]),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default new ZkIdentity();
|
||||
export default new ZkIdentity();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"declarationDir": "./dist/types"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules/**", "tests/**"]
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationDir": "./dist/types"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
11630
packages/protocols/package-lock.json
generated
Normal file
11630
packages/protocols/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
46fb2207c2069382fda548794873c78dc0f49c8d
|
||||
@@ -23,15 +23,13 @@
|
||||
"circomlibjs": "^0.0.8",
|
||||
"ethers": "^5.4.7",
|
||||
"incrementalquintree": "^1.0.7",
|
||||
"@libsem/types": "../types",
|
||||
"snarkjs": "^0.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.10.8",
|
||||
"rollup": "^2.58.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.30.0",
|
||||
"ts-jest": "^27.0.6",
|
||||
"ts-node": "^10.3.0",
|
||||
"typescript": "^4.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
import { ZkProtocol } from "./zk-protocol";
|
||||
import { genSignalHash, poseidonHash } from "./utils";
|
||||
import { Fq } from "./utils";
|
||||
import { Identity } from '../../types';
|
||||
import { Identity } from "@libsem/types";
|
||||
|
||||
class NRln extends ZkProtocol {
|
||||
genWitness(identity: Identity, merkleProof: any, epoch: string | bigint, signal: string, shouldHash = true): any {
|
||||
return {
|
||||
identity_secret: [identity.identityTrapdoor, identity.identityNullifier],
|
||||
path_elements: merkleProof.pathElements,
|
||||
identity_path_index: merkleProof.indices,
|
||||
x: shouldHash ? genSignalHash(signal): signal,
|
||||
epoch,
|
||||
genWitness(identity: Identity, merkleProof: any, epoch: string | bigint, signal: string, shouldHash = true): any {
|
||||
return {
|
||||
identity_secret: [identity.identityTrapdoor, identity.identityNullifier],
|
||||
path_elements: merkleProof.pathElements,
|
||||
identity_path_index: merkleProof.indices,
|
||||
x: shouldHash ? genSignalHash(signal) : signal,
|
||||
epoch,
|
||||
};
|
||||
}
|
||||
|
||||
//TODO add rln identifier
|
||||
calculateOutput(identitySecret: Array<bigint>, epoch: bigint, x: bigint, limit: number): Array<bigint> {
|
||||
const a0 = poseidonHash(identitySecret);
|
||||
|
||||
const coeffs: Array<bigint> = [];
|
||||
let tmpX = x;
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[0], epoch]));
|
||||
let y: bigint = Fq.add(Fq.mul(coeffs[0], tmpX), a0);
|
||||
|
||||
for (let i = 1; i < limit; i++) {
|
||||
tmpX = Fq.mul(x, tmpX);
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[i], epoch]));
|
||||
y = Fq.add(y, Fq.mul(coeffs[i], tmpX));
|
||||
}
|
||||
|
||||
const nullifier: bigint = this.genNullifier(coeffs);
|
||||
return [y, nullifier];
|
||||
}
|
||||
|
||||
genNullifier(coeffs: Array<bigint>): bigint {
|
||||
return poseidonHash(coeffs);
|
||||
}
|
||||
|
||||
retrieveSecret(xs: Array<bigint>, ys: Array<bigint>): bigint {
|
||||
if (xs.length !== ys.length) throw new Error("x and y arrays must be of same size");
|
||||
const numOfPoints: number = xs.length;
|
||||
let f0 = BigInt(0);
|
||||
for (let i = 0; i < numOfPoints; i++) {
|
||||
let p = BigInt(1);
|
||||
for (let j = 0; j < numOfPoints; j++) {
|
||||
if (j !== i) {
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])));
|
||||
}
|
||||
}
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p));
|
||||
}
|
||||
|
||||
//TODO add rln identifier
|
||||
calculateOutput(identitySecret: Array<bigint>, epoch: bigint, x:bigint, limit: number): Array<bigint> {
|
||||
const a0 = poseidonHash(identitySecret);
|
||||
|
||||
const coeffs: Array<bigint> = [];
|
||||
let tmpX = x;
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[0], epoch]));
|
||||
let y:bigint = Fq.add(Fq.mul(coeffs[0], tmpX), a0);
|
||||
|
||||
for(let i = 1; i < limit; i++) {
|
||||
tmpX = Fq.mul(x, tmpX);
|
||||
|
||||
coeffs.push(poseidonHash([identitySecret[i], epoch]));
|
||||
y = Fq.add(y, Fq.mul(coeffs[i], tmpX));
|
||||
}
|
||||
|
||||
const nullifier: bigint = this.genNullifier(coeffs);
|
||||
return [y, nullifier];
|
||||
}
|
||||
|
||||
genNullifier(coeffs: Array<bigint>): bigint {
|
||||
return poseidonHash(coeffs);
|
||||
}
|
||||
|
||||
retrieveSecret(xs: Array<bigint>, ys: Array<bigint>): bigint {
|
||||
if(xs.length !== ys.length) throw new Error('x and y arrays must be of same size');
|
||||
const numOfPoints: number = xs.length;
|
||||
let f0 = BigInt(0);
|
||||
for(let i = 0; i < numOfPoints; i++) {
|
||||
let p = BigInt(1);
|
||||
for(let j = 0; j < numOfPoints; j++) {
|
||||
if(j !== i) {
|
||||
p = Fq.mul(p, Fq.div(xs[j], Fq.sub(xs[j], xs[i])))
|
||||
}
|
||||
}
|
||||
f0 = Fq.add(f0, Fq.mul(ys[i], p));
|
||||
}
|
||||
return f0;
|
||||
}
|
||||
|
||||
return f0;
|
||||
}
|
||||
}
|
||||
|
||||
export default new NRln();
|
||||
export default new NRln();
|
||||
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
import { ZkProtocol } from "./zk-protocol";
|
||||
import { genSignalHash, poseidonHash } from "./utils";
|
||||
import { Identity, MerkleProof } from '../../types';
|
||||
import { Identity, MerkleProof } from "@libsem/types";
|
||||
|
||||
class Semaphore extends ZkProtocol {
|
||||
genWitness(identity: Identity, merkleProof: MerkleProof, externalNullifier: string | bigint, signal: string, shouldHash = true): any {
|
||||
return {
|
||||
identity_nullifier: identity.identityNullifier,
|
||||
identity_trapdoor: identity.identityTrapdoor,
|
||||
identity_path_index: merkleProof.indices,
|
||||
path_elements: merkleProof.pathElements,
|
||||
external_nullifier: externalNullifier,
|
||||
signal_hash: shouldHash ? genSignalHash(signal): signal,
|
||||
}
|
||||
}
|
||||
|
||||
genNullifierHash(externalNullifier: string | bigint, identityNullifier: string | bigint, nLevels: number): bigint {
|
||||
return poseidonHash([BigInt(externalNullifier), BigInt(identityNullifier), BigInt(nLevels)]);
|
||||
}
|
||||
genWitness(
|
||||
identity: Identity,
|
||||
merkleProof: MerkleProof,
|
||||
externalNullifier: string | bigint,
|
||||
signal: string,
|
||||
shouldHash = true
|
||||
): any {
|
||||
return {
|
||||
identity_nullifier: identity.identityNullifier,
|
||||
identity_trapdoor: identity.identityTrapdoor,
|
||||
identity_path_index: merkleProof.indices,
|
||||
path_elements: merkleProof.pathElements,
|
||||
external_nullifier: externalNullifier,
|
||||
signal_hash: shouldHash ? genSignalHash(signal) : signal,
|
||||
};
|
||||
}
|
||||
|
||||
genNullifierHash(externalNullifier: string | bigint, identityNullifier: string | bigint, nLevels: number): bigint {
|
||||
return poseidonHash([BigInt(externalNullifier), BigInt(identityNullifier), BigInt(nLevels)]);
|
||||
}
|
||||
}
|
||||
|
||||
export default new Semaphore();
|
||||
export default new Semaphore();
|
||||
|
||||
|
||||
@@ -1,57 +1,60 @@
|
||||
/* eslint @typescript-eslint/no-var-requires: "off" */
|
||||
const Tree = require('incrementalquintree/build/IncrementalQuinTree');
|
||||
import * as ciromlibjs from 'circomlibjs';
|
||||
import * as ethers from 'ethers';
|
||||
import { MerkleProof } from '../../types';
|
||||
const Tree = require("incrementalquintree/build/IncrementalQuinTree");
|
||||
import * as ciromlibjs from "circomlibjs";
|
||||
import * as ethers from "ethers";
|
||||
import { MerkleProof } from "@libsem/types";
|
||||
|
||||
export const SNARK_FIELD_SIZE = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
||||
|
||||
const ZqField = require('ffjavascript').ZqField;
|
||||
const ZqField = require("ffjavascript").ZqField;
|
||||
export const Fq = new ZqField(SNARK_FIELD_SIZE);
|
||||
|
||||
type IncrementalQuinTree = any;
|
||||
|
||||
|
||||
export const poseidonHash = (data: Array<bigint>): bigint => {
|
||||
return ciromlibjs.poseidon(data);
|
||||
}
|
||||
return ciromlibjs.poseidon(data);
|
||||
};
|
||||
|
||||
export const genSignalHash = (signal: string): bigint => {
|
||||
const converted = ethers.utils.hexlify(ethers.utils.toUtf8Bytes(signal));
|
||||
return BigInt(ethers.utils.solidityKeccak256(['bytes'], [converted])) >> BigInt(8);
|
||||
}
|
||||
const converted = ethers.utils.hexlify(ethers.utils.toUtf8Bytes(signal));
|
||||
return BigInt(ethers.utils.solidityKeccak256(["bytes"], [converted])) >> BigInt(8);
|
||||
};
|
||||
|
||||
export const genExternalNullifier = (plaintext: string): string => {
|
||||
const _cutOrExpandHexToBytes = (hexStr: string, bytes: number): string => {
|
||||
const len = bytes * 2
|
||||
|
||||
const h = hexStr.slice(2, len + 2)
|
||||
return '0x' + h.padStart(len, '0')
|
||||
}
|
||||
const _cutOrExpandHexToBytes = (hexStr: string, bytes: number): string => {
|
||||
const len = bytes * 2;
|
||||
|
||||
const hashed = ethers.utils.solidityKeccak256(['string'], [plaintext])
|
||||
return _cutOrExpandHexToBytes(
|
||||
'0x' + hashed.slice(8),
|
||||
32,
|
||||
)
|
||||
}
|
||||
const h = hexStr.slice(2, len + 2);
|
||||
return "0x" + h.padStart(len, "0");
|
||||
};
|
||||
|
||||
const hashed = ethers.utils.solidityKeccak256(["string"], [plaintext]);
|
||||
return _cutOrExpandHexToBytes("0x" + hashed.slice(8), 32);
|
||||
};
|
||||
|
||||
export const createTree = (depth: number, zeroValue: number | BigInt, leavesPerNode: number): IncrementalQuinTree => {
|
||||
return new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
}
|
||||
return new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
};
|
||||
|
||||
export const generateMerkleProof = (depth: number, zeroValue: number | BigInt, leavesPerNode: number, leaves: Array<bigint | string>, leaf: bigint | string): MerkleProof => {
|
||||
const tree: IncrementalQuinTree = new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
const leafIndex = leaves.indexOf(leaf);
|
||||
if(leafIndex === -1) throw new Error('Leaf does not exists');
|
||||
|
||||
for(const leaf of leaves) {
|
||||
tree.insert(leaf);
|
||||
}
|
||||
export const generateMerkleProof = (
|
||||
depth: number,
|
||||
zeroValue: number | BigInt,
|
||||
leavesPerNode: number,
|
||||
leaves: Array<bigint | string>,
|
||||
leaf: bigint | string
|
||||
): MerkleProof => {
|
||||
const tree: IncrementalQuinTree = new Tree.IncrementalQuinTree(depth, zeroValue, leavesPerNode, poseidonHash);
|
||||
const leafIndex = leaves.indexOf(leaf);
|
||||
if (leafIndex === -1) throw new Error("Leaf does not exists");
|
||||
|
||||
for (const leaf of leaves) {
|
||||
tree.insert(leaf);
|
||||
}
|
||||
|
||||
const merkleProof = tree.genMerklePath(leafIndex);
|
||||
return {
|
||||
root: tree.root,
|
||||
...merkleProof,
|
||||
};
|
||||
};
|
||||
|
||||
const merkleProof = tree.genMerklePath(leafIndex);
|
||||
return {
|
||||
root: tree.root,
|
||||
...merkleProof
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,30 @@
|
||||
/* eslint @typescript-eslint/no-var-requires: "off" */
|
||||
const { groth16 } = require('snarkjs');
|
||||
const { groth16 } = require("snarkjs");
|
||||
import { SNARK_FIELD_SIZE } from "./utils";
|
||||
import { IProof } from "../../types";
|
||||
|
||||
import { IProof } from "@libsem/types";
|
||||
|
||||
export class ZkProtocol {
|
||||
genProof(grothInput: any, wasmFilePath: string, finalZkeyPath: string): Promise<IProof> {
|
||||
return groth16.fullProve(grothInput, wasmFilePath, finalZkeyPath);
|
||||
}
|
||||
|
||||
genProof(grothInput: any, wasmFilePath: string, finalZkeyPath: string): Promise<IProof> {
|
||||
return groth16.fullProve(grothInput, wasmFilePath, finalZkeyPath);
|
||||
}
|
||||
verifyProof(vKey: string, fullProof: IProof): Promise<boolean> {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
return groth16.verify(vKey, publicSignals, proof);
|
||||
}
|
||||
|
||||
verifyProof(vKey: string, fullProof: IProof): Promise<boolean> {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
return groth16.verify(vKey, publicSignals, proof)
|
||||
}
|
||||
packToSolidityProof(fullProof: IProof) {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
|
||||
return {
|
||||
a: proof.pi_a.slice(0, 2),
|
||||
b: proof.pi_b.map((x: any) => x.reverse()).slice(0, 2),
|
||||
c: proof.pi_c.slice(0, 2),
|
||||
inputs: publicSignals.map((x: any) => {
|
||||
x = BigInt(x);
|
||||
return (x % SNARK_FIELD_SIZE).toString();
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
packToSolidityProof(fullProof: IProof) {
|
||||
const { proof, publicSignals } = fullProof;
|
||||
|
||||
return {
|
||||
a: proof.pi_a.slice(0, 2),
|
||||
b: proof.pi_b
|
||||
.map((x:any) => x.reverse())
|
||||
.slice(0, 2),
|
||||
c: proof.pi_c.slice(0, 2),
|
||||
inputs: publicSignals.map((x:any) => {
|
||||
x = BigInt(x);
|
||||
return (x % SNARK_FIELD_SIZE).toString()
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"outDir": "./dist/",
|
||||
"declarationDir": "./dist/types"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules/**", "tests/**"]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
308
packages/types/package-lock.json
generated
308
packages/types/package-lock.json
generated
@@ -1,298 +1,8 @@
|
||||
{
|
||||
"name": "types",
|
||||
"name": "@libsem/types",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "types",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.9.tgz",
|
||||
"integrity": "sha512-H9ReOt+yqIJPCutkTYjFjlyK6WEMQYT9hLZMlWtOjFQY2ItppsWZ6RJf8Aw+jz5qTYceuHvFgPIaKOHtLAEWBw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.0.tgz",
|
||||
"integrity": "sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-node": "dist/bin.js",
|
||||
"ts-node-cwd": "dist/bin-cwd.js",
|
||||
"ts-node-script": "dist/bin-script.js",
|
||||
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||
"ts-script": "dist/bin-script-deprecated.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/core": ">=1.2.50",
|
||||
"@swc/wasm": ">=1.2.50",
|
||||
"@types/node": "*",
|
||||
"typescript": ">=2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@swc/wasm": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
@@ -333,13 +43,6 @@
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.9.tgz",
|
||||
"integrity": "sha512-H9ReOt+yqIJPCutkTYjFjlyK6WEMQYT9hLZMlWtOjFQY2ItppsWZ6RJf8Aw+jz5qTYceuHvFgPIaKOHtLAEWBw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
@@ -487,13 +190,6 @@
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["./index.ts"],
|
||||
}
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["./index.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user