Skip to content

Commit

Permalink
fix: clean deps and publish 0.0.17-beta.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gabin54 committed Jul 12, 2023
1 parent 96ce8aa commit f3948d0
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 73 deletions.
61 changes: 60 additions & 1 deletion packages/common/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { toSismoConnectResponseBytes } from "./utils/toSismoResponseBytes";

export const SISMO_CONNECT_VERSION = `sismo-connect-v1.1`;

export type SismoConnectRequest = {
Expand Down Expand Up @@ -71,12 +73,69 @@ export const authTypeLabels: { [authType in AuthType]: string } = {
[AuthType.TELEGRAM]: "Telegram",
};

export type SismoConnectResponse = Pick<SismoConnectRequest, "namespace" | "version"> & {
export type SismoConnectResponseInterface = Pick<SismoConnectRequest, "namespace" | "version"> & {
appId: string;
signedMessage?: string;
proofs: SismoConnectProof[];
};

export class SismoConnectResponse implements SismoConnectResponseInterface {
namespace?: string;
version: string;
appId: string;
signedMessage?: string;
proofs: SismoConnectProof[];
auths: Auth[];
claims: Auth[];

constructor(params: SismoConnectResponseInterface) {
Object.assign(this, params);
this.auths = params.proofs.reduce((auths: Auth[], proof) => {
if (proof.auths) {
return [...auths, ...proof.auths];
} else {
return auths;
}
}, []);
this.claims = params.proofs.reduce((auths: Auth[], proof) => {
if (proof.auths) {
return [...auths, ...proof.auths];
} else {
return auths;
}
}, []);
}

public toJson(): SismoConnectResponseInterface {
return {
namespace: this.namespace,
version: this.version,
appId: this.appId,
signedMessage: this.signedMessage,
proofs: this.proofs,
};
}

public toBytes(): string {
return toSismoConnectResponseBytes(this);
}

public getUserId(authType: AuthType): string | undefined {
const userId = this.auths.find((verifiedAuth) => verifiedAuth.authType === authType)?.userId;
return resolveSismoIdentifier(userId, authType);
}

public getUserIds(authType: AuthType): string[] {
return this.auths
.filter((verifiedAuth) => verifiedAuth.authType === authType && verifiedAuth.userId)
.map((auth) => resolveSismoIdentifier(auth.userId, authType)) as string[];
}

public getSignedMessage(): string | undefined {
return this.signedMessage;
}
}

export type SismoConnectProof = {
auths?: Auth[];
claims?: Claim[];
Expand Down
2 changes: 1 addition & 1 deletion packages/sismo-connect-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sismo-core/sismo-connect-client",
"version": "0.0.17-beta.0",
"version": "0.0.17-beta.4",
"description": "Sismo Connect client package",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down
23 changes: 11 additions & 12 deletions packages/sismo-connect-client/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import pkg from "./package.json";

export default [
{
Expand All @@ -18,25 +19,23 @@ export default [
sourcemap: true,
},
],
plugins: [
resolve(),
commonjs(),
typescript({ tsconfig: "./tsconfig.json" }),
],
plugins: [resolve(), commonjs(), typescript({ tsconfig: "./tsconfig.json" })],
external: [
"@ethersproject/bignumber",
"viem",
"js-base64",
"pako"
]
"pako",
...Object.keys(pkg.devDependencies || {}),
],
},
{
input: "lib/esm/types/index.d.ts",
output: [
{
file: "lib/index.d.ts",
format: "esm"
}
file: "lib/index.d.ts",
format: "esm",
},
],
plugins: [dts.default()],
}
];
},
];
4 changes: 2 additions & 2 deletions packages/sismo-connect-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sismo-core/sismo-connect-react",
"version": "0.0.16",
"version": "0.0.17-beta.4",
"description": "sismoConnect React package",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down Expand Up @@ -41,6 +41,6 @@
},
"peerDependencies": {},
"dependencies": {
"@sismo-core/sismo-connect-client": "0.0.16"
"@sismo-core/sismo-connect-client": "0.0.17-beta.4"
}
}
29 changes: 12 additions & 17 deletions packages/sismo-connect-react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import postcss from 'rollup-plugin-postcss';
import postcss from "rollup-plugin-postcss";
import dts from "rollup-plugin-dts";
import external from 'rollup-plugin-peer-deps-external';
import packageJson from './package.json';
import external from "rollup-plugin-peer-deps-external";
import packageJson from "./package.json";
import pkg from "./package.json";

