Bläddra i källkod

.gitignore autogenerated files and add them via post-install

Leszek Wiesner 4 år sedan
förälder
incheckning
d7b06b93ff
52 ändrade filer med 25 tillägg och 1917 borttagningar
  1. 6 0
      content-directory-schemas/.gitignore
  2. 0 75
      content-directory-schemas/schemas/entities/ChannelEntity.schema.json
  3. 0 23
      content-directory-schemas/schemas/entities/ContentCategoryEntity.schema.json
  4. 0 24
      content-directory-schemas/schemas/entities/HttpMediaLocationEntity.schema.json
  5. 0 18
      content-directory-schemas/schemas/entities/JoystreamMediaLocationEntity.schema.json
  6. 0 33
      content-directory-schemas/schemas/entities/KnownLicenseEntity.schema.json
  7. 0 24
      content-directory-schemas/schemas/entities/LanguageEntity.schema.json
  8. 0 69
      content-directory-schemas/schemas/entities/LicenseEntity.schema.json
  9. 0 69
      content-directory-schemas/schemas/entities/MediaLocationEntity.schema.json
  10. 0 18
      content-directory-schemas/schemas/entities/UserDefinedLicenseEntity.schema.json
  11. 0 217
      content-directory-schemas/schemas/entities/VideoEntity.schema.json
  12. 0 18
      content-directory-schemas/schemas/entities/VideoMediaEncodingEntity.schema.json
  13. 0 91
      content-directory-schemas/schemas/entities/VideoMediaEntity.schema.json
  14. 0 10
      content-directory-schemas/schemas/entityBatches/ChannelBatch.schema.json
  15. 0 10
      content-directory-schemas/schemas/entityBatches/ContentCategoryBatch.schema.json
  16. 0 10
      content-directory-schemas/schemas/entityBatches/HttpMediaLocationBatch.schema.json
  17. 0 10
      content-directory-schemas/schemas/entityBatches/JoystreamMediaLocationBatch.schema.json
  18. 0 10
      content-directory-schemas/schemas/entityBatches/KnownLicenseBatch.schema.json
  19. 0 10
      content-directory-schemas/schemas/entityBatches/LanguageBatch.schema.json
  20. 0 10
      content-directory-schemas/schemas/entityBatches/LicenseBatch.schema.json
  21. 0 10
      content-directory-schemas/schemas/entityBatches/MediaLocationBatch.schema.json
  22. 0 10
      content-directory-schemas/schemas/entityBatches/UserDefinedLicenseBatch.schema.json
  23. 0 10
      content-directory-schemas/schemas/entityBatches/VideoBatch.schema.json
  24. 0 10
      content-directory-schemas/schemas/entityBatches/VideoMediaBatch.schema.json
  25. 0 10
      content-directory-schemas/schemas/entityBatches/VideoMediaEncodingBatch.schema.json
  26. 0 26
      content-directory-schemas/schemas/entityReferences/ChannelRef.schema.json
  27. 0 26
      content-directory-schemas/schemas/entityReferences/ContentCategoryRef.schema.json
  28. 0 12
      content-directory-schemas/schemas/entityReferences/HttpMediaLocationRef.schema.json
  29. 0 26
      content-directory-schemas/schemas/entityReferences/JoystreamMediaLocationRef.schema.json
  30. 0 26
      content-directory-schemas/schemas/entityReferences/KnownLicenseRef.schema.json
  31. 0 26
      content-directory-schemas/schemas/entityReferences/LanguageRef.schema.json
  32. 0 12
      content-directory-schemas/schemas/entityReferences/LicenseRef.schema.json
  33. 0 12
      content-directory-schemas/schemas/entityReferences/MediaLocationRef.schema.json
  34. 0 12
      content-directory-schemas/schemas/entityReferences/UserDefinedLicenseRef.schema.json
  35. 0 26
      content-directory-schemas/schemas/entityReferences/VideoMediaEncodingRef.schema.json
  36. 0 12
      content-directory-schemas/schemas/entityReferences/VideoMediaRef.schema.json
  37. 0 12
      content-directory-schemas/schemas/entityReferences/VideoRef.schema.json
  38. 13 0
      content-directory-schemas/scripts/inputSchemasToEntitySchemas.ts
  39. 5 1
      content-directory-schemas/scripts/schemasToTS.ts
  40. 0 71
      content-directory-schemas/types/entities/ChannelEntity.d.ts
  41. 0 20
      content-directory-schemas/types/entities/ContentCategoryEntity.d.ts
  42. 0 20
      content-directory-schemas/types/entities/HttpMediaLocationEntity.d.ts
  43. 0 16
      content-directory-schemas/types/entities/JoystreamMediaLocationEntity.d.ts
  44. 0 28
      content-directory-schemas/types/entities/KnownLicenseEntity.d.ts
  45. 0 20
      content-directory-schemas/types/entities/LanguageEntity.d.ts
  46. 0 78
      content-directory-schemas/types/entities/LicenseEntity.d.ts
  47. 0 70
      content-directory-schemas/types/entities/MediaLocationEntity.d.ts
  48. 0 16
      content-directory-schemas/types/entities/UserDefinedLicenseEntity.d.ts
  49. 0 402
      content-directory-schemas/types/entities/VideoEntity.d.ts
  50. 0 16
      content-directory-schemas/types/entities/VideoMediaEncodingEntity.d.ts
  51. 0 131
      content-directory-schemas/types/entities/VideoMediaEntity.d.ts
  52. 1 1
      package.json

+ 6 - 0
content-directory-schemas/.gitignore

@@ -1 +1,7 @@
 operations.json
