diff --git a/.changeset/tidy-cups-kneel.md b/.changeset/tidy-cups-kneel.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/tidy-cups-kneel.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/actions/sync-workspace/action.yml b/.github/actions/sync-workspace/action.yml index 68c777324..a9feacb58 100644 --- a/.github/actions/sync-workspace/action.yml +++ b/.github/actions/sync-workspace/action.yml @@ -17,9 +17,12 @@ runs: REBUILD_PACKAGE: ${{ inputs.rebuild-package }} with: path: | + ./.yarn/cache node_modules + app/**/node_modules packages/**/node_modules - key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('**/yarn.lock') }}-${{ inputs.package-json-checksum }} + examples/docs/node_modules + key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ inputs.package-json-checksum }} enableCrossOsArchive: true fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }}" - name: Restore build artifacts cache @@ -33,7 +36,7 @@ runs: path: | packages/**/lib packages/**/dist - packages/**/build + apps/**/dist key: code-${{ github.sha }} restore-keys: | code-${{ github.sha }} diff --git a/.github/workflows/odis-combiner-container.yml b/.github/workflows/odis-combiner-container.yml index 53f26006e..bd8123de3 100644 --- a/.github/workflows/odis-combiner-container.yml +++ b/.github/workflows/odis-combiner-container.yml @@ -4,14 +4,14 @@ name: Build ODIS combiner image on: push: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-combiner' - - 'packages/phone-number-privacy/combiner/**' + - 'dockerfiles/Dockerfile-combiner' + - 'apps/combiner/**' branches: - main pull_request: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-combiner' - - 'packages/phone-number-privacy/combiner/**' + - 'dockerfiles/Dockerfile-combiner' + - 'apps/combiner/**' workflow_dispatch: jobs: @@ -26,7 +26,7 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-combiner tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-combiner + file: dockerfiles/Dockerfile-combiner trivy: true odis-combiner-build: @@ -40,5 +40,5 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-combiner tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-combiner + file: dockerfiles/Dockerfile-combiner trivy: true diff --git a/.github/workflows/odis-loadtest-container.yml b/.github/workflows/odis-loadtest-container.yml index 39aff17c6..edb795078 100644 --- a/.github/workflows/odis-loadtest-container.yml +++ b/.github/workflows/odis-loadtest-container.yml @@ -4,14 +4,14 @@ name: Build ODIS loadtest image on: push: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-loadtest' - - 'packages/phone-number-privacy/monitor/**' + - 'dockerfiles/Dockerfile-loadtest' + - 'apps/monitor/**' branches: - main pull_request: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-loadtest' - - 'packages/phone-number-privacy/monitor/**' + - 'dockerfiles/Dockerfile-loadtest' + - 'apps/monitor/**' workflow_dispatch: jobs: @@ -26,7 +26,7 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-loadtest + file: dockerfiles/Dockerfile-loadtest trivy: true odis-loadtest-build: @@ -40,5 +40,5 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-loadtest + file: dockerfiles/Dockerfile-loadtest trivy: true diff --git a/.github/workflows/odis-signer-container.yml b/.github/workflows/odis-signer-container.yml index 780d63387..3e797f30b 100644 --- a/.github/workflows/odis-signer-container.yml +++ b/.github/workflows/odis-signer-container.yml @@ -4,14 +4,14 @@ name: Build ODIS signer image on: push: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-signer' - - 'packages/phone-number-privacy/signer/**' + - 'dockerfiles/Dockerfile-signer' + - 'apps/signer/**' branches: - main pull_request: paths: - - 'dockerfiles/phone-number-privacy/Dockerfile-signer' - - 'packages/phone-number-privacy/signer/**' + - 'dockerfiles/Dockerfile-signer' + - 'apps/signer/**' workflow_dispatch: jobs: @@ -26,7 +26,7 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-signer + file: dockerfiles/Dockerfile-signer trivy: true odis-signer-build: @@ -40,5 +40,5 @@ jobs: artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer tag: ${{ github.sha }} context: . - file: dockerfiles/phone-number-privacy/Dockerfile-signer + file: dockerfiles/Dockerfile-signer trivy: true diff --git a/.github/workflows/social-connect.yml b/.github/workflows/social-connect.yml index e5119b47e..ecd2d09b7 100644 --- a/.github/workflows/social-connect.yml +++ b/.github/workflows/social-connect.yml @@ -85,9 +85,12 @@ jobs: # We need to cache all the artifacts generated by yarn install+build # Update this list also in .github/actions/sync-workspace/action.yml with exactly the same list path: | + ./.yarn/cache node_modules + app/**/node_modules packages/**/node_modules - key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('**/yarn.lock') }}-${{ steps.node-checksums.outputs.PACKAGE_JSON_CHECKSUM }} + examples/docs/node_modules + key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ steps.node-checksums.outputs.PACKAGE_JSON_CHECKSUM }} restore-keys: | node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}- # We use cache to share the build artifacts between jobs (gh artifacts are too slow...) @@ -101,7 +104,7 @@ jobs: path: | packages/**/lib packages/**/dist - packages/**/build + apps/**/dist key: code-${{ github.sha }} restore-keys: | code-${{ github.sha }} @@ -109,7 +112,6 @@ jobs: run : sudo corepack enable yarn - name: Install yarn dependencies run: git config --global url."https://".insteadOf ssh:// && yarn install - if: steps.cache_node.outputs.cache-hit == 'true' - name: Fail if any file changed on git run: | # This fails if there is any change @@ -201,10 +203,10 @@ jobs: yarn --cwd=packages/odis-identifiers test - name: Run Encrypted Backup tests run: | - yarn --cwd=packages/sdk/encrypted-backup test + yarn --cwd=packages/encrypted-backup test - name: Run Identity Tests run: | - yarn --cwd=packages/sdk/identity test + yarn --cwd=packages/identity test - name: Upload Jest Test Results uses: actions/upload-artifact@v3 @@ -220,7 +222,7 @@ jobs: needs: install-dependencies if: | github.base_ref == 'main' || contains(github.base_ref, 'staging') || contains(github.base_ref, 'production') || - contains(needs.install-dependencies.outputs.all_modified_files, 'packages/phone-number-privacy/combiner') || + contains(needs.install-dependencies.outputs.all_modified_files, 'apps/combiner') || contains(needs.install-dependencies.outputs.all_modified_files, ',package.json') || contains(needs.install-dependencies.outputs.all_modified_files, ',yarn.lock') || false @@ -237,7 +239,7 @@ jobs: package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }} - name: Run Tests for combiner run: | - yarn --cwd=packages/phone-number-privacy/combiner test:coverage + yarn --cwd=apps/combiner test:coverage odis-test: name: ODIS (signer + common) test needs: install-dependencies @@ -247,7 +249,8 @@ jobs: timeout-minutes: 30 if: | github.base_ref == 'main' || contains(github.base_ref, 'staging') || contains(github.base_ref, 'production') || - contains(needs.install-dependencies.outputs.all_modified_files, 'packages/phone-number-privacy') || + contains(needs.install-dependencies.outputs.all_modified_files, 'packages') || + contains(needs.install-dependencies.outputs.all_modified_files, 'apps/signer') || contains(needs.install-dependencies.outputs.all_modified_files, ',package.json') || contains(needs.install-dependencies.outputs.all_modified_files, ',yarn.lock') || false @@ -264,7 +267,7 @@ jobs: package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }} - name: Run Tests for common package run: | - yarn --cwd=packages/phone-number-privacy/common test:coverage + yarn --cwd=packages/common test:coverage - name: Run Tests for signer run: | - yarn --cwd=packages/phone-number-privacy/signer test:coverage + yarn --cwd=apps/signer test:coverage diff --git a/.prettierignore b/.prettierignore index a9d816c81..0f72bf55b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,9 +2,9 @@ package.json **/.next **/coverage **/node_modules -**/privacy/* .git/ +apps/**/dist packages/**/dist packages/**/lib docs/examples/**/lib diff --git a/.vscode/launch.json b/.vscode/launch.json index 79c6a7e4a..5b8d973c6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,9 +9,9 @@ "--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--rootDir", - "${workspaceFolder}/packages/phone-number-privacy", + "${workspaceFolder}/packages", "--runInBand", - "${workspaceFolder}/packages/phone-number-privacy/combiner/test/**", + "${workspaceFolder}/apps/combiner/test/**", ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", @@ -25,9 +25,9 @@ "--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--rootDir", - "${workspaceFolder}/packages/phone-number-privacy/signer", + "${workspaceFolder}/apps/signer", "--runInBand", - "${workspaceFolder}/packages/phone-number-privacy/signer/test/**", + "${workspaceFolder}/apps/signer/test/**", ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", diff --git a/packages/phone-number-privacy/combiner/.env b/apps/combiner/.env similarity index 100% rename from packages/phone-number-privacy/combiner/.env rename to apps/combiner/.env diff --git a/packages/phone-number-privacy/combiner/.gitignore b/apps/combiner/.gitignore similarity index 100% rename from packages/phone-number-privacy/combiner/.gitignore rename to apps/combiner/.gitignore diff --git a/packages/phone-number-privacy/combiner/CHANGELOG.md b/apps/combiner/CHANGELOG.md similarity index 100% rename from packages/phone-number-privacy/combiner/CHANGELOG.md rename to apps/combiner/CHANGELOG.md diff --git a/packages/phone-number-privacy/combiner/README.md b/apps/combiner/README.md similarity index 100% rename from packages/phone-number-privacy/combiner/README.md rename to apps/combiner/README.md diff --git a/packages/phone-number-privacy/combiner/index.d.ts b/apps/combiner/index.d.ts similarity index 100% rename from packages/phone-number-privacy/combiner/index.d.ts rename to apps/combiner/index.d.ts diff --git a/packages/phone-number-privacy/combiner/jest.config.js b/apps/combiner/jest.config.js similarity index 100% rename from packages/phone-number-privacy/combiner/jest.config.js rename to apps/combiner/jest.config.js diff --git a/packages/phone-number-privacy/combiner/jest_setup.ts b/apps/combiner/jest_setup.ts similarity index 100% rename from packages/phone-number-privacy/combiner/jest_setup.ts rename to apps/combiner/jest_setup.ts diff --git a/packages/phone-number-privacy/combiner/package.json b/apps/combiner/package.json similarity index 97% rename from packages/phone-number-privacy/combiner/package.json rename to apps/combiner/package.json index d9bc4c377..5f7643203 100644 --- a/packages/phone-number-privacy/combiner/package.json +++ b/apps/combiner/package.json @@ -54,6 +54,7 @@ "uuid": "^7.0.3" }, "devDependencies": { + "@celo/phone-number-privacy-signer": "workspace:^", "@celo/phone-utils": "^5.0.4", "@celo/utils": "^5.0.4", "@types/express": "^4.17.6", diff --git a/packages/phone-number-privacy/combiner/src/common/combine.ts b/apps/combiner/src/common/combine.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/combine.ts rename to apps/combiner/src/common/combine.ts diff --git a/packages/phone-number-privacy/combiner/src/common/context.ts b/apps/combiner/src/common/context.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/context.ts rename to apps/combiner/src/common/context.ts diff --git a/packages/phone-number-privacy/combiner/src/common/crypto-clients/bls-crypto-client.ts b/apps/combiner/src/common/crypto-clients/bls-crypto-client.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/crypto-clients/bls-crypto-client.ts rename to apps/combiner/src/common/crypto-clients/bls-crypto-client.ts diff --git a/packages/phone-number-privacy/combiner/src/common/crypto-clients/crypto-client.ts b/apps/combiner/src/common/crypto-clients/crypto-client.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/crypto-clients/crypto-client.ts rename to apps/combiner/src/common/crypto-clients/crypto-client.ts diff --git a/packages/phone-number-privacy/combiner/src/common/crypto-clients/domain-crypto-client.ts b/apps/combiner/src/common/crypto-clients/domain-crypto-client.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/crypto-clients/domain-crypto-client.ts rename to apps/combiner/src/common/crypto-clients/domain-crypto-client.ts diff --git a/packages/phone-number-privacy/combiner/src/common/error.ts b/apps/combiner/src/common/error.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/error.ts rename to apps/combiner/src/common/error.ts diff --git a/packages/phone-number-privacy/combiner/src/common/handlers.ts b/apps/combiner/src/common/handlers.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/handlers.ts rename to apps/combiner/src/common/handlers.ts diff --git a/packages/phone-number-privacy/combiner/src/common/io.ts b/apps/combiner/src/common/io.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/io.ts rename to apps/combiner/src/common/io.ts diff --git a/packages/phone-number-privacy/combiner/src/common/metrics.ts b/apps/combiner/src/common/metrics.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/metrics.ts rename to apps/combiner/src/common/metrics.ts diff --git a/packages/phone-number-privacy/combiner/src/common/tracing-utils.ts b/apps/combiner/src/common/tracing-utils.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/tracing-utils.ts rename to apps/combiner/src/common/tracing-utils.ts diff --git a/packages/phone-number-privacy/combiner/src/common/web3/contracts.ts b/apps/combiner/src/common/web3/contracts.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/common/web3/contracts.ts rename to apps/combiner/src/common/web3/contracts.ts diff --git a/packages/phone-number-privacy/combiner/src/config.ts b/apps/combiner/src/config.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/config.ts rename to apps/combiner/src/config.ts diff --git a/packages/phone-number-privacy/combiner/src/domain/endpoints/disable/action.ts b/apps/combiner/src/domain/endpoints/disable/action.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/domain/endpoints/disable/action.ts rename to apps/combiner/src/domain/endpoints/disable/action.ts diff --git a/packages/phone-number-privacy/combiner/src/domain/endpoints/quota/action.ts b/apps/combiner/src/domain/endpoints/quota/action.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/domain/endpoints/quota/action.ts rename to apps/combiner/src/domain/endpoints/quota/action.ts diff --git a/packages/phone-number-privacy/combiner/src/domain/endpoints/sign/action.ts b/apps/combiner/src/domain/endpoints/sign/action.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/domain/endpoints/sign/action.ts rename to apps/combiner/src/domain/endpoints/sign/action.ts diff --git a/packages/phone-number-privacy/combiner/src/domain/services/log-responses.ts b/apps/combiner/src/domain/services/log-responses.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/domain/services/log-responses.ts rename to apps/combiner/src/domain/services/log-responses.ts diff --git a/packages/phone-number-privacy/combiner/src/domain/services/threshold-state.ts b/apps/combiner/src/domain/services/threshold-state.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/domain/services/threshold-state.ts rename to apps/combiner/src/domain/services/threshold-state.ts diff --git a/packages/phone-number-privacy/combiner/src/index.ts b/apps/combiner/src/index.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/index.ts rename to apps/combiner/src/index.ts diff --git a/packages/phone-number-privacy/combiner/src/pnp/endpoints/quota/action.ts b/apps/combiner/src/pnp/endpoints/quota/action.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/pnp/endpoints/quota/action.ts rename to apps/combiner/src/pnp/endpoints/quota/action.ts diff --git a/packages/phone-number-privacy/combiner/src/pnp/endpoints/sign/action.ts b/apps/combiner/src/pnp/endpoints/sign/action.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/pnp/endpoints/sign/action.ts rename to apps/combiner/src/pnp/endpoints/sign/action.ts diff --git a/packages/phone-number-privacy/combiner/src/pnp/services/account-services.ts b/apps/combiner/src/pnp/services/account-services.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/pnp/services/account-services.ts rename to apps/combiner/src/pnp/services/account-services.ts diff --git a/packages/phone-number-privacy/combiner/src/pnp/services/log-responses.ts b/apps/combiner/src/pnp/services/log-responses.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/pnp/services/log-responses.ts rename to apps/combiner/src/pnp/services/log-responses.ts diff --git a/packages/phone-number-privacy/combiner/src/pnp/services/threshold-state.ts b/apps/combiner/src/pnp/services/threshold-state.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/pnp/services/threshold-state.ts rename to apps/combiner/src/pnp/services/threshold-state.ts diff --git a/packages/phone-number-privacy/combiner/src/server.ts b/apps/combiner/src/server.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/server.ts rename to apps/combiner/src/server.ts diff --git a/packages/phone-number-privacy/combiner/src/tracing.ts b/apps/combiner/src/tracing.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/tracing.ts rename to apps/combiner/src/tracing.ts diff --git a/packages/phone-number-privacy/combiner/src/utils/no-quota-cache.ts b/apps/combiner/src/utils/no-quota-cache.ts similarity index 100% rename from packages/phone-number-privacy/combiner/src/utils/no-quota-cache.ts rename to apps/combiner/src/utils/no-quota-cache.ts diff --git a/packages/phone-number-privacy/combiner/test/end-to-end/domain.test.ts b/apps/combiner/test/end-to-end/domain.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/end-to-end/domain.test.ts rename to apps/combiner/test/end-to-end/domain.test.ts diff --git a/packages/phone-number-privacy/combiner/test/end-to-end/pnp.test.ts b/apps/combiner/test/end-to-end/pnp.test.ts similarity index 99% rename from packages/phone-number-privacy/combiner/test/end-to-end/pnp.test.ts rename to apps/combiner/test/end-to-end/pnp.test.ts index a52a9563a..bf52a5499 100644 --- a/packages/phone-number-privacy/combiner/test/end-to-end/pnp.test.ts +++ b/apps/combiner/test/end-to-end/pnp.test.ts @@ -14,7 +14,7 @@ import { normalizeAddressWith0x } from '@celo/utils/lib/address' import threshold_bls from 'blind-threshold-bls' import { randomBytes } from 'crypto' import fetch from 'node-fetch' -import { config as signerConfig } from '../../../signer/src/config' +import { config as signerConfig } from '@celo/phone-number-privacy-signer/src/config' import { getCombinerVersion } from '../../src' import { ACCOUNT_ADDRESS, diff --git a/packages/phone-number-privacy/combiner/test/end-to-end/resources.ts b/apps/combiner/test/end-to-end/resources.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/end-to-end/resources.ts rename to apps/combiner/test/end-to-end/resources.ts diff --git a/packages/phone-number-privacy/combiner/test/integration/domain.test.ts b/apps/combiner/test/integration/domain.test.ts similarity index 99% rename from packages/phone-number-privacy/combiner/test/integration/domain.test.ts rename to apps/combiner/test/integration/domain.test.ts index 9f5bce5c0..54ae19bc7 100644 --- a/packages/phone-number-privacy/combiner/test/integration/domain.test.ts +++ b/apps/combiner/test/integration/domain.test.ts @@ -31,6 +31,7 @@ import { DefaultKeyName, KeyProvider, } from '@celo/phone-number-privacy-signer/dist/common/key-management/key-provider-base' +import { MockKeyProvider } from '@celo/phone-number-privacy-signer/dist/common/key-management/mock-key-provider' import { SignerConfig, SupportedDatabase, @@ -44,7 +45,6 @@ import { Server } from 'http' import { Server as HttpsServer } from 'https' import { Knex } from 'knex' import request from 'supertest' -import { MockKeyProvider } from '../../../signer/dist/common/key-management/mock-key-provider' import config from '../../src/config' import { startCombiner } from '../../src/server' import { serverClose } from '../utils' diff --git a/packages/phone-number-privacy/combiner/test/integration/pnp.test.ts b/apps/combiner/test/integration/pnp.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/integration/pnp.test.ts rename to apps/combiner/test/integration/pnp.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/bls-signature.test.ts b/apps/combiner/test/unit/bls-signature.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/bls-signature.test.ts rename to apps/combiner/test/unit/bls-signature.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/domain-response-logger.test.ts b/apps/combiner/test/unit/domain-response-logger.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/domain-response-logger.test.ts rename to apps/combiner/test/unit/domain-response-logger.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/domain-threshold-state.test.ts b/apps/combiner/test/unit/domain-threshold-state.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/domain-threshold-state.test.ts rename to apps/combiner/test/unit/domain-threshold-state.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/no-quota-cache.test.ts b/apps/combiner/test/unit/no-quota-cache.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/no-quota-cache.test.ts rename to apps/combiner/test/unit/no-quota-cache.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/pnp-response-logger.test.ts b/apps/combiner/test/unit/pnp-response-logger.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/pnp-response-logger.test.ts rename to apps/combiner/test/unit/pnp-response-logger.test.ts diff --git a/packages/phone-number-privacy/combiner/test/unit/pnp-threshold-state.test.ts b/apps/combiner/test/unit/pnp-threshold-state.test.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/unit/pnp-threshold-state.test.ts rename to apps/combiner/test/unit/pnp-threshold-state.test.ts diff --git a/packages/phone-number-privacy/combiner/test/utils.ts b/apps/combiner/test/utils.ts similarity index 100% rename from packages/phone-number-privacy/combiner/test/utils.ts rename to apps/combiner/test/utils.ts diff --git a/packages/phone-number-privacy/combiner/tsconfig.json b/apps/combiner/tsconfig.json similarity index 100% rename from packages/phone-number-privacy/combiner/tsconfig.json rename to apps/combiner/tsconfig.json diff --git a/packages/phone-number-privacy/monitor/.env b/apps/monitor/.env similarity index 100% rename from packages/phone-number-privacy/monitor/.env rename to apps/monitor/.env diff --git a/packages/phone-number-privacy/monitor/.firebaserc b/apps/monitor/.firebaserc similarity index 100% rename from packages/phone-number-privacy/monitor/.firebaserc rename to apps/monitor/.firebaserc diff --git a/packages/phone-number-privacy/monitor/.gitignore b/apps/monitor/.gitignore similarity index 100% rename from packages/phone-number-privacy/monitor/.gitignore rename to apps/monitor/.gitignore diff --git a/packages/phone-number-privacy/monitor/README.md b/apps/monitor/README.md similarity index 100% rename from packages/phone-number-privacy/monitor/README.md rename to apps/monitor/README.md diff --git a/packages/phone-number-privacy/monitor/firebase.json b/apps/monitor/firebase.json similarity index 100% rename from packages/phone-number-privacy/monitor/firebase.json rename to apps/monitor/firebase.json diff --git a/packages/phone-number-privacy/monitor/package.json b/apps/monitor/package.json similarity index 100% rename from packages/phone-number-privacy/monitor/package.json rename to apps/monitor/package.json diff --git a/packages/phone-number-privacy/monitor/src/index.ts b/apps/monitor/src/index.ts similarity index 100% rename from packages/phone-number-privacy/monitor/src/index.ts rename to apps/monitor/src/index.ts diff --git a/packages/phone-number-privacy/monitor/src/query.ts b/apps/monitor/src/query.ts similarity index 100% rename from packages/phone-number-privacy/monitor/src/query.ts rename to apps/monitor/src/query.ts diff --git a/packages/phone-number-privacy/monitor/src/resources.ts b/apps/monitor/src/resources.ts similarity index 100% rename from packages/phone-number-privacy/monitor/src/resources.ts rename to apps/monitor/src/resources.ts diff --git a/packages/phone-number-privacy/monitor/src/scripts/run-load-test.ts b/apps/monitor/src/scripts/run-load-test.ts similarity index 100% rename from packages/phone-number-privacy/monitor/src/scripts/run-load-test.ts rename to apps/monitor/src/scripts/run-load-test.ts diff --git a/packages/phone-number-privacy/monitor/src/test.ts b/apps/monitor/src/test.ts similarity index 100% rename from packages/phone-number-privacy/monitor/src/test.ts rename to apps/monitor/src/test.ts diff --git a/packages/phone-number-privacy/monitor/tsconfig.json b/apps/monitor/tsconfig.json similarity index 100% rename from packages/phone-number-privacy/monitor/tsconfig.json rename to apps/monitor/tsconfig.json diff --git a/packages/phone-number-privacy/monitor/ui-debug.log b/apps/monitor/ui-debug.log similarity index 100% rename from packages/phone-number-privacy/monitor/ui-debug.log rename to apps/monitor/ui-debug.log diff --git a/packages/phone-number-privacy/signer/.env b/apps/signer/.env similarity index 100% rename from packages/phone-number-privacy/signer/.env rename to apps/signer/.env diff --git a/packages/phone-number-privacy/signer/.gitignore b/apps/signer/.gitignore similarity index 100% rename from packages/phone-number-privacy/signer/.gitignore rename to apps/signer/.gitignore diff --git a/packages/phone-number-privacy/signer/CHANGELOG.md b/apps/signer/CHANGELOG.md similarity index 100% rename from packages/phone-number-privacy/signer/CHANGELOG.md rename to apps/signer/CHANGELOG.md diff --git a/packages/phone-number-privacy/signer/README.md b/apps/signer/README.md similarity index 99% rename from packages/phone-number-privacy/signer/README.md rename to apps/signer/README.md index 6e4ee0f8f..c62fcf56a 100644 --- a/packages/phone-number-privacy/signer/README.md +++ b/apps/signer/README.md @@ -174,4 +174,4 @@ You can test your mainnet service is set up correctly by running specific tests ### Logs -Error logs will be prefixed with `CELO_ODIS_ERROR_XX`. You can see a full list of them in [errors.ts](https://github.com/celo-org/celo-monorepo/blob/master/packages/phone-number-privacy/common/src/interfaces/errors.ts) in the common package. +Error logs will be prefixed with `CELO_ODIS_ERROR_XX`. You can see a full list of them in [errors.ts](https://github.com/celo-org/celo-monorepo/blob/master/packages/common/src/interfaces/errors.ts) in the common package. diff --git a/packages/phone-number-privacy/signer/docs/deploy-on-aws.md b/apps/signer/docs/deploy-on-aws.md similarity index 93% rename from packages/phone-number-privacy/signer/docs/deploy-on-aws.md rename to apps/signer/docs/deploy-on-aws.md index c0d61e53b..d822ea378 100644 --- a/packages/phone-number-privacy/signer/docs/deploy-on-aws.md +++ b/apps/signer/docs/deploy-on-aws.md @@ -2,8 +2,8 @@ ## Prerequisites -- awscli (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) -- AWS credentials configured (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +- awscli () +- AWS credentials configured () ## Steps @@ -35,7 +35,7 @@ For the DB Instance size, `Free tier` should be enough. ### Running the Signer on Fargate ECS Fargate is a container execution service provided by AWS. It runs containers without requiring explicit management of hosts or virtual machines. -Alternatively the signer service can be run using any other service that allows to run containers, such as EC2 or EKS. In the case of EC2, you will need to install docker, configure the instance profile and follow the documentation from [the signer readme](https://github.com/celo-org/celo-monorepo/tree/master/packages/phone-number-privacy/signer). +Alternatively the signer service can be run using any other service that allows to run containers, such as EC2 or EKS. In the case of EC2, you will need to install docker, configure the instance profile and follow the documentation from [the signer readme](https://github.com/celo-org/celo-monorepo/tree/master/apps/signer). 1. Create the service-linked role. If it is the first time you run ECS on your account you will need to run this command. @@ -44,7 +44,7 @@ Alternatively the signer service can be run using any other service that allows ``` 1. Create a Task Role for the signer ([documentation](https://docs.amazonaws.cn/en_us/AmazonECS/latest/userguide/ecs-cli-tutorial-fargate.html)). -First we will create the `assume-role` policy that allows ECS tasks to be assigned to this task role. +First we will create the `assume-role` policy that allows ECS tasks to be assigned to this task role. ```bash cat <<'EOF' > /tmp/task-execution-assume-role.json @@ -70,7 +70,7 @@ First we will create the `assume-role` policy that allows ECS tasks to be assign aws iam --region us-east-2 create-role --role-name signerTaskExecutionRole --assume-role-policy-document file:///tmp/task-execution-assume-role.json ``` - Finally we create the policy assigned to this task-role that allows retrieval of secrets from AWS Secret Manager. Then we attach that policy to the task role. + Finally we create the policy assigned to this task-role that allows retrieval of secrets from AWS Secret Manager. Then we attach that policy to the task role. ```bash cat <<'EOF' > /tmp/secret-manager-signer-policy.json diff --git a/packages/phone-number-privacy/signer/docs/deploy-on-azure.md b/apps/signer/docs/deploy-on-azure.md similarity index 100% rename from packages/phone-number-privacy/signer/docs/deploy-on-azure.md rename to apps/signer/docs/deploy-on-azure.md diff --git a/packages/phone-number-privacy/signer/docs/images/fargate-container-definition.png b/apps/signer/docs/images/fargate-container-definition.png similarity index 100% rename from packages/phone-number-privacy/signer/docs/images/fargate-container-definition.png rename to apps/signer/docs/images/fargate-container-definition.png diff --git a/packages/phone-number-privacy/signer/docs/images/fargate-service-definition.png b/apps/signer/docs/images/fargate-service-definition.png similarity index 100% rename from packages/phone-number-privacy/signer/docs/images/fargate-service-definition.png rename to apps/signer/docs/images/fargate-service-definition.png diff --git a/packages/phone-number-privacy/signer/docs/images/fargate-task-definition.png b/apps/signer/docs/images/fargate-task-definition.png similarity index 100% rename from packages/phone-number-privacy/signer/docs/images/fargate-task-definition.png rename to apps/signer/docs/images/fargate-task-definition.png diff --git a/packages/phone-number-privacy/signer/index.d.ts b/apps/signer/index.d.ts similarity index 100% rename from packages/phone-number-privacy/signer/index.d.ts rename to apps/signer/index.d.ts diff --git a/packages/phone-number-privacy/signer/jest.config.js b/apps/signer/jest.config.js similarity index 100% rename from packages/phone-number-privacy/signer/jest.config.js rename to apps/signer/jest.config.js diff --git a/packages/phone-number-privacy/signer/package.json b/apps/signer/package.json similarity index 100% rename from packages/phone-number-privacy/signer/package.json rename to apps/signer/package.json diff --git a/packages/phone-number-privacy/signer/scripts/create-ssl-cert.sh b/apps/signer/scripts/create-ssl-cert.sh similarity index 100% rename from packages/phone-number-privacy/signer/scripts/create-ssl-cert.sh rename to apps/signer/scripts/create-ssl-cert.sh diff --git a/packages/phone-number-privacy/signer/scripts/poprf-keygen.ts b/apps/signer/scripts/poprf-keygen.ts similarity index 100% rename from packages/phone-number-privacy/signer/scripts/poprf-keygen.ts rename to apps/signer/scripts/poprf-keygen.ts diff --git a/packages/phone-number-privacy/signer/scripts/run-migrations.ts b/apps/signer/scripts/run-migrations.ts similarity index 100% rename from packages/phone-number-privacy/signer/scripts/run-migrations.ts rename to apps/signer/scripts/run-migrations.ts diff --git a/packages/phone-number-privacy/signer/scripts/threshold-bls-keygen.ts b/apps/signer/scripts/threshold-bls-keygen.ts similarity index 100% rename from packages/phone-number-privacy/signer/scripts/threshold-bls-keygen.ts rename to apps/signer/scripts/threshold-bls-keygen.ts diff --git a/packages/phone-number-privacy/signer/src/common/bls/bls-cryptography-client.ts b/apps/signer/src/common/bls/bls-cryptography-client.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/bls/bls-cryptography-client.ts rename to apps/signer/src/common/bls/bls-cryptography-client.ts diff --git a/packages/phone-number-privacy/signer/src/common/context.ts b/apps/signer/src/common/context.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/context.ts rename to apps/signer/src/common/context.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/database.ts b/apps/signer/src/common/database/database.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/database.ts rename to apps/signer/src/common/database/database.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20200330212224_create-accounts-table.ts b/apps/signer/src/common/database/migrations/20200330212224_create-accounts-table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20200330212224_create-accounts-table.ts rename to apps/signer/src/common/database/migrations/20200330212224_create-accounts-table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20200811163913_create_requests_table.ts b/apps/signer/src/common/database/migrations/20200811163913_create_requests_table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20200811163913_create_requests_table.ts rename to apps/signer/src/common/database/migrations/20200811163913_create_requests_table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20210421212301_create-indices.ts b/apps/signer/src/common/database/migrations/20210421212301_create-indices.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20210421212301_create-indices.ts rename to apps/signer/src/common/database/migrations/20210421212301_create-indices.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20210921173354_create-domain-state.ts b/apps/signer/src/common/database/migrations/20210921173354_create-domain-state.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20210921173354_create-domain-state.ts rename to apps/signer/src/common/database/migrations/20210921173354_create-domain-state.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20220119165335_domain-requests.ts b/apps/signer/src/common/database/migrations/20220119165335_domain-requests.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20220119165335_domain-requests.ts rename to apps/signer/src/common/database/migrations/20220119165335_domain-requests.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20220923161710_pnp-requests-onchain.ts b/apps/signer/src/common/database/migrations/20220923161710_pnp-requests-onchain.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20220923161710_pnp-requests-onchain.ts rename to apps/signer/src/common/database/migrations/20220923161710_pnp-requests-onchain.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20220923165433_pnp-accounts-onchain.ts b/apps/signer/src/common/database/migrations/20220923165433_pnp-accounts-onchain.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20220923165433_pnp-accounts-onchain.ts rename to apps/signer/src/common/database/migrations/20220923165433_pnp-accounts-onchain.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20221102141044_change-name-domain-state.ts b/apps/signer/src/common/database/migrations/20221102141044_change-name-domain-state.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20221102141044_change-name-domain-state.ts rename to apps/signer/src/common/database/migrations/20221102141044_change-name-domain-state.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20221213125526_add-constraint-domain-requests.ts b/apps/signer/src/common/database/migrations/20221213125526_add-constraint-domain-requests.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20221213125526_add-constraint-domain-requests.ts rename to apps/signer/src/common/database/migrations/20221213125526_add-constraint-domain-requests.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818223141_rename-legacy-accounts-table.ts b/apps/signer/src/common/database/migrations/20230818223141_rename-legacy-accounts-table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818223141_rename-legacy-accounts-table.ts rename to apps/signer/src/common/database/migrations/20230818223141_rename-legacy-accounts-table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818223301_rename-legacy-requests-table.ts b/apps/signer/src/common/database/migrations/20230818223301_rename-legacy-requests-table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818223301_rename-legacy-requests-table.ts rename to apps/signer/src/common/database/migrations/20230818223301_rename-legacy-requests-table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818223359_drop-legacy-requests-table.ts b/apps/signer/src/common/database/migrations/20230818223359_drop-legacy-requests-table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818223359_drop-legacy-requests-table.ts rename to apps/signer/src/common/database/migrations/20230818223359_drop-legacy-requests-table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818223416_drop-legacy-accounts-table.ts b/apps/signer/src/common/database/migrations/20230818223416_drop-legacy-accounts-table.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818223416_drop-legacy-accounts-table.ts rename to apps/signer/src/common/database/migrations/20230818223416_drop-legacy-accounts-table.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818224022_drop-timestamp-from-requests-primary-key.ts b/apps/signer/src/common/database/migrations/20230818224022_drop-timestamp-from-requests-primary-key.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818224022_drop-timestamp-from-requests-primary-key.ts rename to apps/signer/src/common/database/migrations/20230818224022_drop-timestamp-from-requests-primary-key.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230818230722_drop-redundant-account-index.ts b/apps/signer/src/common/database/migrations/20230818230722_drop-redundant-account-index.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230818230722_drop-redundant-account-index.ts rename to apps/signer/src/common/database/migrations/20230818230722_drop-redundant-account-index.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230825150243_add_signature_request_column.ts b/apps/signer/src/common/database/migrations/20230825150243_add_signature_request_column.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230825150243_add_signature_request_column.ts rename to apps/signer/src/common/database/migrations/20230825150243_add_signature_request_column.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/migrations/20230828180024_add-request-timestamp-index.ts b/apps/signer/src/common/database/migrations/20230828180024_add-request-timestamp-index.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/migrations/20230828180024_add-request-timestamp-index.ts rename to apps/signer/src/common/database/migrations/20230828180024_add-request-timestamp-index.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/models/account.ts b/apps/signer/src/common/database/models/account.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/models/account.ts rename to apps/signer/src/common/database/models/account.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/models/domain-request.ts b/apps/signer/src/common/database/models/domain-request.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/models/domain-request.ts rename to apps/signer/src/common/database/models/domain-request.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/models/domain-state.ts b/apps/signer/src/common/database/models/domain-state.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/models/domain-state.ts rename to apps/signer/src/common/database/models/domain-state.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/models/request.ts b/apps/signer/src/common/database/models/request.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/models/request.ts rename to apps/signer/src/common/database/models/request.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/utils.ts b/apps/signer/src/common/database/utils.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/utils.ts rename to apps/signer/src/common/database/utils.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/wrappers/account.ts b/apps/signer/src/common/database/wrappers/account.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/wrappers/account.ts rename to apps/signer/src/common/database/wrappers/account.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/wrappers/domain-request.ts b/apps/signer/src/common/database/wrappers/domain-request.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/wrappers/domain-request.ts rename to apps/signer/src/common/database/wrappers/domain-request.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/wrappers/domain-state.ts b/apps/signer/src/common/database/wrappers/domain-state.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/wrappers/domain-state.ts rename to apps/signer/src/common/database/wrappers/domain-state.ts diff --git a/packages/phone-number-privacy/signer/src/common/database/wrappers/request.ts b/apps/signer/src/common/database/wrappers/request.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/database/wrappers/request.ts rename to apps/signer/src/common/database/wrappers/request.ts diff --git a/packages/phone-number-privacy/signer/src/common/error.ts b/apps/signer/src/common/error.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/error.ts rename to apps/signer/src/common/error.ts diff --git a/packages/phone-number-privacy/signer/src/common/handler.ts b/apps/signer/src/common/handler.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/handler.ts rename to apps/signer/src/common/handler.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/aws-key-provider.ts b/apps/signer/src/common/key-management/aws-key-provider.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/aws-key-provider.ts rename to apps/signer/src/common/key-management/aws-key-provider.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/azure-key-provider.ts b/apps/signer/src/common/key-management/azure-key-provider.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/azure-key-provider.ts rename to apps/signer/src/common/key-management/azure-key-provider.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/google-key-provider.ts b/apps/signer/src/common/key-management/google-key-provider.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/google-key-provider.ts rename to apps/signer/src/common/key-management/google-key-provider.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/key-provider-base.ts b/apps/signer/src/common/key-management/key-provider-base.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/key-provider-base.ts rename to apps/signer/src/common/key-management/key-provider-base.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/key-provider.ts b/apps/signer/src/common/key-management/key-provider.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/key-provider.ts rename to apps/signer/src/common/key-management/key-provider.ts diff --git a/packages/phone-number-privacy/signer/src/common/key-management/mock-key-provider.ts b/apps/signer/src/common/key-management/mock-key-provider.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/key-management/mock-key-provider.ts rename to apps/signer/src/common/key-management/mock-key-provider.ts diff --git a/packages/phone-number-privacy/signer/src/common/metrics.ts b/apps/signer/src/common/metrics.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/metrics.ts rename to apps/signer/src/common/metrics.ts diff --git a/packages/phone-number-privacy/signer/src/common/quota.ts b/apps/signer/src/common/quota.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/quota.ts rename to apps/signer/src/common/quota.ts diff --git a/packages/phone-number-privacy/signer/src/common/tracing-utils.ts b/apps/signer/src/common/tracing-utils.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/tracing-utils.ts rename to apps/signer/src/common/tracing-utils.ts diff --git a/packages/phone-number-privacy/signer/src/common/web3/contracts.ts b/apps/signer/src/common/web3/contracts.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/common/web3/contracts.ts rename to apps/signer/src/common/web3/contracts.ts diff --git a/packages/phone-number-privacy/signer/src/config.ts b/apps/signer/src/config.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/config.ts rename to apps/signer/src/config.ts diff --git a/packages/phone-number-privacy/signer/src/domain/endpoints/disable/action.ts b/apps/signer/src/domain/endpoints/disable/action.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/domain/endpoints/disable/action.ts rename to apps/signer/src/domain/endpoints/disable/action.ts diff --git a/packages/phone-number-privacy/signer/src/domain/endpoints/quota/action.ts b/apps/signer/src/domain/endpoints/quota/action.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/domain/endpoints/quota/action.ts rename to apps/signer/src/domain/endpoints/quota/action.ts diff --git a/packages/phone-number-privacy/signer/src/domain/endpoints/sign/action.ts b/apps/signer/src/domain/endpoints/sign/action.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/domain/endpoints/sign/action.ts rename to apps/signer/src/domain/endpoints/sign/action.ts diff --git a/packages/phone-number-privacy/signer/src/domain/services/quota.ts b/apps/signer/src/domain/services/quota.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/domain/services/quota.ts rename to apps/signer/src/domain/services/quota.ts diff --git a/packages/phone-number-privacy/signer/src/index.ts b/apps/signer/src/index.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/index.ts rename to apps/signer/src/index.ts diff --git a/packages/phone-number-privacy/signer/src/pnp/endpoints/quota/action.ts b/apps/signer/src/pnp/endpoints/quota/action.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/pnp/endpoints/quota/action.ts rename to apps/signer/src/pnp/endpoints/quota/action.ts diff --git a/packages/phone-number-privacy/signer/src/pnp/endpoints/sign/action.ts b/apps/signer/src/pnp/endpoints/sign/action.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/pnp/endpoints/sign/action.ts rename to apps/signer/src/pnp/endpoints/sign/action.ts diff --git a/packages/phone-number-privacy/signer/src/pnp/services/account-service.ts b/apps/signer/src/pnp/services/account-service.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/pnp/services/account-service.ts rename to apps/signer/src/pnp/services/account-service.ts diff --git a/packages/phone-number-privacy/signer/src/pnp/services/request-service.ts b/apps/signer/src/pnp/services/request-service.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/pnp/services/request-service.ts rename to apps/signer/src/pnp/services/request-service.ts diff --git a/packages/phone-number-privacy/signer/src/server.ts b/apps/signer/src/server.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/server.ts rename to apps/signer/src/server.ts diff --git a/packages/phone-number-privacy/signer/src/tracing.ts b/apps/signer/src/tracing.ts similarity index 100% rename from packages/phone-number-privacy/signer/src/tracing.ts rename to apps/signer/src/tracing.ts diff --git a/packages/phone-number-privacy/signer/test/end-to-end/disabled-apis.test.ts b/apps/signer/test/end-to-end/disabled-apis.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/end-to-end/disabled-apis.test.ts rename to apps/signer/test/end-to-end/disabled-apis.test.ts diff --git a/packages/phone-number-privacy/signer/test/end-to-end/domain.test.ts b/apps/signer/test/end-to-end/domain.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/end-to-end/domain.test.ts rename to apps/signer/test/end-to-end/domain.test.ts diff --git a/packages/phone-number-privacy/signer/test/end-to-end/pnp.test.ts b/apps/signer/test/end-to-end/pnp.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/end-to-end/pnp.test.ts rename to apps/signer/test/end-to-end/pnp.test.ts diff --git a/packages/phone-number-privacy/signer/test/end-to-end/utils.ts b/apps/signer/test/end-to-end/utils.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/end-to-end/utils.ts rename to apps/signer/test/end-to-end/utils.ts diff --git a/packages/phone-number-privacy/signer/test/integration/domain.test.ts b/apps/signer/test/integration/domain.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/integration/domain.test.ts rename to apps/signer/test/integration/domain.test.ts diff --git a/packages/phone-number-privacy/signer/test/integration/pnp.test.ts b/apps/signer/test/integration/pnp.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/integration/pnp.test.ts rename to apps/signer/test/integration/pnp.test.ts diff --git a/packages/phone-number-privacy/signer/test/key-management/aws-key-provider.test.ts b/apps/signer/test/key-management/aws-key-provider.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/key-management/aws-key-provider.test.ts rename to apps/signer/test/key-management/aws-key-provider.test.ts diff --git a/packages/phone-number-privacy/signer/test/key-management/azure-key-provider.test.ts b/apps/signer/test/key-management/azure-key-provider.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/key-management/azure-key-provider.test.ts rename to apps/signer/test/key-management/azure-key-provider.test.ts diff --git a/packages/phone-number-privacy/signer/test/key-management/google-key-provider.test.ts b/apps/signer/test/key-management/google-key-provider.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/key-management/google-key-provider.test.ts rename to apps/signer/test/key-management/google-key-provider.test.ts diff --git a/packages/phone-number-privacy/signer/test/pnp/services/request-service.test.ts b/apps/signer/test/pnp/services/request-service.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/pnp/services/request-service.test.ts rename to apps/signer/test/pnp/services/request-service.test.ts diff --git a/packages/phone-number-privacy/signer/test/signing/bls-signature.test.ts b/apps/signer/test/signing/bls-signature.test.ts similarity index 100% rename from packages/phone-number-privacy/signer/test/signing/bls-signature.test.ts rename to apps/signer/test/signing/bls-signature.test.ts diff --git a/packages/phone-number-privacy/signer/tsconfig.json b/apps/signer/tsconfig.json similarity index 100% rename from packages/phone-number-privacy/signer/tsconfig.json rename to apps/signer/tsconfig.json diff --git a/codecov.yml b/codecov.yml index 901e401c9..a672f250e 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,10 +5,10 @@ coverage: target: auto threshold: null removed_code_behavior: adjust_base - odis: + packages: paths: - - packages/phone-number-privacy - sdk: + - packages/ + apps: paths: - - packages/sdk + - apps/ patch: off diff --git a/dockerfiles/phone-number-privacy/Dockerfile-combiner b/dockerfiles/Dockerfile-combiner similarity index 69% rename from dockerfiles/phone-number-privacy/Dockerfile-combiner rename to dockerfiles/Dockerfile-combiner index 71ee105fe..9aed3381f 100644 --- a/dockerfiles/phone-number-privacy/Dockerfile-combiner +++ b/dockerfiles/Dockerfile-combiner @@ -5,10 +5,11 @@ FROM scratch AS packages # Assemble all dependencies into the packages folder so the second stage can select whether to # include all packages, or just the phone-number-privacy packages. WORKDIR /celo-phone-number-privacy/ -COPY packages/phone-number-privacy/combiner packages/phone-number-privacy/combiner -COPY packages/phone-number-privacy/common packages/phone-number-privacy/common -COPY packages/sdk/encrypted-backup packages/sdk/encrypted-backup -COPY packages/sdk/identity packages/sdk/identity +COPY apps/combiner apps/combiner +COPY apps/signer apps/signer +COPY packages/common packages/common +COPY packages/encrypted-backup packages/encrypted-backup +COPY packages/identity packages/identity COPY packages/odis-identifiers packages/odis-identifiers ##### Main stage @@ -28,17 +29,19 @@ COPY .git .git # phone-number-privacy package being copied into the image, and therefore it will only build using # published dependencies. Setting ONLY_PUBLISHED_DEPENDENCIES to "" will copy in all dependecies. ARG ONLY_PUBLISHED_DEPENDENCIES="" -ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+phone-number-privacy/combiner} -COPY --from=packages celo-phone-number-privacy/packages/${PACKAGE_SELECTOR} packages/${PACKAGE_SELECTOR} +ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+combiner} +COPY --from=packages celo-phone-number-privacy/packages/ packages/ +COPY --from=packages celo-phone-number-privacy/apps/${PACKAGE_SELECTOR} apps/${PACKAGE_SELECTOR} # Install dependencies and build. RUN yarn install --network-timeout 100000 --inline-builds && yarn cache clean +RUN yarn workspaces list RUN yarn workspaces foreach -ipv --topological-dev -R --from @celo/phone-number-privacy-combiner run build -RUN yarn workspaces focus @celo/phone-number-privacy-combiner --production + RUN rm -r .git # Setup and run the combiner application. ENV NODE_ENV production -WORKDIR /celo-phone-number-privacy/packages/phone-number-privacy/combiner +WORKDIR /celo-phone-number-privacy/apps/combiner EXPOSE 8080 ENTRYPOINT ["yarn", "start:docker"] diff --git a/dockerfiles/phone-number-privacy/Dockerfile-loadtest b/dockerfiles/Dockerfile-loadtest similarity index 73% rename from dockerfiles/phone-number-privacy/Dockerfile-loadtest rename to dockerfiles/Dockerfile-loadtest index 84bdaace5..a1cc4918c 100644 --- a/dockerfiles/phone-number-privacy/Dockerfile-loadtest +++ b/dockerfiles/Dockerfile-loadtest @@ -5,10 +5,10 @@ FROM scratch AS packages # Assemble all dependencies into the packages folder so the second stage can select whether to # include all packages, or just the phone-number-privacy packages. WORKDIR /celo-phone-number-privacy/ -COPY packages/phone-number-privacy/monitor packages/phone-number-privacy/monitor -COPY packages/phone-number-privacy/common packages/phone-number-privacy/common -COPY packages/sdk/encrypted-backup packages/sdk/encrypted-backup -COPY packages/sdk/identity packages/sdk/identity +COPY apps/monitor apps/monitor +COPY packages/common packages/common +COPY packages/encrypted-backup packages/encrypted-backup +COPY packages/identity packages/identity COPY packages/odis-identifiers packages/odis-identifiers ##### Main stage @@ -28,9 +28,8 @@ COPY .git .git # phone-number-privacy package being copied into the image, and therefore it will only build using # published dependencies. Setting ONLY_PUBLISHED_DEPENDENCIES to "" will copy in all dependecies. ARG ONLY_PUBLISHED_DEPENDENCIES="" -ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+phone-number-privacy/monitor} -COPY --from=packages celo-phone-number-privacy/packages/${PACKAGE_SELECTOR} packages/${PACKAGE_SELECTOR} - +ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+apps/monitor} +COPY --from=packages celo-phone-number-privacy/apps/${PACKAGE_SELECTOR} apps/${PACKAGE_SELECTOR} # Install dependencies and build. RUN yarn install --network-timeout 100000 --inline-builds && yarn cache clean @@ -41,6 +40,6 @@ RUN rm -r .git # Setup and run the signer application. ENV NODE_ENV production -WORKDIR /celo-phone-number-privacy/packages/phone-number-privacy/monitor +WORKDIR /celo-phone-number-privacy/apps/monitor EXPOSE 8080 ENTRYPOINT ["yarn", "loadTest"] diff --git a/dockerfiles/phone-number-privacy/Dockerfile-signer b/dockerfiles/Dockerfile-signer similarity index 74% rename from dockerfiles/phone-number-privacy/Dockerfile-signer rename to dockerfiles/Dockerfile-signer index d73c47342..aeb739210 100644 --- a/dockerfiles/phone-number-privacy/Dockerfile-signer +++ b/dockerfiles/Dockerfile-signer @@ -5,10 +5,10 @@ FROM scratch AS packages # Assemble all dependencies into the packages folder so the second stage can select whether to # include all packages, or just the phone-number-privacy packages. WORKDIR /celo-phone-number-privacy/ -COPY packages/phone-number-privacy/signer packages/phone-number-privacy/signer -COPY packages/phone-number-privacy/common packages/phone-number-privacy/common -COPY packages/sdk/encrypted-backup packages/sdk/encrypted-backup -COPY packages/sdk/identity packages/sdk/identity +COPY apps/signer apps/signer +COPY packages/common packages/common +COPY packages/encrypted-backup packages/encrypted-backup +COPY packages/identity packages/identity COPY packages/odis-identifiers packages/odis-identifiers ##### Main stage @@ -28,8 +28,8 @@ COPY .git .git # phone-number-privacy package being copied into the image, and therefore it will only build using # published dependencies. Setting ONLY_PUBLISHED_DEPENDENCIES to "" will copy in all dependecies. ARG ONLY_PUBLISHED_DEPENDENCIES="" -ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+phone-number-privacy/signer} -COPY --from=packages celo-phone-number-privacy/packages/${PACKAGE_SELECTOR} packages/${PACKAGE_SELECTOR} +ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+apps/signer} +COPY --from=packages celo-phone-number-privacy/apps/${PACKAGE_SELECTOR} apps/${PACKAGE_SELECTOR} # Install dependencies and build. need dev deps too so we can build (tsc) RUN yarn install --network-timeout 100000 --inline-builds && yarn cache clean @@ -40,6 +40,6 @@ RUN rm -r .git # Setup and run the signer application. ENV NODE_ENV production -WORKDIR /celo-phone-number-privacy/packages/phone-number-privacy/signer +WORKDIR /celo-phone-number-privacy/apps/signer EXPOSE 8080 ENTRYPOINT ["yarn", "start:docker"] diff --git a/docs/privacy.md b/docs/privacy.md index b913c663d..93071357c 100644 --- a/docs/privacy.md +++ b/docs/privacy.md @@ -31,7 +31,7 @@ Below describes the steps to derive the *obfuscated identifier*, which is public |**pepper**| Unique secret, obtained by taking the first 13 characters of the sha256 hash of the *unblinded signature*| |**obfuscated identifier**| Identifier used for on-chain attestations, obtained by hashing the *plaintext identifier*, *identifier prefix*, and *pepper* using this schema: `sha3(sha3({prefix}://{plaintextIdentifier})__{pepper})`. For backwards compatibility, identifiers that are phone numbers use this schema: `sha3({prefix}://{plaintextIdentifier}__{pepper})`| -You can see these steps implemented in the `@celo/identity` sdk [here](https://github.com/celo-org/socialconnect/blob/main/packages/sdk/identity/src/odis/identifier.ts). +You can see these steps implemented in the `@celo/identity` sdk [here](https://github.com/celo-org/socialconnect/blob/main/packages/identity/src/odis/identifier.ts). Here is a concrete example: @@ -45,7 +45,7 @@ Here is a concrete example: Each identifier type has a corresponding prefix that is appended before the blinding and hashing. This prevents identifiers from different sources from having the same pepper (ie. if you have the same handle for twitter and instagram, the obfuscated identifier should be different for each). -These are the prefixes currently defined in the SDK. We are using [DID methods](https://w3c.github.io/did-spec-registries/#did-methods) as prefixes when they exist. We welcome PRs here and [in the SDK](https://github.com/celo-org/celo-monorepo/blob/master/packages/sdk/identity/src/odis/identifier.ts#L27-L34) if you'd like to add a new identifier type and prefix! You can also cast an arbitrary string as your prefix if you would like. +These are the prefixes currently defined in the SDK. We are using [DID methods](https://w3c.github.io/did-spec-registries/#did-methods) as prefixes when they exist. We welcome PRs here and [in the SDK](https://github.com/celo-org/celo-monorepo/blob/master/packages/identity/src/odis/identifier.ts#L27-L34) if you'd like to add a new identifier type and prefix! You can also cast an arbitrary string as your prefix if you would like. | Type | Prefix | |---------|--------| @@ -169,7 +169,7 @@ await OdisUtils.Identifier.getObfuscatedIdentifier( // unblindedSignature: '9as8duf98as...df80u' // } ``` -*Source code for `getObfuscatedIdentifier` and other relevant functions [here](https://github.com/celo-org/celo-monorepo/blob/master/packages/sdk/identity/src/odis/identifier.ts)* +*Source code for `getObfuscatedIdentifier` and other relevant functions [here](https://github.com/celo-org/celo-monorepo/blob/master/packages/identity/src/odis/identifier.ts)* ------------- diff --git a/package.json b/package.json index 690b4fe05..a8c7a67e5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "reset-modules": "rm -rf node_modules/ packages/*/node_modules", "reset-yarn": "yarn cache clean", "test": "yarn workspaces foreach --all run test", - "test:fast": "yarn workspaces foreach -ip --since --exclude '{odis,packages/phone-number-privacy/combiner}' run test", + "test:fast": "yarn workspaces foreach -ip --since --exclude '{odis,apps/combiner}' run test", "build": "yarn workspaces foreach --all -pitv run build", "build:fast": "yarn workspaces foreach -pitv --since run build", "clean": "yarn workspaces foreach --all -piv run clean", @@ -32,8 +32,7 @@ }, "workspaces": [ "packages/*", - "packages/phone-number-privacy/*", - "packages/sdk/*", + "apps/*", "docs/examples" ], "devDependencies": { diff --git a/packages/phone-number-privacy/common/.gitignore b/packages/common/.gitignore similarity index 100% rename from packages/phone-number-privacy/common/.gitignore rename to packages/common/.gitignore diff --git a/packages/phone-number-privacy/common/CHANGELOG.md b/packages/common/CHANGELOG.md similarity index 100% rename from packages/phone-number-privacy/common/CHANGELOG.md rename to packages/common/CHANGELOG.md diff --git a/packages/phone-number-privacy/common/README.md b/packages/common/README.md similarity index 100% rename from packages/phone-number-privacy/common/README.md rename to packages/common/README.md diff --git a/packages/phone-number-privacy/common/bunyan-debug.d.ts b/packages/common/bunyan-debug.d.ts similarity index 100% rename from packages/phone-number-privacy/common/bunyan-debug.d.ts rename to packages/common/bunyan-debug.d.ts diff --git a/packages/phone-number-privacy/common/jest.config.js b/packages/common/jest.config.js similarity index 100% rename from packages/phone-number-privacy/common/jest.config.js rename to packages/common/jest.config.js diff --git a/packages/phone-number-privacy/common/package.json b/packages/common/package.json similarity index 100% rename from packages/phone-number-privacy/common/package.json rename to packages/common/package.json diff --git a/packages/phone-number-privacy/common/src/domains/constants.ts b/packages/common/src/domains/constants.ts similarity index 100% rename from packages/phone-number-privacy/common/src/domains/constants.ts rename to packages/common/src/domains/constants.ts diff --git a/packages/phone-number-privacy/common/src/domains/domains.ts b/packages/common/src/domains/domains.ts similarity index 100% rename from packages/phone-number-privacy/common/src/domains/domains.ts rename to packages/common/src/domains/domains.ts diff --git a/packages/phone-number-privacy/common/src/domains/index.ts b/packages/common/src/domains/index.ts similarity index 100% rename from packages/phone-number-privacy/common/src/domains/index.ts rename to packages/common/src/domains/index.ts diff --git a/packages/phone-number-privacy/common/src/domains/sequential-delay.ts b/packages/common/src/domains/sequential-delay.ts similarity index 100% rename from packages/phone-number-privacy/common/src/domains/sequential-delay.ts rename to packages/common/src/domains/sequential-delay.ts diff --git a/packages/phone-number-privacy/common/src/index.ts b/packages/common/src/index.ts similarity index 100% rename from packages/phone-number-privacy/common/src/index.ts rename to packages/common/src/index.ts diff --git a/packages/phone-number-privacy/common/src/interfaces/endpoints.ts b/packages/common/src/interfaces/endpoints.ts similarity index 100% rename from packages/phone-number-privacy/common/src/interfaces/endpoints.ts rename to packages/common/src/interfaces/endpoints.ts diff --git a/packages/phone-number-privacy/common/src/interfaces/errors.ts b/packages/common/src/interfaces/errors.ts similarity index 100% rename from packages/phone-number-privacy/common/src/interfaces/errors.ts rename to packages/common/src/interfaces/errors.ts diff --git a/packages/phone-number-privacy/common/src/interfaces/index.ts b/packages/common/src/interfaces/index.ts similarity index 100% rename from packages/phone-number-privacy/common/src/interfaces/index.ts rename to packages/common/src/interfaces/index.ts diff --git a/packages/phone-number-privacy/common/src/interfaces/requests.ts b/packages/common/src/interfaces/requests.ts similarity index 100% rename from packages/phone-number-privacy/common/src/interfaces/requests.ts rename to packages/common/src/interfaces/requests.ts diff --git a/packages/phone-number-privacy/common/src/interfaces/responses.ts b/packages/common/src/interfaces/responses.ts similarity index 100% rename from packages/phone-number-privacy/common/src/interfaces/responses.ts rename to packages/common/src/interfaces/responses.ts diff --git a/packages/phone-number-privacy/common/src/poprf.ts b/packages/common/src/poprf.ts similarity index 100% rename from packages/phone-number-privacy/common/src/poprf.ts rename to packages/common/src/poprf.ts diff --git a/packages/phone-number-privacy/common/src/test/index.ts b/packages/common/src/test/index.ts similarity index 100% rename from packages/phone-number-privacy/common/src/test/index.ts rename to packages/common/src/test/index.ts diff --git a/packages/phone-number-privacy/common/src/test/utils.ts b/packages/common/src/test/utils.ts similarity index 100% rename from packages/phone-number-privacy/common/src/test/utils.ts rename to packages/common/src/test/utils.ts diff --git a/packages/phone-number-privacy/common/src/test/values.ts b/packages/common/src/test/values.ts similarity index 100% rename from packages/phone-number-privacy/common/src/test/values.ts rename to packages/common/src/test/values.ts diff --git a/packages/phone-number-privacy/common/src/utils/authentication.ts b/packages/common/src/utils/authentication.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/authentication.ts rename to packages/common/src/utils/authentication.ts diff --git a/packages/phone-number-privacy/common/src/utils/config.utils.ts b/packages/common/src/utils/config.utils.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/config.utils.ts rename to packages/common/src/utils/config.utils.ts diff --git a/packages/phone-number-privacy/common/src/utils/constants.ts b/packages/common/src/utils/constants.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/constants.ts rename to packages/common/src/utils/constants.ts diff --git a/packages/phone-number-privacy/common/src/utils/contracts.ts b/packages/common/src/utils/contracts.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/contracts.ts rename to packages/common/src/utils/contracts.ts diff --git a/packages/phone-number-privacy/common/src/utils/input-validation.ts b/packages/common/src/utils/input-validation.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/input-validation.ts rename to packages/common/src/utils/input-validation.ts diff --git a/packages/phone-number-privacy/common/src/utils/key-version.ts b/packages/common/src/utils/key-version.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/key-version.ts rename to packages/common/src/utils/key-version.ts diff --git a/packages/phone-number-privacy/common/src/utils/logger.ts b/packages/common/src/utils/logger.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/logger.ts rename to packages/common/src/utils/logger.ts diff --git a/packages/phone-number-privacy/common/src/utils/responses.utils.ts b/packages/common/src/utils/responses.utils.ts similarity index 100% rename from packages/phone-number-privacy/common/src/utils/responses.utils.ts rename to packages/common/src/utils/responses.utils.ts diff --git a/packages/phone-number-privacy/common/test/domains.test.ts b/packages/common/test/domains.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/domains.test.ts rename to packages/common/test/domains.test.ts diff --git a/packages/phone-number-privacy/common/test/interfaces/requests.test.ts b/packages/common/test/interfaces/requests.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/interfaces/requests.test.ts rename to packages/common/test/interfaces/requests.test.ts diff --git a/packages/phone-number-privacy/common/test/poprf.test.ts b/packages/common/test/poprf.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/poprf.test.ts rename to packages/common/test/poprf.test.ts diff --git a/packages/phone-number-privacy/common/test/utils/authentication.test.ts b/packages/common/test/utils/authentication.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/utils/authentication.test.ts rename to packages/common/test/utils/authentication.test.ts diff --git a/packages/phone-number-privacy/common/test/utils/input-validation.test.ts b/packages/common/test/utils/input-validation.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/utils/input-validation.test.ts rename to packages/common/test/utils/input-validation.test.ts diff --git a/packages/phone-number-privacy/common/test/utils/key-version.test.ts b/packages/common/test/utils/key-version.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/utils/key-version.test.ts rename to packages/common/test/utils/key-version.test.ts diff --git a/packages/phone-number-privacy/common/test/utils/sequential-delay.test.ts b/packages/common/test/utils/sequential-delay.test.ts similarity index 100% rename from packages/phone-number-privacy/common/test/utils/sequential-delay.test.ts rename to packages/common/test/utils/sequential-delay.test.ts diff --git a/packages/phone-number-privacy/common/tsconfig.json b/packages/common/tsconfig.json similarity index 100% rename from packages/phone-number-privacy/common/tsconfig.json rename to packages/common/tsconfig.json diff --git a/packages/phone-number-privacy/common/tsconfig.test.json b/packages/common/tsconfig.test.json similarity index 100% rename from packages/phone-number-privacy/common/tsconfig.test.json rename to packages/common/tsconfig.test.json diff --git a/packages/sdk/encrypted-backup/.gitignore b/packages/encrypted-backup/.gitignore similarity index 100% rename from packages/sdk/encrypted-backup/.gitignore rename to packages/encrypted-backup/.gitignore diff --git a/packages/sdk/encrypted-backup/.npmignore b/packages/encrypted-backup/.npmignore similarity index 100% rename from packages/sdk/encrypted-backup/.npmignore rename to packages/encrypted-backup/.npmignore diff --git a/packages/sdk/encrypted-backup/README.md b/packages/encrypted-backup/README.md similarity index 100% rename from packages/sdk/encrypted-backup/README.md rename to packages/encrypted-backup/README.md diff --git a/packages/sdk/encrypted-backup/jest.config.js b/packages/encrypted-backup/jest.config.js similarity index 100% rename from packages/sdk/encrypted-backup/jest.config.js rename to packages/encrypted-backup/jest.config.js diff --git a/packages/sdk/encrypted-backup/jestSetup.ts b/packages/encrypted-backup/jestSetup.ts similarity index 100% rename from packages/sdk/encrypted-backup/jestSetup.ts rename to packages/encrypted-backup/jestSetup.ts diff --git a/packages/sdk/encrypted-backup/package.json b/packages/encrypted-backup/package.json similarity index 97% rename from packages/sdk/encrypted-backup/package.json rename to packages/encrypted-backup/package.json index 3675bcf0b..de4e47b61 100644 --- a/packages/sdk/encrypted-backup/package.json +++ b/packages/encrypted-backup/package.json @@ -7,7 +7,7 @@ "author": "Celo", "license": "Apache-2.0", "homepage": "https://celo-sdk-docs.readthedocs.io/en/latest/encrypted-backup", - "repository": "https://github.com/celo-org/social-connect/tree/main/packages/sdk/encrypted-backup", + "repository": "https://github.com/celo-org/social-connect/tree/main/packages/encrypted-backup", "keywords": [ "celo", "blockchain", diff --git a/packages/sdk/encrypted-backup/src/backup.test.ts b/packages/encrypted-backup/src/backup.test.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/backup.test.ts rename to packages/encrypted-backup/src/backup.test.ts diff --git a/packages/sdk/encrypted-backup/src/backup.ts b/packages/encrypted-backup/src/backup.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/backup.ts rename to packages/encrypted-backup/src/backup.ts diff --git a/packages/sdk/encrypted-backup/src/config.ts b/packages/encrypted-backup/src/config.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/config.ts rename to packages/encrypted-backup/src/config.ts diff --git a/packages/sdk/encrypted-backup/src/errors.ts b/packages/encrypted-backup/src/errors.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/errors.ts rename to packages/encrypted-backup/src/errors.ts diff --git a/packages/sdk/encrypted-backup/src/globals.d.ts b/packages/encrypted-backup/src/globals.d.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/globals.d.ts rename to packages/encrypted-backup/src/globals.d.ts diff --git a/packages/sdk/encrypted-backup/src/index.ts b/packages/encrypted-backup/src/index.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/index.ts rename to packages/encrypted-backup/src/index.ts diff --git a/packages/sdk/encrypted-backup/src/odis.mock.ts b/packages/encrypted-backup/src/odis.mock.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/odis.mock.ts rename to packages/encrypted-backup/src/odis.mock.ts diff --git a/packages/sdk/encrypted-backup/src/odis.ts b/packages/encrypted-backup/src/odis.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/odis.ts rename to packages/encrypted-backup/src/odis.ts diff --git a/packages/sdk/encrypted-backup/src/schema.ts b/packages/encrypted-backup/src/schema.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/schema.ts rename to packages/encrypted-backup/src/schema.ts diff --git a/packages/sdk/encrypted-backup/src/utils.ts b/packages/encrypted-backup/src/utils.ts similarity index 100% rename from packages/sdk/encrypted-backup/src/utils.ts rename to packages/encrypted-backup/src/utils.ts diff --git a/packages/sdk/encrypted-backup/tsconfig.json b/packages/encrypted-backup/tsconfig.json similarity index 100% rename from packages/sdk/encrypted-backup/tsconfig.json rename to packages/encrypted-backup/tsconfig.json diff --git a/packages/sdk/encrypted-backup/typedoc.json b/packages/encrypted-backup/typedoc.json similarity index 100% rename from packages/sdk/encrypted-backup/typedoc.json rename to packages/encrypted-backup/typedoc.json diff --git a/packages/sdk/identity/.gitignore b/packages/identity/.gitignore similarity index 100% rename from packages/sdk/identity/.gitignore rename to packages/identity/.gitignore diff --git a/packages/sdk/identity/.npmignore b/packages/identity/.npmignore similarity index 100% rename from packages/sdk/identity/.npmignore rename to packages/identity/.npmignore diff --git a/packages/sdk/identity/CHANGELOG.md b/packages/identity/CHANGELOG.md similarity index 100% rename from packages/sdk/identity/CHANGELOG.md rename to packages/identity/CHANGELOG.md diff --git a/packages/sdk/identity/README.md b/packages/identity/README.md similarity index 100% rename from packages/sdk/identity/README.md rename to packages/identity/README.md diff --git a/packages/sdk/identity/jest.config.js b/packages/identity/jest.config.js similarity index 100% rename from packages/sdk/identity/jest.config.js rename to packages/identity/jest.config.js diff --git a/packages/sdk/identity/package.json b/packages/identity/package.json similarity index 98% rename from packages/sdk/identity/package.json rename to packages/identity/package.json index 83c2672d6..db0b57681 100644 --- a/packages/sdk/identity/package.json +++ b/packages/identity/package.json @@ -7,7 +7,7 @@ "author": "Celo", "license": "Apache-2.0", "homepage": "https://celo-sdk-docs.readthedocs.io/en/latest/identity", - "repository": "https://github.com/celo-org/social-connect/tree/main/packages/sdk/identity", + "repository": "https://github.com/celo-org/social-connect/tree/main/packages/identity", "keywords": [ "celo", "blockchain", diff --git a/packages/sdk/identity/src/__mocks__/cross-fetch.ts b/packages/identity/src/__mocks__/cross-fetch.ts similarity index 100% rename from packages/sdk/identity/src/__mocks__/cross-fetch.ts rename to packages/identity/src/__mocks__/cross-fetch.ts diff --git a/packages/sdk/identity/src/index.ts b/packages/identity/src/index.ts similarity index 100% rename from packages/sdk/identity/src/index.ts rename to packages/identity/src/index.ts diff --git a/packages/sdk/identity/src/odis/bls-blinding-client.ts b/packages/identity/src/odis/bls-blinding-client.ts similarity index 100% rename from packages/sdk/identity/src/odis/bls-blinding-client.ts rename to packages/identity/src/odis/bls-blinding-client.ts diff --git a/packages/sdk/identity/src/odis/circuit-breaker.mock.ts b/packages/identity/src/odis/circuit-breaker.mock.ts similarity index 100% rename from packages/sdk/identity/src/odis/circuit-breaker.mock.ts rename to packages/identity/src/odis/circuit-breaker.mock.ts diff --git a/packages/sdk/identity/src/odis/circuit-breaker.test.ts b/packages/identity/src/odis/circuit-breaker.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/circuit-breaker.test.ts rename to packages/identity/src/odis/circuit-breaker.test.ts diff --git a/packages/sdk/identity/src/odis/circuit-breaker.ts b/packages/identity/src/odis/circuit-breaker.ts similarity index 100% rename from packages/sdk/identity/src/odis/circuit-breaker.ts rename to packages/identity/src/odis/circuit-breaker.ts diff --git a/packages/sdk/identity/src/odis/identifier-backwards-compatibility.test.ts b/packages/identity/src/odis/identifier-backwards-compatibility.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/identifier-backwards-compatibility.test.ts rename to packages/identity/src/odis/identifier-backwards-compatibility.test.ts diff --git a/packages/sdk/identity/src/odis/identifier.test.ts b/packages/identity/src/odis/identifier.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/identifier.test.ts rename to packages/identity/src/odis/identifier.test.ts diff --git a/packages/sdk/identity/src/odis/identifier.ts b/packages/identity/src/odis/identifier.ts similarity index 100% rename from packages/sdk/identity/src/odis/identifier.ts rename to packages/identity/src/odis/identifier.ts diff --git a/packages/sdk/identity/src/odis/index.ts b/packages/identity/src/odis/index.ts similarity index 100% rename from packages/sdk/identity/src/odis/index.ts rename to packages/identity/src/odis/index.ts diff --git a/packages/sdk/identity/src/odis/phone-number-identifier.test.ts b/packages/identity/src/odis/phone-number-identifier.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/phone-number-identifier.test.ts rename to packages/identity/src/odis/phone-number-identifier.test.ts diff --git a/packages/sdk/identity/src/odis/phone-number-identifier.ts b/packages/identity/src/odis/phone-number-identifier.ts similarity index 100% rename from packages/sdk/identity/src/odis/phone-number-identifier.ts rename to packages/identity/src/odis/phone-number-identifier.ts diff --git a/packages/sdk/identity/src/odis/query.test.ts b/packages/identity/src/odis/query.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/query.test.ts rename to packages/identity/src/odis/query.test.ts diff --git a/packages/sdk/identity/src/odis/query.ts b/packages/identity/src/odis/query.ts similarity index 100% rename from packages/sdk/identity/src/odis/query.ts rename to packages/identity/src/odis/query.ts diff --git a/packages/sdk/identity/src/odis/quota.test.ts b/packages/identity/src/odis/quota.test.ts similarity index 100% rename from packages/sdk/identity/src/odis/quota.test.ts rename to packages/identity/src/odis/quota.test.ts diff --git a/packages/sdk/identity/src/odis/quota.ts b/packages/identity/src/odis/quota.ts similarity index 100% rename from packages/sdk/identity/src/odis/quota.ts rename to packages/identity/src/odis/quota.ts diff --git a/packages/sdk/identity/src/offchain-data-wrapper.test.ts b/packages/identity/src/offchain-data-wrapper.test.ts similarity index 100% rename from packages/sdk/identity/src/offchain-data-wrapper.test.ts rename to packages/identity/src/offchain-data-wrapper.test.ts diff --git a/packages/sdk/identity/src/offchain-data-wrapper.ts b/packages/identity/src/offchain-data-wrapper.ts similarity index 100% rename from packages/sdk/identity/src/offchain-data-wrapper.ts rename to packages/identity/src/offchain-data-wrapper.ts diff --git a/packages/sdk/identity/src/offchain/accessors/authorized-signer.ts b/packages/identity/src/offchain/accessors/authorized-signer.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/authorized-signer.ts rename to packages/identity/src/offchain/accessors/authorized-signer.ts diff --git a/packages/sdk/identity/src/offchain/accessors/binary.ts b/packages/identity/src/offchain/accessors/binary.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/binary.ts rename to packages/identity/src/offchain/accessors/binary.ts diff --git a/packages/sdk/identity/src/offchain/accessors/errors.ts b/packages/identity/src/offchain/accessors/errors.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/errors.ts rename to packages/identity/src/offchain/accessors/errors.ts diff --git a/packages/sdk/identity/src/offchain/accessors/interfaces.ts b/packages/identity/src/offchain/accessors/interfaces.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/interfaces.ts rename to packages/identity/src/offchain/accessors/interfaces.ts diff --git a/packages/sdk/identity/src/offchain/accessors/name.ts b/packages/identity/src/offchain/accessors/name.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/name.ts rename to packages/identity/src/offchain/accessors/name.ts diff --git a/packages/sdk/identity/src/offchain/accessors/pictures.ts b/packages/identity/src/offchain/accessors/pictures.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/pictures.ts rename to packages/identity/src/offchain/accessors/pictures.ts diff --git a/packages/sdk/identity/src/offchain/accessors/simple.ts b/packages/identity/src/offchain/accessors/simple.ts similarity index 100% rename from packages/sdk/identity/src/offchain/accessors/simple.ts rename to packages/identity/src/offchain/accessors/simple.ts diff --git a/packages/sdk/identity/src/offchain/storage-writers.ts b/packages/identity/src/offchain/storage-writers.ts similarity index 100% rename from packages/sdk/identity/src/offchain/storage-writers.ts rename to packages/identity/src/offchain/storage-writers.ts diff --git a/packages/sdk/identity/src/offchain/utils.ts b/packages/identity/src/offchain/utils.ts similarity index 100% rename from packages/sdk/identity/src/offchain/utils.ts rename to packages/identity/src/offchain/utils.ts diff --git a/packages/sdk/identity/src/test-utils/setup.global.ts b/packages/identity/src/test-utils/setup.global.ts similarity index 100% rename from packages/sdk/identity/src/test-utils/setup.global.ts rename to packages/identity/src/test-utils/setup.global.ts diff --git a/packages/sdk/identity/src/test-utils/teardown.global.ts b/packages/identity/src/test-utils/teardown.global.ts similarity index 100% rename from packages/sdk/identity/src/test-utils/teardown.global.ts rename to packages/identity/src/test-utils/teardown.global.ts diff --git a/packages/sdk/identity/tsconfig.json b/packages/identity/tsconfig.json similarity index 100% rename from packages/sdk/identity/tsconfig.json rename to packages/identity/tsconfig.json diff --git a/packages/sdk/identity/typedoc.json b/packages/identity/typedoc.json similarity index 100% rename from packages/sdk/identity/typedoc.json rename to packages/identity/typedoc.json diff --git a/tsconfig.json b/tsconfig.json index e2a35dfe3..53172e818 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,12 +8,12 @@ ], "references": [ {"path":"./docs/examples","name":"odis-example-scripts"}, - {"path":"./packages/phone-number-privacy/combiner","name":"@celo/phone-number-privacy-combiner"}, - {"path":"./packages/phone-number-privacy/common","name":"@celo/phone-number-privacy-common"}, - {"path":"./packages/phone-number-privacy/monitor","name":"@celo/phone-number-privacy-monitor"}, - {"path":"./packages/phone-number-privacy/signer","name":"@celo/phone-number-privacy-signer"}, - {"path":"./packages/sdk/encrypted-backup","name":"@celo/encrypted-backup"}, - {"path":"./packages/sdk/identity","name":"@celo/identity"}, + {"path":"./apps/combiner","name":"@celo/phone-number-privacy-combiner"}, + {"path":"./packages/common","name":"@celo/phone-number-privacy-common"}, + {"path":"./apps/monitor","name":"@celo/phone-number-privacy-monitor"}, + {"path":"./apps/signer","name":"@celo/phone-number-privacy-signer"}, + {"path":"./packages/encrypted-backup","name":"@celo/encrypted-backup"}, + {"path":"./packages/identity","name":"@celo/identity"}, ] } diff --git a/yarn.lock b/yarn.lock index dc82fdb17..28e599072 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1772,9 +1772,9 @@ __metadata: languageName: node linkType: hard -"@celo/encrypted-backup@npm:^5.0.4, @celo/encrypted-backup@workspace:packages/sdk/encrypted-backup": +"@celo/encrypted-backup@npm:^5.0.4, @celo/encrypted-backup@workspace:packages/encrypted-backup": version: 0.0.0-use.local - resolution: "@celo/encrypted-backup@workspace:packages/sdk/encrypted-backup" + resolution: "@celo/encrypted-backup@workspace:packages/encrypted-backup" dependencies: "@celo/base": "npm:^5.0.4" "@celo/connect": "npm:^5.0.4" @@ -1793,9 +1793,9 @@ __metadata: languageName: unknown linkType: soft -"@celo/identity@npm:^5.0.4, @celo/identity@workspace:packages/sdk/identity": +"@celo/identity@npm:^5.0.4, @celo/identity@workspace:packages/identity": version: 0.0.0-use.local - resolution: "@celo/identity@workspace:packages/sdk/identity" + resolution: "@celo/identity@workspace:packages/identity" dependencies: "@celo/base": "npm:^5.0.4" "@celo/celo-devchain": "npm:6.0.0" @@ -1830,15 +1830,16 @@ __metadata: languageName: unknown linkType: soft -"@celo/phone-number-privacy-combiner@workspace:packages/phone-number-privacy/combiner": +"@celo/phone-number-privacy-combiner@workspace:apps/combiner": version: 0.0.0-use.local - resolution: "@celo/phone-number-privacy-combiner@workspace:packages/phone-number-privacy/combiner" + resolution: "@celo/phone-number-privacy-combiner@workspace:apps/combiner" dependencies: "@celo/base": "npm:^5.0.4" "@celo/contractkit": "npm:^5.0.4" "@celo/encrypted-backup": "npm:^5.0.4" "@celo/identity": "npm:^5.0.4" "@celo/phone-number-privacy-common": "npm:^3.1.0" + "@celo/phone-number-privacy-signer": "workspace:^" "@celo/phone-utils": "npm:^5.0.4" "@celo/poprf": "npm:^0.1.9" "@celo/utils": "npm:^5.0.4" @@ -1894,9 +1895,9 @@ __metadata: languageName: node linkType: hard -"@celo/phone-number-privacy-common@npm:^3.0.3, @celo/phone-number-privacy-common@npm:^3.1.0, @celo/phone-number-privacy-common@workspace:packages/phone-number-privacy/common": +"@celo/phone-number-privacy-common@npm:^3.0.3, @celo/phone-number-privacy-common@npm:^3.1.0, @celo/phone-number-privacy-common@workspace:packages/common": version: 0.0.0-use.local - resolution: "@celo/phone-number-privacy-common@workspace:packages/phone-number-privacy/common" + resolution: "@celo/phone-number-privacy-common@workspace:packages/common" dependencies: "@celo/base": "npm:^5.0.4" "@celo/contractkit": "npm:^5.0.4" @@ -1931,9 +1932,9 @@ __metadata: languageName: unknown linkType: soft -"@celo/phone-number-privacy-monitor@workspace:packages/phone-number-privacy/monitor": +"@celo/phone-number-privacy-monitor@workspace:apps/monitor": version: 0.0.0-use.local - resolution: "@celo/phone-number-privacy-monitor@workspace:packages/phone-number-privacy/monitor" + resolution: "@celo/phone-number-privacy-monitor@workspace:apps/monitor" dependencies: "@celo/base": "npm:^5.0.4" "@celo/contractkit": "npm:^5.0.4" @@ -1952,9 +1953,9 @@ __metadata: languageName: unknown linkType: soft -"@celo/phone-number-privacy-signer@workspace:packages/phone-number-privacy/signer": +"@celo/phone-number-privacy-signer@workspace:^, @celo/phone-number-privacy-signer@workspace:apps/signer": version: 0.0.0-use.local - resolution: "@celo/phone-number-privacy-signer@workspace:packages/phone-number-privacy/signer" + resolution: "@celo/phone-number-privacy-signer@workspace:apps/signer" dependencies: "@celo/base": "npm:^5.0.4" "@celo/contractkit": "npm:^5.0.4"