Skip to content

Commit

Permalink
Merge branch 'typedoc-ci' of github.com:prosopo/captcha into typedoc-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
goastler committed Mar 6, 2024
2 parents 3998e3d + 3a691c4 commit d635d52
Show file tree
Hide file tree
Showing 154 changed files with 7,254 additions and 5,294 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
echo ""
# grep for the version line
version_changes=$(echo "$diff" | grep -e "[-\+]\s*\"version\"")
version_changes=$(echo "$diff" | grep -e "[-\+]\s*\"version\"" || true)
echo "version_changes:"
echo "$version_changes"
echo ""
Expand Down Expand Up @@ -499,7 +499,7 @@ jobs:
run: |
if [[ "${{ steps.publish_docker_js_server.outcome }}" == 'success' ]]; then
echo "Redeploying flux docker js_server."
npx tsx ./dev/scripts/dist/scripts/fluxDeploy.js ProcaptchaJavascriptServer
npx tsx ./dev/flux/dist/index.js deploy --app ProcaptchaJavascriptServer
else
echo "Skipping flux redeploy."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.formatOnSave": true,
Expand Down
24 changes: 12 additions & 12 deletions contracts/captcha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@
},
"homepage": "https://github.com/prosopo/captcha#readme",
"dependencies": {
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@polkadot/keyring": "12.6.1",
"@polkadot/rpc-provider": "10.11.1",
"@polkadot/typegen": "10.11.1",
"@polkadot/types": "10.11.1",
"@polkadot/types-codec": "10.11.1",
"@polkadot/types-create": "10.11.1",
"@polkadot/util": "12.6.1",
"@polkadot/util-crypto": "12.6.1",
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13"
"@polkadot/api": "10.11.2",
"@polkadot/api-contract": "10.11.2",
"@polkadot/keyring": "12.6.2",
"@polkadot/rpc-provider": "10.11.2",
"@polkadot/typegen": "10.11.2",
"@polkadot/types": "10.11.2",
"@polkadot/types-codec": "10.11.2",
"@polkadot/types-create": "10.11.2",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/typechain-polkadot": "1.1.14",
"@prosopo/typechain-types": "1.1.14"
},
"devDependencies": {
"tslib": "2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion contracts/captcha/src/captcha.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x47ccf93a15772e2794acf525ebaa5e374d11453a4edb0bbdf9ce229e9b6bdc88",
"hash": "0x1a6a2231e769ffa304a6813e59b9bd2b43744deef5af75f32a7c60ff65e3ba2c",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand Down
4 changes: 2 additions & 2 deletions contracts/captcha/src/contract-info/captcha.ts

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions contracts/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
},
"homepage": "https://github.com/prosopo/captcha#readme",
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@polkadot/types": "10.11.1",
"@polkadot/types-codec": "10.11.1",
"@polkadot/keyring": "12.6.1",
"@polkadot/rpc-provider": "10.11.1",
"@polkadot/typegen": "10.11.1",
"@polkadot/types-create": "10.11.1",
"@polkadot/util": "12.6.1",
"@polkadot/util-crypto": "12.6.1"
"@prosopo/typechain-polkadot": "1.1.14",
"@prosopo/typechain-types": "1.1.14",
"@polkadot/api": "10.11.2",
"@polkadot/api-contract": "10.11.2",
"@polkadot/types": "10.11.2",
"@polkadot/types-codec": "10.11.2",
"@polkadot/keyring": "12.6.2",
"@polkadot/rpc-provider": "10.11.2",
"@polkadot/typegen": "10.11.2",
"@polkadot/types-create": "10.11.2",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2"
},
"devDependencies": {
"tslib": "2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/src/common.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0xd5d61042041d18e2435d77eb4ff86581dadfcf0ef213f4323db798a0c625d679",
"hash": "0xc830dbe153609dc207383fa44e97145d0f449aebfdb1fb7575186812b0e9846a",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand Down
4 changes: 2 additions & 2 deletions contracts/common/src/contract-info/common.ts

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions contracts/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
},
"homepage": "https://github.com/prosopo/captcha#readme",
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@polkadot/types": "10.11.1",
"@polkadot/types-codec": "10.11.1",
"@polkadot/keyring": "12.6.1",
"@polkadot/rpc-provider": "10.11.1",
"@polkadot/typegen": "10.11.1",
"@polkadot/types-create": "10.11.1",
"@polkadot/util": "12.6.1",
"@polkadot/util-crypto": "12.6.1"
"@prosopo/typechain-polkadot": "1.1.14",
"@prosopo/typechain-types": "1.1.14",
"@polkadot/api": "10.11.2",
"@polkadot/api-contract": "10.11.2",
"@polkadot/types": "10.11.2",
"@polkadot/types-codec": "10.11.2",
"@polkadot/keyring": "12.6.2",
"@polkadot/rpc-provider": "10.11.2",
"@polkadot/typegen": "10.11.2",
"@polkadot/types-create": "10.11.2",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2"
},
"devDependencies": {
"tslib": "2.6.2",
Expand Down
4 changes: 2 additions & 2 deletions contracts/proxy/src/contract-info/proxy.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/proxy/src/proxy.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x84e4819370416fa4461dcb132c1d5677c21394ebda33c618c9405398e91da7a7",
"hash": "0x06a07b2287c32764322813ae978d0565caa7c42e132ea68b2d209035aa8d7800",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand Down
2 changes: 1 addition & 1 deletion demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"dotenv": "^16.0.1",
"vite": "^4.5.2"
"vite": "^5.1.4"
},
"version": "0.2.41",
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions demos/client-example-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"homepage": "https://github.com/prosopo/client-example-server#readme",
"dependencies": {
"@noble/hashes": "^1.3.1",
"@polkadot/util": "12.6.1",
"@polkadot/util-crypto": "12.6.1",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/api": "0.2.41",
"@prosopo/contract": "0.2.41",
"@prosopo/procaptcha": "0.2.41",
Expand All @@ -55,7 +55,7 @@
"ts-node": "^10.9.1",
"tslib": "2.6.2",
"typescript": "5.1.6",
"vite": "^4.5.2",
"vite": "^5.1.4",
"@prosopo/config": "0.2.41"
}
}
3 changes: 3 additions & 0 deletions demos/client-pow-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Getting Started with the Client Example