export default [
{
Expand All @@ -14,7 +15,7 @@ export default [
file: packageJson.module,
format: "esm",
sourcemap: true,
}
},
],
plugins: [
external(),
Expand All @@ -23,23 +24,17 @@ export default [
typescript({ tsconfig: "./tsconfig.json" }),
postcss(),
],
external: [
"viem",
"js-base64",
"pako"
]
external: ["@sismo-core/sismo-connect-client", ...Object.keys(pkg.devDependencies || {})],
},
{
input: "lib/esm/types/index.d.ts",
output: [
{
file: "lib/index.d.ts",
format: "esm"
}
file: "lib/index.d.ts",
format: "esm",
},
],
external: [/\.css$/],
plugins: [
dts.default()
],
}
];
plugins: [dts.default()],
},
];
32 changes: 10 additions & 22 deletions packages/sismo-connect-react/yarn-error.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Arguments:
/usr/local/bin/node /Users/dev/.cache/node/corepack/yarn/1.22.19/bin/yarn.js upgrade @sismo-core/sismo-connec[email protected].12-beta.14
/usr/local/bin/node /Users/dev/.cache/node/corepack/yarn/1.22.19/bin/yarn.js upgrade @sismo-core/sismo-connect[email protected].17-beta.4

PATH:
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/dev/.cargo/bin:/Users/dev/.foundry/bin
Expand All @@ -8,28 +8,19 @@ Yarn version:
1.22.19

Node version:
16.20.0
18.16.1

Platform:
darwin arm64

Trace:
Error: https://registry.npmjs.org/@sismo-core%2fsismo-connec-client: Not found
at Request.params.callback [as _callback] (/Users/dev/.cache/node/corepack/yarn/1.22.19/lib/cli.js:66145:18)
at Request.self.callback (/Users/dev/.cache/node/corepack/yarn/1.22.19/lib/cli.js:140890:22)
at Request.emit (node:events:513:28)
at Request.<anonymous> (/Users/dev/.cache/node/corepack/yarn/1.22.19/lib/cli.js:141862:10)
at Request.emit (node:events:513:28)
at IncomingMessage.<anonymous> (/Users/dev/.cache/node/corepack/yarn/1.22.19/lib/cli.js:141784:12)
at Object.onceWrapper (node:events:627:28)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: getaddrinfo ENOTFOUND registry.npmjs.org
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)

npm manifest:
{
"name": "@sismo-core/sismo-connect-react",
"version": "0.0.14-beta.10",
"version": "0.0.17-beta.3",
"description": "sismoConnect React package",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down Expand Up @@ -59,9 +50,6 @@ npm manifest:
"lib",
"src"
],
"engines": {
"npm": "USE YARN INSTEAD OF NPM"
},
"repository": "[email protected]:sismo-core/sismo-connect-packages.git",
"author": "[email protected]",
"license": "MIT",
Expand All @@ -73,7 +61,7 @@ npm manifest:
},
"peerDependencies": {},
"dependencies": {
"@sismo-core/sismo-connect-client": "0.0.12-beta.12"
"@sismo-core/sismo-connect-client": "0.0.17-beta.3"
}
}

Expand Down Expand Up @@ -226,10 +214,10 @@ Lockfile:
"@noble/hashes" "~1.3.0"
"@scure/base" "~1.1.0"

