Mokhtar Naamani b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
..
compiled b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
doc b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
proto b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
src b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
test b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
.eslintignore b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
.eslintrc.js b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
.gitignore b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
.prettierignore b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
README.md b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
compile.sh b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
package.json b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred
tsconfig.json b68e329495 content-metadata: rename package to content-metadata-protobuf 4 rokov pred

README.md

Joystream Content Directory Metadata Library

This package contains protobuf message definitions compiled to Javascript/Typescript used for creating and updating various metadata blobs in the joystream content directory.

Message Specs

Documented in doc folder

Choice of protobuf protocol v2

For our usecase we wish to re-use same message to create and update subset of fields. For this reason we need the explicit information about wether a field has been set or not and this is only possible with proto v2.

Background: required/optional feilds are deprecated in proto v3

Helper methods

The custom Joystream types such as License have helper methods to construct pre-defined well known values.

Example code:

Best place to look at are the tests specs

Opaque types

We use simple ISO_639-1 code representation for Language. useful npm package https://www.npmjs.com/package/iso-639-1

Compiling .proto files:

pre-requisists:

- [protoc](https://github.com/protocolbuffers/protobuf/releases)
- [golang](https://golang.org/)
- [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) to generate docs
yarn compile

Build

After compiling proto files

yarn build

Test

yarn test