diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 5374436..bec1610 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -1,85 +1,85 @@ -name: 'Pipeline' +name: "Pipeline" on: - push: - branches: ['main'] - - pull_request: - types: [opened, synchronize] - - workflow_dispatch: - inputs: - release-type: - description: 'Type of release (major, minor, patch, alpha)' - required: true - default: alpha - type: choice - options: - - major - - minor - - patch - - alpha + push: + branches: ["main"] + + pull_request: + types: [opened, synchronize] + + workflow_dispatch: + inputs: + release-type: + description: "Type of release (major, minor, patch, alpha)" + required: true + default: alpha + type: choice + options: + - major + - minor + - patch + - alpha jobs: - continous-integration: - name: 'Continuous Integration' - runs-on: ubuntu-latest + continous-integration: + name: "Continuous Integration" + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8.6.0 + - uses: pnpm/action-setup@v2 + with: + version: 8.6.0 - - name: Install dependencies - run: pnpm install + - name: Install dependencies + run: pnpm install - - name: Check formatting - run: pnpm check-format + - name: Check formatting + run: pnpm check-format - - name: Check types - run: pnpm check-types + - name: Check types + run: pnpm check-types - - name: Test - run: pnpm test + - name: Test + run: pnpm test - continious-deployment: - if: github.event_name == 'workflow_dispatch' + continious-deployment: + if: github.event_name == 'workflow_dispatch' - name: 'Continous Deployment' - runs-on: ubuntu-latest - needs: ['continous-integration'] + name: "Continous Deployment" + runs-on: ubuntu-latest + needs: ["continous-integration"] - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8.6.0 + - uses: pnpm/action-setup@v2 + with: + version: 8.6.0 - - name: Install dependencies - run: pnpm install + - name: Install dependencies + run: pnpm install - - name: Build - run: pnpm build + - name: Build + run: pnpm build - - name: Initialise the NPM config - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN + - name: Initialise the NPM config + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN - - name: Publish - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo ${{ inputs.release-type }} - git config --global user.email "development@animo.id" - git config --global user.name "Animo Bot" + - name: Publish + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo ${{ inputs.release-type }} + git config --global user.email "development@animo.id" + git config --global user.name "Animo Bot" - if [ ${{ inputs.release-type }} == 'alpha' ]; then - pnpm release --preRelease=${{ inputs.release-type }} --npm.tag=latest - else - pnpm release ${{ inputs.release-type }} - fi + if [ ${{ inputs.release-type }} == 'alpha' ]; then + pnpm release --preRelease=${{ inputs.release-type }} --npm.tag=latest + else + pnpm release ${{ inputs.release-type }} + fi diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..bf17638 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, +body size, disability, ethnicity, gender identity and expression, level of +experience, nationality, personal appearance, race, religion, or sexual +identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an +appointed representative at an online or offline event. Representation of a +project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at +[contact@animo.id](mailto:contact@animo.id). All complaints will be reviewed +and investigated and will result in a response that is deemed necessary and +appropriate to the circumstances. The project team is obligated to maintain +confidentiality with regard to the reporter of an incident. Further details of +specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +[http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org [version]: +http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fa5142e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,20 @@ +# How to contribute + +You are encouraged to contribute to the repository by forking and submitting a +pull request. + +For significant changes, please open an issue first to discuss the proposed +changes to avoid re-work. + +(If you are new to GitHub, you might start with a [basic +tutorial](https://docs.github.com/en/get-started/quickstart/set-up-git) and +check out a more detailed guide to [pull +requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).) + +Pull requests will be evaluated by the repository guardians on a schedule and +if deemed beneficial will be committed to the main branch. Pull requests should +have a descriptive name and include an summary of all changes made in the pull +request description. + +If you would like to propose a significant change, please open an issue first +to discuss the work with the community. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2c6c83 --- /dev/null +++ b/README.md @@ -0,0 +1,100 @@ +<p align="center"> + <picture> + <source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-light-no-text_ok9auy.svg"> + <source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-dark-no-text_fqqdq9.svg"> + <img alt="Animo Logo" height="250px" /> + </picture> +</p> + +<h1 align="center" ><b>Univeral Resolver integration for Aries Framework JavaScript</b></h1> + +<h4 align="center">Powered by + <picture> + <source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-light-text_cma2yo.svg"> + <source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-dark-text_uccvqa.svg"> + <img alt="Animo Logo" height="12px" /> + </picture> +</h4><br> + +<p align="center"> + <a href="https://typescriptlang.org"> + <img src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" /> + </a> + <a href="https://yarnpkg.com"> + <img src="https://img.shields.io/badge/yarn-workspaces-2188b6" /> + </a> + <a href="https://opensource.org/licenses/Apache-2.0"> + <img src="https://img.shields.io/badge/License-Apache_2.0-yellowgreen.svg" /> + </a> +</p> + +<p align="center"> + <a href="#getting-started">Getting started</a> + | + <a href="#usage">Usage</a> + | + <a href="#contributing">Contributing</a> + | + <a href="#license">License</a> +</p> + +--- + +## Getting Started + +<details> +<summary>Yarn</summary> + +```console +yarn add @animo-id/afj-universal-resolver +``` + +</details> + +## Usage + +> NOTE: it is recommended to use a self-hosted universal resolver and only use +> the development hosted one for development. + +```typescript +import { UniversalDidResolver } from "@animo-id/afj-universal-resolver" +import { agentDependencies } from "@aries-framework/node" +import { Agent, DidsModule } from "@aries-framework/core" +import { AskarModule } from "@aries-framework/askar" +import { ariesAskar } from "@hyperledger/aries-askar-nodejs" + +const devUniResolverUrl = "https://dev.uniresolver.io" +const didKey = + "did:key:z4MXj1wBzi9jUstyPMS4jQqB6KdJaiatPkAtVtGc6bQEQEEsKTic4G7Rou3iBf9vPmT5dbkm9qsZsuVNjq8HCuW1w24nhBFGkRE4cd2Uf2tfrB3N7h4mnyPp1BF3ZttHTYv3DLUPi1zMdkULiow3M1GfXkoC6DoxDUm1jmN6GBj22SjVsr6dxezRVQc7aj9TxE7JLbMH1wh5X3kA58H3DFW8rnYMakFGbca5CB2Jf6CnGQZmL7o5uJAdTwXfy2iiiyPxXEGerMhHwhjTA1mKYobyk2CpeEcmvynADfNZ5MBvcCS7m3XkFCMNUYBS9NQ3fze6vMSUPsNa6GVYmKx2x6JrdEjCk3qRMMmyjnjCMfR4pXbRMZa3i" + +const uni = await UniversalDidResolver.initializeWithDynamicMethods( + agentDependencies, + devUniResolverUrl +) + +const agent = new Agent({ + config: { + label: "my-agent", + walletConfig: { id: "some-id", key: "some-key" } + }, + modules: { + askar: new AskarModule({ ariesAskar }), + dids: new DidsModule({ resolvers: [uni] }) + }, + dependencies: agentDependencies +}) + +await agent.initialize() + +const { didDocument } = await agent.dids.resolve(didKey) +``` + +## Contributing + +Is there something you'd like to fix or add? Great, we love community +contributions! To get involved, please follow our [contribution +guidelines](./CONTRIBUTING.md). + +## License + +[Apache 2.0](./LICENSE)