Observed since 21 Oct, 08:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xintuition/slang-cli
web3 scaffolding made easy
.---. ,-. .--. .-. .-. ,--, ,--, ,-. ,-.
( .-._)| | / /\ \ | \| |.' .' .' .') | | |(|
(_) \ | | / /__\ \| | || | __ ____.___ | |(_) | | (_)
_ \ \ | | | __ || |\ |\ \ ( _)`----==='\ \ | | | |
( `-' ) | `--. | | |)|| | |)| \ `-) ) \ `-. | `--. | |
`----' |( __.'|_| (_)/( (_) )\____/ \____\|( __.'`-'
(_) (__) (__) (_)
Web3 Backends Made Easy
slang composedb:generate : Generates ComposeDB composites, types, and a full-featured sql client for readsmore coming soon...
Install Slang globally
npm install -g @0xintuition/slang-cli
Fill in a .env file with the following content (replace with your info):
COMPOSEDB_API_URL="http://localhost:7007"
COMPOSEDB_DB_URL="sqlite:///Users/<your_username>/.ceramic/indexing.sqlite"
COMPOSEDB_PRIVATE_KEY=<your_composedb_private_key>
Define a /schema folder at the root of your package/repository and add some schemas
All files must ordered in the way they are to be deployed (see the test package for example)
Dependent model id's can be referenced by using a template string with the model name EG: id: "${List}"
Run a local ComposeDB instance
npx @ceramicnetwork/cli daemon
Run slang composedb:generate and you're off to the races!
Check out the code in __generated__/ after running the generator to see what's available.
Reads can be done by using the Prisma client included in the distributed client like so:
const client = new Client(...stuff)
const dbStuff = await client.prisma.myModelName.findMany(...moreStuff)
Since the stream_content column in the database is JSON, the resulting data is untyped. To parse this into a type-safe format, helper functions are included with each service that add a data field with the typed object. For example:
const client = new Client(...stuff)
const dbStuff = await client.prisma.myModelName.findMany(...moreStuff)
/**
* dbStuff = [
* {
* stream_id: string,
* controller_did: string,
* stream_content: any,
* ...
* }
* ...]
*/
const parsedDBStuff = dbStuff.map((s) => client.myModelNameService.parse(s))
/**
* dbStuff = [
* {
* stream_id: string,
* controller_did: string,
* stream_content: any,
* data: MyModelType
* ...
* }
* ...]
*/
I realize this is not ideal, however it will improve soon as Prisma has been dramatically improving JSON support.
WRITES MUST BE DONE THROUGH THE COMPOSEDB CLIENT (NOT PRISMA)!!!!!!
Nice types are included to make this very simple. For example:
const client = new Client(...stuff)
const resp = await client.myModelNameService.create({
content: {
...myModelFieldsForCreation,
},
})
Zod is used to validate the input fields and ensure they conform to the model schemas you defined.
Transpiled client code (currently output in typescript)
Add Lit command to generate relay code for interacting with PKP's + walletless onboarding
Add --encrypt flag to composedb:generate to automatically handle encrypting/decrypting ComposeDB data
Whatever else you might suggest!
My whole team at Intuition, stay sweaty <3
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
ejsEnvironment{
"local_name": "ejs",
"alias": false,
"peer_metadata": null
} | ^3.1.9 | runtime |
zodEnvironment{
"local_name": "zod",
"alias": false,
"peer_metadata": null
} | ^3.20.6 | runtime |
didsEnvironment{
"local_name": "dids",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | runtime |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^16.0.3 | runtime |
ethersEnvironment{
"local_name": "ethers",
"alias": false,
"peer_metadata": null
} | ^5.7.0 | runtime |
figletEnvironment{
"local_name": "figlet",
"alias": false,
"peer_metadata": null
} | ^1.5.2 | runtime |
graphqlEnvironment{
"local_name": "graphql",
"alias": false,
"peer_metadata": null
} | ^16.6.0 | runtime |
punycodeEnvironment{
"local_name": "punycode",
"alias": false,
"peer_metadata": null
} | ^2.3.0 | runtime |
@oclif/coreEnvironment{
"local_name": "@oclif/core",
"alias": false,
"peer_metadata": null
} | ^2 | runtime |
did-sessionEnvironment{
"local_name": "did-session",
"alias": false,
"peer_metadata": null
} | ^2.0.0 | runtime |
graphql-tagEnvironment{
"local_name": "graphql-tag",
"alias": false,
"peer_metadata": null
} | ^2.12.6 | runtime |
uint8arraysEnvironment{
"local_name": "uint8arrays",
"alias": false,
"peer_metadata": null
} | ^4.0.3 | runtime |
@didtools/cacaoEnvironment{
"local_name": "@didtools/cacao",
"alias": false,
"peer_metadata": null
} | ^2.0.0 | runtime |
@tuplo/envsubstEnvironment{
"local_name": "@tuplo/envsubst",
"alias": false,
"peer_metadata": null
} | ^1.15.2 | runtime |
key-did-resolverEnvironment{
"local_name": "key-did-resolver",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | runtime |
@composedb/clientEnvironment{
"local_name": "@composedb/client",
"alias": false,
"peer_metadata": null
} | ^0.4.3 | runtime |
@stablelib/randomEnvironment{
"local_name": "@stablelib/random",
"alias": false,
"peer_metadata": null
} | ^1.0.2 | runtime |
@oclif/plugin-helpEnvironment{
"local_name": "@oclif/plugin-help",
"alias": false,
"peer_metadata": null
} | ^5 | runtime |
@composedb/devtoolsEnvironment{
"local_name": "@composedb/devtools",
"alias": false,
"peer_metadata": null
} | ^0.4.3 | runtime |
@graphql-tools/loadEnvironment{
"local_name": "@graphql-tools/load",
"alias": false,
"peer_metadata": null
} | ^7.8.12 | runtime |
google-auth-libraryEnvironment{
"local_name": "google-auth-library",
"alias": false,
"peer_metadata": null
} | ^8.7.0 | runtime |
@graphql-codegen/addEnvironment{
"local_name": "@graphql-codegen/add",
"alias": false,
"peer_metadata": null
} | ^4.0.1 | runtime |
@graphql-codegen/cliEnvironment{
"local_name": "@graphql-codegen/cli",
"alias": false,
"peer_metadata": null
} | ^3.2.1 | runtime |
@graphql-tools/utilsEnvironment{
"local_name": "@graphql-tools/utils",
"alias": false,
"peer_metadata": null
} | ^9.2.1 | runtime |
@oclif/plugin-pluginsEnvironment{
"local_name": "@oclif/plugin-plugins",
"alias": false,
"peer_metadata": null
} | ^2.4.2 | runtime |
@ceramicnetwork/commonEnvironment{
"local_name": "@ceramicnetwork/common",
"alias": false,
"peer_metadata": null
} | ^2.23.0 | runtime |
detect-package-managerEnvironment{
"local_name": "detect-package-manager",
"alias": false,
"peer_metadata": null
} | ^2.0.1 | runtime |
@lit-protocol/constantsEnvironment{
"local_name": "@lit-protocol/constants",
"alias": false,
"peer_metadata": null
} | ^2.1.43 | runtime |
@ceramicnetwork/streamidEnvironment{
"local_name": "@ceramicnetwork/streamid",
"alias": false,
"peer_metadata": null
} | ^2.14.0 | runtime |
@composedb/devtools-nodeEnvironment{
"local_name": "@composedb/devtools-node",
"alias": false,
"peer_metadata": null
} | ^0.4.3 | runtime |
key-did-provider-ed25519Environment{
"local_name": "key-did-provider-ed25519",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | runtime |
@ceramicnetwork/http-clientEnvironment{
"local_name": "@ceramicnetwork/http-client",
"alias": false,
"peer_metadata": null
} | ^2.20.0 | runtime |
@graphql-codegen/typescriptEnvironment{
"local_name": "@graphql-codegen/typescript",
"alias": false,
"peer_metadata": null
} | ^3.0.2 | runtime |
@lit-protocol/contracts-sdkEnvironment{
"local_name": "@lit-protocol/contracts-sdk",
"alias": false,
"peer_metadata": null
} | 2.1.30 | runtime |
@lit-protocol/lit-node-clientEnvironment{
"local_name": "@lit-protocol/lit-node-client",
"alias": false,
"peer_metadata": null
} | ^2.1.43 | runtime |
@graphql-codegen/plugin-helpersEnvironment{
"local_name": "@graphql-codegen/plugin-helpers",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | runtime |
@graphql-tools/graphql-file-loaderEnvironment{
"local_name": "@graphql-tools/graphql-file-loader",
"alias": false,
"peer_metadata": null
} | ^7.5.16 | runtime |
@graphql-codegen/typescript-operationsEnvironment{
"local_name": "@graphql-codegen/typescript-operations",
"alias": false,
"peer_metadata": null
} | ^3.0.1 | runtime |
graphql-codegen-typescript-validation-schemaEnvironment{
"local_name": "graphql-codegen-typescript-validation-schema",
"alias": false,
"peer_metadata": null
} | ^0.7.1 | runtime |
shxEnvironment{
"local_name": "shx",
"alias": false,
"peer_metadata": null
} | ^0.3.3 | development |
ts-nodeEnvironment{
"local_name": "ts-node",
"alias": false,
"peer_metadata": null
} | ^10.9.1 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^2.8.4 | development |
bun-typesEnvironment{
"local_name": "bun-types",
"alias": false,
"peer_metadata": null
} | ^0.5.0 | development |
@types/ejsEnvironment{
"local_name": "@types/ejs",
"alias": false,
"peer_metadata": null
} | ^3.1.2 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.0.2 | development |
@composedb/typesEnvironment{
"local_name": "@composedb/types",
"alias": false,
"peer_metadata": null
} | ^0.4.3 | development |
@types/chalk-animationEnvironment{
"local_name": "@types/chalk-animation",
"alias": false,
"peer_metadata": null
} | ^1.6.1 | development |
prettier-plugin-organize-importsEnvironment{
"local_name": "prettier-plugin-organize-imports",
"alias": false,
"peer_metadata": null
} | ^3.2.2 | development |
Source distribution
{
"shasum": "d43f543cde7e93b578a660fa5b255d5f3a9aab38",
"tarball": "https://registry.npmjs.org/@0xintuition/slang-cli/-/slang-cli-0.0.3.tgz",
"fileCount": 12,
"integrity": "sha512-hV8oNpHWywQnPVsX7cu2flu8OM1zp7I9m/pDCB57HM22mFTRgFEzppKb2nVVR7e0ycf+5luGpjpLdwsTNhbntQ==",
"signatures": [
{
"sig": "MEUCIHON894uX9FUjTO5VgCpeXaoOecFY7O5pAFglGO4gOSGAiEAjPXrfjWOazvTvIbz5ctGy4YqPJUicsBTgnQ6JJlDKKY=",
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
}
],
"unpackedSize": 33731,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGwf/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQwhAAnaAwQM1fysXv3WCanSRoo0iXnIC31g5SLD/ge2f/CA6JLGTT\r\nI/XW3A9Gkfp2NAvuqtqWqIL0AgHxtk/Xy1Q1i/20JySlPtrLWG+XyV4rt8VI\r\nL1zgGWK5W1TJxLseR32YKVEGpa/IZSBMK9/yGlfeTKV+nIA/o+93yeYnpgmJ\r\nb3TBg34rUn38lPnhTDVGZrhG9J8vLffHSkCD0rXaDe6mFFmYBG1SRuSS0mGB\r\n04gdaYxnyx47gjWqSNzjSx2Db3lL97V9gQUgWUX5khaR3KaVsVZVq9J/FawF\r\ndg+6fKgoofbteZxq0ewytgKKLRnmQ7Du5ySZIJ/tblEso/kSUyaHP8i06NFS\r\n+lLXWR23HbL89RakWqsbmlydFftLBAN7kQjATStmsAMvJyLLVtTEyseLyZPG\r\nS0IoyrzFMMLaaARwbsBsXQ8qu9B/jSSuGuAlPSQJITWp0r8sTRUmc9j7Wowt\r\nwhW2IN+c3oy7DEjMNdXE6LVCHgE2fLqWhJ25sCbkc+thGYObnb/twCR8BL8l\r\nA8r7vtaydFhrAK2FKBYLQlGOQiynx4miiO43qJbC2X519T1T1ydEVgl3PrY8\r\nVvEdhJiiRMhpbwtkReikUmybS6tJoIv1HGfKLiuTR8749dLP3H7Qf8tboqe6\r\nE9AdWw8fvqamOEykgsQ5VGGPYhLkJGUyAXs=\r\n=3Mef\r\n-----END PGP SIGNATURE-----\r\n"
}Observed since 21 Oct, 08:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:331948671c9ca7d4d4626f985aa189f888958b4e2da081aa46695d92bc0bda86