Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
fix: push docs and small improvements for TS.
Browse files Browse the repository at this point in the history
  • Loading branch information
elribonazo committed Jan 15, 2024
1 parent 054e08f commit c19153b
Show file tree
Hide file tree
Showing 45 changed files with 378 additions and 360 deletions.
58 changes: 55 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,34 @@ npm i @pluto-encrypted/inmemory --save
```typescript
import InMemory from "@pluto-encrypted/inmemory";
import { Database } from "@pluto-encrypted/database";
import {
getDefaultCollections,
DIDCollection,
DIDPairCollection,
MediatorCollection,
PrivateKeyColletion,
CredentialCollection,
CredentialRequestMetadataCollection,
LinkSecretColletion,
MessageColletion
} from "@pluto-encrypted/schemas";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
const database = db = await Database.createEncrypted<{
dids: DIDCollection;
didpairs: DIDPairCollection;
mediators: MediatorCollection;
privatekeys: PrivateKeyColletion;
credentials: CredentialCollection;
credentialrequestmetadatas: CredentialRequestMetadataCollection;
linksecrets: LinkSecretColletion;
messages: MessageColletion;
}>(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: InMemory,
collections: getDefaultCollections()
}
);
```
Expand All @@ -48,13 +69,34 @@ const database = db = await Database.createEncrypted(
```typescript
import IndexDB from "@pluto-encrypted/indexdb";
import { Database } from "@pluto-encrypted/database";
import {
getDefaultCollections,
DIDCollection,
DIDPairCollection,
MediatorCollection,
PrivateKeyColletion,
CredentialCollection,
CredentialRequestMetadataCollection,
LinkSecretColletion,
MessageColletion
} from "@pluto-encrypted/schemas";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
const database = db = await Database.createEncrypted<{
dids: DIDCollection;
didpairs: DIDPairCollection;
mediators: MediatorCollection;
privatekeys: PrivateKeyColletion;
credentials: CredentialCollection;
credentialrequestmetadatas: CredentialRequestMetadataCollection;
linksecrets: LinkSecretColletion;
messages: MessageColletion;
}>(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: IndexDB,
collections: getDefaultCollections()
}
);
```
Expand All @@ -66,14 +108,24 @@ import { createLevelDBStorage } from "@pluto-encrypted/leveldb";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
const database = db = await Database.createEncrypted<{
dids: DIDCollection;
didpairs: DIDPairCollection;
mediators: MediatorCollection;
privatekeys: PrivateKeyColletion;
credentials: CredentialCollection;
credentialrequestmetadatas: CredentialRequestMetadataCollection;
linksecrets: LinkSecretColletion;
messages: MessageColletion;
}>(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: createLevelDBStorage({
dbName: "demo",
dbPath: "/tmp/demo"
}),
collections: getDefaultCollections()
}
);
```
16 changes: 8 additions & 8 deletions docs/classes/encryption.EncryptedDataMigrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#### Defined in

[packages/encryption/src/migration/index.ts:28](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L28)
[packages/encryption/src/migration/index.ts:28](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L28)

## Properties

Expand All @@ -48,7 +48,7 @@

#### Defined in

[packages/encryption/src/migration/index.ts:37](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L37)
[packages/encryption/src/migration/index.ts:37](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L37)

___

Expand All @@ -58,7 +58,7 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:38](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L38)
[packages/encryption/src/migration/index.ts:38](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L38)

___

Expand All @@ -68,7 +68,7 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:30](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L30)
[packages/encryption/src/migration/index.ts:30](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L30)

___

Expand All @@ -78,7 +78,7 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:39](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L39)
[packages/encryption/src/migration/index.ts:39](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L39)

___

Expand All @@ -88,7 +88,7 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:29](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L29)
[packages/encryption/src/migration/index.ts:29](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L29)

## Methods

Expand All @@ -110,7 +110,7 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:41](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L41)
[packages/encryption/src/migration/index.ts:41](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L41)

___

Expand All @@ -130,4 +130,4 @@ ___

#### Defined in

[packages/encryption/src/migration/index.ts:57](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/encryption/src/migration/index.ts#L57)
[packages/encryption/src/migration/index.ts:57](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/encryption/src/migration/index.ts#L57)
16 changes: 8 additions & 8 deletions docs/classes/shared.DatabaseBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#### Defined in

[packages/shared/src/index.ts:261](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L261)
[packages/shared/src/index.ts:270](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L270)

## Properties

Expand All @@ -62,7 +62,7 @@

#### Defined in

[packages/shared/src/index.ts:245](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L245)
[packages/shared/src/index.ts:254](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L254)

___

Expand All @@ -72,7 +72,7 @@ ___

#### Defined in

[packages/shared/src/index.ts:262](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L262)
[packages/shared/src/index.ts:271](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L271)

## Accessors

Expand All @@ -86,7 +86,7 @@ ___

#### Defined in

[packages/shared/src/index.ts:247](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L247)
[packages/shared/src/index.ts:256](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L256)

## Methods

Expand All @@ -100,7 +100,7 @@ ___

#### Defined in

[packages/shared/src/index.ts:269](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L269)
[packages/shared/src/index.ts:278](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L278)

___

Expand All @@ -117,7 +117,7 @@ and then destroy the database itself.

#### Defined in

[packages/shared/src/index.ts:277](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L277)
[packages/shared/src/index.ts:286](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L286)

___

Expand All @@ -137,7 +137,7 @@ ___

#### Defined in

[packages/shared/src/index.ts:254](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L254)
[packages/shared/src/index.ts:263](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L263)

___

Expand All @@ -159,4 +159,4 @@ Start the database and build collections

#### Defined in

[packages/shared/src/index.ts:288](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/shared/src/index.ts#L288)
[packages/shared/src/index.ts:297](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/shared/src/index.ts#L297)
2 changes: 1 addition & 1 deletion docs/interfaces/database-1.CredentialMethodTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

#### Defined in

[packages/schemas/src/schemas/credential/types.ts:27](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credential/types.ts#L27)
[packages/schemas/src/schemas/credential/types.ts:28](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credential/types.ts#L28)
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:29](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L29)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:30](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L30)
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:17](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L17)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:18](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L18)

___

Expand All @@ -37,7 +37,7 @@ ___

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:18](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L18)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:19](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L19)

___

Expand All @@ -47,7 +47,7 @@ ___

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:21](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L21)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:22](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L22)

___

Expand All @@ -57,4 +57,4 @@ ___

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:22](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L22)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:23](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L23)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

| Name | Type |
| :------ | :------ |
| `this` | [`StaticRxCollectionContext`](../modules/database-1.md#staticrxcollectioncontext)\<\{ `credentialrequestmetadatas`: [`CredentialRequestMetadataCollection`](../modules/database-1.md#credentialrequestmetadatacollection) }\> |
| `this` | [`PlutoDBontext`](../modules/database-1.md#plutodbontext) |
| `linkSecretName` | `string` |

#### Returns
Expand All @@ -36,7 +36,7 @@

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:35](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L35)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:36](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L36)

___

Expand All @@ -48,7 +48,7 @@ ___

| Name | Type |
| :------ | :------ |
| `this` | [`StaticRxCollectionContext`](../modules/database-1.md#staticrxcollectioncontext)\<\{ `credentialrequestmetadatas`: [`CredentialRequestMetadataCollection`](../modules/database-1.md#credentialrequestmetadatacollection) }\> |
| `this` | [`PlutoDBontext`](../modules/database-1.md#plutodbontext) |
| `metadata` | [`CredentialRequestMeta`](database-1.WALLET_SDK_DOMAIN.Anoncreds.CredentialRequestMeta.md) |
| `linkSecret` | `string` |

Expand All @@ -58,4 +58,4 @@ ___

#### Defined in

[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:39](https://github.com/atala-community-projects/pluto-encrypted/blob/879549ef/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L39)
[packages/schemas/src/schemas/credentialRequestMetadata/types.ts:40](https://github.com/atala-community-projects/pluto-encrypted/blob/054e08f/packages/schemas/src/schemas/credentialRequestMetadata/types.ts#L40)
Loading

0 comments on commit c19153b

Please sign in to comment.