+
+# Auto-generated
+schemas/entities
+schemas/entityBatches
+schemas/entityReferences
+types/entities

+ 0 - 75
content-directory-schemas/schemas/entities/ChannelEntity.schema.json

@@ -1,75 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ChannelEntity.schema.json",
-    "title": "ChannelEntity",
-    "description": "JSON schema for entities based on Channel runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "title",
-        "description",
-        "coverPhotoUrl",
-        "avatarPhotoURL",
-        "isPublic",
-        "isCurated"
-    ],
-    "properties": {
-        "title": {
-            "type": "string",
-            "maxLength": 64,
-            "description": "The title of the Channel"
-        },
-        "description": {
-            "type": "string",
-            "maxLength": 1024,
-            "description": "The description of a Channel"
-        },
-        "coverPhotoUrl": {
-            "type": "string",
-            "maxLength": 256,
-            "description": "Url for Channel's cover (background) photo. Recommended ratio: 16:9."
-        },
-        "avatarPhotoURL": {
-            "type": "string",
-            "maxLength": 256,
-            "description": "Channel's avatar photo."
-        },
-        "isPublic": {
-            "type": "boolean",
-            "description": "Flag signaling whether a channel is public."
-        },
-        "isCurated": {
-            "type": "boolean",
-            "description": "Flag signaling whether a channel is curated/verified."
-        },
-        "language": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./LanguageEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/LanguageRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "The primary langauge of the channel's content"
-        }
-    }
-}

+ 0 - 23
content-directory-schemas/schemas/entities/ContentCategoryEntity.schema.json

@@ -1,23 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ContentCategoryEntity.schema.json",
-    "title": "ContentCategoryEntity",
-    "description": "JSON schema for entities based on ContentCategory runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "Name"
-    ],
-    "properties": {
-        "Name": {
-            "type": "string",
-            "maxLength": 64,
-            "description": "The name of the category"
-        },
-        "Description": {
-            "type": "string",
-            "maxLength": 1024,
-            "description": "The description of the category"
-        }
-    }
-}

+ 0 - 24
content-directory-schemas/schemas/entities/HttpMediaLocationEntity.schema.json

@@ -1,24 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/HttpMediaLocationEntity.schema.json",
-    "title": "HttpMediaLocationEntity",
-    "description": "JSON schema for entities based on HttpMediaLocation runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "url"
-    ],
-    "properties": {
-        "url": {
-            "type": "string",
-            "maxLength": 256,
-            "description": "The http url pointing to the media"
-        },
-        "port": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 65535,
-            "description": "The port to use when connecting to the http url (defaults to 80)"
-        }
-    }
-}

+ 0 - 18
content-directory-schemas/schemas/entities/JoystreamMediaLocationEntity.schema.json

@@ -1,18 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/JoystreamMediaLocationEntity.schema.json",
-    "title": "JoystreamMediaLocationEntity",
-    "description": "JSON schema for entities based on JoystreamMediaLocation runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "dataObjectId"
-    ],
-    "properties": {
-        "dataObjectId": {
-            "type": "string",
-            "maxLength": 48,
-            "description": "Id of the data object in the Joystream runtime dataDirectory module"
-        }
-    }
-}

+ 0 - 33
content-directory-schemas/schemas/entities/KnownLicenseEntity.schema.json

@@ -1,33 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/KnownLicenseEntity.schema.json",
-    "title": "KnownLicenseEntity",
-    "description": "JSON schema for entities based on KnownLicense runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "code"
-    ],
-    "properties": {
-        "code": {
-            "type": "string",
-            "maxLength": 16,
-            "description": "Short, commonly recognized code of the licence (ie. CC_BY_SA)"
-        },
-        "name": {
-            "type": "string",
-            "maxLength": 64,
-            "description": "Full, descriptive name of the license (ie. Creative Commons - Attribution-NonCommercial-NoDerivs)"
-        },
-        "description": {
-            "type": "string",
-            "maxLength": 1024,
-            "description": "Short description of the license conditions"
-        },
-        "url": {
-            "type": "string",
-            "maxLength": 256,
-            "description": "An url pointing to full license content"
-        }
-    }
-}

+ 0 - 24
content-directory-schemas/schemas/entities/LanguageEntity.schema.json

@@ -1,24 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LanguageEntity.schema.json",
-    "title": "LanguageEntity",
-    "description": "JSON schema for entities based on Language runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "Name",
-        "Code"
-    ],
-    "properties": {
-        "Name": {
-            "type": "string",
-            "maxLength": 64,
-            "description": "The name of the language (ie. English)"
-        },
-        "Code": {
-            "type": "string",
-            "maxLength": 2,
-            "description": "ISO 639-1 code of the language (ie. en)"
-        }
-    }
-}

+ 0 - 69
content-directory-schemas/schemas/entities/LicenseEntity.schema.json

@@ -1,69 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LicenseEntity.schema.json",
-    "title": "LicenseEntity",
-    "description": "JSON schema for entities based on License runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [],
-    "properties": {
-        "knownLicense": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./KnownLicenseEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/KnownLicenseRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Reference to a known license"
-        },
-        "userDefinedLicense": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./UserDefinedLicenseEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/UserDefinedLicenseRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Reference to user-defined license"
-        }
-    }
-}

+ 0 - 69
content-directory-schemas/schemas/entities/MediaLocationEntity.schema.json

