-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2e74999
Showing
190 changed files
with
25,820 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build and test | ||
on: [push, pull_request] | ||
env: | ||
CI: true | ||
jobs: | ||
build: | ||
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['16.x'] | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies and build | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Lint | ||
run: pnpm run lint | ||
|
||
- name: Test | ||
run: pnpm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.log | ||
.DS_Store | ||
node_modules | ||
dist | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"eslint-config-3box/prettier.config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2020" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ComposeDB monorepo | ||
|
||
Packages providing the reference TypeScript implementation of ComposeDB. | ||
|
||
## Installation | ||
|
||
This monorepo uses [pnpm](https://pnpm.io/), make sure to install it first if you don't already have it. | ||
|
||
1. `pnpm install` to install the dependencies | ||
1. `pnpm build` to build all the packages | ||
|
||
### Additional scripts | ||
|
||
- `pnpm lint` to run the linter in all packages | ||
- `pnpm test` to run tests in all packages | ||
- `pnpm docs` to generate API documentation | ||
|
||
## Packages | ||
|
||
| Name | Description | Version | | ||
| ---------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------- | | ||
| **Client libraries** | | ||
| [`@composedb/client`](./packages/client) | ComposeDB client for executing GraphQL query on a Ceramic node | ![npm version](https://img.shields.io/npm/v/@composedb/client.svg) | | ||
| **Developer tools** | | ||
| [`@composedb/devtools`](./packages/devtools) | Development tools library | ![npm version](https://img.shields.io/npm/v/@composedb/devtools.svg) | | ||
| [`@composedb/devtools-node`](./packages/devtools-node) | Node.js-specific development tools library | ![npm version](https://img.shields.io/npm/v/@composedb/devtools-node.svg) | | ||
| **Shared libraries** | | ||
| [`@composedb/graphql-scalars`](./packages/graphql-scalars) | Shared GraphQL scalars | ![npm version](https://img.shields.io/npm/v/@composedb/graphql-scalars.svg) | | ||
| [`@composedb/types`](./packages/types) | Shared types | ![npm version](https://img.shields.io/npm/v/@composedb/types.svg) | | ||
|
||
## License | ||
|
||
Dual licensed under [MIT](LICENSE-MIT) and [Apache 2](LICENSE-APACHE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Class: ComposeClient | ||
|
||
[client](../modules/client.md).ComposeClient | ||
|
||
The ComposeClient class provides APIs to execute queries on a GraphQL schema generated from a | ||
[`RuntimeCompositeDefinition`](../modules/types.md#runtimecompositedefinition). It allows applications | ||
to interact with documents using known models on a Ceramic node. | ||
|
||
It is exported by the [`client`](../modules/client.md) module. | ||
|
||
```sh | ||
import { ComposeClient } from '@composedb/client' | ||
``` | ||
## Constructors | ||
### constructor | ||
• **new ComposeClient**(`params`) | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `params` | [`ComposeClientParams`](../modules/client.md#composeclientparams) | | ||
## Accessors | ||
### context | ||
• `get` **context**(): [`Context`](client.Context.md) | ||
Context instance used internally. | ||
#### Returns | ||
[`Context`](client.Context.md) | ||
___ | ||
### did | ||
• `get` **did**(): `undefined` \| `DID` | ||
DID instance used internally by the Ceramic client instance. | ||
#### Returns | ||
`undefined` \| `DID` | ||
___ | ||
### id | ||
• `get` **id**(): `undefined` \| `string` | ||
ID of the DID attached to the Ceramic client instance used internally. If `undefined`, the | ||
Ceramic instance is not authenticated and mutations will fail. | ||
#### Returns | ||
`undefined` \| `string` | ||
___ | ||
### resources | ||
• `get` **resources**(): `string`[] | ||
CACAO resources URLs for the models the client interacts with. | ||
#### Returns | ||
`string`[] | ||
## Methods | ||
### execute | ||
▸ **execute**(`document`, `variableValues?`): `Promise`<`ExecutionResult`<`ObjMap`<`unknown`\>, `ObjMap`<`unknown`\>\>\> | ||
Execute a GraphQL query from a DocumentNode and optional variables. | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `document` | `DocumentNode` | | ||
| `variableValues?` | `Record`<`string`, `unknown`\> | | ||
#### Returns | ||
`Promise`<`ExecutionResult`<`ObjMap`<`unknown`\>, `ObjMap`<`unknown`\>\>\> | ||
___ | ||
### executeQuery | ||
▸ **executeQuery**(`source`, `variableValues?`): `Promise`<`ExecutionResult`<`ObjMap`<`unknown`\>, `ObjMap`<`unknown`\>\>\> | ||
Execute a GraphQL query from its source and optional variables. | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `source` | `string` \| `Source` | | ||
| `variableValues?` | `Record`<`string`, `unknown`\> | | ||
#### Returns | ||
`Promise`<`ExecutionResult`<`ObjMap`<`unknown`\>, `ObjMap`<`unknown`\>\>\> | ||
___ | ||
### setDID | ||
▸ **setDID**(`did`): `void` | ||
Attach the given DID instance to the Ceramic client instance used internally. An authenticated | ||
DID instance is necessary to perform GraphQL mutations. | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `did` | `DID` | | ||
#### Returns | ||
`void` |
Oops, something went wrong.