Skip to content

Commit

Permalink
SET account relation support (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam authored Feb 5, 2024
1 parent 961278c commit cf49049
Show file tree
Hide file tree
Showing 61 changed files with 7,088 additions and 3,703 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"@jest/globals": "^29.7.0",
"@skypack/package-check": "^0.2.2",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.100",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@swc/core": "^1.4.0",
"@swc/jest": "^0.2.36",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"del-cli": "^5.1.0",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-3box": "^1.0.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jest": "^27.6.3",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"turbo": "^1.11.0",
"typedoc": "0.25.4",
"prettier": "^3.2.5",
"turbo": "^1.12.2",
"typedoc": "0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
},
"pnpm": {
"overrides": {}
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @composedb/cli

## 0.7.0

### Minor Changes

- Add support for models using the new `set` account relation
- Add support for the `shouldIndex` metadata flag
- Add support for immutable fields
- Add support for optional relation fields

## 0.6.0

### Minor Changes
Expand Down
42 changes: 21 additions & 21 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@composedb/cli",
"version": "0.6.1",
"version": "0.7.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://composedb.js.org",
Expand Down Expand Up @@ -38,7 +38,7 @@
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
"build": "pnpm build:clean && pnpm build:types && pnpm build:js",
"lint": "eslint src test --fix",
"test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
"--test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
"--test:ci": "pnpm run test --ci --coverage",
"prepare": "pnpm build",
"prepublishOnly": "package-check"
Expand Down Expand Up @@ -69,45 +69,45 @@
]
},
"dependencies": {
"@ceramicnetwork/3id-did-resolver": "^3.0.5",
"@ceramicnetwork/cli": "^3.0.5",
"@ceramicnetwork/http-client": "^3.0.5",
"@ceramicnetwork/stream-model": "^2.0.5",
"@ceramicnetwork/stream-model-instance": "^2.0.5",
"@ceramicnetwork/streamid": "^3.0.5",
"@ceramicnetwork/3id-did-resolver": "^4.1.0",
"@ceramicnetwork/cli": "^4.1.0",
"@ceramicnetwork/http-client": "^4.1.0",
"@ceramicnetwork/stream-model": "^3.1.0",
"@ceramicnetwork/stream-model-instance": "^3.1.0",
"@ceramicnetwork/streamid": "^4.1.0",
"@composedb/client": "workspace:^",
"@composedb/devtools": "workspace:^",
"@composedb/devtools-node": "workspace:^",
"@composedb/runtime": "workspace:^",
"@oclif/core": "^3.13.2",
"@oclif/plugin-help": "^6.0.7",
"@oclif/plugin-version": "^2.0.8",
"@oclif/core": "^3.18.2",
"@oclif/plugin-help": "^6.0.12",
"@oclif/plugin-version": "^2.0.12",
"cli-table3": "^0.6.3",
"did-resolver": "^4.1.0",
"dids": "^4.0.4",
"dids": "^5.0.2",
"env-paths": "^3.0.0",
"fs-extra": "^11.2.0",
"key-did-provider-ed25519": "^3.0.2",
"key-did-resolver": "^3.0.0",
"key-did-provider-ed25519": "^4.0.2",
"key-did-resolver": "^4.0.0",
"listr": "^0.14.3",
"listr-update-renderer": "^0.5.0",
"ora": "^7.0.1",
"ora": "^8.0.1",
"terminal-size": "^4.0.0",
"uint8arrays": "^4.0.9"
"uint8arrays": "^5.0.1"
},
"devDependencies": {
"@ceramicnetwork/common": "^3.0.5",
"@ceramicnetwork/common": "^4.1.0",
"@composedb/types": "workspace:^",
"@swc-node/register": "^1.6.8",
"@swc-node/register": "^1.8.0",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.12",
"@types/listr": "^0.14.9",
"@types/node": "^20.10.3",
"@types/node": "^20.11.16",
"@types/update-notifier": "^6.0.8",
"ajv": "^8.12.0",
"execa": "^8.0.1",
"jest-dev-server": "^9.0.2",
"oclif": "^4.0.4",
"oclif": "^4.4.4",
"strip-ansi": "~7.1.0"
},
"jest": {
Expand Down
8 changes: 5 additions & 3 deletions packages/cli/src/commands/composite/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ export default class CompositeCompile extends Command<Flags> {
return
}
const runtimeDefinition = composite.toRuntime()
outputPaths.map(async (outputPath) => {
await writeRuntimeDefinition(runtimeDefinition, outputPath)
})
await Promise.all(
outputPaths.map(async (outputPath) => {
await writeRuntimeDefinition(runtimeDefinition, outputPath)
}),
)
this.spinner.succeed('Compiling the composite... Done!')
for (const path of outputPaths) {
if (path.endsWith('.json')) {
Expand Down
9 changes: 9 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @composedb/client

## 0.7.0

### Minor Changes

- Add support for models using the new `set` account relation
- Add support for the `shouldIndex` metadata flag
- Add support for immutable fields
- Add support for optional relation fields

## 0.6.0

### Minor Changes
Expand Down
14 changes: 7 additions & 7 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@composedb/client",
"version": "0.6.0",
"version": "0.7.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://composedb.js.org",
Expand Down Expand Up @@ -39,25 +39,25 @@
"prepublishOnly": "package-check"
},
"dependencies": {
"@ceramicnetwork/http-client": "^3.0.5",
"@ceramicnetwork/stream-model": "^2.0.5",
"@ceramicnetwork/stream-model-instance": "^2.0.5",
"@ceramicnetwork/http-client": "^4.1.0",
"@ceramicnetwork/stream-model": "^3.1.0",
"@ceramicnetwork/stream-model-instance": "^3.1.0",
"@composedb/constants": "workspace:^",
"@composedb/graphql-scalars": "workspace:^",
"@composedb/runtime": "workspace:^",
"@graphql-tools/batch-execute": "^9.0.2",
"@graphql-tools/stitch": "^9.0.3",
"@graphql-tools/utils": "^10.0.11",
"@graphql-tools/utils": "^10.0.13",
"dataloader": "^2.2.2",
"graphql": "^16.8.1",
"graphql-relay": "^0.10.0"
},
"devDependencies": {
"@ceramicnetwork/common": "^3.0.5",
"@ceramicnetwork/common": "^4.1.0",
"@composedb/devtools": "workspace:^",
"@composedb/test-schemas": "workspace:^",
"@composedb/types": "workspace:^",
"dids": "^4.0.4",
"dids": "^5.0.2",
"jest-environment-composedb": "workspace:^"
},
"jest": {
Expand Down
5 changes: 2 additions & 3 deletions packages/client/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { CeramicApi } from '@ceramicnetwork/common'
import { CeramicClient } from '@ceramicnetwork/http-client'
import {
ComposeRuntime,
Expand All @@ -7,7 +6,7 @@ import {
type DocumentCache,
createContext,
} from '@composedb/runtime'
import type { RuntimeCompositeDefinition } from '@composedb/types'
import type { CeramicAPI, RuntimeCompositeDefinition } from '@composedb/types'
import type { Executor } from '@graphql-tools/utils'
import type { DID } from 'dids'
import type { DocumentNode, ExecutionResult, Source } from 'graphql'
Expand All @@ -22,7 +21,7 @@ export type ComposeClientParams = {
/**
* Ceramic client instance or HTTP URL.
*/
ceramic: CeramicApi | string
ceramic: CeramicAPI | string
/**
* Runtime composite definition, created using the {@linkcode devtools.Composite Composite}
* development tools.
Expand Down
10 changes: 5 additions & 5 deletions packages/client/test/remote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('remote', () => {

describe('createHybridSchema()', () => {
test('Runs mutations directly', async () => {
const createSingle = jest.fn(() => {
const upsertSingle = jest.fn(() => {
return {
id: 'createdDocumentID',
metadata: { model: definition.models['GenericProfile'].id },
Expand All @@ -35,12 +35,12 @@ describe('remote', () => {
ceramic: {
did: { authenticated: true },
},
createSingle,
upsertSingle,
},
schema,
document: parse(`
mutation CreateProfile($input: CreateGenericProfileInput!) {
createGenericProfile(input: $input) {
mutation SetProfile($input: SetGenericProfileInput!) {
setGenericProfile(input: $input) {
document {
id
}
Expand All @@ -50,7 +50,7 @@ describe('remote', () => {
variableValues: { input: { content: { name: 'Alice' } } },
})
expect(res.errors).not.toBeDefined()
expect(createSingle).toHaveBeenCalled()
expect(upsertSingle).toHaveBeenCalled()
expect(remoteExecutor).not.toHaveBeenCalled()
})

Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CeramicApi } from '@ceramicnetwork/common'
import type { CeramicAPI } from '@composedb/types'

declare global {
const ceramic: CeramicApi
const ceramic: CeramicAPI
}
9 changes: 9 additions & 0 deletions packages/devtools-node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @composedb/devtools-node

## 0.7.0

### Minor Changes

- Add support for models using the new `set` account relation
- Add support for the `shouldIndex` metadata flag
- Add support for immutable fields
- Add support for optional relation fields

## 0.6.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/devtools-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@composedb/devtools-node",
"version": "0.6.1",
"version": "0.7.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://composedb.js.org",
Expand Down Expand Up @@ -37,7 +37,7 @@
"prepublishOnly": "package-check"
},
"dependencies": {
"@ceramicnetwork/http-client": "^3.0.5",
"@ceramicnetwork/http-client": "^4.1.0",
"@composedb/client": "workspace:^",
"@composedb/runtime": "workspace:^",
"@composedb/server": "workspace:^",
Expand All @@ -50,7 +50,7 @@
"@composedb/devtools": "workspace:^",
"@composedb/types": "workspace:^",
"@types/fs-extra": "^11.0.4",
"dids": "^4.0.4"
"dids": "^5.0.2"
},
"jest": {
"extensionsToTreatAsEsm": [
Expand Down
9 changes: 9 additions & 0 deletions packages/devtools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @composedb/devtools

## 0.7.0

### Minor Changes

- Add support for models using the new `set` account relation
- Add support for the `shouldIndex` metadata flag
- Add support for immutable fields
- Add support for optional relation fields

## 0.6.0

### Minor Changes
Expand Down
26 changes: 13 additions & 13 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@composedb/devtools",
"version": "0.6.1",
"version": "0.7.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://composedb.js.org",
Expand Down Expand Up @@ -39,30 +39,30 @@
"prepublishOnly": "package-check"
},
"dependencies": {
"@ceramicnetwork/common": "^3.0.5",
"@ceramicnetwork/stream-model": "^2.0.5",
"@ceramicnetwork/streamid": "^3.0.5",
"@ceramicnetwork/common": "^4.1.0",
"@ceramicnetwork/stream-model": "^3.1.0",
"@ceramicnetwork/streamid": "^4.1.0",
"@composedb/graphql-scalars": "workspace:^",
"@didtools/cacao": "^2.0.0",
"@didtools/cacao": "^3.0.1",
"@graphql-tools/schema": "^10.0.2",
"@graphql-tools/utils": "^10.0.11",
"change-case": "^5.3.0",
"@graphql-tools/utils": "^10.0.13",
"change-case": "^5.4.2",
"json-ptr": "^3.1.1",
"lodash-es": "^4.17.21",
"multiformats": "^12.1.3",
"multiformats": "^13.0.1",
"object-hash": "^3.0.0",
"type-fest": "^4.8.3",
"uint8arrays": "^4.0.9"
"type-fest": "^4.10.2",
"uint8arrays": "^5.0.1"
},
"devDependencies": {
"@composedb/test-schemas": "workspace:^",
"@composedb/types": "workspace:^",
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.12",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.3",
"@types/node": "^20.11.16",
"@types/object-hash": "^3.0.6",
"ajv": "^8.12.0",
"dids": "^4.0.4",
"dids": "^5.0.2",
"fs-extra": "^11.2.0",
"graphql": "^16.8.1",
"jest-environment-composedb": "workspace:^"
Expand Down
Loading

0 comments on commit cf49049

Please sign in to comment.