"@sismo-core/[email protected].12-beta.12":
version "0.0.12-beta.12"
resolved "https://registry.yarnpkg.com/@sismo-core/sismo-connect-client/-/sismo-connect-client-0.0.12-beta.12.tgz#99792ab9a527356adef82d74435a4a9dab05e7b3"
integrity sha512-alIbo5p7MLKM8+vJC4ZkRgeJ9/75M9BoreJo4BuRpi3nqttqoDglJNQn7BUCzeaOuGdmhlYT5BgfTqiG0JrFuQ==
"@sismo-core/[email protected].17-beta.3":
version "0.0.17-beta.3"
resolved "https://registry.yarnpkg.com/@sismo-core/sismo-connect-client/-/sismo-connect-client-0.0.17-beta.3.tgz#8d6ef3e802a9a627be4ffa6e292422050ed0d678"
integrity sha512-vwAzL4jegye+TFleWMrGbV7gxLt6SfrNMD2AD7TVzKfm0TiDiyMd2GRyKIfi7kxCymdOHIzSPhCbMnQy60AkOg==
dependencies:
"@ethersproject/bignumber" "5.7.0"
js-base64 "^3.7.5"
Expand Down
8 changes: 4 additions & 4 deletions packages/sismo-connect-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@
"@noble/hashes" "~1.3.0"
"@scure/base" "~1.1.0"

"@sismo-core/[email protected].16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@sismo-core/sismo-connect-client/-/sismo-connect-client-0.0.16.tgz#28f1c8e586509bf6272fc42969c8b13d837e3cbc"
integrity sha512-SO33SjpVPy2rVSIqE3B568+bQfNGe1T5ieh1pxNR68W6sAeLGU+PtzRegdKNbirFLVhVTi0Ky/vfmqI12Ehmng==
"@sismo-core/[email protected].17-beta.4":
version "0.0.17-beta.4"
resolved "https://registry.yarnpkg.com/@sismo-core/sismo-connect-client/-/sismo-connect-client-0.0.17-beta.4.tgz#39968c5dc1245437b073735fe26b0b49d625439d"
integrity sha512-9qSUzoKkAGoAuuV+NANBe+bXq02PijVJ5wvbrhcQt6jr03bn2MfxVVfOhOzeTHrQ7vlg7Uyf3lJHmtJWymAa0w==
dependencies:
"@ethersproject/bignumber" "5.7.0"
js-base64 "^3.7.5"
Expand Down
5 changes: 3 additions & 2 deletions packages/sismo-connect-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sismo-core/sismo-connect-server",
"version": "0.0.16",
"version": "0.0.17-beta.4",
"description": "sismoConnect server package",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down Expand Up @@ -38,7 +38,8 @@
"license": "MIT",
"dependencies": {
"@ethersproject/bignumber": "^5.7.0",
"@sismo-core/hydra-s3": "^1.0.0"
"@sismo-core/hydra-s3": "^1.0.0",
"viem": "^1.2.13"
},
"lint-staged": {
"src/**/*": "prettier --write --ignore-unknown",
Expand Down
24 changes: 13 additions & 11 deletions packages/sismo-connect-server/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import json from '@rollup/plugin-json';
import json from "@rollup/plugin-json";
import dts from "rollup-plugin-dts";
import pkg from "./package.json";

export default [
{
Expand All @@ -19,21 +20,22 @@ export default [
sourcemap: true,
},
],
plugins: [
resolve(),
commonjs(),
json(),
typescript(),
external: [
"@ethersproject/bignumber",
"@sismo-core/hydra-s3",
"viem",
...Object.keys(pkg.devDependencies || {}),
],
plugins: [resolve(), commonjs(), json(), typescript()],
},
{
input: "lib/esm/types/index.d.ts",
output: [
{
file: "lib/index.d.ts",
format: "esm"
}
file: "lib/index.d.ts",
format: "esm",
},
],
plugins: [dts.default()],
}
];
},
];
Loading

0 comments on commit f3948d0

Please sign in to comment.