Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	apps/developers/package.json
#	apps/self.id/package.json
#	docs/modules/framework.md
#	docs/modules/multiauth.md
#	docs/modules/react.md
#	docs/modules/ui.md
#	package.json
#	packages/framework/src/index.ts
#	packages/multiauth/package.json
#	packages/multiauth/src/index.ts
#	packages/react/package.json
#	packages/react/src/index.ts
#	packages/ui/src/index.ts
#	packages/web/package.json
#	templates/next-notes-typescript/package.json
#	templates/next-notes-typescript/src/model.json
#	templates/vite-basic/package.json
#	templates/webpack-basic-typescript/package.json
#	templates/webpack-basic/package.json
#	yarn.lock
  • Loading branch information
PaulLeCam committed Feb 24, 2022
2 parents bf0ffea + 72fc48b commit 489862b
Show file tree
Hide file tree
Showing 36 changed files with 2,096 additions and 689 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Issue template
about: Standard issue template.
title: "[Replace me with meaningful title]"
labels: ''
assignees: ''

---

# Description

Provide a 2-3 sentence overview of the work to be done.

# Technical Information

Provide an explanation of the technical work to be done.
31 changes: 31 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# [Replace Me With Meaningful Name] - #[Issue]

## Description

Include a summary of the change and which issue it addresses in the title of the PR.

Include relevant motivation, context, brief description and impact of the change(s). List follow-up tasks here.

## How Has This Been Tested?

Describe the tests that you ran to verify your changes. Provide instructions for reproduction.

- [ ] Test A (e.g. Test A - New test that ... ran in local, docker, and dev unstable.)
- [ ] Test B

## Definition of Done

Before submitting this PR, please make sure:

- [ ] The work addresses the description and outcomes in the issue
- [ ] I have added relevant tests for new or updated functionality
- [ ] My code follows conventions, is well commented, and easy to understand
- [ ] My code builds and tests pass without any errors or warnings
- [ ] I have tagged the relevant reviewers
- [ ] I have updated the READMEs of affected packages
- [ ] I have made corresponding changes to the documentation
- [ ] The changes have been communicated to interested parties

## References:

Please list relevant documentation (e.g. tech specs, articles, related work etc.) relevant to this change, and note if the documentation has been updated.
2 changes: 1 addition & 1 deletion apps/developers/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/ceramicstudio/self.id/edit/master/apps/developers/',
editUrl: 'https://github.com/ceramicstudio/self.id/edit/main/apps/developers/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
4 changes: 2 additions & 2 deletions apps/developers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.9",
"@tsconfig/docusaurus": "^1.0.4",
"@types/react": "^17.0.36",
"@types/react": "^17.0.37",
"@types/react-helmet": "^6.1.3",
"@types/react-router-dom": "^5.3.2",
"docusaurus-plugin-typedoc": "^0.16.4",
"docusaurus-plugin-typedoc": "^0.16.5",
"typescript": "^4.5.2"
}
}
8 changes: 4 additions & 4 deletions apps/self.id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"devDependencies": {
"@next/bundle-analyzer": "^12.0.4",
"@self.id/multiauth": "^0.1.0",
"@types/node": "^16.11.6",
"@types/node": "^16.11.11",
"@types/pica": "^5.1.3",
"@types/react": "^17.0.36",
"@types/react": "^17.0.37",
"@types/styled-components": "^5.1.15",
"babel-plugin-styled-components": "^2.0.1",
"babel-plugin-styled-components": "^2.0.2",
"eslint": "^8.3.0",
"eslint-config-3box": "^0.4.0",
"eslint-config-next": "^12.0.4",
"key-did-provider-ed25519": "^1.1.0",
"prettier": "^2.4.1",
"prettier": "^2.5.0",
"typescript": "^4.5.2"
}
}
22 changes: 21 additions & 1 deletion docs/modules/3box_legacy.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# Module: 3box-legacy

3Box legacy utilities
Load legacy 3Box profiles.