This project is a _minimal_ example demonstrating how to include Prosopo PoW Procaptcha in a client React app.
8 changes: 8 additions & 0 deletions demos/client-pow-example/env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PROSOPO_SITE_KEY=5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw
PROSOPO_SUBSTRATE_ENDPOINT=ws://127.0.0.1:9944
PROSOPO_CONTRACT_ADDRESS=
PROSOPO_WEB2=true
PROSOPO_SERVER_URL=http://localhost:9228
PROSOPO_PORT=9234
PROSOPO_DEFAULT_NETWORK=development
PROSOPO_DEFAULT_ENVIRONMENT=development
42 changes: 42 additions & 0 deletions demos/client-pow-example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Prosopo procaptcha client login example" />
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Prosopo Procaptcha Client Login Example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
59 changes: 59 additions & 0 deletions demos/client-pow-example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "@prosopo/client-pow-example",
"version": "0.2.41",
"private": true,
"type": "module",
"engines": {
"node": ">=18",
"npm": ">=9"
},
"dependencies": {
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@mui/material": "^5.9.1",
"@prosopo/common": "0.2.41",
"@prosopo/procaptcha": "0.2.41",
"@prosopo/procaptcha-react": "0.2.41",
"@prosopo/types": "0.2.41",
"@types/react-dom": "^18.2.4",
"electron": "25.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"web-vitals": "^2.1.4",
"@prosopo/procaptcha-pow": "0.2.41"
},
"devDependencies": {
"@prosopo/cli": "0.2.41",
"@prosopo/config": "0.2.41",
"@types/node": "^20.3.1",
"css-loader": "^6.8.1",
"eslint-config-react-app": "^7.0.1",
"tslib": "2.6.2",
"typescript": "5.1.6"
},
"scripts": {
"start": "vite serve --mode=development --config vite.config.ts --port 9240 --host --force",
"build": "tsc --build --verbose",
"bundle:prod": "vite build --mode=production --config vite.config.ts --outDir dist --emptyOutDir",
"bundle:dev": "vite build --mode=development --config vite.config.ts --outDir dist --emptyOutDir",
"clean": "tsc --build --clean",
"eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
"eslint:fix": "npm run eslint -- --fix",
"prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
"prettier:fix": "npm run prettier -- --write",
"lint": "npm run eslint && npm run prettier",
"lint:fix": "npm run eslint:fix && npm run prettier:fix"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
40 changes: 40 additions & 0 deletions demos/client-pow-example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2021-2023 Prosopo (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { EnvironmentTypes, EnvironmentTypesSchema, ProsopoClientConfigSchema } from '@prosopo/types'
import { ProcaptchaPow } from '@prosopo/procaptcha-pow'
import { useState } from 'react'

function App() {
const [account, setAccount] = useState<string>('')
const config = ProsopoClientConfigSchema.parse({
userAccountAddress: account,
account: {
address: process.env.PROSOPO_SITE_KEY || '',
},
web2: process.env.PROSOPO_WEB2 === 'true',
dappName: 'client-example',
defaultEnvironment:
(process.env.PROSOPO_DEFAULT_ENVIRONMENT as EnvironmentTypes) || EnvironmentTypesSchema.enum.development,
serverUrl: process.env.PROSOPO_SERVER_URL || '',
atlasUri: process.env._DEV_ONLY_WATCH_EVENTS === 'true' || false,
})
return (
<div style={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ProcaptchaPow config={config} />
</div>
)
}

export default App
41 changes: 41 additions & 0 deletions demos/client-pow-example/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2021-2023 Prosopo (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ../.env | .env.local | .env.development >>
// PROSOPO_API_BASE_URL=http://localhost
// PROSOPO_SITE_KEY=5FzjruAqyhRGV81pMb4yznNS7t52hNB8u2VC2N1P22j5QLY9

import { EnvironmentTypesSchema, NetworkNamesSchema } from '@prosopo/types'
import { ProsopoClientConfigInput } from '@prosopo/types'

const getWeb2 = (): boolean | undefined => {
return process.env.PROSOPO_WEB2 === 'true' ? true : process.env.PROSOPO_WEB2 === 'false' ? false : undefined
}

const config: ProsopoClientConfigInput = {
account: {
address: process.env.PROSOPO_SITE_KEY || '',
},
userAccountAddress: '',
web2: getWeb2(),
defaultEnvironment: process.env.PROSOPO_DEFAULT_ENVIRONMENT
? EnvironmentTypesSchema.parse(process.env.PROSOPO_DEFAULT_ENVIRONMENT)
: EnvironmentTypesSchema.enum.development,
defaultNetwork: process.env.PROSOPO_DEFAULT_NETWORK
? NetworkNamesSchema.parse(process.env.PROSOPO_DEFAULT_NETWORK)
: NetworkNamesSchema.enum.development,
dappName: 'client-example',
serverUrl: process.env.PROSOPO_SERVER_URL || '',
}

export default config
26 changes: 26 additions & 0 deletions demos/client-pow-example/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2021-2023 Prosopo (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CssBaseline } from '@mui/material'
import App from './App.js'
import React from 'react'
import ReactDOM from 'react-dom/client'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)

root.render(
<React.Fragment>
<CssBaseline />
<App />
</React.Fragment>
)
Loading

0 comments on commit d635d52

Please sign in to comment.