@@ -1,69 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/MediaLocationEntity.schema.json",
-    "title": "MediaLocationEntity",
-    "description": "JSON schema for entities based on MediaLocation runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [],
-    "properties": {
-        "httpMediaLocation": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./HttpMediaLocationEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/HttpMediaLocationRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "A reference to HttpMediaLocation"
-        },
-        "joystreamMediaLocation": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./JoystreamMediaLocationEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/JoystreamMediaLocationRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "A reference to JoystreamMediaLocation"
-        }
-    }
-}

+ 0 - 18
content-directory-schemas/schemas/entities/UserDefinedLicenseEntity.schema.json

@@ -1,18 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/UserDefinedLicenseEntity.schema.json",
-    "title": "UserDefinedLicenseEntity",
-    "description": "JSON schema for entities based on UserDefinedLicense runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "content"
-    ],
-    "properties": {
-        "content": {
-            "type": "string",
-            "maxLength": 4096,
-            "description": "Custom license content"
-        }
-    }
-}

+ 0 - 217
content-directory-schemas/schemas/entities/VideoEntity.schema.json

@@ -1,217 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoEntity.schema.json",
-    "title": "VideoEntity",
-    "description": "JSON schema for entities based on Video runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "channel",
-        "category",
-        "title",
-        "description",
-        "duration",
-        "thumbnailURL",
-        "media",
-        "isPublic",
-        "isCurated",
-        "isExplicit",
-        "license"
-    ],
-    "properties": {
-        "channel": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./ChannelEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/ChannelRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Reference to member's channel"
-        },
-        "category": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./ContentCategoryEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/ContentCategoryRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Reference to a video category"
-        },
-        "title": {
-            "type": "string",
-            "maxLength": 64,
-            "description": "The title of the video"
-        },
-        "description": {
-            "type": "string",
-            "maxLength": 1024,
-            "description": "The description of the Video"
-        },
-        "duration": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 4294967295,
-            "description": "Video duration in seconds"
-        },
-        "skippableIntroDuration": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 65535,
-            "description": "Video's kippable intro duration in seconds"
-        },
-        "thumbnailURL": {
-            "type": "string",
-            "maxLength": 256,
-            "description": "Video thumbnail url (recommended ratio: 16:9)"
-        },
-        "language": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./LanguageEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/LanguageRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Video's main langauge"
-        },
-        "media": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./VideoMediaEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/VideoMediaRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Reference to VideoMedia"
-        },
-        "hasMarketing": {
-            "type": "boolean",
-            "description": "Whether or not Video contains marketing"
-        },
-        "publishedBeforeJoystream": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 4294967295,
-            "description": "If the Video was published on other platform before beeing published on Joystream - the original publication date"
-        },
-        "isPublic": {
-            "type": "boolean",
-            "description": "Whether the Video is supposed to be publically displayed"
-        },
-        "isCurated": {
-            "type": "boolean",
-            "description": "Whether the Video has been curated (verified) by a Curator"
-        },
-        "isExplicit": {
-            "type": "boolean",
-            "description": "Whether the Video contains explicit material."
-        },
-        "license": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./LicenseEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/LicenseRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "A License the Video is published under"
-        }
-    }
-}

+ 0 - 18
content-directory-schemas/schemas/entities/VideoMediaEncodingEntity.schema.json

@@ -1,18 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaEncodingEntity.schema.json",
-    "title": "VideoMediaEncodingEntity",
-    "description": "JSON schema for entities based on VideoMediaEncoding runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "Name"
-    ],
-    "properties": {
-        "Name": {
-            "type": "string",
-            "maxLength": 32,
-            "description": "The name of the encoding format (ie. H264_mpeg4)"
-        }
-    }
-}

+ 0 - 91
content-directory-schemas/schemas/entities/VideoMediaEntity.schema.json

@@ -1,91 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaEntity.schema.json",
-    "title": "VideoMediaEntity",
-    "description": "JSON schema for entities based on VideoMedia runtime schema",
-    "type": "object",
-    "additionalProperties": false,
-    "required": [
-        "encoding",
-        "pixelWidth",
-        "pixelHeight",
-        "location"
-    ],
-    "properties": {
-        "encoding": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./VideoMediaEncodingEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/VideoMediaEncodingRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Encoding of the video media object"
-        },
-        "pixelWidth": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 65535,
-            "description": "Video media width in pixels"
-        },
-        "pixelHeight": {
-            "type": "integer",
-            "minimum": 0,
-            "maximum": 65535,
-            "description": "Video media height in pixels"
-        },
-        "size": {
-            "type": "integer",
-            "minimum": 0,
-            "description": "Video media size in bytes"
-        },
-        "location": {
-            "oneOf": [
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "new"
-                    ],
-                    "properties": {
-                        "new": {
-                            "$ref": "./MediaLocationEntity.schema.json"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "additionalProperties": false,
-                    "required": [
-                        "existing"
-                    ],
-                    "properties": {
-                        "existing": {
-                            "$ref": "../entityReferences/MediaLocationRef.schema.json"
-                        }
-                    }
-                }
-            ],
-            "description": "Location of the video media object"
-        }
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/ChannelBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ChannelBatch.schema.json",
-    "title": "ChannelBatch",
-    "description": "JSON schema for batch of entities based on Channel runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/ChannelEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/ContentCategoryBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ContentCategoryBatch.schema.json",
-    "title": "ContentCategoryBatch",
-    "description": "JSON schema for batch of entities based on ContentCategory runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/ContentCategoryEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/HttpMediaLocationBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/HttpMediaLocationBatch.schema.json",
-    "title": "HttpMediaLocationBatch",
-    "description": "JSON schema for batch of entities based on HttpMediaLocation runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/HttpMediaLocationEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/JoystreamMediaLocationBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/JoystreamMediaLocationBatch.schema.json",
-    "title": "JoystreamMediaLocationBatch",
-    "description": "JSON schema for batch of entities based on JoystreamMediaLocation runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/JoystreamMediaLocationEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/KnownLicenseBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/KnownLicenseBatch.schema.json",
-    "title": "KnownLicenseBatch",
-    "description": "JSON schema for batch of entities based on KnownLicense runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/KnownLicenseEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/LanguageBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LanguageBatch.schema.json",
-    "title": "LanguageBatch",
-    "description": "JSON schema for batch of entities based on Language runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/LanguageEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/LicenseBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LicenseBatch.schema.json",
-    "title": "LicenseBatch",
-    "description": "JSON schema for batch of entities based on License runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/LicenseEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/MediaLocationBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/MediaLocationBatch.schema.json",
-    "title": "MediaLocationBatch",
-    "description": "JSON schema for batch of entities based on MediaLocation runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/MediaLocationEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/UserDefinedLicenseBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/UserDefinedLicenseBatch.schema.json",
-    "title": "UserDefinedLicenseBatch",
-    "description": "JSON schema for batch of entities based on UserDefinedLicense runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/UserDefinedLicenseEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/VideoBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoBatch.schema.json",
-    "title": "VideoBatch",
-    "description": "JSON schema for batch of entities based on Video runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/VideoEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/VideoMediaBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaBatch.schema.json",
-    "title": "VideoMediaBatch",
-    "description": "JSON schema for batch of entities based on VideoMedia runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/VideoMediaEntity.schema.json"
-    }
-}