## Purpose

The`3box-legacy` module provides utility functions to load legacy 3Box profiles.

## Installation

```sh
npm install @self.id/3box-legacy
```

## Common use-cases

### Load a legacy 3Box profile as a Self.ID basic profile

```ts
import { getLegacy3BoxProfileAsBasicProfile } from '@self.id/3box-legacy'

async function getProfile() {
// Ethereum address to load the profile of
const address = '0x123efad...'
return await getLegacy3BoxProfileAsBasicProfile(address)
}
```

## Functions

### getLegacy3BoxProfileAsBasicProfile
Expand Down
99 changes: 76 additions & 23 deletions docs/modules/core.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,86 @@
# Module: core

Core APIs
Read public records in Node and browsers environments.

## Purpose

The `core` module of the Self.ID SDK exports the `Core` and `PublicID` classes to provide APIs
for reading public records in Node and browsers environments.

It can therefore be used both client-side and server-side by applications wanting to access
records associated to a DID on a Ceramic network.

## Installation

```sh
npm install @self.id/core
```

## Common use-cases

### Read the basic profile of a known DID

```ts
import { Core } from '@self.id/core'

const core = new Core({ ceramic: 'testnet-clay' })

async function getProfile() {
// Replace by the wanted DID string
const did = 'did:3:...'
return await core.get('basicProfile', did)
}
```

### Connect to a custom Ceramic node

```ts
import { Core } from '@self.id/core'

// You can provide the URL of a custom node as the `ceramic` parameter
const core = new Core({ ceramic: 'https://ceramic-clay.3boxlabs.com' })
```

### Use a custom data model

```ts
import { Core } from '@self.id/core'

const model = {
definitions: {
basicProfile: 'kjzl6cwe1jw145cjbeko9kil8g9bxszjhyde21ob8epxuxkaon1izyqsu8wgcic',
notes: 'kjzl6cwe1jw14688v7zhf5eo1uiblt0thkgdedb5gaiq99isj224g6v8uza2r4m',
},
schemas: {
BasicProfile: 'ceramic://k3y52l7qbv1frxt706gqfzmq6cbqdkptzk8uudaryhlkf6ly9vx21hqu4r6k1jqio',
Note: 'ceramic://k3y52l7qbv1fryg3uy4gz50pj3ivni18h6younsgd2kb5u7mivx3h258m01tkwk5c',
Notes: 'ceramic://k3y52l7qbv1frxk024s7ds2456qo3rwa02k31uf98loz8lm1lodlgv3eeqh4cxgjk',
},
tiles: {
placeholderNote: 'kjzl6cwe1jw148snra9bmyf32y5pj2ysnvenqx59k7n2lz3gnri72axvp25fo1v',
},
}
const core = new Core({ ceramic: 'testnet-clay', model })

async function getNotes(did) {
return await core.get('notes', did)
}
```

### Use a PublicID instance

```ts
import { Core, PublicID } from '@self.id/core'

const core = new Core({ ceramic: 'testnet-clay' })
// Replace the `id` parameter by the wanted DID string
const currentUser = new PublicID({ core, id: 'did:3:...' })

async function getCurrentUserProfile() {
return await currentUser.get('basicProfile')
}
```

## Classes

- [Core](../classes/core.Core.md)
Expand Down Expand Up @@ -62,25 +137,3 @@ ___
| :------ | :------ |
| `core` | [`Core`](../classes/core.Core.md)<`ModelTypes`\> |
| `id` | `string` |

## Variables

### CERAMIC\_URLS

**CERAMIC\_URLS**: `Record`<[`CeramicNetwork`](core.md#ceramicnetwork), `string`\>

## Functions

### isCAIP10string

**isCAIP10string**(`account`): `boolean`

#### Parameters

| Name | Type |
| :------ | :------ |
| `account` | `string` |

#### Returns

`boolean`
Loading

0 comments on commit 489862b

Please sign in to comment.