+ 0 - 10
content-directory-schemas/schemas/entityBatches/VideoMediaEncodingBatch.schema.json

@@ -1,10 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaEncodingBatch.schema.json",
-    "title": "VideoMediaEncodingBatch",
-    "description": "JSON schema for batch of entities based on VideoMediaEncoding runtime schema",
-    "type": "array",
-    "items": {
-        "$ref": "../entities/VideoMediaEncodingEntity.schema.json"
-    }
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/ChannelRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ChannelReference.schema.json",
-    "title": "ChannelReference",
-    "description": "JSON schema for reference to Channel entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "title"
-            ],
-            "properties": {
-                "title": {
-                    "type": "string",
-                    "maxLength": 64,
-                    "description": "The title of the Channel"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/ContentCategoryRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/ContentCategoryReference.schema.json",
-    "title": "ContentCategoryReference",
-    "description": "JSON schema for reference to ContentCategory entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "Name"
-            ],
-            "properties": {
-                "Name": {
-                    "type": "string",
-                    "maxLength": 64,
-                    "description": "The name of the category"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/HttpMediaLocationRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/HttpMediaLocationReference.schema.json",
-    "title": "HttpMediaLocationReference",
-    "description": "JSON schema for reference to HttpMediaLocation entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/JoystreamMediaLocationRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/JoystreamMediaLocationReference.schema.json",
-    "title": "JoystreamMediaLocationReference",
-    "description": "JSON schema for reference to JoystreamMediaLocation entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "dataObjectId"
-            ],
-            "properties": {
-                "dataObjectId": {
-                    "type": "string",
-                    "maxLength": 48,
-                    "description": "Id of the data object in the Joystream runtime dataDirectory module"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/KnownLicenseRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/KnownLicenseReference.schema.json",
-    "title": "KnownLicenseReference",
-    "description": "JSON schema for reference to KnownLicense entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "code"
-            ],
-            "properties": {
-                "code": {
-                    "type": "string",
-                    "maxLength": 16,
-                    "description": "Short, commonly recognized code of the licence (ie. CC_BY_SA)"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/LanguageRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LanguageReference.schema.json",
-    "title": "LanguageReference",
-    "description": "JSON schema for reference to Language entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "Code"
-            ],
-            "properties": {
-                "Code": {
-                    "type": "string",
-                    "maxLength": 2,
-                    "description": "ISO 639-1 code of the language (ie. en)"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/LicenseRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/LicenseReference.schema.json",
-    "title": "LicenseReference",
-    "description": "JSON schema for reference to License entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/MediaLocationRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/MediaLocationReference.schema.json",
-    "title": "MediaLocationReference",
-    "description": "JSON schema for reference to MediaLocation entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/UserDefinedLicenseRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/UserDefinedLicenseReference.schema.json",
-    "title": "UserDefinedLicenseReference",
-    "description": "JSON schema for reference to UserDefinedLicense entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 26
content-directory-schemas/schemas/entityReferences/VideoMediaEncodingRef.schema.json

@@ -1,26 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaEncodingReference.schema.json",
-    "title": "VideoMediaEncodingReference",
-    "description": "JSON schema for reference to VideoMediaEncoding entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "object",
-            "additionalProperties": false,
-            "required": [
-                "Name"
-            ],
-            "properties": {
-                "Name": {
-                    "type": "string",
-                    "maxLength": 32,
-                    "description": "The name of the encoding format (ie. H264_mpeg4)"
-                }
-            }
-        },
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/VideoMediaRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoMediaReference.schema.json",
-    "title": "VideoMediaReference",
-    "description": "JSON schema for reference to VideoMedia entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 0 - 12
content-directory-schemas/schemas/entityReferences/VideoRef.schema.json

@@ -1,12 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema",
-    "$id": "https://joystream.org/VideoReference.schema.json",
-    "title": "VideoReference",
-    "description": "JSON schema for reference to Video entity based on runtime schema",
-    "anyOf": [
-        {
-            "type": "integer",
-            "minimum": 0
-        }
-    ]
-}

+ 13 - 0
content-directory-schemas/scripts/inputSchemasToEntitySchemas.ts

@@ -82,6 +82,19 @@ const PropertyDef = ({ property_type: propertyType, description }: Property) =>
   description,
 })
 
+// Mkdir entity schemas directories if they do not exist
+const entitySchemasDirs = [
+  SINGLE_ENTITY_SCHEMAS_LOCATION,
+  BATCH_OF_ENITIES_SCHEMAS_LOCATION,
+  ENTITY_REFERENCE_SCHEMAS_LOCATION,
+]
+entitySchemasDirs.forEach((dir) => {
+  if (!fs.existsSync(dir)) {
+    fs.mkdirSync(dir)
+  }
+})
+
+// Run schema conversion:
 inputFilenames.forEach((fileName) => {
   const inputFilePath = path.join(INPUTS_LOCATION, fileName)
   const inputJson = fs.readFileSync(inputFilePath).toString()

+ 5 - 1
content-directory-schemas/scripts/schemasToTS.ts

@@ -19,7 +19,11 @@ async function main() {
     for (const schemaFilename of fs.readdirSync(path.join(SCHEMAS_LOCATION, schemaSubdir))) {
       const schemaFilePath = path.join(SCHEMAS_LOCATION, schemaSubdir, schemaFilename)
       const outputFilename = schemaFilename.replace('.schema.json', '.d.ts')
-      const outputFilePath = path.join(OUTPUT_TYPES_LOCATION, schemaSubdir, outputFilename)
+      const outputDir = path.join(OUTPUT_TYPES_LOCATION, schemaSubdir)
+      if (!fs.existsSync(outputDir)) {
+        fs.mkdirSync(outputDir)
+      }
+      const outputFilePath = path.join(outputDir, outputFilename)
       try {
         await compileFromFile(schemaFilePath, {
           cwd: path.join(SCHEMAS_LOCATION, schemaSubdir),

+ 0 - 71
content-directory-schemas/types/entities/ChannelEntity.d.ts

@@ -1,71 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for reference to Language entity based on runtime schema
- */
-export type LanguageReference =
-  | {
-      /**
-       * ISO 639-1 code of the language (ie. en)
-       */
-      Code: string
-    }
-  | number
-
-/**
- * JSON schema for entities based on Channel runtime schema
- */
-export interface ChannelEntity {
-  /**
-   * The title of the Channel
-   */
-  title: string
-  /**
-   * The description of a Channel
-   */
-  description: string
-  /**
-   * Url for Channel's cover (background) photo. Recommended ratio: 16:9.
-   */
-  coverPhotoUrl: string
-  /**
-   * Channel's avatar photo.
-   */
-  avatarPhotoURL: string
-  /**
-   * Flag signaling whether a channel is public.
-   */
-  isPublic: boolean
-  /**
-   * Flag signaling whether a channel is curated/verified.
-   */
-  isCurated: boolean
-  /**
-   * The primary langauge of the channel's content
-   */
-  language?:
-    | {
-        new: LanguageEntity
-      }
-    | {
-        existing: LanguageReference
-      }
-}
-/**
- * JSON schema for entities based on Language runtime schema
- */
-export interface LanguageEntity {
-  /**
-   * The name of the language (ie. English)
-   */
-  Name: string
-  /**
-   * ISO 639-1 code of the language (ie. en)
-   */
-  Code: string
-}

+ 0 - 20
content-directory-schemas/types/entities/ContentCategoryEntity.d.ts

@@ -1,20 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on ContentCategory runtime schema
- */
-export interface ContentCategoryEntity {
-  /**
-   * The name of the category
-   */
-  Name: string
-  /**
-   * The description of the category
-   */
-  Description?: string
-}

+ 0 - 20
content-directory-schemas/types/entities/HttpMediaLocationEntity.d.ts

@@ -1,20 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on HttpMediaLocation runtime schema
- */
-export interface HttpMediaLocationEntity {
-  /**
-   * The http url pointing to the media
-   */
-  url: string
-  /**
-   * The port to use when connecting to the http url (defaults to 80)
-   */
-  port?: number
-}

+ 0 - 16
content-directory-schemas/types/entities/JoystreamMediaLocationEntity.d.ts

@@ -1,16 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on JoystreamMediaLocation runtime schema
- */
-export interface JoystreamMediaLocationEntity {
-  /**
-   * Id of the data object in the Joystream runtime dataDirectory module
-   */
-  dataObjectId: string
-}

+ 0 - 28
content-directory-schemas/types/entities/KnownLicenseEntity.d.ts

@@ -1,28 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on KnownLicense runtime schema
- */
-export interface KnownLicenseEntity {
-  /**
-   * Short, commonly recognized code of the licence (ie. CC_BY_SA)
-   */
-  code: string
-  /**
-   * Full, descriptive name of the license (ie. Creative Commons - Attribution-NonCommercial-NoDerivs)
-   */
-  name?: string
-  /**
-   * Short description of the license conditions
-   */
-  description?: string
-  /**
-   * An url pointing to full license content
-   */
-  url?: string
-}

+ 0 - 20
content-directory-schemas/types/entities/LanguageEntity.d.ts

@@ -1,20 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on Language runtime schema
- */
-export interface LanguageEntity {
-  /**
-   * The name of the language (ie. English)
-   */
-  Name: string
-  /**
-   * ISO 639-1 code of the language (ie. en)
-   */
-  Code: string
-}

+ 0 - 78
content-directory-schemas/types/entities/LicenseEntity.d.ts

@@ -1,78 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for reference to KnownLicense entity based on runtime schema
- */
-export type KnownLicenseReference =
-  | {
-      /**
-       * Short, commonly recognized code of the licence (ie. CC_BY_SA)
-       */
-      code: string
-    }
-  | number
-/**
- * JSON schema for reference to UserDefinedLicense entity based on runtime schema
- */
-export type UserDefinedLicenseReference = number
-
-/**
- * JSON schema for entities based on License runtime schema
- */
-export interface LicenseEntity {
-  /**
-   * Reference to a known license
-   */
-  knownLicense?:
-    | {
-        new: KnownLicenseEntity
-      }
-    | {
-        existing: KnownLicenseReference
-      }
-  /**
-   * Reference to user-defined license
-   */
-  userDefinedLicense?:
-    | {
-        new: UserDefinedLicenseEntity
-      }
-    | {
-        existing: UserDefinedLicenseReference
-      }
-}
-/**
- * JSON schema for entities based on KnownLicense runtime schema
- */
-export interface KnownLicenseEntity {
-  /**
-   * Short, commonly recognized code of the licence (ie. CC_BY_SA)
-   */
-  code: string
-  /**
-   * Full, descriptive name of the license (ie. Creative Commons - Attribution-NonCommercial-NoDerivs)
-   */
-  name?: string
-  /**
-   * Short description of the license conditions
-   */
-  description?: string
-  /**
-   * An url pointing to full license content
-   */
-  url?: string
-}
-/**
- * JSON schema for entities based on UserDefinedLicense runtime schema
- */
-export interface UserDefinedLicenseEntity {
-  /**
-   * Custom license content
-   */
-  content: string
-}

+ 0 - 70
content-directory-schemas/types/entities/MediaLocationEntity.d.ts

@@ -1,70 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for reference to HttpMediaLocation entity based on runtime schema
- */
-export type HttpMediaLocationReference = number
-/**
- * JSON schema for reference to JoystreamMediaLocation entity based on runtime schema
- */
-export type JoystreamMediaLocationReference =
-  | {
-      /**
-       * Id of the data object in the Joystream runtime dataDirectory module
-       */
-      dataObjectId: string
-    }
-  | number
-
-/**
- * JSON schema for entities based on MediaLocation runtime schema
- */
-export interface MediaLocationEntity {
-  /**
-   * A reference to HttpMediaLocation
-   */
-  httpMediaLocation?:
-    | {
-        new: HttpMediaLocationEntity
-      }
-    | {
-        existing: HttpMediaLocationReference
-      }
-  /**
-   * A reference to JoystreamMediaLocation
-   */
-  joystreamMediaLocation?:
-    | {
-        new: JoystreamMediaLocationEntity
-      }
-    | {
-        existing: JoystreamMediaLocationReference
-      }
-}
-/**
- * JSON schema for entities based on HttpMediaLocation runtime schema
- */
-export interface HttpMediaLocationEntity {
-  /**
-   * The http url pointing to the media
-   */
-  url: string
-  /**
-   * The port to use when connecting to the http url (defaults to 80)
-   */
-  port?: number
-}
-/**
- * JSON schema for entities based on JoystreamMediaLocation runtime schema
- */
-export interface JoystreamMediaLocationEntity {
-  /**
-   * Id of the data object in the Joystream runtime dataDirectory module
-   */
-  dataObjectId: string
-}

+ 0 - 16
content-directory-schemas/types/entities/UserDefinedLicenseEntity.d.ts

@@ -1,16 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on UserDefinedLicense runtime schema
- */
-export interface UserDefinedLicenseEntity {
-  /**
-   * Custom license content
-   */
-  content: string
-}

+ 0 - 402
content-directory-schemas/types/entities/VideoEntity.d.ts

@@ -1,402 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for reference to Language entity based on runtime schema
- */
-export type LanguageReference =
-  | {
-      /**
-       * ISO 639-1 code of the language (ie. en)
-       */
-      Code: string
-    }
-  | number
-/**
- * JSON schema for reference to Channel entity based on runtime schema
- */
-export type ChannelReference =
-  | {
-      /**
-       * The title of the Channel
-       */
-      title: string
-    }
-  | number
-/**
- * JSON schema for reference to ContentCategory entity based on runtime schema
- */
-export type ContentCategoryReference =
-  | {
-      /**
-       * The name of the category
-       */
-      Name: string
-    }
-  | number
-/**
- * JSON schema for reference to VideoMediaEncoding entity based on runtime schema
- */
-export type VideoMediaEncodingReference =
-  | {
-      /**
-       * The name of the encoding format (ie. H264_mpeg4)
-       */
-      Name: string
-    }
-  | number
-/**
- * JSON schema for reference to HttpMediaLocation entity based on runtime schema
- */
-export type HttpMediaLocationReference = number
-/**
- * JSON schema for reference to JoystreamMediaLocation entity based on runtime schema
- */
-export type JoystreamMediaLocationReference =
-  | {
-      /**
-       * Id of the data object in the Joystream runtime dataDirectory module
-       */
-      dataObjectId: string
-    }
-  | number
-/**
- * JSON schema for reference to MediaLocation entity based on runtime schema
- */
-export type MediaLocationReference = number
-/**
- * JSON schema for reference to VideoMedia entity based on runtime schema
- */
-export type VideoMediaReference = number
-/**
- * JSON schema for reference to KnownLicense entity based on runtime schema
- */
-export type KnownLicenseReference =
-  | {
-      /**
-       * Short, commonly recognized code of the licence (ie. CC_BY_SA)
-       */
-      code: string
-    }
-  | number
-/**
- * JSON schema for reference to UserDefinedLicense entity based on runtime schema
- */
-export type UserDefinedLicenseReference = number
-/**
- * JSON schema for reference to License entity based on runtime schema
- */
-export type LicenseReference = number
-
-/**
- * JSON schema for entities based on Video runtime schema
- */
-export interface VideoEntity {
-  /**
-   * Reference to member's channel
-   */
-  channel:
-    | {
-        new: ChannelEntity
-      }
-    | {
-        existing: ChannelReference
-      }
-  /**
-   * Reference to a video category
-   */
-  category:
-    | {
-        new: ContentCategoryEntity
-      }
-    | {
-        existing: ContentCategoryReference
-      }
-  /**
-   * The title of the video
-   */
-  title: string
-  /**
-   * The description of the Video
-   */
-  description: string
-  /**
-   * Video duration in seconds
-   */
-  duration: number
-  /**
-   * Video's kippable intro duration in seconds
-   */
-  skippableIntroDuration?: number
-  /**
-   * Video thumbnail url (recommended ratio: 16:9)
-   */
-  thumbnailURL: string
-  /**
-   * Video's main langauge
-   */
-  language?:
-    | {
-        new: LanguageEntity
-      }
-    | {
-        existing: LanguageReference
-      }
-  /**
-   * Reference to VideoMedia
-   */
-  media:
-    | {
-        new: VideoMediaEntity
-      }
-    | {
-        existing: VideoMediaReference
-      }
-  /**
-   * Whether or not Video contains marketing
-   */
-  hasMarketing?: boolean
-  /**
-   * If the Video was published on other platform before beeing published on Joystream - the original publication date
-   */
-  publishedBeforeJoystream?: number
-  /**
-   * Whether the Video is supposed to be publically displayed
-   */
-  isPublic: boolean
-  /**
-   * Whether the Video has been curated (verified) by a Curator
-   */
-  isCurated: boolean
-  /**
-   * Whether the Video contains explicit material.
-   */
-  isExplicit: boolean
-  /**
-   * A License the Video is published under
-   */
-  license:
-    | {
-        new: LicenseEntity
-      }
-    | {
-        existing: LicenseReference
-      }
-}
-/**
- * JSON schema for entities based on Channel runtime schema
- */
-export interface ChannelEntity {
-  /**
-   * The title of the Channel
-   */
-  title: string
-  /**
-   * The description of a Channel
-   */
-  description: string
-  /**
-   * Url for Channel's cover (background) photo. Recommended ratio: 16:9.
-   */
-  coverPhotoUrl: string
-  /**
-   * Channel's avatar photo.
-   */
-  avatarPhotoURL: string
-  /**
-   * Flag signaling whether a channel is public.
-   */
-  isPublic: boolean
-  /**
-   * Flag signaling whether a channel is curated/verified.
-   */
-  isCurated: boolean
-  /**
-   * The primary langauge of the channel's content
-   */
-  language?:
-    | {
-        new: LanguageEntity
-      }
-    | {
-        existing: LanguageReference
-      }
-}
-/**
- * JSON schema for entities based on Language runtime schema
- */
-export interface LanguageEntity {
-  /**
-   * The name of the language (ie. English)
-   */
-  Name: string
-  /**
-   * ISO 639-1 code of the language (ie. en)
-   */
-  Code: string
-}
-/**
- * JSON schema for entities based on ContentCategory runtime schema
- */
-export interface ContentCategoryEntity {
-  /**
-   * The name of the category
-   */
-  Name: string
-  /**
-   * The description of the category
-   */
-  Description?: string
-}
-/**
- * JSON schema for entities based on VideoMedia runtime schema
- */
-export interface VideoMediaEntity {
-  /**
-   * Encoding of the video media object
-   */
-  encoding:
-    | {
-        new: VideoMediaEncodingEntity
-      }
-    | {
-        existing: VideoMediaEncodingReference
-      }
-  /**
-   * Video media width in pixels
-   */
-  pixelWidth: number
-  /**
-   * Video media height in pixels
-   */
-  pixelHeight: number
-  /**
-   * Video media size in bytes
-   */
-  size?: number
-  /**
-   * Location of the video media object
-   */
-  location:
-    | {
-        new: MediaLocationEntity
-      }
-    | {
-        existing: MediaLocationReference
-      }
-}
-/**
- * JSON schema for entities based on VideoMediaEncoding runtime schema
- */
-export interface VideoMediaEncodingEntity {
-  /**
-   * The name of the encoding format (ie. H264_mpeg4)
-   */
-  Name: string
-}
-/**
- * JSON schema for entities based on MediaLocation runtime schema
- */
-export interface MediaLocationEntity {
-  /**
-   * A reference to HttpMediaLocation
-   */
-  httpMediaLocation?:
-    | {
-        new: HttpMediaLocationEntity
-      }
-    | {
-        existing: HttpMediaLocationReference
-      }
-  /**
-   * A reference to JoystreamMediaLocation
-   */
-  joystreamMediaLocation?:
-    | {
-        new: JoystreamMediaLocationEntity
-      }
-    | {
-        existing: JoystreamMediaLocationReference
-      }
-}
-/**
- * JSON schema for entities based on HttpMediaLocation runtime schema
- */
-export interface HttpMediaLocationEntity {
-  /**
-   * The http url pointing to the media
-   */
-  url: string
-  /**
-   * The port to use when connecting to the http url (defaults to 80)
-   */
-  port?: number
-}
-/**
- * JSON schema for entities based on JoystreamMediaLocation runtime schema
- */
-export interface JoystreamMediaLocationEntity {
-  /**
-   * Id of the data object in the Joystream runtime dataDirectory module
-   */
-  dataObjectId: string
-}
-/**
- * JSON schema for entities based on License runtime schema
- */
-export interface LicenseEntity {
-  /**
-   * Reference to a known license
-   */
-  knownLicense?:
-    | {
-        new: KnownLicenseEntity
-      }
-    | {
-        existing: KnownLicenseReference
-      }
-  /**
-   * Reference to user-defined license
-   */
-  userDefinedLicense?:
-    | {
-        new: UserDefinedLicenseEntity
-      }
-    | {
-        existing: UserDefinedLicenseReference
-      }
-}
-/**
- * JSON schema for entities based on KnownLicense runtime schema
- */
-export interface KnownLicenseEntity {
-  /**
-   * Short, commonly recognized code of the licence (ie. CC_BY_SA)
-   */
-  code: string
-  /**
-   * Full, descriptive name of the license (ie. Creative Commons - Attribution-NonCommercial-NoDerivs)
-   */
-  name?: string
-  /**
-   * Short description of the license conditions
-   */
-  description?: string
-  /**
-   * An url pointing to full license content
-   */
-  url?: string
-}
-/**
- * JSON schema for entities based on UserDefinedLicense runtime schema
- */
-export interface UserDefinedLicenseEntity {
-  /**
-   * Custom license content
-   */
-  content: string
-}

+ 0 - 16
content-directory-schemas/types/entities/VideoMediaEncodingEntity.d.ts

@@ -1,16 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for entities based on VideoMediaEncoding runtime schema
- */
-export interface VideoMediaEncodingEntity {
-  /**
-   * The name of the encoding format (ie. H264_mpeg4)
-   */
-  Name: string
-}

+ 0 - 131
content-directory-schemas/types/entities/VideoMediaEntity.d.ts

@@ -1,131 +0,0 @@
-/* tslint:disable */
-/**
- * This file was automatically generated by json-schema-to-typescript.
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
- * and run json-schema-to-typescript to regenerate this file.
- */
-
-/**
- * JSON schema for reference to VideoMediaEncoding entity based on runtime schema
- */
-export type VideoMediaEncodingReference =
-  | {
-      /**
-       * The name of the encoding format (ie. H264_mpeg4)
-       */
-      Name: string
-    }
-  | number
-/**
- * JSON schema for reference to HttpMediaLocation entity based on runtime schema
- */
-export type HttpMediaLocationReference = number
-/**
- * JSON schema for reference to JoystreamMediaLocation entity based on runtime schema
- */
-export type JoystreamMediaLocationReference =
-  | {
-      /**
-       * Id of the data object in the Joystream runtime dataDirectory module
-       */
-      dataObjectId: string
-    }
-  | number
-/**
- * JSON schema for reference to MediaLocation entity based on runtime schema
- */
-export type MediaLocationReference = number
-
-/**
- * JSON schema for entities based on VideoMedia runtime schema
- */
-export interface VideoMediaEntity {
-  /**
-   * Encoding of the video media object
-   */
-  encoding:
-    | {
-        new: VideoMediaEncodingEntity
-      }
-    | {
-        existing: VideoMediaEncodingReference
-      }
-  /**
-   * Video media width in pixels
-   */
-  pixelWidth: number
-  /**
-   * Video media height in pixels
-   */
-  pixelHeight: number
-  /**
-   * Video media size in bytes
-   */
-  size?: number
-  /**
-   * Location of the video media object
-   */
-  location:
-    | {
-        new: MediaLocationEntity
-      }
-    | {
-        existing: MediaLocationReference
-      }
-}
-/**
- * JSON schema for entities based on VideoMediaEncoding runtime schema
- */
-export interface VideoMediaEncodingEntity {
-  /**
-   * The name of the encoding format (ie. H264_mpeg4)
-   */
-  Name: string
-}
-/**
- * JSON schema for entities based on MediaLocation runtime schema
- */
-export interface MediaLocationEntity {
-  /**
-   * A reference to HttpMediaLocation
-   */
-  httpMediaLocation?:
-    | {
-        new: HttpMediaLocationEntity
-      }
-    | {
-        existing: HttpMediaLocationReference
-      }
-  /**
-   * A reference to JoystreamMediaLocation
-   */
-  joystreamMediaLocation?:
-    | {
-        new: JoystreamMediaLocationEntity
-      }
-    | {
-        existing: JoystreamMediaLocationReference
-      }
-}
-/**
- * JSON schema for entities based on HttpMediaLocation runtime schema
- */
-export interface HttpMediaLocationEntity {
-  /**
-   * The http url pointing to the media
-   */
-  url: string
-  /**
-   * The port to use when connecting to the http url (defaults to 80)
-   */
-  port?: number
-}
-/**
- * JSON schema for entities based on JoystreamMediaLocation runtime schema
- */
-export interface JoystreamMediaLocationEntity {
-  /**
-   * Id of the data object in the Joystream runtime dataDirectory module
-   */
-  dataObjectId: string
-}

+ 1 - 1
package.json

@@ -6,7 +6,7 @@
   "scripts": {
     "test": "yarn && yarn workspaces run test",
     "test-migration": "yarn && yarn workspaces run test-migration",
-    "postinstall": "yarn workspace @joystream/types build",
+    "postinstall": "yarn workspace @joystream/types build && yarn workspace cd-schemas generate:all",
     "cargo-checks": "devops/git-hooks/pre-commit && devops/git-hooks/pre-push",
     "cargo-build": "scripts/cargo-build.sh",
     "lint": "yarn workspaces run lint"