Переглянути джерело

Merge branch 'giza-protobuf-and-query-node' into giza_staging_mappings_and_api

Leszek Wiesner 3 роки тому
батько
коміт
f690d269d0

+ 0 - 16
metadata-protobuf/compile.sh

@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-# Directory to write generated code to (.js and .d.ts files)
-OUT_DIR="./compiled"
-mkdir -p ${OUT_DIR}
-
-yarn pbjs \
-  -t="static-module" \
-  -w="commonjs" \
-  -o="${OUT_DIR}/index.js" \
-  --force-long \
-  proto/*.proto
-
-yarn pbts \
-  -o="${OUT_DIR}/index.d.ts" \
-  ${OUT_DIR}/*.js

+ 0 - 1723
metadata-protobuf/compiled/index.d.ts

@@ -1,1723 +0,0 @@
-import { Long } from 'long'
-import * as $protobuf from "protobufjs";
-/** Properties of a ChannelMetadata. */
-export interface IChannelMetadata {
-
-    /** ChannelMetadata title */
-    title?: (string|null);
-
-    /** ChannelMetadata description */
-    description?: (string|null);
-
-    /** ChannelMetadata isPublic */
-    isPublic?: (boolean|null);
-
-    /** ChannelMetadata language */
-    language?: (string|null);
-
-    /** ChannelMetadata coverPhoto */
-    coverPhoto?: (number|null);
-
-    /** ChannelMetadata avatarPhoto */
-    avatarPhoto?: (number|null);
-
-    /** ChannelMetadata category */
-    category?: (Long|null);
-}
-
-/** Represents a ChannelMetadata. */
-export class ChannelMetadata implements IChannelMetadata {
-
-    /**
-     * Constructs a new ChannelMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IChannelMetadata);
-
-    /** ChannelMetadata title. */
-    public title: string;
-
-    /** ChannelMetadata description. */
-    public description: string;
-
-    /** ChannelMetadata isPublic. */
-    public isPublic: boolean;
-
-    /** ChannelMetadata language. */
-    public language: string;
-
-    /** ChannelMetadata coverPhoto. */
-    public coverPhoto: number;
-
-    /** ChannelMetadata avatarPhoto. */
-    public avatarPhoto: number;
-
-    /** ChannelMetadata category. */
-    public category: Long;
-
-    /**
-     * Creates a new ChannelMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns ChannelMetadata instance
-     */
-    public static create(properties?: IChannelMetadata): ChannelMetadata;
-
-    /**
-     * Encodes the specified ChannelMetadata message. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
-     * @param message ChannelMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IChannelMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified ChannelMetadata message, length delimited. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
-     * @param message ChannelMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IChannelMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a ChannelMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns ChannelMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ChannelMetadata;
-
-    /**
-     * Decodes a ChannelMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns ChannelMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ChannelMetadata;
-
-    /**
-     * Verifies a ChannelMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a ChannelMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns ChannelMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): ChannelMetadata;
-
-    /**
-     * Creates a plain object from a ChannelMetadata message. Also converts values to other types if specified.
-     * @param message ChannelMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: ChannelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this ChannelMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a ChannelCategoryMetadata. */
-export interface IChannelCategoryMetadata {
-
-    /** ChannelCategoryMetadata name */
-    name?: (string|null);
-}
-
-/** Represents a ChannelCategoryMetadata. */
-export class ChannelCategoryMetadata implements IChannelCategoryMetadata {
-
-    /**
-     * Constructs a new ChannelCategoryMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IChannelCategoryMetadata);
-
-    /** ChannelCategoryMetadata name. */
-    public name: string;
-
-    /**
-     * Creates a new ChannelCategoryMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns ChannelCategoryMetadata instance
-     */
-    public static create(properties?: IChannelCategoryMetadata): ChannelCategoryMetadata;
-
-    /**
-     * Encodes the specified ChannelCategoryMetadata message. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
-     * @param message ChannelCategoryMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IChannelCategoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified ChannelCategoryMetadata message, length delimited. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
-     * @param message ChannelCategoryMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IChannelCategoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a ChannelCategoryMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns ChannelCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ChannelCategoryMetadata;
-
-    /**
-     * Decodes a ChannelCategoryMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns ChannelCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ChannelCategoryMetadata;
-
-    /**
-     * Verifies a ChannelCategoryMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a ChannelCategoryMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns ChannelCategoryMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): ChannelCategoryMetadata;
-
-    /**
-     * Creates a plain object from a ChannelCategoryMetadata message. Also converts values to other types if specified.
-     * @param message ChannelCategoryMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: ChannelCategoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this ChannelCategoryMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a PersonMetadata. */
-export interface IPersonMetadata {
-
-    /** PersonMetadata firstName */
-    firstName?: (string|null);
-
-    /** PersonMetadata middleName */
-    middleName?: (string|null);
-
-    /** PersonMetadata lastName */
-    lastName?: (string|null);
-
-    /** PersonMetadata about */
-    about?: (string|null);
-
-    /** PersonMetadata coverPhoto */
-    coverPhoto?: (number|null);
-
-    /** PersonMetadata avatarPhoto */
-    avatarPhoto?: (number|null);
-}
-
-/** Represents a PersonMetadata. */
-export class PersonMetadata implements IPersonMetadata {
-
-    /**
-     * Constructs a new PersonMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IPersonMetadata);
-
-    /** PersonMetadata firstName. */
-    public firstName: string;
-
-    /** PersonMetadata middleName. */
-    public middleName: string;
-
-    /** PersonMetadata lastName. */
-    public lastName: string;
-
-    /** PersonMetadata about. */
-    public about: string;
-
-    /** PersonMetadata coverPhoto. */
-    public coverPhoto: number;
-
-    /** PersonMetadata avatarPhoto. */
-    public avatarPhoto: number;
-
-    /**
-     * Creates a new PersonMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns PersonMetadata instance
-     */
-    public static create(properties?: IPersonMetadata): PersonMetadata;
-
-    /**
-     * Encodes the specified PersonMetadata message. Does not implicitly {@link PersonMetadata.verify|verify} messages.
-     * @param message PersonMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IPersonMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified PersonMetadata message, length delimited. Does not implicitly {@link PersonMetadata.verify|verify} messages.
-     * @param message PersonMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IPersonMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a PersonMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns PersonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PersonMetadata;
-
-    /**
-     * Decodes a PersonMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns PersonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PersonMetadata;
-
-    /**
-     * Verifies a PersonMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a PersonMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns PersonMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): PersonMetadata;
-
-    /**
-     * Creates a plain object from a PersonMetadata message. Also converts values to other types if specified.
-     * @param message PersonMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: PersonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this PersonMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a PlaylistMetadata. */
-export interface IPlaylistMetadata {
-
-    /** PlaylistMetadata title */
-    title?: (string|null);
-
-    /** PlaylistMetadata videos */
-    videos?: (Long[]|null);
-}
-
-/** Represents a PlaylistMetadata. */
-export class PlaylistMetadata implements IPlaylistMetadata {
-
-    /**
-     * Constructs a new PlaylistMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IPlaylistMetadata);
-
-    /** PlaylistMetadata title. */
-    public title: string;
-
-    /** PlaylistMetadata videos. */
-    public videos: Long[];
-
-    /**
-     * Creates a new PlaylistMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns PlaylistMetadata instance
-     */
-    public static create(properties?: IPlaylistMetadata): PlaylistMetadata;
-
-    /**
-     * Encodes the specified PlaylistMetadata message. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
-     * @param message PlaylistMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IPlaylistMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified PlaylistMetadata message, length delimited. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
-     * @param message PlaylistMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IPlaylistMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a PlaylistMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns PlaylistMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PlaylistMetadata;
-
-    /**
-     * Decodes a PlaylistMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns PlaylistMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PlaylistMetadata;
-
-    /**
-     * Verifies a PlaylistMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a PlaylistMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns PlaylistMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): PlaylistMetadata;
-
-    /**
-     * Creates a plain object from a PlaylistMetadata message. Also converts values to other types if specified.
-     * @param message PlaylistMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: PlaylistMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this PlaylistMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a SeriesMetadata. */
-export interface ISeriesMetadata {
-
-    /** SeriesMetadata title */
-    title?: (string|null);
-
-    /** SeriesMetadata description */
-    description?: (string|null);
-
-    /** SeriesMetadata coverPhoto */
-    coverPhoto?: (number|null);
-
-    /** SeriesMetadata persons */
-    persons?: (Long[]|null);
-}
-
-/** Represents a SeriesMetadata. */
-export class SeriesMetadata implements ISeriesMetadata {
-
-    /**
-     * Constructs a new SeriesMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: ISeriesMetadata);
-
-    /** SeriesMetadata title. */
-    public title: string;
-
-    /** SeriesMetadata description. */
-    public description: string;
-
-    /** SeriesMetadata coverPhoto. */
-    public coverPhoto: number;
-
-    /** SeriesMetadata persons. */
-    public persons: Long[];
-
-    /**
-     * Creates a new SeriesMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns SeriesMetadata instance
-     */
-    public static create(properties?: ISeriesMetadata): SeriesMetadata;
-
-    /**
-     * Encodes the specified SeriesMetadata message. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
-     * @param message SeriesMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: ISeriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
-     * @param message SeriesMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: ISeriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a SeriesMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns SeriesMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SeriesMetadata;
-
-    /**
-     * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns SeriesMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SeriesMetadata;
-
-    /**
-     * Verifies a SeriesMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns SeriesMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): SeriesMetadata;
-
-    /**
-     * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified.
-     * @param message SeriesMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: SeriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this SeriesMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a SeasonMetadata. */
-export interface ISeasonMetadata {
-
-    /** SeasonMetadata title */
-    title?: (string|null);
-
-    /** SeasonMetadata description */
-    description?: (string|null);
-
-    /** SeasonMetadata coverPhoto */
-    coverPhoto?: (number|null);
-
-    /** SeasonMetadata persons */
-    persons?: (Long[]|null);
-}
-
-/** Represents a SeasonMetadata. */
-export class SeasonMetadata implements ISeasonMetadata {
-
-    /**
-     * Constructs a new SeasonMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: ISeasonMetadata);
-
-    /** SeasonMetadata title. */
-    public title: string;
-
-    /** SeasonMetadata description. */
-    public description: string;
-
-    /** SeasonMetadata coverPhoto. */
-    public coverPhoto: number;
-
-    /** SeasonMetadata persons. */
-    public persons: Long[];
-
-    /**
-     * Creates a new SeasonMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns SeasonMetadata instance
-     */
-    public static create(properties?: ISeasonMetadata): SeasonMetadata;
-
-    /**
-     * Encodes the specified SeasonMetadata message. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
-     * @param message SeasonMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: ISeasonMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified SeasonMetadata message, length delimited. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
-     * @param message SeasonMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: ISeasonMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a SeasonMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns SeasonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SeasonMetadata;
-
-    /**
-     * Decodes a SeasonMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns SeasonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SeasonMetadata;
-
-    /**
-     * Verifies a SeasonMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a SeasonMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns SeasonMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): SeasonMetadata;
-
-    /**
-     * Creates a plain object from a SeasonMetadata message. Also converts values to other types if specified.
-     * @param message SeasonMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: SeasonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this SeasonMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a GeoCoordiantes. */
-export interface IGeoCoordiantes {
-
-    /** GeoCoordiantes latitude */
-    latitude?: (number|null);
-
-    /** GeoCoordiantes longitude */
-    longitude?: (number|null);
-}
-
-/** Represents a GeoCoordiantes. */
-export class GeoCoordiantes implements IGeoCoordiantes {
-
-    /**
-     * Constructs a new GeoCoordiantes.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IGeoCoordiantes);
-
-    /** GeoCoordiantes latitude. */
-    public latitude: number;
-
-    /** GeoCoordiantes longitude. */
-    public longitude: number;
-
-    /**
-     * Creates a new GeoCoordiantes instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns GeoCoordiantes instance
-     */
-    public static create(properties?: IGeoCoordiantes): GeoCoordiantes;
-
-    /**
-     * Encodes the specified GeoCoordiantes message. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
-     * @param message GeoCoordiantes message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IGeoCoordiantes, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified GeoCoordiantes message, length delimited. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
-     * @param message GeoCoordiantes message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IGeoCoordiantes, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a GeoCoordiantes message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns GeoCoordiantes
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): GeoCoordiantes;
-
-    /**
-     * Decodes a GeoCoordiantes message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns GeoCoordiantes
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): GeoCoordiantes;
-
-    /**
-     * Verifies a GeoCoordiantes message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a GeoCoordiantes message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns GeoCoordiantes
-     */
-    public static fromObject(object: { [k: string]: any }): GeoCoordiantes;
-
-    /**
-     * Creates a plain object from a GeoCoordiantes message. Also converts values to other types if specified.
-     * @param message GeoCoordiantes
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: GeoCoordiantes, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this GeoCoordiantes to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a NodeLocationMetadata. */
-export interface INodeLocationMetadata {
-
-    /** NodeLocationMetadata countryCode */
-    countryCode?: (string|null);
-
-    /** NodeLocationMetadata city */
-    city?: (string|null);
-
-    /** NodeLocationMetadata coordinates */
-    coordinates?: (IGeoCoordiantes|null);
-}
-
-/** Represents a NodeLocationMetadata. */
-export class NodeLocationMetadata implements INodeLocationMetadata {
-
-    /**
-     * Constructs a new NodeLocationMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: INodeLocationMetadata);
-
-    /** NodeLocationMetadata countryCode. */
-    public countryCode: string;
-
-    /** NodeLocationMetadata city. */
-    public city: string;
-
-    /** NodeLocationMetadata coordinates. */
-    public coordinates?: (IGeoCoordiantes|null);
-
-    /**
-     * Creates a new NodeLocationMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns NodeLocationMetadata instance
-     */
-    public static create(properties?: INodeLocationMetadata): NodeLocationMetadata;
-
-    /**
-     * Encodes the specified NodeLocationMetadata message. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
-     * @param message NodeLocationMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: INodeLocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified NodeLocationMetadata message, length delimited. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
-     * @param message NodeLocationMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: INodeLocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a NodeLocationMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns NodeLocationMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): NodeLocationMetadata;
-
-    /**
-     * Decodes a NodeLocationMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns NodeLocationMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): NodeLocationMetadata;
-
-    /**
-     * Verifies a NodeLocationMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a NodeLocationMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns NodeLocationMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): NodeLocationMetadata;
-
-    /**
-     * Creates a plain object from a NodeLocationMetadata message. Also converts values to other types if specified.
-     * @param message NodeLocationMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: NodeLocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this NodeLocationMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a StorageBucketOperatorMetadata. */
-export interface IStorageBucketOperatorMetadata {
-
-    /** StorageBucketOperatorMetadata endpoint */
-    endpoint?: (string|null);
-
-    /** StorageBucketOperatorMetadata location */
-    location?: (INodeLocationMetadata|null);
-
-    /** StorageBucketOperatorMetadata extra */
-    extra?: (string|null);
-}
-
-/** Represents a StorageBucketOperatorMetadata. */
-export class StorageBucketOperatorMetadata implements IStorageBucketOperatorMetadata {
-
-    /**
-     * Constructs a new StorageBucketOperatorMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IStorageBucketOperatorMetadata);
-
-    /** StorageBucketOperatorMetadata endpoint. */
-    public endpoint: string;
-
-    /** StorageBucketOperatorMetadata location. */
-    public location?: (INodeLocationMetadata|null);
-
-    /** StorageBucketOperatorMetadata extra. */
-    public extra: string;
-
-    /**
-     * Creates a new StorageBucketOperatorMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns StorageBucketOperatorMetadata instance
-     */
-    public static create(properties?: IStorageBucketOperatorMetadata): StorageBucketOperatorMetadata;
-
-    /**
-     * Encodes the specified StorageBucketOperatorMetadata message. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
-     * @param message StorageBucketOperatorMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IStorageBucketOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified StorageBucketOperatorMetadata message, length delimited. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
-     * @param message StorageBucketOperatorMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IStorageBucketOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns StorageBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): StorageBucketOperatorMetadata;
-
-    /**
-     * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns StorageBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): StorageBucketOperatorMetadata;
-
-    /**
-     * Verifies a StorageBucketOperatorMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a StorageBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns StorageBucketOperatorMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): StorageBucketOperatorMetadata;
-
-    /**
-     * Creates a plain object from a StorageBucketOperatorMetadata message. Also converts values to other types if specified.
-     * @param message StorageBucketOperatorMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: StorageBucketOperatorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this StorageBucketOperatorMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a DistributionBucketOperatorMetadata. */
-export interface IDistributionBucketOperatorMetadata {
-
-    /** DistributionBucketOperatorMetadata endpoint */
-    endpoint?: (string|null);
-
-    /** DistributionBucketOperatorMetadata location */
-    location?: (INodeLocationMetadata|null);
-
-    /** DistributionBucketOperatorMetadata extra */
-    extra?: (string|null);
-}
-
-/** Represents a DistributionBucketOperatorMetadata. */
-export class DistributionBucketOperatorMetadata implements IDistributionBucketOperatorMetadata {
-
-    /**
-     * Constructs a new DistributionBucketOperatorMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IDistributionBucketOperatorMetadata);
-
-    /** DistributionBucketOperatorMetadata endpoint. */
-    public endpoint: string;
-
-    /** DistributionBucketOperatorMetadata location. */
-    public location?: (INodeLocationMetadata|null);
-
-    /** DistributionBucketOperatorMetadata extra. */
-    public extra: string;
-
-    /**
-     * Creates a new DistributionBucketOperatorMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns DistributionBucketOperatorMetadata instance
-     */
-    public static create(properties?: IDistributionBucketOperatorMetadata): DistributionBucketOperatorMetadata;
-
-    /**
-     * Encodes the specified DistributionBucketOperatorMetadata message. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
-     * @param message DistributionBucketOperatorMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IDistributionBucketOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified DistributionBucketOperatorMetadata message, length delimited. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
-     * @param message DistributionBucketOperatorMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IDistributionBucketOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns DistributionBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DistributionBucketOperatorMetadata;
-
-    /**
-     * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns DistributionBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DistributionBucketOperatorMetadata;
-
-    /**
-     * Verifies a DistributionBucketOperatorMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a DistributionBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns DistributionBucketOperatorMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): DistributionBucketOperatorMetadata;
-
-    /**
-     * Creates a plain object from a DistributionBucketOperatorMetadata message. Also converts values to other types if specified.
-     * @param message DistributionBucketOperatorMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: DistributionBucketOperatorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this DistributionBucketOperatorMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a DistributionBucketFamilyMetadata. */
-export interface IDistributionBucketFamilyMetadata {
-
-    /** DistributionBucketFamilyMetadata region */
-    region?: (string|null);
-
-    /** DistributionBucketFamilyMetadata description */
-    description?: (string|null);
-
-    /** DistributionBucketFamilyMetadata boundary */
-    boundary?: (IGeoCoordiantes[]|null);
-}
-
-/** Represents a DistributionBucketFamilyMetadata. */
-export class DistributionBucketFamilyMetadata implements IDistributionBucketFamilyMetadata {
-
-    /**
-     * Constructs a new DistributionBucketFamilyMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IDistributionBucketFamilyMetadata);
-
-    /** DistributionBucketFamilyMetadata region. */
-    public region: string;
-
-    /** DistributionBucketFamilyMetadata description. */
-    public description: string;
-
-    /** DistributionBucketFamilyMetadata boundary. */
-    public boundary: IGeoCoordiantes[];
-
-    /**
-     * Creates a new DistributionBucketFamilyMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns DistributionBucketFamilyMetadata instance
-     */
-    public static create(properties?: IDistributionBucketFamilyMetadata): DistributionBucketFamilyMetadata;
-
-    /**
-     * Encodes the specified DistributionBucketFamilyMetadata message. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
-     * @param message DistributionBucketFamilyMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IDistributionBucketFamilyMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified DistributionBucketFamilyMetadata message, length delimited. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
-     * @param message DistributionBucketFamilyMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IDistributionBucketFamilyMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns DistributionBucketFamilyMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DistributionBucketFamilyMetadata;
-
-    /**
-     * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns DistributionBucketFamilyMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DistributionBucketFamilyMetadata;
-
-    /**
-     * Verifies a DistributionBucketFamilyMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a DistributionBucketFamilyMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns DistributionBucketFamilyMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): DistributionBucketFamilyMetadata;
-
-    /**
-     * Creates a plain object from a DistributionBucketFamilyMetadata message. Also converts values to other types if specified.
-     * @param message DistributionBucketFamilyMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: DistributionBucketFamilyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this DistributionBucketFamilyMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a PublishedBeforeJoystream. */
-export interface IPublishedBeforeJoystream {
-
-    /** PublishedBeforeJoystream isPublished */
-    isPublished?: (boolean|null);
-
-    /** PublishedBeforeJoystream date */
-    date?: (string|null);
-}
-
-/** Represents a PublishedBeforeJoystream. */
-export class PublishedBeforeJoystream implements IPublishedBeforeJoystream {
-
-    /**
-     * Constructs a new PublishedBeforeJoystream.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IPublishedBeforeJoystream);
-
-    /** PublishedBeforeJoystream isPublished. */
-    public isPublished: boolean;
-
-    /** PublishedBeforeJoystream date. */
-    public date: string;
-
-    /**
-     * Creates a new PublishedBeforeJoystream instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns PublishedBeforeJoystream instance
-     */
-    public static create(properties?: IPublishedBeforeJoystream): PublishedBeforeJoystream;
-
-    /**
-     * Encodes the specified PublishedBeforeJoystream message. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
-     * @param message PublishedBeforeJoystream message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IPublishedBeforeJoystream, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified PublishedBeforeJoystream message, length delimited. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
-     * @param message PublishedBeforeJoystream message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IPublishedBeforeJoystream, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a PublishedBeforeJoystream message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns PublishedBeforeJoystream
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PublishedBeforeJoystream;
-
-    /**
-     * Decodes a PublishedBeforeJoystream message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns PublishedBeforeJoystream
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PublishedBeforeJoystream;
-
-    /**
-     * Verifies a PublishedBeforeJoystream message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a PublishedBeforeJoystream message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns PublishedBeforeJoystream
-     */
-    public static fromObject(object: { [k: string]: any }): PublishedBeforeJoystream;
-
-    /**
-     * Creates a plain object from a PublishedBeforeJoystream message. Also converts values to other types if specified.
-     * @param message PublishedBeforeJoystream
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: PublishedBeforeJoystream, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this PublishedBeforeJoystream to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a License. */
-export interface ILicense {
-
-    /** License code */
-    code?: (number|null);
-
-    /** License attribution */
-    attribution?: (string|null);
-
-    /** License customText */
-    customText?: (string|null);
-}
-
-/** Represents a License. */
-export class License implements ILicense {
-
-    /**
-     * Constructs a new License.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: ILicense);
-
-    /** License code. */
-    public code: number;
-
-    /** License attribution. */
-    public attribution: string;
-
-    /** License customText. */
-    public customText: string;
-
-    /**
-     * Creates a new License instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns License instance
-     */
-    public static create(properties?: ILicense): License;
-
-    /**
-     * Encodes the specified License message. Does not implicitly {@link License.verify|verify} messages.
-     * @param message License message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: ILicense, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified License message, length delimited. Does not implicitly {@link License.verify|verify} messages.
-     * @param message License message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: ILicense, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a License message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns License
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): License;
-
-    /**
-     * Decodes a License message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns License
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): License;
-
-    /**
-     * Verifies a License message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a License message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns License
-     */
-    public static fromObject(object: { [k: string]: any }): License;
-
-    /**
-     * Creates a plain object from a License message. Also converts values to other types if specified.
-     * @param message License
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: License, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this License to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a MediaType. */
-export interface IMediaType {
-
-    /** MediaType codecName */
-    codecName?: (string|null);
-
-    /** MediaType container */
-    container?: (string|null);
-
-    /** MediaType mimeMediaType */
-    mimeMediaType?: (string|null);
-}
-
-/** Represents a MediaType. */
-export class MediaType implements IMediaType {
-
-    /**
-     * Constructs a new MediaType.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IMediaType);
-
-    /** MediaType codecName. */
-    public codecName: string;
-
-    /** MediaType container. */
-    public container: string;
-
-    /** MediaType mimeMediaType. */
-    public mimeMediaType: string;
-
-    /**
-     * Creates a new MediaType instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns MediaType instance
-     */
-    public static create(properties?: IMediaType): MediaType;
-
-    /**
-     * Encodes the specified MediaType message. Does not implicitly {@link MediaType.verify|verify} messages.
-     * @param message MediaType message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IMediaType, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified MediaType message, length delimited. Does not implicitly {@link MediaType.verify|verify} messages.
-     * @param message MediaType message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IMediaType, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a MediaType message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns MediaType
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MediaType;
-
-    /**
-     * Decodes a MediaType message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns MediaType
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MediaType;
-
-    /**
-     * Verifies a MediaType message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a MediaType message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns MediaType
-     */
-    public static fromObject(object: { [k: string]: any }): MediaType;
-
-    /**
-     * Creates a plain object from a MediaType message. Also converts values to other types if specified.
-     * @param message MediaType
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: MediaType, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this MediaType to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a VideoMetadata. */
-export interface IVideoMetadata {
-
-    /** VideoMetadata title */
-    title?: (string|null);
-
-    /** VideoMetadata description */
-    description?: (string|null);
-
-    /** VideoMetadata video */
-    video?: (number|null);
-
-    /** VideoMetadata thumbnailPhoto */
-    thumbnailPhoto?: (number|null);
-
-    /** VideoMetadata duration */
-    duration?: (number|null);
-
-    /** VideoMetadata mediaPixelHeight */
-    mediaPixelHeight?: (number|null);
-
-    /** VideoMetadata mediaPixelWidth */
-    mediaPixelWidth?: (number|null);
-
-    /** VideoMetadata mediaType */
-    mediaType?: (IMediaType|null);
-
-    /** VideoMetadata language */
-    language?: (string|null);
-
-    /** VideoMetadata license */
-    license?: (ILicense|null);
-
-    /** VideoMetadata publishedBeforeJoystream */
-    publishedBeforeJoystream?: (IPublishedBeforeJoystream|null);
-
-    /** VideoMetadata hasMarketing */
-    hasMarketing?: (boolean|null);
-
-    /** VideoMetadata isPublic */
-    isPublic?: (boolean|null);
-
-    /** VideoMetadata isExplicit */
-    isExplicit?: (boolean|null);
-
-    /** VideoMetadata persons */
-    persons?: (Long[]|null);
-
-    /** VideoMetadata category */
-    category?: (Long|null);
-}
-
-/** Represents a VideoMetadata. */
-export class VideoMetadata implements IVideoMetadata {
-
-    /**
-     * Constructs a new VideoMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IVideoMetadata);
-
-    /** VideoMetadata title. */
-    public title: string;
-
-    /** VideoMetadata description. */
-    public description: string;
-
-    /** VideoMetadata video. */
-    public video: number;
-
-    /** VideoMetadata thumbnailPhoto. */
-    public thumbnailPhoto: number;
-
-    /** VideoMetadata duration. */
-    public duration: number;
-
-    /** VideoMetadata mediaPixelHeight. */
-    public mediaPixelHeight: number;
-
-    /** VideoMetadata mediaPixelWidth. */
-    public mediaPixelWidth: number;
-
-    /** VideoMetadata mediaType. */
-    public mediaType?: (IMediaType|null);
-
-    /** VideoMetadata language. */
-    public language: string;
-
-    /** VideoMetadata license. */
-    public license?: (ILicense|null);
-
-    /** VideoMetadata publishedBeforeJoystream. */
-    public publishedBeforeJoystream?: (IPublishedBeforeJoystream|null);
-
-    /** VideoMetadata hasMarketing. */
-    public hasMarketing: boolean;
-
-    /** VideoMetadata isPublic. */
-    public isPublic: boolean;
-
-    /** VideoMetadata isExplicit. */
-    public isExplicit: boolean;
-
-    /** VideoMetadata persons. */
-    public persons: Long[];
-
-    /** VideoMetadata category. */
-    public category: Long;
-
-    /**
-     * Creates a new VideoMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns VideoMetadata instance
-     */
-    public static create(properties?: IVideoMetadata): VideoMetadata;
-
-    /**
-     * Encodes the specified VideoMetadata message. Does not implicitly {@link VideoMetadata.verify|verify} messages.
-     * @param message VideoMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link VideoMetadata.verify|verify} messages.
-     * @param message VideoMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a VideoMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns VideoMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): VideoMetadata;
-
-    /**
-     * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns VideoMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): VideoMetadata;
-
-    /**
-     * Verifies a VideoMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns VideoMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): VideoMetadata;
-
-    /**
-     * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
-     * @param message VideoMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: VideoMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this VideoMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}
-
-/** Properties of a VideoCategoryMetadata. */
-export interface IVideoCategoryMetadata {
-
-    /** VideoCategoryMetadata name */
-    name?: (string|null);
-}
-
-/** Represents a VideoCategoryMetadata. */
-export class VideoCategoryMetadata implements IVideoCategoryMetadata {
-
-    /**
-     * Constructs a new VideoCategoryMetadata.
-     * @param [properties] Properties to set
-     */
-    constructor(properties?: IVideoCategoryMetadata);
-
-    /** VideoCategoryMetadata name. */
-    public name: string;
-
-    /**
-     * Creates a new VideoCategoryMetadata instance using the specified properties.
-     * @param [properties] Properties to set
-     * @returns VideoCategoryMetadata instance
-     */
-    public static create(properties?: IVideoCategoryMetadata): VideoCategoryMetadata;
-
-    /**
-     * Encodes the specified VideoCategoryMetadata message. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
-     * @param message VideoCategoryMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encode(message: IVideoCategoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Encodes the specified VideoCategoryMetadata message, length delimited. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
-     * @param message VideoCategoryMetadata message or plain object to encode
-     * @param [writer] Writer to encode to
-     * @returns Writer
-     */
-    public static encodeDelimited(message: IVideoCategoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
-
-    /**
-     * Decodes a VideoCategoryMetadata message from the specified reader or buffer.
-     * @param reader Reader or buffer to decode from
-     * @param [length] Message length if known beforehand
-     * @returns VideoCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): VideoCategoryMetadata;
-
-    /**
-     * Decodes a VideoCategoryMetadata message from the specified reader or buffer, length delimited.
-     * @param reader Reader or buffer to decode from
-     * @returns VideoCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): VideoCategoryMetadata;
-
-    /**
-     * Verifies a VideoCategoryMetadata message.
-     * @param message Plain object to verify
-     * @returns `null` if valid, otherwise the reason why it is not
-     */
-    public static verify(message: { [k: string]: any }): (string|null);
-
-    /**
-     * Creates a VideoCategoryMetadata message from a plain object. Also converts values to their respective internal types.
-     * @param object Plain object
-     * @returns VideoCategoryMetadata
-     */
-    public static fromObject(object: { [k: string]: any }): VideoCategoryMetadata;
-
-    /**
-     * Creates a plain object from a VideoCategoryMetadata message. Also converts values to other types if specified.
-     * @param message VideoCategoryMetadata
-     * @param [options] Conversion options
-     * @returns Plain object
-     */
-    public static toObject(message: VideoCategoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
-    /**
-     * Converts this VideoCategoryMetadata to JSON.
-     * @returns JSON object
-     */
-    public toJSON(): { [k: string]: any };
-}

+ 0 - 4268
metadata-protobuf/compiled/index.js

@@ -1,4268 +0,0 @@
-/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
-"use strict";
-
-var $protobuf = require("protobufjs/minimal");
-
-// Common aliases
-var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
-
-// Exported root namespace
-var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
-
-$root.ChannelMetadata = (function() {
-
-    /**
-     * Properties of a ChannelMetadata.
-     * @exports IChannelMetadata
-     * @interface IChannelMetadata
-     * @property {string|null} [title] ChannelMetadata title
-     * @property {string|null} [description] ChannelMetadata description
-     * @property {boolean|null} [isPublic] ChannelMetadata isPublic
-     * @property {string|null} [language] ChannelMetadata language
-     * @property {number|null} [coverPhoto] ChannelMetadata coverPhoto
-     * @property {number|null} [avatarPhoto] ChannelMetadata avatarPhoto
-     * @property {Long|null} [category] ChannelMetadata category
-     */
-
-    /**
-     * Constructs a new ChannelMetadata.
-     * @exports ChannelMetadata
-     * @classdesc Represents a ChannelMetadata.
-     * @implements IChannelMetadata
-     * @constructor
-     * @param {IChannelMetadata=} [properties] Properties to set
-     */
-    function ChannelMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * ChannelMetadata title.
-     * @member {string} title
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.title = "";
-
-    /**
-     * ChannelMetadata description.
-     * @member {string} description
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.description = "";
-
-    /**
-     * ChannelMetadata isPublic.
-     * @member {boolean} isPublic
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.isPublic = false;
-
-    /**
-     * ChannelMetadata language.
-     * @member {string} language
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.language = "";
-
-    /**
-     * ChannelMetadata coverPhoto.
-     * @member {number} coverPhoto
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.coverPhoto = 0;
-
-    /**
-     * ChannelMetadata avatarPhoto.
-     * @member {number} avatarPhoto
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.avatarPhoto = 0;
-
-    /**
-     * ChannelMetadata category.
-     * @member {Long} category
-     * @memberof ChannelMetadata
-     * @instance
-     */
-    ChannelMetadata.prototype.category = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
-
-    /**
-     * Creates a new ChannelMetadata instance using the specified properties.
-     * @function create
-     * @memberof ChannelMetadata
-     * @static
-     * @param {IChannelMetadata=} [properties] Properties to set
-     * @returns {ChannelMetadata} ChannelMetadata instance
-     */
-    ChannelMetadata.create = function create(properties) {
-        return new ChannelMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified ChannelMetadata message. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof ChannelMetadata
-     * @static
-     * @param {IChannelMetadata} message ChannelMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    ChannelMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.title != null && Object.hasOwnProperty.call(message, "title"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
-        if (message.description != null && Object.hasOwnProperty.call(message, "description"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
-        if (message.isPublic != null && Object.hasOwnProperty.call(message, "isPublic"))
-            writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPublic);
-        if (message.language != null && Object.hasOwnProperty.call(message, "language"))
-            writer.uint32(/* id 4, wireType 2 =*/34).string(message.language);
-        if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
-            writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.coverPhoto);
-        if (message.avatarPhoto != null && Object.hasOwnProperty.call(message, "avatarPhoto"))
-            writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.avatarPhoto);
-        if (message.category != null && Object.hasOwnProperty.call(message, "category"))
-            writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.category);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified ChannelMetadata message, length delimited. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof ChannelMetadata
-     * @static
-     * @param {IChannelMetadata} message ChannelMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    ChannelMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a ChannelMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof ChannelMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {ChannelMetadata} ChannelMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    ChannelMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChannelMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.title = reader.string();
-                break;
-            case 2:
-                message.description = reader.string();
-                break;
-            case 3:
-                message.isPublic = reader.bool();
-                break;
-            case 4:
-                message.language = reader.string();
-                break;
-            case 5:
-                message.coverPhoto = reader.uint32();
-                break;
-            case 6:
-                message.avatarPhoto = reader.uint32();
-                break;
-            case 7:
-                message.category = reader.uint64();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a ChannelMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof ChannelMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {ChannelMetadata} ChannelMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    ChannelMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a ChannelMetadata message.
-     * @function verify
-     * @memberof ChannelMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    ChannelMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.title != null && message.hasOwnProperty("title"))
-            if (!$util.isString(message.title))
-                return "title: string expected";
-        if (message.description != null && message.hasOwnProperty("description"))
-            if (!$util.isString(message.description))
-                return "description: string expected";
-        if (message.isPublic != null && message.hasOwnProperty("isPublic"))
-            if (typeof message.isPublic !== "boolean")
-                return "isPublic: boolean expected";
-        if (message.language != null && message.hasOwnProperty("language"))
-            if (!$util.isString(message.language))
-                return "language: string expected";
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            if (!$util.isInteger(message.coverPhoto))
-                return "coverPhoto: integer expected";
-        if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
-            if (!$util.isInteger(message.avatarPhoto))
-                return "avatarPhoto: integer expected";
-        if (message.category != null && message.hasOwnProperty("category"))
-            if (!$util.isInteger(message.category) && !(message.category && $util.isInteger(message.category.low) && $util.isInteger(message.category.high)))
-                return "category: integer|Long expected";
-        return null;
-    };
-
-    /**
-     * Creates a ChannelMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof ChannelMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {ChannelMetadata} ChannelMetadata
-     */
-    ChannelMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.ChannelMetadata)
-            return object;
-        var message = new $root.ChannelMetadata();
-        if (object.title != null)
-            message.title = String(object.title);
-        if (object.description != null)
-            message.description = String(object.description);
-        if (object.isPublic != null)
-            message.isPublic = Boolean(object.isPublic);
-        if (object.language != null)
-            message.language = String(object.language);
-        if (object.coverPhoto != null)
-            message.coverPhoto = object.coverPhoto >>> 0;
-        if (object.avatarPhoto != null)
-            message.avatarPhoto = object.avatarPhoto >>> 0;
-        if (object.category != null)
-            if ($util.Long)
-                (message.category = $util.Long.fromValue(object.category)).unsigned = true;
-            else if (typeof object.category === "string")
-                message.category = parseInt(object.category, 10);
-            else if (typeof object.category === "number")
-                message.category = object.category;
-            else if (typeof object.category === "object")
-                message.category = new $util.LongBits(object.category.low >>> 0, object.category.high >>> 0).toNumber(true);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a ChannelMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof ChannelMetadata
-     * @static
-     * @param {ChannelMetadata} message ChannelMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    ChannelMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.title = "";
-            object.description = "";
-            object.isPublic = false;
-            object.language = "";
-            object.coverPhoto = 0;
-            object.avatarPhoto = 0;
-            if ($util.Long) {
-                var long = new $util.Long(0, 0, true);
-                object.category = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
-            } else
-                object.category = options.longs === String ? "0" : 0;
-        }
-        if (message.title != null && message.hasOwnProperty("title"))
-            object.title = message.title;
-        if (message.description != null && message.hasOwnProperty("description"))
-            object.description = message.description;
-        if (message.isPublic != null && message.hasOwnProperty("isPublic"))
-            object.isPublic = message.isPublic;
-        if (message.language != null && message.hasOwnProperty("language"))
-            object.language = message.language;
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            object.coverPhoto = message.coverPhoto;
-        if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
-            object.avatarPhoto = message.avatarPhoto;
-        if (message.category != null && message.hasOwnProperty("category"))
-            if (typeof message.category === "number")
-                object.category = options.longs === String ? String(message.category) : message.category;
-            else
-                object.category = options.longs === String ? $util.Long.prototype.toString.call(message.category) : options.longs === Number ? new $util.LongBits(message.category.low >>> 0, message.category.high >>> 0).toNumber(true) : message.category;
-        return object;
-    };
-
-    /**
-     * Converts this ChannelMetadata to JSON.
-     * @function toJSON
-     * @memberof ChannelMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    ChannelMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return ChannelMetadata;
-})();
-
-$root.ChannelCategoryMetadata = (function() {
-
-    /**
-     * Properties of a ChannelCategoryMetadata.
-     * @exports IChannelCategoryMetadata
-     * @interface IChannelCategoryMetadata
-     * @property {string|null} [name] ChannelCategoryMetadata name
-     */
-
-    /**
-     * Constructs a new ChannelCategoryMetadata.
-     * @exports ChannelCategoryMetadata
-     * @classdesc Represents a ChannelCategoryMetadata.
-     * @implements IChannelCategoryMetadata
-     * @constructor
-     * @param {IChannelCategoryMetadata=} [properties] Properties to set
-     */
-    function ChannelCategoryMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * ChannelCategoryMetadata name.
-     * @member {string} name
-     * @memberof ChannelCategoryMetadata
-     * @instance
-     */
-    ChannelCategoryMetadata.prototype.name = "";
-
-    /**
-     * Creates a new ChannelCategoryMetadata instance using the specified properties.
-     * @function create
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {IChannelCategoryMetadata=} [properties] Properties to set
-     * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata instance
-     */
-    ChannelCategoryMetadata.create = function create(properties) {
-        return new ChannelCategoryMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified ChannelCategoryMetadata message. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {IChannelCategoryMetadata} message ChannelCategoryMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    ChannelCategoryMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.name != null && Object.hasOwnProperty.call(message, "name"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified ChannelCategoryMetadata message, length delimited. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {IChannelCategoryMetadata} message ChannelCategoryMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    ChannelCategoryMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a ChannelCategoryMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    ChannelCategoryMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChannelCategoryMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.name = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a ChannelCategoryMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    ChannelCategoryMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a ChannelCategoryMetadata message.
-     * @function verify
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    ChannelCategoryMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.name != null && message.hasOwnProperty("name"))
-            if (!$util.isString(message.name))
-                return "name: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a ChannelCategoryMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
-     */
-    ChannelCategoryMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.ChannelCategoryMetadata)
-            return object;
-        var message = new $root.ChannelCategoryMetadata();
-        if (object.name != null)
-            message.name = String(object.name);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a ChannelCategoryMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof ChannelCategoryMetadata
-     * @static
-     * @param {ChannelCategoryMetadata} message ChannelCategoryMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    ChannelCategoryMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults)
-            object.name = "";
-        if (message.name != null && message.hasOwnProperty("name"))
-            object.name = message.name;
-        return object;
-    };
-
-    /**
-     * Converts this ChannelCategoryMetadata to JSON.
-     * @function toJSON
-     * @memberof ChannelCategoryMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    ChannelCategoryMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return ChannelCategoryMetadata;
-})();
-
-$root.PersonMetadata = (function() {
-
-    /**
-     * Properties of a PersonMetadata.
-     * @exports IPersonMetadata
-     * @interface IPersonMetadata
-     * @property {string|null} [firstName] PersonMetadata firstName
-     * @property {string|null} [middleName] PersonMetadata middleName
-     * @property {string|null} [lastName] PersonMetadata lastName
-     * @property {string|null} [about] PersonMetadata about
-     * @property {number|null} [coverPhoto] PersonMetadata coverPhoto
-     * @property {number|null} [avatarPhoto] PersonMetadata avatarPhoto
-     */
-
-    /**
-     * Constructs a new PersonMetadata.
-     * @exports PersonMetadata
-     * @classdesc Represents a PersonMetadata.
-     * @implements IPersonMetadata
-     * @constructor
-     * @param {IPersonMetadata=} [properties] Properties to set
-     */
-    function PersonMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * PersonMetadata firstName.
-     * @member {string} firstName
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.firstName = "";
-
-    /**
-     * PersonMetadata middleName.
-     * @member {string} middleName
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.middleName = "";
-
-    /**
-     * PersonMetadata lastName.
-     * @member {string} lastName
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.lastName = "";
-
-    /**
-     * PersonMetadata about.
-     * @member {string} about
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.about = "";
-
-    /**
-     * PersonMetadata coverPhoto.
-     * @member {number} coverPhoto
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.coverPhoto = 0;
-
-    /**
-     * PersonMetadata avatarPhoto.
-     * @member {number} avatarPhoto
-     * @memberof PersonMetadata
-     * @instance
-     */
-    PersonMetadata.prototype.avatarPhoto = 0;
-
-    /**
-     * Creates a new PersonMetadata instance using the specified properties.
-     * @function create
-     * @memberof PersonMetadata
-     * @static
-     * @param {IPersonMetadata=} [properties] Properties to set
-     * @returns {PersonMetadata} PersonMetadata instance
-     */
-    PersonMetadata.create = function create(properties) {
-        return new PersonMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified PersonMetadata message. Does not implicitly {@link PersonMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof PersonMetadata
-     * @static
-     * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PersonMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstName);
-        if (message.middleName != null && Object.hasOwnProperty.call(message, "middleName"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.middleName);
-        if (message.lastName != null && Object.hasOwnProperty.call(message, "lastName"))
-            writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastName);
-        if (message.about != null && Object.hasOwnProperty.call(message, "about"))
-            writer.uint32(/* id 4, wireType 2 =*/34).string(message.about);
-        if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
-            writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.coverPhoto);
-        if (message.avatarPhoto != null && Object.hasOwnProperty.call(message, "avatarPhoto"))
-            writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.avatarPhoto);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified PersonMetadata message, length delimited. Does not implicitly {@link PersonMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof PersonMetadata
-     * @static
-     * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PersonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a PersonMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof PersonMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {PersonMetadata} PersonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PersonMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PersonMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.firstName = reader.string();
-                break;
-            case 2:
-                message.middleName = reader.string();
-                break;
-            case 3:
-                message.lastName = reader.string();
-                break;
-            case 4:
-                message.about = reader.string();
-                break;
-            case 5:
-                message.coverPhoto = reader.uint32();
-                break;
-            case 6:
-                message.avatarPhoto = reader.uint32();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a PersonMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof PersonMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {PersonMetadata} PersonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PersonMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a PersonMetadata message.
-     * @function verify
-     * @memberof PersonMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    PersonMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.firstName != null && message.hasOwnProperty("firstName"))
-            if (!$util.isString(message.firstName))
-                return "firstName: string expected";
-        if (message.middleName != null && message.hasOwnProperty("middleName"))
-            if (!$util.isString(message.middleName))
-                return "middleName: string expected";
-        if (message.lastName != null && message.hasOwnProperty("lastName"))
-            if (!$util.isString(message.lastName))
-                return "lastName: string expected";
-        if (message.about != null && message.hasOwnProperty("about"))
-            if (!$util.isString(message.about))
-                return "about: string expected";
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            if (!$util.isInteger(message.coverPhoto))
-                return "coverPhoto: integer expected";
-        if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
-            if (!$util.isInteger(message.avatarPhoto))
-                return "avatarPhoto: integer expected";
-        return null;
-    };
-
-    /**
-     * Creates a PersonMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof PersonMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {PersonMetadata} PersonMetadata
-     */
-    PersonMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.PersonMetadata)
-            return object;
-        var message = new $root.PersonMetadata();
-        if (object.firstName != null)
-            message.firstName = String(object.firstName);
-        if (object.middleName != null)
-            message.middleName = String(object.middleName);
-        if (object.lastName != null)
-            message.lastName = String(object.lastName);
-        if (object.about != null)
-            message.about = String(object.about);
-        if (object.coverPhoto != null)
-            message.coverPhoto = object.coverPhoto >>> 0;
-        if (object.avatarPhoto != null)
-            message.avatarPhoto = object.avatarPhoto >>> 0;
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a PersonMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof PersonMetadata
-     * @static
-     * @param {PersonMetadata} message PersonMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    PersonMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.firstName = "";
-            object.middleName = "";
-            object.lastName = "";
-            object.about = "";
-            object.coverPhoto = 0;
-            object.avatarPhoto = 0;
-        }
-        if (message.firstName != null && message.hasOwnProperty("firstName"))
-            object.firstName = message.firstName;
-        if (message.middleName != null && message.hasOwnProperty("middleName"))
-            object.middleName = message.middleName;
-        if (message.lastName != null && message.hasOwnProperty("lastName"))
-            object.lastName = message.lastName;
-        if (message.about != null && message.hasOwnProperty("about"))
-            object.about = message.about;
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            object.coverPhoto = message.coverPhoto;
-        if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
-            object.avatarPhoto = message.avatarPhoto;
-        return object;
-    };
-
-    /**
-     * Converts this PersonMetadata to JSON.
-     * @function toJSON
-     * @memberof PersonMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    PersonMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return PersonMetadata;
-})();
-
-$root.PlaylistMetadata = (function() {
-
-    /**
-     * Properties of a PlaylistMetadata.
-     * @exports IPlaylistMetadata
-     * @interface IPlaylistMetadata
-     * @property {string|null} [title] PlaylistMetadata title
-     * @property {Array.<Long>|null} [videos] PlaylistMetadata videos
-     */
-
-    /**
-     * Constructs a new PlaylistMetadata.
-     * @exports PlaylistMetadata
-     * @classdesc Represents a PlaylistMetadata.
-     * @implements IPlaylistMetadata
-     * @constructor
-     * @param {IPlaylistMetadata=} [properties] Properties to set
-     */
-    function PlaylistMetadata(properties) {
-        this.videos = [];
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * PlaylistMetadata title.
-     * @member {string} title
-     * @memberof PlaylistMetadata
-     * @instance
-     */
-    PlaylistMetadata.prototype.title = "";
-
-    /**
-     * PlaylistMetadata videos.
-     * @member {Array.<Long>} videos
-     * @memberof PlaylistMetadata
-     * @instance
-     */
-    PlaylistMetadata.prototype.videos = $util.emptyArray;
-
-    /**
-     * Creates a new PlaylistMetadata instance using the specified properties.
-     * @function create
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {IPlaylistMetadata=} [properties] Properties to set
-     * @returns {PlaylistMetadata} PlaylistMetadata instance
-     */
-    PlaylistMetadata.create = function create(properties) {
-        return new PlaylistMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified PlaylistMetadata message. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PlaylistMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.title != null && Object.hasOwnProperty.call(message, "title"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
-        if (message.videos != null && message.videos.length)
-            for (var i = 0; i < message.videos.length; ++i)
-                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.videos[i]);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified PlaylistMetadata message, length delimited. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PlaylistMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a PlaylistMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {PlaylistMetadata} PlaylistMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PlaylistMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PlaylistMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.title = reader.string();
-                break;
-            case 2:
-                if (!(message.videos && message.videos.length))
-                    message.videos = [];
-                if ((tag & 7) === 2) {
-                    var end2 = reader.uint32() + reader.pos;
-                    while (reader.pos < end2)
-                        message.videos.push(reader.uint64());
-                } else
-                    message.videos.push(reader.uint64());
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a PlaylistMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {PlaylistMetadata} PlaylistMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PlaylistMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a PlaylistMetadata message.
-     * @function verify
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    PlaylistMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.title != null && message.hasOwnProperty("title"))
-            if (!$util.isString(message.title))
-                return "title: string expected";
-        if (message.videos != null && message.hasOwnProperty("videos")) {
-            if (!Array.isArray(message.videos))
-                return "videos: array expected";
-            for (var i = 0; i < message.videos.length; ++i)
-                if (!$util.isInteger(message.videos[i]) && !(message.videos[i] && $util.isInteger(message.videos[i].low) && $util.isInteger(message.videos[i].high)))
-                    return "videos: integer|Long[] expected";
-        }
-        return null;
-    };
-
-    /**
-     * Creates a PlaylistMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {PlaylistMetadata} PlaylistMetadata
-     */
-    PlaylistMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.PlaylistMetadata)
-            return object;
-        var message = new $root.PlaylistMetadata();
-        if (object.title != null)
-            message.title = String(object.title);
-        if (object.videos) {
-            if (!Array.isArray(object.videos))
-                throw TypeError(".PlaylistMetadata.videos: array expected");
-            message.videos = [];
-            for (var i = 0; i < object.videos.length; ++i)
-                if ($util.Long)
-                    (message.videos[i] = $util.Long.fromValue(object.videos[i])).unsigned = true;
-                else if (typeof object.videos[i] === "string")
-                    message.videos[i] = parseInt(object.videos[i], 10);
-                else if (typeof object.videos[i] === "number")
-                    message.videos[i] = object.videos[i];
-                else if (typeof object.videos[i] === "object")
-                    message.videos[i] = new $util.LongBits(object.videos[i].low >>> 0, object.videos[i].high >>> 0).toNumber(true);
-        }
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a PlaylistMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof PlaylistMetadata
-     * @static
-     * @param {PlaylistMetadata} message PlaylistMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    PlaylistMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.arrays || options.defaults)
-            object.videos = [];
-        if (options.defaults)
-            object.title = "";
-        if (message.title != null && message.hasOwnProperty("title"))
-            object.title = message.title;
-        if (message.videos && message.videos.length) {
-            object.videos = [];
-            for (var j = 0; j < message.videos.length; ++j)
-                if (typeof message.videos[j] === "number")
-                    object.videos[j] = options.longs === String ? String(message.videos[j]) : message.videos[j];
-                else
-                    object.videos[j] = options.longs === String ? $util.Long.prototype.toString.call(message.videos[j]) : options.longs === Number ? new $util.LongBits(message.videos[j].low >>> 0, message.videos[j].high >>> 0).toNumber(true) : message.videos[j];
-        }
-        return object;
-    };
-
-    /**
-     * Converts this PlaylistMetadata to JSON.
-     * @function toJSON
-     * @memberof PlaylistMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    PlaylistMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return PlaylistMetadata;
-})();
-
-$root.SeriesMetadata = (function() {
-
-    /**
-     * Properties of a SeriesMetadata.
-     * @exports ISeriesMetadata
-     * @interface ISeriesMetadata
-     * @property {string|null} [title] SeriesMetadata title
-     * @property {string|null} [description] SeriesMetadata description
-     * @property {number|null} [coverPhoto] SeriesMetadata coverPhoto
-     * @property {Array.<Long>|null} [persons] SeriesMetadata persons
-     */
-
-    /**
-     * Constructs a new SeriesMetadata.
-     * @exports SeriesMetadata
-     * @classdesc Represents a SeriesMetadata.
-     * @implements ISeriesMetadata
-     * @constructor
-     * @param {ISeriesMetadata=} [properties] Properties to set
-     */
-    function SeriesMetadata(properties) {
-        this.persons = [];
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * SeriesMetadata title.
-     * @member {string} title
-     * @memberof SeriesMetadata
-     * @instance
-     */
-    SeriesMetadata.prototype.title = "";
-
-    /**
-     * SeriesMetadata description.
-     * @member {string} description
-     * @memberof SeriesMetadata
-     * @instance
-     */
-    SeriesMetadata.prototype.description = "";
-
-    /**
-     * SeriesMetadata coverPhoto.
-     * @member {number} coverPhoto
-     * @memberof SeriesMetadata
-     * @instance
-     */
-    SeriesMetadata.prototype.coverPhoto = 0;
-
-    /**
-     * SeriesMetadata persons.
-     * @member {Array.<Long>} persons
-     * @memberof SeriesMetadata
-     * @instance
-     */
-    SeriesMetadata.prototype.persons = $util.emptyArray;
-
-    /**
-     * Creates a new SeriesMetadata instance using the specified properties.
-     * @function create
-     * @memberof SeriesMetadata
-     * @static
-     * @param {ISeriesMetadata=} [properties] Properties to set
-     * @returns {SeriesMetadata} SeriesMetadata instance
-     */
-    SeriesMetadata.create = function create(properties) {
-        return new SeriesMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified SeriesMetadata message. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof SeriesMetadata
-     * @static
-     * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    SeriesMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.title != null && Object.hasOwnProperty.call(message, "title"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
-        if (message.description != null && Object.hasOwnProperty.call(message, "description"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
-        if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
-            writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
-        if (message.persons != null && message.persons.length) {
-            writer.uint32(/* id 4, wireType 2 =*/34).fork();
-            for (var i = 0; i < message.persons.length; ++i)
-                writer.uint64(message.persons[i]);
-            writer.ldelim();
-        }
-        return writer;
-    };
-
-    /**
-     * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof SeriesMetadata
-     * @static
-     * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    SeriesMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a SeriesMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof SeriesMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {SeriesMetadata} SeriesMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    SeriesMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeriesMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.title = reader.string();
-                break;
-            case 2:
-                message.description = reader.string();
-                break;
-            case 3:
-                message.coverPhoto = reader.uint32();
-                break;
-            case 4:
-                if (!(message.persons && message.persons.length))
-                    message.persons = [];
-                if ((tag & 7) === 2) {
-                    var end2 = reader.uint32() + reader.pos;
-                    while (reader.pos < end2)
-                        message.persons.push(reader.uint64());
-                } else
-                    message.persons.push(reader.uint64());
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof SeriesMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {SeriesMetadata} SeriesMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    SeriesMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a SeriesMetadata message.
-     * @function verify
-     * @memberof SeriesMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    SeriesMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.title != null && message.hasOwnProperty("title"))
-            if (!$util.isString(message.title))
-                return "title: string expected";
-        if (message.description != null && message.hasOwnProperty("description"))
-            if (!$util.isString(message.description))
-                return "description: string expected";
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            if (!$util.isInteger(message.coverPhoto))
-                return "coverPhoto: integer expected";
-        if (message.persons != null && message.hasOwnProperty("persons")) {
-            if (!Array.isArray(message.persons))
-                return "persons: array expected";
-            for (var i = 0; i < message.persons.length; ++i)
-                if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
-                    return "persons: integer|Long[] expected";
-        }
-        return null;
-    };
-
-    /**
-     * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof SeriesMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {SeriesMetadata} SeriesMetadata
-     */
-    SeriesMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.SeriesMetadata)
-            return object;
-        var message = new $root.SeriesMetadata();
-        if (object.title != null)
-            message.title = String(object.title);
-        if (object.description != null)
-            message.description = String(object.description);
-        if (object.coverPhoto != null)
-            message.coverPhoto = object.coverPhoto >>> 0;
-        if (object.persons) {
-            if (!Array.isArray(object.persons))
-                throw TypeError(".SeriesMetadata.persons: array expected");
-            message.persons = [];
-            for (var i = 0; i < object.persons.length; ++i)
-                if ($util.Long)
-                    (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
-                else if (typeof object.persons[i] === "string")
-                    message.persons[i] = parseInt(object.persons[i], 10);
-                else if (typeof object.persons[i] === "number")
-                    message.persons[i] = object.persons[i];
-                else if (typeof object.persons[i] === "object")
-                    message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
-        }
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof SeriesMetadata
-     * @static
-     * @param {SeriesMetadata} message SeriesMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    SeriesMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.arrays || options.defaults)
-            object.persons = [];
-        if (options.defaults) {
-            object.title = "";
-            object.description = "";
-            object.coverPhoto = 0;
-        }
-        if (message.title != null && message.hasOwnProperty("title"))
-            object.title = message.title;
-        if (message.description != null && message.hasOwnProperty("description"))
-            object.description = message.description;
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            object.coverPhoto = message.coverPhoto;
-        if (message.persons && message.persons.length) {
-            object.persons = [];
-            for (var j = 0; j < message.persons.length; ++j)
-                if (typeof message.persons[j] === "number")
-                    object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
-                else
-                    object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
-        }
-        return object;
-    };
-
-    /**
-     * Converts this SeriesMetadata to JSON.
-     * @function toJSON
-     * @memberof SeriesMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    SeriesMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return SeriesMetadata;
-})();
-
-$root.SeasonMetadata = (function() {
-
-    /**
-     * Properties of a SeasonMetadata.
-     * @exports ISeasonMetadata
-     * @interface ISeasonMetadata
-     * @property {string|null} [title] SeasonMetadata title
-     * @property {string|null} [description] SeasonMetadata description
-     * @property {number|null} [coverPhoto] SeasonMetadata coverPhoto
-     * @property {Array.<Long>|null} [persons] SeasonMetadata persons
-     */
-
-    /**
-     * Constructs a new SeasonMetadata.
-     * @exports SeasonMetadata
-     * @classdesc Represents a SeasonMetadata.
-     * @implements ISeasonMetadata
-     * @constructor
-     * @param {ISeasonMetadata=} [properties] Properties to set
-     */
-    function SeasonMetadata(properties) {
-        this.persons = [];
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * SeasonMetadata title.
-     * @member {string} title
-     * @memberof SeasonMetadata
-     * @instance
-     */
-    SeasonMetadata.prototype.title = "";
-
-    /**
-     * SeasonMetadata description.
-     * @member {string} description
-     * @memberof SeasonMetadata
-     * @instance
-     */
-    SeasonMetadata.prototype.description = "";
-
-    /**
-     * SeasonMetadata coverPhoto.
-     * @member {number} coverPhoto
-     * @memberof SeasonMetadata
-     * @instance
-     */
-    SeasonMetadata.prototype.coverPhoto = 0;
-
-    /**
-     * SeasonMetadata persons.
-     * @member {Array.<Long>} persons
-     * @memberof SeasonMetadata
-     * @instance
-     */
-    SeasonMetadata.prototype.persons = $util.emptyArray;
-
-    /**
-     * Creates a new SeasonMetadata instance using the specified properties.
-     * @function create
-     * @memberof SeasonMetadata
-     * @static
-     * @param {ISeasonMetadata=} [properties] Properties to set
-     * @returns {SeasonMetadata} SeasonMetadata instance
-     */
-    SeasonMetadata.create = function create(properties) {
-        return new SeasonMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified SeasonMetadata message. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof SeasonMetadata
-     * @static
-     * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    SeasonMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.title != null && Object.hasOwnProperty.call(message, "title"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
-        if (message.description != null && Object.hasOwnProperty.call(message, "description"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
-        if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
-            writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
-        if (message.persons != null && message.persons.length) {
-            writer.uint32(/* id 4, wireType 2 =*/34).fork();
-            for (var i = 0; i < message.persons.length; ++i)
-                writer.uint64(message.persons[i]);
-            writer.ldelim();
-        }
-        return writer;
-    };
-
-    /**
-     * Encodes the specified SeasonMetadata message, length delimited. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof SeasonMetadata
-     * @static
-     * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    SeasonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a SeasonMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof SeasonMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {SeasonMetadata} SeasonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    SeasonMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeasonMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.title = reader.string();
-                break;
-            case 2:
-                message.description = reader.string();
-                break;
-            case 3:
-                message.coverPhoto = reader.uint32();
-                break;
-            case 4:
-                if (!(message.persons && message.persons.length))
-                    message.persons = [];
-                if ((tag & 7) === 2) {
-                    var end2 = reader.uint32() + reader.pos;
-                    while (reader.pos < end2)
-                        message.persons.push(reader.uint64());
-                } else
-                    message.persons.push(reader.uint64());
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a SeasonMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof SeasonMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {SeasonMetadata} SeasonMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    SeasonMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a SeasonMetadata message.
-     * @function verify
-     * @memberof SeasonMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    SeasonMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.title != null && message.hasOwnProperty("title"))
-            if (!$util.isString(message.title))
-                return "title: string expected";
-        if (message.description != null && message.hasOwnProperty("description"))
-            if (!$util.isString(message.description))
-                return "description: string expected";
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            if (!$util.isInteger(message.coverPhoto))
-                return "coverPhoto: integer expected";
-        if (message.persons != null && message.hasOwnProperty("persons")) {
-            if (!Array.isArray(message.persons))
-                return "persons: array expected";
-            for (var i = 0; i < message.persons.length; ++i)
-                if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
-                    return "persons: integer|Long[] expected";
-        }
-        return null;
-    };
-
-    /**
-     * Creates a SeasonMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof SeasonMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {SeasonMetadata} SeasonMetadata
-     */
-    SeasonMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.SeasonMetadata)
-            return object;
-        var message = new $root.SeasonMetadata();
-        if (object.title != null)
-            message.title = String(object.title);
-        if (object.description != null)
-            message.description = String(object.description);
-        if (object.coverPhoto != null)
-            message.coverPhoto = object.coverPhoto >>> 0;
-        if (object.persons) {
-            if (!Array.isArray(object.persons))
-                throw TypeError(".SeasonMetadata.persons: array expected");
-            message.persons = [];
-            for (var i = 0; i < object.persons.length; ++i)
-                if ($util.Long)
-                    (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
-                else if (typeof object.persons[i] === "string")
-                    message.persons[i] = parseInt(object.persons[i], 10);
-                else if (typeof object.persons[i] === "number")
-                    message.persons[i] = object.persons[i];
-                else if (typeof object.persons[i] === "object")
-                    message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
-        }
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a SeasonMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof SeasonMetadata
-     * @static
-     * @param {SeasonMetadata} message SeasonMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    SeasonMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.arrays || options.defaults)
-            object.persons = [];
-        if (options.defaults) {
-            object.title = "";
-            object.description = "";
-            object.coverPhoto = 0;
-        }
-        if (message.title != null && message.hasOwnProperty("title"))
-            object.title = message.title;
-        if (message.description != null && message.hasOwnProperty("description"))
-            object.description = message.description;
-        if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
-            object.coverPhoto = message.coverPhoto;
-        if (message.persons && message.persons.length) {
-            object.persons = [];
-            for (var j = 0; j < message.persons.length; ++j)
-                if (typeof message.persons[j] === "number")
-                    object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
-                else
-                    object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
-        }
-        return object;
-    };
-
-    /**
-     * Converts this SeasonMetadata to JSON.
-     * @function toJSON
-     * @memberof SeasonMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    SeasonMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return SeasonMetadata;
-})();
-
-$root.GeoCoordiantes = (function() {
-
-    /**
-     * Properties of a GeoCoordiantes.
-     * @exports IGeoCoordiantes
-     * @interface IGeoCoordiantes
-     * @property {number|null} [latitude] GeoCoordiantes latitude
-     * @property {number|null} [longitude] GeoCoordiantes longitude
-     */
-
-    /**
-     * Constructs a new GeoCoordiantes.
-     * @exports GeoCoordiantes
-     * @classdesc Represents a GeoCoordiantes.
-     * @implements IGeoCoordiantes
-     * @constructor
-     * @param {IGeoCoordiantes=} [properties] Properties to set
-     */
-    function GeoCoordiantes(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * GeoCoordiantes latitude.
-     * @member {number} latitude
-     * @memberof GeoCoordiantes
-     * @instance
-     */
-    GeoCoordiantes.prototype.latitude = 0;
-
-    /**
-     * GeoCoordiantes longitude.
-     * @member {number} longitude
-     * @memberof GeoCoordiantes
-     * @instance
-     */
-    GeoCoordiantes.prototype.longitude = 0;
-
-    /**
-     * Creates a new GeoCoordiantes instance using the specified properties.
-     * @function create
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {IGeoCoordiantes=} [properties] Properties to set
-     * @returns {GeoCoordiantes} GeoCoordiantes instance
-     */
-    GeoCoordiantes.create = function create(properties) {
-        return new GeoCoordiantes(properties);
-    };
-
-    /**
-     * Encodes the specified GeoCoordiantes message. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
-     * @function encode
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {IGeoCoordiantes} message GeoCoordiantes message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    GeoCoordiantes.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude"))
-            writer.uint32(/* id 3, wireType 5 =*/29).float(message.latitude);
-        if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude"))
-            writer.uint32(/* id 4, wireType 5 =*/37).float(message.longitude);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified GeoCoordiantes message, length delimited. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {IGeoCoordiantes} message GeoCoordiantes message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    GeoCoordiantes.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a GeoCoordiantes message from the specified reader or buffer.
-     * @function decode
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {GeoCoordiantes} GeoCoordiantes
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    GeoCoordiantes.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.GeoCoordiantes();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 3:
-                message.latitude = reader.float();
-                break;
-            case 4:
-                message.longitude = reader.float();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a GeoCoordiantes message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {GeoCoordiantes} GeoCoordiantes
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    GeoCoordiantes.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a GeoCoordiantes message.
-     * @function verify
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    GeoCoordiantes.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.latitude != null && message.hasOwnProperty("latitude"))
-            if (typeof message.latitude !== "number")
-                return "latitude: number expected";
-        if (message.longitude != null && message.hasOwnProperty("longitude"))
-            if (typeof message.longitude !== "number")
-                return "longitude: number expected";
-        return null;
-    };
-
-    /**
-     * Creates a GeoCoordiantes message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {GeoCoordiantes} GeoCoordiantes
-     */
-    GeoCoordiantes.fromObject = function fromObject(object) {
-        if (object instanceof $root.GeoCoordiantes)
-            return object;
-        var message = new $root.GeoCoordiantes();
-        if (object.latitude != null)
-            message.latitude = Number(object.latitude);
-        if (object.longitude != null)
-            message.longitude = Number(object.longitude);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a GeoCoordiantes message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof GeoCoordiantes
-     * @static
-     * @param {GeoCoordiantes} message GeoCoordiantes
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    GeoCoordiantes.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.latitude = 0;
-            object.longitude = 0;
-        }
-        if (message.latitude != null && message.hasOwnProperty("latitude"))
-            object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude;
-        if (message.longitude != null && message.hasOwnProperty("longitude"))
-            object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude;
-        return object;
-    };
-
-    /**
-     * Converts this GeoCoordiantes to JSON.
-     * @function toJSON
-     * @memberof GeoCoordiantes
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    GeoCoordiantes.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return GeoCoordiantes;
-})();
-
-$root.NodeLocationMetadata = (function() {
-
-    /**
-     * Properties of a NodeLocationMetadata.
-     * @exports INodeLocationMetadata
-     * @interface INodeLocationMetadata
-     * @property {string|null} [countryCode] NodeLocationMetadata countryCode
-     * @property {string|null} [city] NodeLocationMetadata city
-     * @property {IGeoCoordiantes|null} [coordinates] NodeLocationMetadata coordinates
-     */
-
-    /**
-     * Constructs a new NodeLocationMetadata.
-     * @exports NodeLocationMetadata
-     * @classdesc Represents a NodeLocationMetadata.
-     * @implements INodeLocationMetadata
-     * @constructor
-     * @param {INodeLocationMetadata=} [properties] Properties to set
-     */
-    function NodeLocationMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * NodeLocationMetadata countryCode.
-     * @member {string} countryCode
-     * @memberof NodeLocationMetadata
-     * @instance
-     */
-    NodeLocationMetadata.prototype.countryCode = "";
-
-    /**
-     * NodeLocationMetadata city.
-     * @member {string} city
-     * @memberof NodeLocationMetadata
-     * @instance
-     */
-    NodeLocationMetadata.prototype.city = "";
-
-    /**
-     * NodeLocationMetadata coordinates.
-     * @member {IGeoCoordiantes|null|undefined} coordinates
-     * @memberof NodeLocationMetadata
-     * @instance
-     */
-    NodeLocationMetadata.prototype.coordinates = null;
-
-    /**
-     * Creates a new NodeLocationMetadata instance using the specified properties.
-     * @function create
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {INodeLocationMetadata=} [properties] Properties to set
-     * @returns {NodeLocationMetadata} NodeLocationMetadata instance
-     */
-    NodeLocationMetadata.create = function create(properties) {
-        return new NodeLocationMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified NodeLocationMetadata message. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {INodeLocationMetadata} message NodeLocationMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    NodeLocationMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.countryCode);
-        if (message.city != null && Object.hasOwnProperty.call(message, "city"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.city);
-        if (message.coordinates != null && Object.hasOwnProperty.call(message, "coordinates"))
-            $root.GeoCoordiantes.encode(message.coordinates, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
-        return writer;
-    };
-
-    /**
-     * Encodes the specified NodeLocationMetadata message, length delimited. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {INodeLocationMetadata} message NodeLocationMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    NodeLocationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a NodeLocationMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {NodeLocationMetadata} NodeLocationMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    NodeLocationMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.NodeLocationMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.countryCode = reader.string();
-                break;
-            case 2:
-                message.city = reader.string();
-                break;
-            case 3:
-                message.coordinates = $root.GeoCoordiantes.decode(reader, reader.uint32());
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a NodeLocationMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {NodeLocationMetadata} NodeLocationMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    NodeLocationMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a NodeLocationMetadata message.
-     * @function verify
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    NodeLocationMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.countryCode != null && message.hasOwnProperty("countryCode"))
-            if (!$util.isString(message.countryCode))
-                return "countryCode: string expected";
-        if (message.city != null && message.hasOwnProperty("city"))
-            if (!$util.isString(message.city))
-                return "city: string expected";
-        if (message.coordinates != null && message.hasOwnProperty("coordinates")) {
-            var error = $root.GeoCoordiantes.verify(message.coordinates);
-            if (error)
-                return "coordinates." + error;
-        }
-        return null;
-    };
-
-    /**
-     * Creates a NodeLocationMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {NodeLocationMetadata} NodeLocationMetadata
-     */
-    NodeLocationMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.NodeLocationMetadata)
-            return object;
-        var message = new $root.NodeLocationMetadata();
-        if (object.countryCode != null)
-            message.countryCode = String(object.countryCode);
-        if (object.city != null)
-            message.city = String(object.city);
-        if (object.coordinates != null) {
-            if (typeof object.coordinates !== "object")
-                throw TypeError(".NodeLocationMetadata.coordinates: object expected");
-            message.coordinates = $root.GeoCoordiantes.fromObject(object.coordinates);
-        }
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a NodeLocationMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof NodeLocationMetadata
-     * @static
-     * @param {NodeLocationMetadata} message NodeLocationMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    NodeLocationMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.countryCode = "";
-            object.city = "";
-            object.coordinates = null;
-        }
-        if (message.countryCode != null && message.hasOwnProperty("countryCode"))
-            object.countryCode = message.countryCode;
-        if (message.city != null && message.hasOwnProperty("city"))
-            object.city = message.city;
-        if (message.coordinates != null && message.hasOwnProperty("coordinates"))
-            object.coordinates = $root.GeoCoordiantes.toObject(message.coordinates, options);
-        return object;
-    };
-
-    /**
-     * Converts this NodeLocationMetadata to JSON.
-     * @function toJSON
-     * @memberof NodeLocationMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    NodeLocationMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return NodeLocationMetadata;
-})();
-
-$root.StorageBucketOperatorMetadata = (function() {
-
-    /**
-     * Properties of a StorageBucketOperatorMetadata.
-     * @exports IStorageBucketOperatorMetadata
-     * @interface IStorageBucketOperatorMetadata
-     * @property {string|null} [endpoint] StorageBucketOperatorMetadata endpoint
-     * @property {INodeLocationMetadata|null} [location] StorageBucketOperatorMetadata location
-     * @property {string|null} [extra] StorageBucketOperatorMetadata extra
-     */
-
-    /**
-     * Constructs a new StorageBucketOperatorMetadata.
-     * @exports StorageBucketOperatorMetadata
-     * @classdesc Represents a StorageBucketOperatorMetadata.
-     * @implements IStorageBucketOperatorMetadata
-     * @constructor
-     * @param {IStorageBucketOperatorMetadata=} [properties] Properties to set
-     */
-    function StorageBucketOperatorMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * StorageBucketOperatorMetadata endpoint.
-     * @member {string} endpoint
-     * @memberof StorageBucketOperatorMetadata
-     * @instance
-     */
-    StorageBucketOperatorMetadata.prototype.endpoint = "";
-
-    /**
-     * StorageBucketOperatorMetadata location.
-     * @member {INodeLocationMetadata|null|undefined} location
-     * @memberof StorageBucketOperatorMetadata
-     * @instance
-     */
-    StorageBucketOperatorMetadata.prototype.location = null;
-
-    /**
-     * StorageBucketOperatorMetadata extra.
-     * @member {string} extra
-     * @memberof StorageBucketOperatorMetadata
-     * @instance
-     */
-    StorageBucketOperatorMetadata.prototype.extra = "";
-
-    /**
-     * Creates a new StorageBucketOperatorMetadata instance using the specified properties.
-     * @function create
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {IStorageBucketOperatorMetadata=} [properties] Properties to set
-     * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata instance
-     */
-    StorageBucketOperatorMetadata.create = function create(properties) {
-        return new StorageBucketOperatorMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified StorageBucketOperatorMetadata message. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {IStorageBucketOperatorMetadata} message StorageBucketOperatorMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    StorageBucketOperatorMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint);
-        if (message.location != null && Object.hasOwnProperty.call(message, "location"))
-            $root.NodeLocationMetadata.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
-        if (message.extra != null && Object.hasOwnProperty.call(message, "extra"))
-            writer.uint32(/* id 3, wireType 2 =*/26).string(message.extra);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified StorageBucketOperatorMetadata message, length delimited. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {IStorageBucketOperatorMetadata} message StorageBucketOperatorMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    StorageBucketOperatorMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    StorageBucketOperatorMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StorageBucketOperatorMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.endpoint = reader.string();
-                break;
-            case 2:
-                message.location = $root.NodeLocationMetadata.decode(reader, reader.uint32());
-                break;
-            case 3:
-                message.extra = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    StorageBucketOperatorMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a StorageBucketOperatorMetadata message.
-     * @function verify
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    StorageBucketOperatorMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.endpoint != null && message.hasOwnProperty("endpoint"))
-            if (!$util.isString(message.endpoint))
-                return "endpoint: string expected";
-        if (message.location != null && message.hasOwnProperty("location")) {
-            var error = $root.NodeLocationMetadata.verify(message.location);
-            if (error)
-                return "location." + error;
-        }
-        if (message.extra != null && message.hasOwnProperty("extra"))
-            if (!$util.isString(message.extra))
-                return "extra: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a StorageBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
-     */
-    StorageBucketOperatorMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.StorageBucketOperatorMetadata)
-            return object;
-        var message = new $root.StorageBucketOperatorMetadata();
-        if (object.endpoint != null)
-            message.endpoint = String(object.endpoint);
-        if (object.location != null) {
-            if (typeof object.location !== "object")
-                throw TypeError(".StorageBucketOperatorMetadata.location: object expected");
-            message.location = $root.NodeLocationMetadata.fromObject(object.location);
-        }
-        if (object.extra != null)
-            message.extra = String(object.extra);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a StorageBucketOperatorMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof StorageBucketOperatorMetadata
-     * @static
-     * @param {StorageBucketOperatorMetadata} message StorageBucketOperatorMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    StorageBucketOperatorMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.endpoint = "";
-            object.location = null;
-            object.extra = "";
-        }
-        if (message.endpoint != null && message.hasOwnProperty("endpoint"))
-            object.endpoint = message.endpoint;
-        if (message.location != null && message.hasOwnProperty("location"))
-            object.location = $root.NodeLocationMetadata.toObject(message.location, options);
-        if (message.extra != null && message.hasOwnProperty("extra"))
-            object.extra = message.extra;
-        return object;
-    };
-
-    /**
-     * Converts this StorageBucketOperatorMetadata to JSON.
-     * @function toJSON
-     * @memberof StorageBucketOperatorMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    StorageBucketOperatorMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return StorageBucketOperatorMetadata;
-})();
-
-$root.DistributionBucketOperatorMetadata = (function() {
-
-    /**
-     * Properties of a DistributionBucketOperatorMetadata.
-     * @exports IDistributionBucketOperatorMetadata
-     * @interface IDistributionBucketOperatorMetadata
-     * @property {string|null} [endpoint] DistributionBucketOperatorMetadata endpoint
-     * @property {INodeLocationMetadata|null} [location] DistributionBucketOperatorMetadata location
-     * @property {string|null} [extra] DistributionBucketOperatorMetadata extra
-     */
-
-    /**
-     * Constructs a new DistributionBucketOperatorMetadata.
-     * @exports DistributionBucketOperatorMetadata
-     * @classdesc Represents a DistributionBucketOperatorMetadata.
-     * @implements IDistributionBucketOperatorMetadata
-     * @constructor
-     * @param {IDistributionBucketOperatorMetadata=} [properties] Properties to set
-     */
-    function DistributionBucketOperatorMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * DistributionBucketOperatorMetadata endpoint.
-     * @member {string} endpoint
-     * @memberof DistributionBucketOperatorMetadata
-     * @instance
-     */
-    DistributionBucketOperatorMetadata.prototype.endpoint = "";
-
-    /**
-     * DistributionBucketOperatorMetadata location.
-     * @member {INodeLocationMetadata|null|undefined} location
-     * @memberof DistributionBucketOperatorMetadata
-     * @instance
-     */
-    DistributionBucketOperatorMetadata.prototype.location = null;
-
-    /**
-     * DistributionBucketOperatorMetadata extra.
-     * @member {string} extra
-     * @memberof DistributionBucketOperatorMetadata
-     * @instance
-     */
-    DistributionBucketOperatorMetadata.prototype.extra = "";
-
-    /**
-     * Creates a new DistributionBucketOperatorMetadata instance using the specified properties.
-     * @function create
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {IDistributionBucketOperatorMetadata=} [properties] Properties to set
-     * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata instance
-     */
-    DistributionBucketOperatorMetadata.create = function create(properties) {
-        return new DistributionBucketOperatorMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified DistributionBucketOperatorMetadata message. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {IDistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    DistributionBucketOperatorMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint);
-        if (message.location != null && Object.hasOwnProperty.call(message, "location"))
-            $root.NodeLocationMetadata.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
-        if (message.extra != null && Object.hasOwnProperty.call(message, "extra"))
-            writer.uint32(/* id 3, wireType 2 =*/26).string(message.extra);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified DistributionBucketOperatorMetadata message, length delimited. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {IDistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    DistributionBucketOperatorMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    DistributionBucketOperatorMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DistributionBucketOperatorMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.endpoint = reader.string();
-                break;
-            case 2:
-                message.location = $root.NodeLocationMetadata.decode(reader, reader.uint32());
-                break;
-            case 3:
-                message.extra = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    DistributionBucketOperatorMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a DistributionBucketOperatorMetadata message.
-     * @function verify
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    DistributionBucketOperatorMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.endpoint != null && message.hasOwnProperty("endpoint"))
-            if (!$util.isString(message.endpoint))
-                return "endpoint: string expected";
-        if (message.location != null && message.hasOwnProperty("location")) {
-            var error = $root.NodeLocationMetadata.verify(message.location);
-            if (error)
-                return "location." + error;
-        }
-        if (message.extra != null && message.hasOwnProperty("extra"))
-            if (!$util.isString(message.extra))
-                return "extra: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a DistributionBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
-     */
-    DistributionBucketOperatorMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.DistributionBucketOperatorMetadata)
-            return object;
-        var message = new $root.DistributionBucketOperatorMetadata();
-        if (object.endpoint != null)
-            message.endpoint = String(object.endpoint);
-        if (object.location != null) {
-            if (typeof object.location !== "object")
-                throw TypeError(".DistributionBucketOperatorMetadata.location: object expected");
-            message.location = $root.NodeLocationMetadata.fromObject(object.location);
-        }
-        if (object.extra != null)
-            message.extra = String(object.extra);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a DistributionBucketOperatorMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof DistributionBucketOperatorMetadata
-     * @static
-     * @param {DistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    DistributionBucketOperatorMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.endpoint = "";
-            object.location = null;
-            object.extra = "";
-        }
-        if (message.endpoint != null && message.hasOwnProperty("endpoint"))
-            object.endpoint = message.endpoint;
-        if (message.location != null && message.hasOwnProperty("location"))
-            object.location = $root.NodeLocationMetadata.toObject(message.location, options);
-        if (message.extra != null && message.hasOwnProperty("extra"))
-            object.extra = message.extra;
-        return object;
-    };
-
-    /**
-     * Converts this DistributionBucketOperatorMetadata to JSON.
-     * @function toJSON
-     * @memberof DistributionBucketOperatorMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    DistributionBucketOperatorMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return DistributionBucketOperatorMetadata;
-})();
-
-$root.DistributionBucketFamilyMetadata = (function() {
-
-    /**
-     * Properties of a DistributionBucketFamilyMetadata.
-     * @exports IDistributionBucketFamilyMetadata
-     * @interface IDistributionBucketFamilyMetadata
-     * @property {string|null} [region] DistributionBucketFamilyMetadata region
-     * @property {string|null} [description] DistributionBucketFamilyMetadata description
-     * @property {Array.<IGeoCoordiantes>|null} [boundary] DistributionBucketFamilyMetadata boundary
-     */
-
-    /**
-     * Constructs a new DistributionBucketFamilyMetadata.
-     * @exports DistributionBucketFamilyMetadata
-     * @classdesc Represents a DistributionBucketFamilyMetadata.
-     * @implements IDistributionBucketFamilyMetadata
-     * @constructor
-     * @param {IDistributionBucketFamilyMetadata=} [properties] Properties to set
-     */
-    function DistributionBucketFamilyMetadata(properties) {
-        this.boundary = [];
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * DistributionBucketFamilyMetadata region.
-     * @member {string} region
-     * @memberof DistributionBucketFamilyMetadata
-     * @instance
-     */
-    DistributionBucketFamilyMetadata.prototype.region = "";
-
-    /**
-     * DistributionBucketFamilyMetadata description.
-     * @member {string} description
-     * @memberof DistributionBucketFamilyMetadata
-     * @instance
-     */
-    DistributionBucketFamilyMetadata.prototype.description = "";
-
-    /**
-     * DistributionBucketFamilyMetadata boundary.
-     * @member {Array.<IGeoCoordiantes>} boundary
-     * @memberof DistributionBucketFamilyMetadata
-     * @instance
-     */
-    DistributionBucketFamilyMetadata.prototype.boundary = $util.emptyArray;
-
-    /**
-     * Creates a new DistributionBucketFamilyMetadata instance using the specified properties.
-     * @function create
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {IDistributionBucketFamilyMetadata=} [properties] Properties to set
-     * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata instance
-     */
-    DistributionBucketFamilyMetadata.create = function create(properties) {
-        return new DistributionBucketFamilyMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified DistributionBucketFamilyMetadata message. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {IDistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    DistributionBucketFamilyMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.region != null && Object.hasOwnProperty.call(message, "region"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.region);
-        if (message.description != null && Object.hasOwnProperty.call(message, "description"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
-        if (message.boundary != null && message.boundary.length)
-            for (var i = 0; i < message.boundary.length; ++i)
-                $root.GeoCoordiantes.encode(message.boundary[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
-        return writer;
-    };
-
-    /**
-     * Encodes the specified DistributionBucketFamilyMetadata message, length delimited. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {IDistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    DistributionBucketFamilyMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    DistributionBucketFamilyMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DistributionBucketFamilyMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.region = reader.string();
-                break;
-            case 2:
-                message.description = reader.string();
-                break;
-            case 3:
-                if (!(message.boundary && message.boundary.length))
-                    message.boundary = [];
-                message.boundary.push($root.GeoCoordiantes.decode(reader, reader.uint32()));
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    DistributionBucketFamilyMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a DistributionBucketFamilyMetadata message.
-     * @function verify
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    DistributionBucketFamilyMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.region != null && message.hasOwnProperty("region"))
-            if (!$util.isString(message.region))
-                return "region: string expected";
-        if (message.description != null && message.hasOwnProperty("description"))
-            if (!$util.isString(message.description))
-                return "description: string expected";
-        if (message.boundary != null && message.hasOwnProperty("boundary")) {
-            if (!Array.isArray(message.boundary))
-                return "boundary: array expected";
-            for (var i = 0; i < message.boundary.length; ++i) {
-                var error = $root.GeoCoordiantes.verify(message.boundary[i]);
-                if (error)
-                    return "boundary." + error;
-            }
-        }
-        return null;
-    };
-
-    /**
-     * Creates a DistributionBucketFamilyMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
-     */
-    DistributionBucketFamilyMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.DistributionBucketFamilyMetadata)
-            return object;
-        var message = new $root.DistributionBucketFamilyMetadata();
-        if (object.region != null)
-            message.region = String(object.region);
-        if (object.description != null)
-            message.description = String(object.description);
-        if (object.boundary) {
-            if (!Array.isArray(object.boundary))
-                throw TypeError(".DistributionBucketFamilyMetadata.boundary: array expected");
-            message.boundary = [];
-            for (var i = 0; i < object.boundary.length; ++i) {
-                if (typeof object.boundary[i] !== "object")
-                    throw TypeError(".DistributionBucketFamilyMetadata.boundary: object expected");
-                message.boundary[i] = $root.GeoCoordiantes.fromObject(object.boundary[i]);
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a DistributionBucketFamilyMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof DistributionBucketFamilyMetadata
-     * @static
-     * @param {DistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    DistributionBucketFamilyMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.arrays || options.defaults)
-            object.boundary = [];
-        if (options.defaults) {
-            object.region = "";
-            object.description = "";
-        }
-        if (message.region != null && message.hasOwnProperty("region"))
-            object.region = message.region;
-        if (message.description != null && message.hasOwnProperty("description"))
-            object.description = message.description;
-        if (message.boundary && message.boundary.length) {
-            object.boundary = [];
-            for (var j = 0; j < message.boundary.length; ++j)
-                object.boundary[j] = $root.GeoCoordiantes.toObject(message.boundary[j], options);
-        }
-        return object;
-    };
-
-    /**
-     * Converts this DistributionBucketFamilyMetadata to JSON.
-     * @function toJSON
-     * @memberof DistributionBucketFamilyMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    DistributionBucketFamilyMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return DistributionBucketFamilyMetadata;
-})();
-
-$root.PublishedBeforeJoystream = (function() {
-
-    /**
-     * Properties of a PublishedBeforeJoystream.
-     * @exports IPublishedBeforeJoystream
-     * @interface IPublishedBeforeJoystream
-     * @property {boolean|null} [isPublished] PublishedBeforeJoystream isPublished
-     * @property {string|null} [date] PublishedBeforeJoystream date
-     */
-
-    /**
-     * Constructs a new PublishedBeforeJoystream.
-     * @exports PublishedBeforeJoystream
-     * @classdesc Represents a PublishedBeforeJoystream.
-     * @implements IPublishedBeforeJoystream
-     * @constructor
-     * @param {IPublishedBeforeJoystream=} [properties] Properties to set
-     */
-    function PublishedBeforeJoystream(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * PublishedBeforeJoystream isPublished.
-     * @member {boolean} isPublished
-     * @memberof PublishedBeforeJoystream
-     * @instance
-     */
-    PublishedBeforeJoystream.prototype.isPublished = false;
-
-    /**
-     * PublishedBeforeJoystream date.
-     * @member {string} date
-     * @memberof PublishedBeforeJoystream
-     * @instance
-     */
-    PublishedBeforeJoystream.prototype.date = "";
-
-    /**
-     * Creates a new PublishedBeforeJoystream instance using the specified properties.
-     * @function create
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {IPublishedBeforeJoystream=} [properties] Properties to set
-     * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream instance
-     */
-    PublishedBeforeJoystream.create = function create(properties) {
-        return new PublishedBeforeJoystream(properties);
-    };
-
-    /**
-     * Encodes the specified PublishedBeforeJoystream message. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
-     * @function encode
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PublishedBeforeJoystream.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.isPublished != null && Object.hasOwnProperty.call(message, "isPublished"))
-            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isPublished);
-        if (message.date != null && Object.hasOwnProperty.call(message, "date"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.date);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified PublishedBeforeJoystream message, length delimited. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    PublishedBeforeJoystream.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a PublishedBeforeJoystream message from the specified reader or buffer.
-     * @function decode
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PublishedBeforeJoystream.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PublishedBeforeJoystream();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.isPublished = reader.bool();
-                break;
-            case 2:
-                message.date = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a PublishedBeforeJoystream message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    PublishedBeforeJoystream.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a PublishedBeforeJoystream message.
-     * @function verify
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    PublishedBeforeJoystream.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.isPublished != null && message.hasOwnProperty("isPublished"))
-            if (typeof message.isPublished !== "boolean")
-                return "isPublished: boolean expected";
-        if (message.date != null && message.hasOwnProperty("date"))
-            if (!$util.isString(message.date))
-                return "date: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a PublishedBeforeJoystream message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
-     */
-    PublishedBeforeJoystream.fromObject = function fromObject(object) {
-        if (object instanceof $root.PublishedBeforeJoystream)
-            return object;
-        var message = new $root.PublishedBeforeJoystream();
-        if (object.isPublished != null)
-            message.isPublished = Boolean(object.isPublished);
-        if (object.date != null)
-            message.date = String(object.date);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a PublishedBeforeJoystream message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof PublishedBeforeJoystream
-     * @static
-     * @param {PublishedBeforeJoystream} message PublishedBeforeJoystream
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    PublishedBeforeJoystream.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.isPublished = false;
-            object.date = "";
-        }
-        if (message.isPublished != null && message.hasOwnProperty("isPublished"))
-            object.isPublished = message.isPublished;
-        if (message.date != null && message.hasOwnProperty("date"))
-            object.date = message.date;
-        return object;
-    };
-
-    /**
-     * Converts this PublishedBeforeJoystream to JSON.
-     * @function toJSON
-     * @memberof PublishedBeforeJoystream
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    PublishedBeforeJoystream.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return PublishedBeforeJoystream;
-})();
-
-$root.License = (function() {
-
-    /**
-     * Properties of a License.
-     * @exports ILicense
-     * @interface ILicense
-     * @property {number|null} [code] License code
-     * @property {string|null} [attribution] License attribution
-     * @property {string|null} [customText] License customText
-     */
-
-    /**
-     * Constructs a new License.
-     * @exports License
-     * @classdesc Represents a License.
-     * @implements ILicense
-     * @constructor
-     * @param {ILicense=} [properties] Properties to set
-     */
-    function License(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * License code.
-     * @member {number} code
-     * @memberof License
-     * @instance
-     */
-    License.prototype.code = 0;
-
-    /**
-     * License attribution.
-     * @member {string} attribution
-     * @memberof License
-     * @instance
-     */
-    License.prototype.attribution = "";
-
-    /**
-     * License customText.
-     * @member {string} customText
-     * @memberof License
-     * @instance
-     */
-    License.prototype.customText = "";
-
-    /**
-     * Creates a new License instance using the specified properties.
-     * @function create
-     * @memberof License
-     * @static
-     * @param {ILicense=} [properties] Properties to set
-     * @returns {License} License instance
-     */
-    License.create = function create(properties) {
-        return new License(properties);
-    };
-
-    /**
-     * Encodes the specified License message. Does not implicitly {@link License.verify|verify} messages.
-     * @function encode
-     * @memberof License
-     * @static
-     * @param {ILicense} message License message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    License.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.code != null && Object.hasOwnProperty.call(message, "code"))
-            writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code);
-        if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.attribution);
-        if (message.customText != null && Object.hasOwnProperty.call(message, "customText"))
-            writer.uint32(/* id 3, wireType 2 =*/26).string(message.customText);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified License message, length delimited. Does not implicitly {@link License.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof License
-     * @static
-     * @param {ILicense} message License message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    License.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a License message from the specified reader or buffer.
-     * @function decode
-     * @memberof License
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {License} License
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    License.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.License();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.code = reader.uint32();
-                break;
-            case 2:
-                message.attribution = reader.string();
-                break;
-            case 3:
-                message.customText = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a License message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof License
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {License} License
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    License.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a License message.
-     * @function verify
-     * @memberof License
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    License.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.code != null && message.hasOwnProperty("code"))
-            if (!$util.isInteger(message.code))
-                return "code: integer expected";
-        if (message.attribution != null && message.hasOwnProperty("attribution"))
-            if (!$util.isString(message.attribution))
-                return "attribution: string expected";
-        if (message.customText != null && message.hasOwnProperty("customText"))
-            if (!$util.isString(message.customText))
-                return "customText: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a License message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof License
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {License} License
-     */
-    License.fromObject = function fromObject(object) {
-        if (object instanceof $root.License)
-            return object;
-        var message = new $root.License();
-        if (object.code != null)
-            message.code = object.code >>> 0;
-        if (object.attribution != null)
-            message.attribution = String(object.attribution);
-        if (object.customText != null)
-            message.customText = String(object.customText);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a License message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof License
-     * @static
-     * @param {License} message License
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    License.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.code = 0;
-            object.attribution = "";
-            object.customText = "";
-        }
-        if (message.code != null && message.hasOwnProperty("code"))
-            object.code = message.code;
-        if (message.attribution != null && message.hasOwnProperty("attribution"))
-            object.attribution = message.attribution;
-        if (message.customText != null && message.hasOwnProperty("customText"))
-            object.customText = message.customText;
-        return object;
-    };
-
-    /**
-     * Converts this License to JSON.
-     * @function toJSON
-     * @memberof License
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    License.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return License;
-})();
-
-$root.MediaType = (function() {
-
-    /**
-     * Properties of a MediaType.
-     * @exports IMediaType
-     * @interface IMediaType
-     * @property {string|null} [codecName] MediaType codecName
-     * @property {string|null} [container] MediaType container
-     * @property {string|null} [mimeMediaType] MediaType mimeMediaType
-     */
-
-    /**
-     * Constructs a new MediaType.
-     * @exports MediaType
-     * @classdesc Represents a MediaType.
-     * @implements IMediaType
-     * @constructor
-     * @param {IMediaType=} [properties] Properties to set
-     */
-    function MediaType(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * MediaType codecName.
-     * @member {string} codecName
-     * @memberof MediaType
-     * @instance
-     */
-    MediaType.prototype.codecName = "";
-
-    /**
-     * MediaType container.
-     * @member {string} container
-     * @memberof MediaType
-     * @instance
-     */
-    MediaType.prototype.container = "";
-
-    /**
-     * MediaType mimeMediaType.
-     * @member {string} mimeMediaType
-     * @memberof MediaType
-     * @instance
-     */
-    MediaType.prototype.mimeMediaType = "";
-
-    /**
-     * Creates a new MediaType instance using the specified properties.
-     * @function create
-     * @memberof MediaType
-     * @static
-     * @param {IMediaType=} [properties] Properties to set
-     * @returns {MediaType} MediaType instance
-     */
-    MediaType.create = function create(properties) {
-        return new MediaType(properties);
-    };
-
-    /**
-     * Encodes the specified MediaType message. Does not implicitly {@link MediaType.verify|verify} messages.
-     * @function encode
-     * @memberof MediaType
-     * @static
-     * @param {IMediaType} message MediaType message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    MediaType.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.codecName != null && Object.hasOwnProperty.call(message, "codecName"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.codecName);
-        if (message.container != null && Object.hasOwnProperty.call(message, "container"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.container);
-        if (message.mimeMediaType != null && Object.hasOwnProperty.call(message, "mimeMediaType"))
-            writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeMediaType);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified MediaType message, length delimited. Does not implicitly {@link MediaType.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof MediaType
-     * @static
-     * @param {IMediaType} message MediaType message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    MediaType.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a MediaType message from the specified reader or buffer.
-     * @function decode
-     * @memberof MediaType
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {MediaType} MediaType
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    MediaType.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MediaType();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.codecName = reader.string();
-                break;
-            case 2:
-                message.container = reader.string();
-                break;
-            case 3:
-                message.mimeMediaType = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a MediaType message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof MediaType
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {MediaType} MediaType
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    MediaType.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a MediaType message.
-     * @function verify
-     * @memberof MediaType
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    MediaType.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.codecName != null && message.hasOwnProperty("codecName"))
-            if (!$util.isString(message.codecName))
-                return "codecName: string expected";
-        if (message.container != null && message.hasOwnProperty("container"))
-            if (!$util.isString(message.container))
-                return "container: string expected";
-        if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
-            if (!$util.isString(message.mimeMediaType))
-                return "mimeMediaType: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a MediaType message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof MediaType
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {MediaType} MediaType
-     */
-    MediaType.fromObject = function fromObject(object) {
-        if (object instanceof $root.MediaType)
-            return object;
-        var message = new $root.MediaType();
-        if (object.codecName != null)
-            message.codecName = String(object.codecName);
-        if (object.container != null)
-            message.container = String(object.container);
-        if (object.mimeMediaType != null)
-            message.mimeMediaType = String(object.mimeMediaType);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a MediaType message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof MediaType
-     * @static
-     * @param {MediaType} message MediaType
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    MediaType.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults) {
-            object.codecName = "";
-            object.container = "";
-            object.mimeMediaType = "";
-        }
-        if (message.codecName != null && message.hasOwnProperty("codecName"))
-            object.codecName = message.codecName;
-        if (message.container != null && message.hasOwnProperty("container"))
-            object.container = message.container;
-        if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
-            object.mimeMediaType = message.mimeMediaType;
-        return object;
-    };
-
-    /**
-     * Converts this MediaType to JSON.
-     * @function toJSON
-     * @memberof MediaType
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    MediaType.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return MediaType;
-})();
-
-$root.VideoMetadata = (function() {
-
-    /**
-     * Properties of a VideoMetadata.
-     * @exports IVideoMetadata
-     * @interface IVideoMetadata
-     * @property {string|null} [title] VideoMetadata title
-     * @property {string|null} [description] VideoMetadata description
-     * @property {number|null} [video] VideoMetadata video
-     * @property {number|null} [thumbnailPhoto] VideoMetadata thumbnailPhoto
-     * @property {number|null} [duration] VideoMetadata duration
-     * @property {number|null} [mediaPixelHeight] VideoMetadata mediaPixelHeight
-     * @property {number|null} [mediaPixelWidth] VideoMetadata mediaPixelWidth
-     * @property {IMediaType|null} [mediaType] VideoMetadata mediaType
-     * @property {string|null} [language] VideoMetadata language
-     * @property {ILicense|null} [license] VideoMetadata license
-     * @property {IPublishedBeforeJoystream|null} [publishedBeforeJoystream] VideoMetadata publishedBeforeJoystream
-     * @property {boolean|null} [hasMarketing] VideoMetadata hasMarketing
-     * @property {boolean|null} [isPublic] VideoMetadata isPublic
-     * @property {boolean|null} [isExplicit] VideoMetadata isExplicit
-     * @property {Array.<Long>|null} [persons] VideoMetadata persons
-     * @property {Long|null} [category] VideoMetadata category
-     */
-
-    /**
-     * Constructs a new VideoMetadata.
-     * @exports VideoMetadata
-     * @classdesc Represents a VideoMetadata.
-     * @implements IVideoMetadata
-     * @constructor
-     * @param {IVideoMetadata=} [properties] Properties to set
-     */
-    function VideoMetadata(properties) {
-        this.persons = [];
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * VideoMetadata title.
-     * @member {string} title
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.title = "";
-
-    /**
-     * VideoMetadata description.
-     * @member {string} description
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.description = "";
-
-    /**
-     * VideoMetadata video.
-     * @member {number} video
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.video = 0;
-
-    /**
-     * VideoMetadata thumbnailPhoto.
-     * @member {number} thumbnailPhoto
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.thumbnailPhoto = 0;
-
-    /**
-     * VideoMetadata duration.
-     * @member {number} duration
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.duration = 0;
-
-    /**
-     * VideoMetadata mediaPixelHeight.
-     * @member {number} mediaPixelHeight
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.mediaPixelHeight = 0;
-
-    /**
-     * VideoMetadata mediaPixelWidth.
-     * @member {number} mediaPixelWidth
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.mediaPixelWidth = 0;
-
-    /**
-     * VideoMetadata mediaType.
-     * @member {IMediaType|null|undefined} mediaType
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.mediaType = null;
-
-    /**
-     * VideoMetadata language.
-     * @member {string} language
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.language = "";
-
-    /**
-     * VideoMetadata license.
-     * @member {ILicense|null|undefined} license
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.license = null;
-
-    /**
-     * VideoMetadata publishedBeforeJoystream.
-     * @member {IPublishedBeforeJoystream|null|undefined} publishedBeforeJoystream
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.publishedBeforeJoystream = null;
-
-    /**
-     * VideoMetadata hasMarketing.
-     * @member {boolean} hasMarketing
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.hasMarketing = false;
-
-    /**
-     * VideoMetadata isPublic.
-     * @member {boolean} isPublic
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.isPublic = false;
-
-    /**
-     * VideoMetadata isExplicit.
-     * @member {boolean} isExplicit
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.isExplicit = false;
-
-    /**
-     * VideoMetadata persons.
-     * @member {Array.<Long>} persons
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.persons = $util.emptyArray;
-
-    /**
-     * VideoMetadata category.
-     * @member {Long} category
-     * @memberof VideoMetadata
-     * @instance
-     */
-    VideoMetadata.prototype.category = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
-
-    /**
-     * Creates a new VideoMetadata instance using the specified properties.
-     * @function create
-     * @memberof VideoMetadata
-     * @static
-     * @param {IVideoMetadata=} [properties] Properties to set
-     * @returns {VideoMetadata} VideoMetadata instance
-     */
-    VideoMetadata.create = function create(properties) {
-        return new VideoMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified VideoMetadata message. Does not implicitly {@link VideoMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof VideoMetadata
-     * @static
-     * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    VideoMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.title != null && Object.hasOwnProperty.call(message, "title"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
-        if (message.description != null && Object.hasOwnProperty.call(message, "description"))
-            writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
-        if (message.video != null && Object.hasOwnProperty.call(message, "video"))
-            writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.video);
-        if (message.thumbnailPhoto != null && Object.hasOwnProperty.call(message, "thumbnailPhoto"))
-            writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.thumbnailPhoto);
-        if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
-            writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.duration);
-        if (message.mediaPixelHeight != null && Object.hasOwnProperty.call(message, "mediaPixelHeight"))
-            writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.mediaPixelHeight);
-        if (message.mediaPixelWidth != null && Object.hasOwnProperty.call(message, "mediaPixelWidth"))
-            writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.mediaPixelWidth);
-        if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType"))
-            $root.MediaType.encode(message.mediaType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
-        if (message.language != null && Object.hasOwnProperty.call(message, "language"))
-            writer.uint32(/* id 9, wireType 2 =*/74).string(message.language);
-        if (message.license != null && Object.hasOwnProperty.call(message, "license"))
-            $root.License.encode(message.license, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
-        if (message.publishedBeforeJoystream != null && Object.hasOwnProperty.call(message, "publishedBeforeJoystream"))
-            $root.PublishedBeforeJoystream.encode(message.publishedBeforeJoystream, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
-        if (message.hasMarketing != null && Object.hasOwnProperty.call(message, "hasMarketing"))
-            writer.uint32(/* id 12, wireType 0 =*/96).bool(message.hasMarketing);
-        if (message.isPublic != null && Object.hasOwnProperty.call(message, "isPublic"))
-            writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isPublic);
-        if (message.isExplicit != null && Object.hasOwnProperty.call(message, "isExplicit"))
-            writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isExplicit);
-        if (message.persons != null && message.persons.length) {
-            writer.uint32(/* id 15, wireType 2 =*/122).fork();
-            for (var i = 0; i < message.persons.length; ++i)
-                writer.uint64(message.persons[i]);
-            writer.ldelim();
-        }
-        if (message.category != null && Object.hasOwnProperty.call(message, "category"))
-            writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.category);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link VideoMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof VideoMetadata
-     * @static
-     * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a VideoMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof VideoMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {VideoMetadata} VideoMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    VideoMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.title = reader.string();
-                break;
-            case 2:
-                message.description = reader.string();
-                break;
-            case 3:
-                message.video = reader.uint32();
-                break;
-            case 4:
-                message.thumbnailPhoto = reader.uint32();
-                break;
-            case 5:
-                message.duration = reader.uint32();
-                break;
-            case 6:
-                message.mediaPixelHeight = reader.uint32();
-                break;
-            case 7:
-                message.mediaPixelWidth = reader.uint32();
-                break;
-            case 8:
-                message.mediaType = $root.MediaType.decode(reader, reader.uint32());
-                break;
-            case 9:
-                message.language = reader.string();
-                break;
-            case 10:
-                message.license = $root.License.decode(reader, reader.uint32());
-                break;
-            case 11:
-                message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.decode(reader, reader.uint32());
-                break;
-            case 12:
-                message.hasMarketing = reader.bool();
-                break;
-            case 13:
-                message.isPublic = reader.bool();
-                break;
-            case 14:
-                message.isExplicit = reader.bool();
-                break;
-            case 15:
-                if (!(message.persons && message.persons.length))
-                    message.persons = [];
-                if ((tag & 7) === 2) {
-                    var end2 = reader.uint32() + reader.pos;
-                    while (reader.pos < end2)
-                        message.persons.push(reader.uint64());
-                } else
-                    message.persons.push(reader.uint64());
-                break;
-            case 16:
-                message.category = reader.uint64();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof VideoMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {VideoMetadata} VideoMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    VideoMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a VideoMetadata message.
-     * @function verify
-     * @memberof VideoMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    VideoMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.title != null && message.hasOwnProperty("title"))
-            if (!$util.isString(message.title))
-                return "title: string expected";
-        if (message.description != null && message.hasOwnProperty("description"))
-            if (!$util.isString(message.description))
-                return "description: string expected";
-        if (message.video != null && message.hasOwnProperty("video"))
-            if (!$util.isInteger(message.video))
-                return "video: integer expected";
-        if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
-            if (!$util.isInteger(message.thumbnailPhoto))
-                return "thumbnailPhoto: integer expected";
-        if (message.duration != null && message.hasOwnProperty("duration"))
-            if (!$util.isInteger(message.duration))
-                return "duration: integer expected";
-        if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
-            if (!$util.isInteger(message.mediaPixelHeight))
-                return "mediaPixelHeight: integer expected";
-        if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
-            if (!$util.isInteger(message.mediaPixelWidth))
-                return "mediaPixelWidth: integer expected";
-        if (message.mediaType != null && message.hasOwnProperty("mediaType")) {
-            var error = $root.MediaType.verify(message.mediaType);
-            if (error)
-                return "mediaType." + error;
-        }
-        if (message.language != null && message.hasOwnProperty("language"))
-            if (!$util.isString(message.language))
-                return "language: string expected";
-        if (message.license != null && message.hasOwnProperty("license")) {
-            var error = $root.License.verify(message.license);
-            if (error)
-                return "license." + error;
-        }
-        if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream")) {
-            var error = $root.PublishedBeforeJoystream.verify(message.publishedBeforeJoystream);
-            if (error)
-                return "publishedBeforeJoystream." + error;
-        }
-        if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
-            if (typeof message.hasMarketing !== "boolean")
-                return "hasMarketing: boolean expected";
-        if (message.isPublic != null && message.hasOwnProperty("isPublic"))
-            if (typeof message.isPublic !== "boolean")
-                return "isPublic: boolean expected";
-        if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
-            if (typeof message.isExplicit !== "boolean")
-                return "isExplicit: boolean expected";
-        if (message.persons != null && message.hasOwnProperty("persons")) {
-            if (!Array.isArray(message.persons))
-                return "persons: array expected";
-            for (var i = 0; i < message.persons.length; ++i)
-                if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
-                    return "persons: integer|Long[] expected";
-        }
-        if (message.category != null && message.hasOwnProperty("category"))
-            if (!$util.isInteger(message.category) && !(message.category && $util.isInteger(message.category.low) && $util.isInteger(message.category.high)))
-                return "category: integer|Long expected";
-        return null;
-    };
-
-    /**
-     * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof VideoMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {VideoMetadata} VideoMetadata
-     */
-    VideoMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.VideoMetadata)
-            return object;
-        var message = new $root.VideoMetadata();
-        if (object.title != null)
-            message.title = String(object.title);
-        if (object.description != null)
-            message.description = String(object.description);
-        if (object.video != null)
-            message.video = object.video >>> 0;
-        if (object.thumbnailPhoto != null)
-            message.thumbnailPhoto = object.thumbnailPhoto >>> 0;
-        if (object.duration != null)
-            message.duration = object.duration >>> 0;
-        if (object.mediaPixelHeight != null)
-            message.mediaPixelHeight = object.mediaPixelHeight >>> 0;
-        if (object.mediaPixelWidth != null)
-            message.mediaPixelWidth = object.mediaPixelWidth >>> 0;
-        if (object.mediaType != null) {
-            if (typeof object.mediaType !== "object")
-                throw TypeError(".VideoMetadata.mediaType: object expected");
-            message.mediaType = $root.MediaType.fromObject(object.mediaType);
-        }
-        if (object.language != null)
-            message.language = String(object.language);
-        if (object.license != null) {
-            if (typeof object.license !== "object")
-                throw TypeError(".VideoMetadata.license: object expected");
-            message.license = $root.License.fromObject(object.license);
-        }
-        if (object.publishedBeforeJoystream != null) {
-            if (typeof object.publishedBeforeJoystream !== "object")
-                throw TypeError(".VideoMetadata.publishedBeforeJoystream: object expected");
-            message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.fromObject(object.publishedBeforeJoystream);
-        }
-        if (object.hasMarketing != null)
-            message.hasMarketing = Boolean(object.hasMarketing);
-        if (object.isPublic != null)
-            message.isPublic = Boolean(object.isPublic);
-        if (object.isExplicit != null)
-            message.isExplicit = Boolean(object.isExplicit);
-        if (object.persons) {
-            if (!Array.isArray(object.persons))
-                throw TypeError(".VideoMetadata.persons: array expected");
-            message.persons = [];
-            for (var i = 0; i < object.persons.length; ++i)
-                if ($util.Long)
-                    (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
-                else if (typeof object.persons[i] === "string")
-                    message.persons[i] = parseInt(object.persons[i], 10);
-                else if (typeof object.persons[i] === "number")
-                    message.persons[i] = object.persons[i];
-                else if (typeof object.persons[i] === "object")
-                    message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
-        }
-        if (object.category != null)
-            if ($util.Long)
-                (message.category = $util.Long.fromValue(object.category)).unsigned = true;
-            else if (typeof object.category === "string")
-                message.category = parseInt(object.category, 10);
-            else if (typeof object.category === "number")
-                message.category = object.category;
-            else if (typeof object.category === "object")
-                message.category = new $util.LongBits(object.category.low >>> 0, object.category.high >>> 0).toNumber(true);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof VideoMetadata
-     * @static
-     * @param {VideoMetadata} message VideoMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    VideoMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.arrays || options.defaults)
-            object.persons = [];
-        if (options.defaults) {
-            object.title = "";
-            object.description = "";
-            object.video = 0;
-            object.thumbnailPhoto = 0;
-            object.duration = 0;
-            object.mediaPixelHeight = 0;
-            object.mediaPixelWidth = 0;
-            object.mediaType = null;
-            object.language = "";
-            object.license = null;
-            object.publishedBeforeJoystream = null;
-            object.hasMarketing = false;
-            object.isPublic = false;
-            object.isExplicit = false;
-            if ($util.Long) {
-                var long = new $util.Long(0, 0, true);
-                object.category = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
-            } else
-                object.category = options.longs === String ? "0" : 0;
-        }
-        if (message.title != null && message.hasOwnProperty("title"))
-            object.title = message.title;
-        if (message.description != null && message.hasOwnProperty("description"))
-            object.description = message.description;
-        if (message.video != null && message.hasOwnProperty("video"))
-            object.video = message.video;
-        if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
-            object.thumbnailPhoto = message.thumbnailPhoto;
-        if (message.duration != null && message.hasOwnProperty("duration"))
-            object.duration = message.duration;
-        if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
-            object.mediaPixelHeight = message.mediaPixelHeight;
-        if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
-            object.mediaPixelWidth = message.mediaPixelWidth;
-        if (message.mediaType != null && message.hasOwnProperty("mediaType"))
-            object.mediaType = $root.MediaType.toObject(message.mediaType, options);
-        if (message.language != null && message.hasOwnProperty("language"))
-            object.language = message.language;
-        if (message.license != null && message.hasOwnProperty("license"))
-            object.license = $root.License.toObject(message.license, options);
-        if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream"))
-            object.publishedBeforeJoystream = $root.PublishedBeforeJoystream.toObject(message.publishedBeforeJoystream, options);
-        if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
-            object.hasMarketing = message.hasMarketing;
-        if (message.isPublic != null && message.hasOwnProperty("isPublic"))
-            object.isPublic = message.isPublic;
-        if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
-            object.isExplicit = message.isExplicit;
-        if (message.persons && message.persons.length) {
-            object.persons = [];
-            for (var j = 0; j < message.persons.length; ++j)
-                if (typeof message.persons[j] === "number")
-                    object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
-                else
-                    object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
-        }
-        if (message.category != null && message.hasOwnProperty("category"))
-            if (typeof message.category === "number")
-                object.category = options.longs === String ? String(message.category) : message.category;
-            else
-                object.category = options.longs === String ? $util.Long.prototype.toString.call(message.category) : options.longs === Number ? new $util.LongBits(message.category.low >>> 0, message.category.high >>> 0).toNumber(true) : message.category;
-        return object;
-    };
-
-    /**
-     * Converts this VideoMetadata to JSON.
-     * @function toJSON
-     * @memberof VideoMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    VideoMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return VideoMetadata;
-})();
-
-$root.VideoCategoryMetadata = (function() {
-
-    /**
-     * Properties of a VideoCategoryMetadata.
-     * @exports IVideoCategoryMetadata
-     * @interface IVideoCategoryMetadata
-     * @property {string|null} [name] VideoCategoryMetadata name
-     */
-
-    /**
-     * Constructs a new VideoCategoryMetadata.
-     * @exports VideoCategoryMetadata
-     * @classdesc Represents a VideoCategoryMetadata.
-     * @implements IVideoCategoryMetadata
-     * @constructor
-     * @param {IVideoCategoryMetadata=} [properties] Properties to set
-     */
-    function VideoCategoryMetadata(properties) {
-        if (properties)
-            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
-                if (properties[keys[i]] != null)
-                    this[keys[i]] = properties[keys[i]];
-    }
-
-    /**
-     * VideoCategoryMetadata name.
-     * @member {string} name
-     * @memberof VideoCategoryMetadata
-     * @instance
-     */
-    VideoCategoryMetadata.prototype.name = "";
-
-    /**
-     * Creates a new VideoCategoryMetadata instance using the specified properties.
-     * @function create
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {IVideoCategoryMetadata=} [properties] Properties to set
-     * @returns {VideoCategoryMetadata} VideoCategoryMetadata instance
-     */
-    VideoCategoryMetadata.create = function create(properties) {
-        return new VideoCategoryMetadata(properties);
-    };
-
-    /**
-     * Encodes the specified VideoCategoryMetadata message. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
-     * @function encode
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    VideoCategoryMetadata.encode = function encode(message, writer) {
-        if (!writer)
-            writer = $Writer.create();
-        if (message.name != null && Object.hasOwnProperty.call(message, "name"))
-            writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
-        return writer;
-    };
-
-    /**
-     * Encodes the specified VideoCategoryMetadata message, length delimited. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
-     * @function encodeDelimited
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
-     * @param {$protobuf.Writer} [writer] Writer to encode to
-     * @returns {$protobuf.Writer} Writer
-     */
-    VideoCategoryMetadata.encodeDelimited = function encodeDelimited(message, writer) {
-        return this.encode(message, writer).ldelim();
-    };
-
-    /**
-     * Decodes a VideoCategoryMetadata message from the specified reader or buffer.
-     * @function decode
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @param {number} [length] Message length if known beforehand
-     * @returns {VideoCategoryMetadata} VideoCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    VideoCategoryMetadata.decode = function decode(reader, length) {
-        if (!(reader instanceof $Reader))
-            reader = $Reader.create(reader);
-        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoCategoryMetadata();
-        while (reader.pos < end) {
-            var tag = reader.uint32();
-            switch (tag >>> 3) {
-            case 1:
-                message.name = reader.string();
-                break;
-            default:
-                reader.skipType(tag & 7);
-                break;
-            }
-        }
-        return message;
-    };
-
-    /**
-     * Decodes a VideoCategoryMetadata message from the specified reader or buffer, length delimited.
-     * @function decodeDelimited
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
-     * @returns {VideoCategoryMetadata} VideoCategoryMetadata
-     * @throws {Error} If the payload is not a reader or valid buffer
-     * @throws {$protobuf.util.ProtocolError} If required fields are missing
-     */
-    VideoCategoryMetadata.decodeDelimited = function decodeDelimited(reader) {
-        if (!(reader instanceof $Reader))
-            reader = new $Reader(reader);
-        return this.decode(reader, reader.uint32());
-    };
-
-    /**
-     * Verifies a VideoCategoryMetadata message.
-     * @function verify
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {Object.<string,*>} message Plain object to verify
-     * @returns {string|null} `null` if valid, otherwise the reason why it is not
-     */
-    VideoCategoryMetadata.verify = function verify(message) {
-        if (typeof message !== "object" || message === null)
-            return "object expected";
-        if (message.name != null && message.hasOwnProperty("name"))
-            if (!$util.isString(message.name))
-                return "name: string expected";
-        return null;
-    };
-
-    /**
-     * Creates a VideoCategoryMetadata message from a plain object. Also converts values to their respective internal types.
-     * @function fromObject
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {Object.<string,*>} object Plain object
-     * @returns {VideoCategoryMetadata} VideoCategoryMetadata
-     */
-    VideoCategoryMetadata.fromObject = function fromObject(object) {
-        if (object instanceof $root.VideoCategoryMetadata)
-            return object;
-        var message = new $root.VideoCategoryMetadata();
-        if (object.name != null)
-            message.name = String(object.name);
-        return message;
-    };
-
-    /**
-     * Creates a plain object from a VideoCategoryMetadata message. Also converts values to other types if specified.
-     * @function toObject
-     * @memberof VideoCategoryMetadata
-     * @static
-     * @param {VideoCategoryMetadata} message VideoCategoryMetadata
-     * @param {$protobuf.IConversionOptions} [options] Conversion options
-     * @returns {Object.<string,*>} Plain object
-     */
-    VideoCategoryMetadata.toObject = function toObject(message, options) {
-        if (!options)
-            options = {};
-        var object = {};
-        if (options.defaults)
-            object.name = "";
-        if (message.name != null && message.hasOwnProperty("name"))
-            object.name = message.name;
-        return object;
-    };
-
-    /**
-     * Converts this VideoCategoryMetadata to JSON.
-     * @function toJSON
-     * @memberof VideoCategoryMetadata
-     * @instance
-     * @returns {Object.<string,*>} JSON object
-     */
-    VideoCategoryMetadata.prototype.toJSON = function toJSON() {
-        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
-    };
-
-    return VideoCategoryMetadata;
-})();
-
-module.exports = $root;

+ 39 - 1
metadata-protobuf/doc/index.md

@@ -21,9 +21,12 @@
     - [DistributionBucketFamilyMetadata](#.DistributionBucketFamilyMetadata)
     - [DistributionBucketOperatorMetadata](#.DistributionBucketOperatorMetadata)
     - [GeoCoordiantes](#.GeoCoordiantes)
+    - [GeographicalArea](#.GeographicalArea)
     - [NodeLocationMetadata](#.NodeLocationMetadata)
     - [StorageBucketOperatorMetadata](#.StorageBucketOperatorMetadata)
   
+    - [GeographicalArea.Continent](#.GeographicalArea.Continent)
+  
 - [proto/Video.proto](#proto/Video.proto)
     - [License](#.License)
     - [MediaType](#.MediaType)
@@ -224,7 +227,8 @@
 | ----- | ---- | ----- | ----------- |
 | region | [string](#string) | optional | ID / name of the region covered by the distribution family (ie. us-east-1). Should be unique. |
 | description | [string](#string) | optional | Additional, more specific description of the region |
-| boundary | [GeoCoordiantes](#GeoCoordiantes) | repeated | Geographical boundary of the region, defined as polygon through array of coordinates (providing [{}] will unset the current value) |
+| areas | [GeographicalArea](#GeographicalArea) | repeated | Standarized geographical areas covered by the family (providing [{}] will unset the current value) |
+| latency_test_targets | [string](#string) | repeated | List of targets (hosts/ips) best suited latency measurements for this family |
 
 
 
@@ -264,6 +268,23 @@
 
 
 
+<a name=".GeographicalArea"></a>
+
+### GeographicalArea
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| continent | [GeographicalArea.Continent](#GeographicalArea.Continent) | optional |  |
+| country_code | [string](#string) | optional | ISO 3166-1 alpha-2 country code |
+| subdivision_code | [string](#string) | optional | ISO 3166-2 subdivision code |
+
+
+
+
+
+
 <a name=".NodeLocationMetadata"></a>
 
 ### NodeLocationMetadata
@@ -299,6 +320,23 @@
 
  
 
+
+<a name=".GeographicalArea.Continent"></a>
+
+### GeographicalArea.Continent
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| AF | 1 |  |
+| NA | 2 |  |
+| OC | 3 |  |
+| AN | 4 |  |
+| AS | 5 |  |
+| EU | 6 |  |
+| SA | 7 |  |
+
+
  
 
  

+ 3 - 1
metadata-protobuf/package.json

@@ -42,7 +42,9 @@
     "@types/long": "^4.0.1",
     "i18n-iso-countries": "^6.8.0",
     "iso-639-1": "^2.1.9",
-    "protobufjs": "^6.11.2"
+    "protobufjs": "^6.11.2",
+    "iso-3166-2": "^1.0.0",
+    "@types/iso-3166-2": "^1.0.0"
   },
   "devDependencies": {
     "@types/chai": "^4.2.11",

+ 19 - 1
metadata-protobuf/proto/Storage.proto

@@ -23,8 +23,26 @@ message DistributionBucketOperatorMetadata {
   optional string extra = 3; // Additional information about the node / node operator
 }
 
+message GeographicalArea {
+  enum Continent {
+    AF = 1;
+    NA = 2;
+    OC = 3;
+    AN = 4;
+    AS = 5;
+    EU = 6;
+    SA = 7;
+  }
+  oneof code {
+    Continent continent = 1;
+    string country_code = 2; // ISO 3166-1 alpha-2 country code
+    string subdivision_code = 3; // ISO 3166-2 subdivision code
+  }
+}
+
 message DistributionBucketFamilyMetadata {
   optional string region = 1; // ID / name of the region covered by the distribution family (ie. us-east-1). Should be unique.
   optional string description = 2; // Additional, more specific description of the region
-  repeated GeoCoordiantes boundary = 3; // Geographical boundary of the region, defined as polygon through array of coordinates (providing [{}] will unset the current value)
+  repeated GeographicalArea areas = 3; // Standarized geographical areas covered by the family (providing [{}] will unset the current value)
+  repeated string latency_test_targets = 4; // List of targets (hosts/ips) best suited latency measurements for this family
 }

+ 4 - 0
metadata-protobuf/scripts/compile.ts

@@ -5,6 +5,10 @@ import fs from 'fs'
 
 const OUT_DIR = path.resolve(__dirname, '../compiled')
 
+if (!fs.existsSync(OUT_DIR)) {
+  fs.mkdirSync(OUT_DIR)
+}
+
 pbjs(
   ['--target', 'static-module', '-w', 'commonjs', '-o', `${OUT_DIR}/index.js`, '--force-long', 'proto/*.proto'],
   function (err) {

+ 6 - 0
metadata-protobuf/src/utils.ts

@@ -1,6 +1,7 @@
 import { AnyMessage, AnyMetadataClass, DecodedMetadataObject } from './types'
 import countries from 'i18n-iso-countries'
 import langs from 'iso-639-1'
+import subdivisions from 'iso-3166-2'
 
 export function isSet<T>(v: T | null | undefined): v is T {
   return v !== null && v !== undefined
@@ -42,3 +43,8 @@ export function isValidCountryCode(code: string): boolean {
 export function isValidLanguageCode(code: string): boolean {
   return langs.validate(code)
 }
+
+// According to ISO 3166-2 standard
+export function isValidSubdivisionCode(code: string): boolean {
+  return !!subdivisions.subdivision(code)
+}

+ 3 - 0
query-node/manifest.yml

@@ -83,6 +83,7 @@ typegen:
     - content.VideoDeleted
     - content.VideoCensorshipStatusUpdated
     - content.FeaturedVideosSet
+    - content.ChannelDeleted
 
     # working groups (we're using "storage_working_group" as a reference module)
     - storage_working_group.WorkerStorageUpdated
@@ -172,6 +173,8 @@ mappings:
       handler: content_VideoCensorshipStatusUpdated
     - event: content.FeaturedVideosSet
       handler: content_FeaturedVideosSet
+    - event: content.ChannelDeleted
+      handler: content_ChannelDeleted
 
     # working groups
     ## storage - workers

+ 17 - 7
query-node/mappings/content/channel.ts

@@ -4,7 +4,7 @@ eslint-disable @typescript-eslint/naming-convention
 import { EventContext, StoreContext } from '@joystream/hydra-common'
 import { Content } from '../generated/types'
 import { convertContentActorToChannelOwner, processChannelMetadata } from './utils'
-import { AssetNone, Channel, ChannelCategory, StorageDataObject } from 'query-node/dist/model'
+import { Channel, ChannelCategory, StorageDataObject } from 'query-node/dist/model'
 import { deserializeMetadata, inconsistentState, logger } from '../common'
 import { ChannelCategoryMetadata, ChannelMetadata } from '@joystream/metadata-protobuf'
 import { integrateMeta } from '@joystream/metadata-protobuf/utils'
@@ -27,9 +27,6 @@ export async function content_ChannelCreated(ctx: EventContext & StoreContext):
     createdInBlock: event.blockNumber,
     rewardAccount: channelCreationParameters.reward_account.unwrapOr(undefined)?.toString(),
     deletionPrizeDestAccount: runtimeChannel.deletion_prize_source_account_id.toString(),
-    // assets
-    coverPhoto: new AssetNone(),
-    avatarPhoto: new AssetNone(),
     // fill in auto-generated fields
     createdAt: new Date(event.blockTimestamp),
     updatedAt: new Date(event.blockTimestamp),
@@ -38,8 +35,10 @@ export async function content_ChannelCreated(ctx: EventContext & StoreContext):
   })
 
   // deserialize & process metadata
-  const metadata = deserializeMetadata(ChannelMetadata, channelCreationParameters.meta) || {}
-  await processChannelMetadata(ctx, channel, metadata, channelCreationParameters.assets)
+  if (channelCreationParameters.meta.isSome) {
+    const metadata = deserializeMetadata(ChannelMetadata, channelCreationParameters.meta.unwrap()) || {}
+    await processChannelMetadata(ctx, channel, metadata, channelCreationParameters.assets.unwrapOr(undefined))
+  }
 
   // save entity
   await store.save<Channel>(channel)
@@ -67,7 +66,12 @@ export async function content_ChannelUpdated(ctx: EventContext & StoreContext):
   //  update metadata if it was changed
   if (newMetadataBytes) {
     const newMetadata = deserializeMetadata(ChannelMetadata, newMetadataBytes) || {}
-    await processChannelMetadata(ctx, channel, newMetadata, channelUpdateParameters.assets.unwrapOr(undefined))
+    await processChannelMetadata(
+      ctx,
+      channel,
+      newMetadata,
+      channelUpdateParameters.assets_to_upload.unwrapOr(undefined)
+    )
   }
 
   // prepare changed reward account
@@ -209,3 +213,9 @@ export async function content_ChannelCategoryDeleted({ store, event }: EventCont
   // emit log event
   logger.info('Channel category has been deleted', { id: channelCategory.id })
 }
+
+export async function content_ChannelDeleted({ store, event }: EventContext & StoreContext): Promise<void> {
+  const [, channelId] = new Content.ChannelDeletedEvent(event).params
+
+  await store.remove<Channel>(new Channel({ id: channelId.toString() }))
+}

+ 119 - 113
query-node/mappings/content/utils.ts

@@ -8,7 +8,7 @@ import {
   IChannelMetadata,
 } from '@joystream/metadata-protobuf'
 import { integrateMeta, isSet, isValidLanguageCode } from '@joystream/metadata-protobuf/utils'
-import { invalidMetadata, inconsistentState, unexpectedData, logger } from '../common'
+import { invalidMetadata, inconsistentState, logger } from '../common'
 import {
   // primary entities
   CuratorGroup,
@@ -20,54 +20,121 @@ import {
   License,
   VideoMediaMetadata,
   // asset
-  Asset,
   Membership,
   VideoMediaEncoding,
   ChannelCategory,
-  AssetNone,
-  AssetExternal,
-  AssetJoystreamStorage,
   StorageDataObject,
+  DataObjectTypeChannelAvatar,
+  DataObjectTypeChannelCoverPhoto,
+  DataObjectTypeVideoMedia,
+  DataObjectTypeVideoThumbnail,
 } from 'query-node/dist/model'
 // Joystream types
-import { NewAssets, ContentActor } from '@joystream/types/augment'
+import { ContentActor, StorageAssets } from '@joystream/types/augment'
 import { DecodedMetadataObject } from '@joystream/metadata-protobuf/types'
 import BN from 'bn.js'
 import { getMostRecentlyCreatedDataObjects } from '../storage/utils'
-import { DataObjectCreationParameters as ObjectCreationParams } from '@joystream/types/storage'
-import { registry } from '@joystream/types'
+
+const ASSET_TYPES = {
+  channel: [
+    {
+      DataObjectTypeConstructor: DataObjectTypeChannelCoverPhoto,
+      metaFieldName: 'coverPhoto',
+      schemaFieldName: 'coverPhoto',
+    },
+    {
+      DataObjectTypeConstructor: DataObjectTypeChannelAvatar,
+      metaFieldName: 'avatarPhoto',
+      schemaFieldName: 'avatarPhoto',
+    },
+  ],
+  video: [
+    {
+      DataObjectTypeConstructor: DataObjectTypeVideoMedia,
+      metaFieldName: 'video',
+      schemaFieldName: 'media',
+    },
+    {
+      DataObjectTypeConstructor: DataObjectTypeVideoThumbnail,
+      metaFieldName: 'thumbnailPhoto',
+      schemaFieldName: 'thumbnailPhoto',
+    },
+  ],
+} as const
+
+async function processChannelAssets(
+  { event, store }: EventContext & StoreContext,
+  assets: StorageDataObject[],
+  channel: Channel,
+  meta: DecodedMetadataObject<IChannelMetadata>
+) {
+  await Promise.all(
+    ASSET_TYPES.channel.map(async ({ metaFieldName, schemaFieldName, DataObjectTypeConstructor }) => {
+      const newAssetIndex = meta[metaFieldName]
+      const currentAsset = channel[schemaFieldName]
+      if (isSet(newAssetIndex)) {
+        const asset = findAssetByIndex(assets, newAssetIndex)
+        if (asset) {
+          if (currentAsset) {
+            currentAsset.unsetAt = new Date(event.blockTimestamp)
+            await store.save<StorageDataObject>(currentAsset)
+          }
+          const dataObjectType = new DataObjectTypeConstructor()
+          dataObjectType.channelId = channel.id
+          asset.type = dataObjectType
+          channel[schemaFieldName] = asset
+          await store.save<StorageDataObject>(asset)
+        }
+      }
+    })
+  )
+}
+
+async function processVideoAssets(
+  { event, store }: EventContext & StoreContext,
+  assets: StorageDataObject[],
+  video: Video,
+  meta: DecodedMetadataObject<IVideoMetadata>
+) {
+  await Promise.all(
+    ASSET_TYPES.video.map(async ({ metaFieldName, schemaFieldName, DataObjectTypeConstructor }) => {
+      const newAssetIndex = meta[metaFieldName]
+      const currentAsset = video[schemaFieldName]
+      if (isSet(newAssetIndex)) {
+        const asset = findAssetByIndex(assets, newAssetIndex)
+        if (asset) {
+          if (currentAsset) {
+            currentAsset.unsetAt = new Date(event.blockTimestamp)
+            await store.save<StorageDataObject>(currentAsset)
+          }
+          const dataObjectType = new DataObjectTypeConstructor()
+          dataObjectType.videoId = video.id
+          asset.type = dataObjectType
+          video[schemaFieldName] = asset
+          await store.save<StorageDataObject>(asset)
+        }
+      }
+    })
+  )
+}
 
 export async function processChannelMetadata(
   ctx: EventContext & StoreContext,
   channel: Channel,
   meta: DecodedMetadataObject<IChannelMetadata>,
-  assets?: NewAssets
+  assetsParams?: StorageAssets
 ): Promise<Channel> {
-  const processedAssets = assets ? await processNewAssets(ctx, assets) : []
+  const assets = assetsParams ? await processNewAssets(ctx, assetsParams) : []
 
   integrateMeta(channel, meta, ['title', 'description', 'isPublic'])
 
+  await processChannelAssets(ctx, assets, channel, meta)
+
   // prepare channel category if needed
   if (isSet(meta.category)) {
     channel.category = await processChannelCategory(ctx, channel.category, parseInt(meta.category))
   }
 
-  // prepare cover photo asset if needed
-  if (isSet(meta.coverPhoto)) {
-    const asset = findAssetByIndex(processedAssets, meta.coverPhoto, 'channel cover photo')
-    if (asset) {
-      channel.coverPhoto = asset
-    }
-  }
-
-  // prepare avatar photo asset if needed
-  if (isSet(meta.avatarPhoto)) {
-    const asset = findAssetByIndex(processedAssets, meta.avatarPhoto, 'channel avatar photo')
-    if (asset) {
-      channel.avatarPhoto = asset
-    }
-  }
-
   // prepare language if needed
   if (isSet(meta.language)) {
     channel.language = await processLanguage(ctx, channel.language, meta.language)
@@ -80,21 +147,23 @@ export async function processVideoMetadata(
   ctx: EventContext & StoreContext,
   video: Video,
   meta: DecodedMetadataObject<IVideoMetadata>,
-  assets?: NewAssets
+  assetsParams?: StorageAssets
 ): Promise<Video> {
-  const processedAssets = assets ? await processNewAssets(ctx, assets) : []
+  const assets = assetsParams ? await processNewAssets(ctx, assetsParams) : []
 
   integrateMeta(video, meta, ['title', 'description', 'duration', 'hasMarketing', 'isExplicit', 'isPublic'])
 
+  await processVideoAssets(ctx, assets, video, meta)
+
   // prepare video category if needed
   if (meta.category) {
     video.category = await processVideoCategory(ctx, video.category, parseInt(meta.category))
   }
 
   // prepare media meta information if needed
-  if (isSet(meta.mediaType) || isSet(meta.mediaPixelWidth) || isSet(meta.mediaPixelHeight)) {
+  if (isSet(meta.video) || isSet(meta.mediaType) || isSet(meta.mediaPixelWidth) || isSet(meta.mediaPixelHeight)) {
     // prepare video file size if poosible
-    const videoSize = extractVideoSize(assets, meta.video)
+    const videoSize = extractVideoSize(assets)
     video.mediaMetadata = await processVideoMediaMetadata(ctx, video.mediaMetadata, meta, videoSize)
   }
 
@@ -103,22 +172,6 @@ export async function processVideoMetadata(
     await updateVideoLicense(ctx, video, meta.license)
   }
 
-  // prepare thumbnail photo asset if needed
-  if (isSet(meta.thumbnailPhoto)) {
-    const asset = findAssetByIndex(processedAssets, meta.thumbnailPhoto, 'thumbnail photo')
-    if (asset) {
-      video.thumbnailPhoto = asset
-    }
-  }
-
-  // prepare video asset if needed
-  if (isSet(meta.video)) {
-    const asset = findAssetByIndex(processedAssets, meta.video, 'video')
-    if (asset) {
-      video.media = asset
-    }
-  }
-
   // prepare language if needed
   if (isSet(meta.language)) {
     video.language = await processLanguage(ctx, video.language, meta.language)
@@ -135,7 +188,7 @@ export async function processVideoMetadata(
   return video
 }
 
-function findAssetByIndex(assets: typeof Asset[], index: number, name?: string): typeof Asset | null {
+function findAssetByIndex(assets: StorageDataObject[], index: number, name?: string): StorageDataObject | null {
   if (assets[index]) {
     return assets[index]
   }
@@ -172,7 +225,7 @@ async function processVideoMediaMetadata(
   ctx: StoreContext & EventContext,
   existingVideoMedia: VideoMediaMetadata | undefined,
   metadata: DecodedMetadataObject<IVideoMetadata>,
-  videoSize: number | undefined
+  videoSize: BN | undefined
 ): Promise<VideoMediaMetadata> {
   const { store, event } = ctx
   const videoMedia =
@@ -272,65 +325,16 @@ function processPublishedBeforeJoystream(
   return new Date(timestamp)
 }
 
-async function processNewAssets(ctx: EventContext & StoreContext, assets: NewAssets): Promise<Array<typeof Asset>> {
-  if (assets.isUrls) {
-    return assets.asUrls.map((assetUrls) => {
-      const resultAsset = new AssetExternal()
-      resultAsset.urls = JSON.stringify(assetUrls.map((u) => u.toString()))
-      return resultAsset
-    })
-  }
-
-  if (assets.isUpload) {
-    const assetsUploaded = assets.asUpload.object_creation_list.length
-    // FIXME: Ideally the runtime would provide object ids in ChannelCreated/VideoCreated/ChannelUpdated(...) events
-    const objects = await getMostRecentlyCreatedDataObjects(ctx.store, assetsUploaded)
-    return objects.map((o) => {
-      const resultAsset = new AssetJoystreamStorage()
-      resultAsset.dataObjectId = o.id
-      return resultAsset
-    })
-  }
-
-  unexpectedData('Unrecognized assets type', assets.type)
+async function processNewAssets(ctx: EventContext & StoreContext, assets: StorageAssets): Promise<StorageDataObject[]> {
+  const assetsUploaded = assets.object_creation_list.length
+  // FIXME: Ideally the runtime would provide object ids in ChannelCreated/VideoCreated/ChannelUpdated(...) events
+  const objects = await getMostRecentlyCreatedDataObjects(ctx.store, assetsUploaded)
+  return objects
 }
 
-function extractVideoSize(assets: NewAssets | undefined, assetIndex: number | null | undefined): number | undefined {
-  // escape if no assetIndex is set
-  if (!isSet(assetIndex)) {
-    return undefined
-  }
-
-  // index provided, but there are no assets
-  if (!assets) {
-    invalidMetadata(`Non-existing asset video size extraction requested - no assets were uploaded!`, {
-      assetIndex,
-    })
-    return undefined
-  }
-
-  // cannot extract size from other asset types than "Upload"
-  if (!assets.isUpload) {
-    return undefined
-  }
-
-  const dataObjectsParams = assets.asUpload.object_creation_list
-
-  // ensure asset index is valid
-  if (assetIndex >= dataObjectsParams.length) {
-    invalidMetadata(`Non-existing asset video size extraction requested`, {
-      assetsProvided: dataObjectsParams.length,
-      assetIndex,
-    })
-    return undefined
-  }
-
-  // extract video size from objectParams
-  const objectParams = assets.asUpload.object_creation_list[assetIndex]
-  const params = new ObjectCreationParams(registry, objectParams.toJSON() as any)
-  const videoSize = params.getField('size').toNumber()
-
-  return videoSize
+function extractVideoSize(assets: StorageDataObject[]): BN | undefined {
+  const mediaAsset = assets.find((a) => a.type?.isTypeOf === DataObjectTypeVideoMedia.name)
+  return mediaAsset ? mediaAsset.size : undefined
 }
 
 async function processLanguage(
@@ -476,23 +480,25 @@ export async function unsetAssetRelations(store: DatabaseManager, dataObject: St
   // is allowed to be associated only with one channel/video in runtime
   const channel = await store.get(Channel, {
     where: channelAssets.map((assetName) => ({
-      [assetName]: Raw((alias) => `${alias} ->> 'dataObjectId' = :id`, {
+      [assetName]: {
         id: dataObject.id,
-      }),
+      },
     })),
+    relations: [...channelAssets],
   })
   const video = await store.get(Video, {
     where: videoAssets.map((assetName) => ({
-      [assetName]: Raw((alias) => `${alias} ->> 'dataObjectId' = :id`, {
+      [assetName]: {
         id: dataObject.id,
-      }),
+      },
     })),
+    relations: [...videoAssets],
   })
 
   if (channel) {
     channelAssets.forEach((assetName) => {
-      if (channel[assetName] && (channel[assetName] as AssetJoystreamStorage).dataObjectId === dataObject.id) {
-        channel[assetName] = new AssetNone()
+      if (channel[assetName] && channel[assetName]?.id === dataObject.id) {
+        channel[assetName] = null as any
       }
     })
     await store.save<Channel>(channel)
@@ -506,8 +512,8 @@ export async function unsetAssetRelations(store: DatabaseManager, dataObject: St
 
   if (video) {
     videoAssets.forEach((assetName) => {
-      if (video[assetName] && (video[assetName] as AssetJoystreamStorage).dataObjectId === dataObject.id) {
-        video[assetName] = new AssetNone()
+      if (video[assetName] && video[assetName]?.id === dataObject.id) {
+        video[assetName] = null as any
       }
     })
     await store.save<Video>(video)

+ 6 - 6
query-node/mappings/content/video.ts

@@ -6,7 +6,7 @@ import { In } from 'typeorm'
 import { Content } from '../generated/types'
 import { deserializeMetadata, inconsistentState, logger } from '../common'
 import { processVideoMetadata } from './utils'
-import { Channel, Video, VideoCategory, AssetNone } from 'query-node/dist/model'
+import { Channel, Video, VideoCategory } from 'query-node/dist/model'
 import { VideoMetadata, VideoCategoryMetadata } from '@joystream/metadata-protobuf'
 import { integrateMeta } from '@joystream/metadata-protobuf/utils'
 import _ from 'lodash'
@@ -107,14 +107,14 @@ export async function content_VideoCreated(ctx: EventContext & StoreContext): Pr
     isCensored: false,
     isFeatured: false,
     createdInBlock: event.blockNumber,
-    thumbnailPhoto: new AssetNone(),
-    media: new AssetNone(),
     createdAt: new Date(event.blockTimestamp),
     updatedAt: new Date(event.blockTimestamp),
   })
   // deserialize & process metadata
-  const metadata = deserializeMetadata(VideoMetadata, videoCreationParameters.meta) || {}
-  await processVideoMetadata(ctx, video, metadata, videoCreationParameters.assets)
+  if (videoCreationParameters.meta.isSome) {
+    const metadata = deserializeMetadata(VideoMetadata, videoCreationParameters.meta.unwrap()) || {}
+    await processVideoMetadata(ctx, video, metadata, videoCreationParameters.assets.unwrapOr(undefined))
+  }
 
   // save video
   await store.save<Video>(video)
@@ -145,7 +145,7 @@ export async function content_VideoUpdated(ctx: EventContext & StoreContext): Pr
   // update metadata if it was changed
   if (newMetadataBytes) {
     const newMetadata = deserializeMetadata(VideoMetadata, newMetadataBytes) || {}
-    await processVideoMetadata(ctx, video, newMetadata, videoUpdateParameters.assets.unwrapOr(undefined))
+    await processVideoMetadata(ctx, video, newMetadata, videoUpdateParameters.assets_to_upload.unwrapOr(undefined))
   }
 
   // set last update time

+ 21 - 155
query-node/mappings/storage/index.ts

@@ -1,7 +1,7 @@
 /*
 eslint-disable @typescript-eslint/naming-convention
 */
-import { DatabaseManager, EventContext, StoreContext } from '@joystream/hydra-common'
+import { EventContext, StoreContext } from '@joystream/hydra-common'
 import { Storage } from '../generated/types/storage'
 import {
   DistributionBucket,
@@ -11,11 +11,6 @@ import {
   DistributionBucketOperatorStatus,
   NodeLocationMetadata,
   StorageBag,
-  StorageBagOwner,
-  StorageBagOwnerChannel,
-  StorageBagOwnerCouncil,
-  StorageBagOwnerMember,
-  StorageBagOwnerWorkingGroup,
   StorageBucket,
   StorageBucketOperatorStatusActive,
   StorageBucketOperatorStatusInvited,
@@ -28,156 +23,25 @@ import {
 } from 'query-node/dist/model'
 import BN from 'bn.js'
 import { getById } from '../common'
-import { BTreeSet } from '@polkadot/types'
 import { In } from 'typeorm'
-import _ from 'lodash'
-import { DataObjectId, BagId, DynamicBagId, StaticBagId } from '@joystream/types/augment/all'
 import {
   processDistributionBucketFamilyMetadata,
   processDistributionOperatorMetadata,
   processStorageOperatorMetadata,
 } from './metadata'
-import { createDataObjects, getStorageSystem, removeDataObject } from './utils'
-
-async function getDataObjectsInBag(
-  store: DatabaseManager,
-  bagId: BagId,
-  dataObjectIds: BTreeSet<DataObjectId>
-): Promise<StorageDataObject[]> {
-  const dataObjects = await store.getMany(StorageDataObject, {
-    where: {
-      id: In(Array.from(dataObjectIds).map((id) => id.toString())),
-      storageBag: { id: getBagId(bagId) },
-    },
-  })
-  if (dataObjects.length !== Array.from(dataObjectIds).length) {
-    throw new Error(
-      `Missing data objects: ${_.difference(
-        Array.from(dataObjectIds).map((id) => id.toString()),
-        dataObjects.map((o) => o.id)
-      )} in bag ${getBagId(bagId)}`
-    )
-  }
-  return dataObjects
-}
-
-function getStaticBagOwner(bagId: StaticBagId): typeof StorageBagOwner {
-  if (bagId.isCouncil) {
-    return new StorageBagOwnerCouncil()
-  } else if (bagId.isWorkingGroup) {
-    const owner = new StorageBagOwnerWorkingGroup()
-    owner.workingGroupId = bagId.asWorkingGroup.toString().toLowerCase()
-    return owner
-  } else {
-    throw new Error(`Unexpected static bag type: ${bagId.type}`)
-  }
-}
-
-function getDynamicBagOwner(bagId: DynamicBagId) {
-  if (bagId.isChannel) {
-    const owner = new StorageBagOwnerChannel()
-    owner.channelId = bagId.asChannel.toNumber()
-    return owner
-  } else if (bagId.isMember) {
-    const owner = new StorageBagOwnerMember()
-    owner.memberId = bagId.asMember.toNumber()
-    return owner
-  } else {
-    throw new Error(`Unexpected dynamic bag type: ${bagId.type}`)
-  }
-}
-
-function getStaticBagId(bagId: StaticBagId): string {
-  if (bagId.isCouncil) {
-    return `static:council`
-  } else if (bagId.isWorkingGroup) {
-    return `static:wg:${bagId.asWorkingGroup.type.toLowerCase()}`
-  } else {
-    throw new Error(`Unexpected static bag type: ${bagId.type}`)
-  }
-}
-
-function getDynamicBagId(bagId: DynamicBagId): string {
-  if (bagId.isChannel) {
-    return `dynamic:channel:${bagId.asChannel.toString()}`
-  } else if (bagId.isMember) {
-    return `dynamic:member:${bagId.asMember.toString()}`
-  } else {
-    throw new Error(`Unexpected dynamic bag type: ${bagId.type}`)
-  }
-}
-
-function getBagId(bagId: BagId) {
-  return bagId.isStatic ? getStaticBagId(bagId.asStatic) : getDynamicBagId(bagId.asDynamic)
-}
-
-async function getDynamicBag(
-  store: DatabaseManager,
-  bagId: DynamicBagId,
-  relations?: 'objects'[]
-): Promise<StorageBag> {
-  return getById(store, StorageBag, getDynamicBagId(bagId), relations)
-}
-
-async function getStaticBag(store: DatabaseManager, bagId: StaticBagId, relations?: 'objects'[]): Promise<StorageBag> {
-  const id = getStaticBagId(bagId)
-  const bag = await store.get(StorageBag, { where: { id }, relations })
-  if (!bag) {
-    console.log(`Creating new static bag: ${id}`)
-    const newBag = new StorageBag({
-      id,
-      owner: getStaticBagOwner(bagId),
-    })
-    await store.save<StorageBag>(newBag)
-    return newBag
-  }
-  return bag
-}
-
-async function getBag(store: DatabaseManager, bagId: BagId, relations?: 'objects'[]): Promise<StorageBag> {
-  return bagId.isStatic
-    ? getStaticBag(store, bagId.asStatic, relations)
-    : getDynamicBag(store, bagId.asDynamic, relations)
-}
-
-async function getDistributionBucketOperatorWithMetadata(
-  store: DatabaseManager,
-  id: string
-): Promise<DistributionBucketOperator> {
-  const operator = await store.get(DistributionBucketOperator, {
-    where: { id },
-    relations: ['metadata', 'metadata.nodeLocation', 'metadata.nodeLocation.coordinates'],
-  })
-  if (!operator) {
-    throw new Error(`DistributionBucketOperator not found by id: ${id}`)
-  }
-  return operator
-}
-
-async function getStorageBucketWithOperatorMetadata(store: DatabaseManager, id: string): Promise<StorageBucket> {
-  const bucket = await store.get(StorageBucket, {
-    where: { id },
-    relations: ['operatorMetadata', 'operatorMetadata.nodeLocation', 'operatorMetadata.nodeLocation.coordinates'],
-  })
-  if (!bucket) {
-    throw new Error(`StorageBucket not found by id: ${id}`)
-  }
-  return bucket
-}
-
-async function getDistributionBucketFamilyWithMetadata(
-  store: DatabaseManager,
-  id: string
-): Promise<DistributionBucketFamily> {
-  const family = await store.get(DistributionBucketFamily, {
-    where: { id },
-    relations: ['metadata', 'metadata.boundary'],
-  })
-  if (!family) {
-    throw new Error(`DistributionBucketFamily not found by id: ${id}`)
-  }
-  return family
-}
+import {
+  createDataObjects,
+  getStorageSystem,
+  removeDataObject,
+  getStorageBucketWithOperatorMetadata,
+  getBag,
+  getDynamicBagId,
+  getDynamicBagOwner,
+  getDataObjectsInBag,
+  getDynamicBag,
+  getDistributionBucketFamilyWithMetadata,
+  getDistributionBucketOperatorWithMetadata,
+} from './utils'
 
 // STORAGE BUCKETS
 
@@ -363,7 +227,11 @@ export async function storage_DynamicBagCreated({ event, store }: EventContext &
 export async function storage_DynamicBagDeleted({ event, store }: EventContext & StoreContext): Promise<void> {
   const [, bagId] = new Storage.DynamicBagDeletedEvent(event).params
   const storageBag = await getDynamicBag(store, bagId, ['objects'])
-  // The bag should already be empty, so no cascade-remove required
+  // TODO: Cascade remove on db level (would require changes in Hydra / comitting autogenerated files)
+  const storageAssignments = await store.getMany(StorageBagStorageAssignment, { where: { storageBag } })
+  const distributionAssignments = await store.getMany(StorageBagDistributionAssignment, { where: { storageBag } })
+  await Promise.all(storageAssignments.map((a) => store.remove<StorageBagStorageAssignment>(a)))
+  await Promise.all(distributionAssignments.map((a) => store.remove<StorageBagDistributionAssignment>(a)))
   await store.remove<StorageBag>(storageBag)
 }
 
@@ -371,10 +239,8 @@ export async function storage_DynamicBagDeleted({ event, store }: EventContext &
 
 // Note: "Uploaded" here actually means "created" (the real upload happens later)
 export async function storage_DataObjectsUploaded({ event, store }: EventContext & StoreContext): Promise<void> {
-  const [dataObjectIds, uploadParams] = new Storage.DataObjectsUploadedEvent(event).params
-  const { bagId, objectCreationList } = uploadParams
-  const storageBag = await getBag(store, bagId)
-  await createDataObjects(store, objectCreationList, storageBag, dataObjectIds)
+  const [dataObjectIds, uploadParams, deletionPrize] = new Storage.DataObjectsUploadedEvent(event).params
+  await createDataObjects(store, uploadParams, deletionPrize, dataObjectIds)
 }
 
 export async function storage_PendingDataObjectsAccepted({ event, store }: EventContext & StoreContext): Promise<void> {

+ 65 - 16
query-node/mappings/storage/metadata.ts

@@ -5,16 +5,32 @@ import {
   StorageBucketOperatorMetadata,
   GeoCoordinates,
   NodeLocationMetadata,
+  Continent,
+  GeographicalAreaContinent,
+  GeographicalAreaCountry,
+  GeographicalAreaSubdivistion,
+  DistributionBucketFamilyGeographicArea,
 } from 'query-node/dist/model'
-import { deserializeMetadata } from '../common'
+import { deserializeMetadata, invalidMetadata } from '../common'
 import { Bytes } from '@polkadot/types'
 import {
   DistributionBucketOperatorMetadata as DistributionBucketOperatorMetadataProto,
   StorageBucketOperatorMetadata as StorageBucketOperatorMetadataProto,
   DistributionBucketFamilyMetadata as DistributionBucketFamilyMetadataProto,
   INodeLocationMetadata,
+  GeographicalArea as GeographicalAreaProto,
 } from '@joystream/metadata-protobuf'
-import { isSet, isEmptyObject, isValidCountryCode } from '@joystream/metadata-protobuf/utils'
+import { isSet, isEmptyObject, isValidCountryCode, isValidSubdivisionCode } from '@joystream/metadata-protobuf/utils'
+
+const protobufContinentToGraphlContinent: { [key in GeographicalAreaProto.Continent]: Continent } = {
+  [GeographicalAreaProto.Continent.AF]: Continent.AF,
+  [GeographicalAreaProto.Continent.AN]: Continent.AN,
+  [GeographicalAreaProto.Continent.AS]: Continent.AS,
+  [GeographicalAreaProto.Continent.EU]: Continent.EU,
+  [GeographicalAreaProto.Continent.NA]: Continent.NA,
+  [GeographicalAreaProto.Continent.OC]: Continent.OC,
+  [GeographicalAreaProto.Continent.SA]: Continent.SA,
+}
 
 async function processNodeLocationMetadata(
   store: DatabaseManager,
@@ -118,24 +134,57 @@ export async function processDistributionBucketFamilyMetadata(
   if (isSet(meta.description)) {
     metadataEntity.description = meta.description || (null as any)
   }
+  if (isSet(meta.latencyTestTargets)) {
+    metadataEntity.latencyTestTargets = meta.latencyTestTargets.filter((t) => t)
+  }
 
   await store.save<DistributionBucketOperatorMetadata>(metadataEntity)
 
-  // Update boundary after metadata is saved (since we need an id to reference)
-  if (isSet(meta.boundary)) {
-    await Promise.all((metadataEntity.boundary || []).map((coords) => store.remove<GeoCoordinates>(coords)))
+  // Update areas after metadata is saved (since we need an id to reference)
+  if (isSet(meta.areas)) {
+    // Drop current areas
+    await Promise.all(metadataEntity.areas?.map((a) => store.remove<DistributionBucketFamilyGeographicArea>(a)) || [])
+    // Save new areas
     await Promise.all(
-      meta.boundary
-        .filter((c) => !isEmptyObject(c))
-        .map(({ latitude, longitude }) =>
-          store.save<GeoCoordinates>(
-            new GeoCoordinates({
-              latitude: latitude || 0,
-              longitude: longitude || 0,
-              boundarySourceBucketFamilyMeta: metadataEntity,
-            })
-          )
-        )
+      meta.areas
+        .filter((a) => !isEmptyObject(a))
+        .map(async (a) => {
+          const area = new DistributionBucketFamilyGeographicArea({
+            distributionBucketFamilyMetadata: metadataEntity,
+          })
+
+          if (a.continent) {
+            const continent = new GeographicalAreaContinent()
+            continent.code = protobufContinentToGraphlContinent[a.continent]
+            if (!continent.code) {
+              return invalidMetadata(`Unrecognized continent enum variant: ${a.continent}`)
+            }
+            area.id = `${metadataEntity.id}-C-${continent.code}`
+            area.area = continent
+          }
+
+          if (a.countryCode) {
+            if (!isValidCountryCode(a.countryCode)) {
+              return invalidMetadata(`Invalid country code: ${a.countryCode}`)
+            }
+            const country = new GeographicalAreaCountry()
+            country.code = a.countryCode
+            area.id = `${metadataEntity.id}-c-${country.code}`
+            area.area = country
+          }
+
+          if (a.subdivisionCode) {
+            if (!isValidSubdivisionCode(a.subdivisionCode)) {
+              return invalidMetadata(`Invalid subdivision code: ${a.subdivisionCode}`)
+            }
+            const subdivision = new GeographicalAreaSubdivistion()
+            subdivision.code = a.subdivisionCode
+            area.id = `${metadataEntity.id}-s-${subdivision.code}`
+            area.area = subdivision
+          }
+
+          await store.save<DistributionBucketFamilyGeographicArea>(area)
+        })
     )
   }
 

+ 173 - 7
query-node/mappings/storage/utils.ts

@@ -1,13 +1,175 @@
 import { DatabaseManager } from '@joystream/hydra-common'
-import { DataObjectCreationParameters } from '@joystream/types/augment'
+import { UploadParameters } from '@joystream/types/augment'
 import { registry } from '@joystream/types'
 import { DataObjectCreationParameters as ObjectCreationParams } from '@joystream/types/storage'
-import { StorageBag, StorageDataObject, StorageSystemParameters } from 'query-node/dist/model'
+import {
+  DataObjectTypeUnknown,
+  StorageBag,
+  StorageDataObject,
+  StorageSystemParameters,
+  StorageBagOwner,
+  StorageBagOwnerChannel,
+  StorageBagOwnerCouncil,
+  StorageBagOwnerMember,
+  StorageBagOwnerWorkingGroup,
+  StorageBucket,
+  DistributionBucketOperator,
+  DistributionBucketFamily,
+} from 'query-node/dist/model'
 import BN from 'bn.js'
-import { bytesToString, inconsistentState } from '../common'
+import { bytesToString, inconsistentState, getById } from '../common'
 import { In } from 'typeorm'
 import { unsetAssetRelations } from '../content/utils'
 
+import { BTreeSet } from '@polkadot/types'
+import _ from 'lodash'
+import { DataObjectId, BagId, DynamicBagId, StaticBagId } from '@joystream/types/augment/all'
+import { Balance } from '@polkadot/types/interfaces'
+
+export async function getDataObjectsInBag(
+  store: DatabaseManager,
+  bagId: BagId,
+  dataObjectIds: BTreeSet<DataObjectId>
+): Promise<StorageDataObject[]> {
+  const dataObjects = await store.getMany(StorageDataObject, {
+    where: {
+      id: In(Array.from(dataObjectIds).map((id) => id.toString())),
+      storageBag: { id: getBagId(bagId) },
+    },
+  })
+  if (dataObjects.length !== Array.from(dataObjectIds).length) {
+    throw new Error(
+      `Missing data objects: ${_.difference(
+        Array.from(dataObjectIds).map((id) => id.toString()),
+        dataObjects.map((o) => o.id)
+      )} in bag ${getBagId(bagId)}`
+    )
+  }
+  return dataObjects
+}
+
+export function getStaticBagOwner(bagId: StaticBagId): typeof StorageBagOwner {
+  if (bagId.isCouncil) {
+    return new StorageBagOwnerCouncil()
+  } else if (bagId.isWorkingGroup) {
+    const owner = new StorageBagOwnerWorkingGroup()
+    owner.workingGroupId = bagId.asWorkingGroup.toString().toLowerCase()
+    return owner
+  } else {
+    throw new Error(`Unexpected static bag type: ${bagId.type}`)
+  }
+}
+
+export function getDynamicBagOwner(bagId: DynamicBagId) {
+  if (bagId.isChannel) {
+    const owner = new StorageBagOwnerChannel()
+    owner.channelId = bagId.asChannel.toNumber()
+    return owner
+  } else if (bagId.isMember) {
+    const owner = new StorageBagOwnerMember()
+    owner.memberId = bagId.asMember.toNumber()
+    return owner
+  } else {
+    throw new Error(`Unexpected dynamic bag type: ${bagId.type}`)
+  }
+}
+
+export function getStaticBagId(bagId: StaticBagId): string {
+  if (bagId.isCouncil) {
+    return `static:council`
+  } else if (bagId.isWorkingGroup) {
+    return `static:wg:${bagId.asWorkingGroup.type.toLowerCase()}`
+  } else {
+    throw new Error(`Unexpected static bag type: ${bagId.type}`)
+  }
+}
+
+export function getDynamicBagId(bagId: DynamicBagId): string {
+  if (bagId.isChannel) {
+    return `dynamic:channel:${bagId.asChannel.toString()}`
+  } else if (bagId.isMember) {
+    return `dynamic:member:${bagId.asMember.toString()}`
+  } else {
+    throw new Error(`Unexpected dynamic bag type: ${bagId.type}`)
+  }
+}
+
+export function getBagId(bagId: BagId) {
+  return bagId.isStatic ? getStaticBagId(bagId.asStatic) : getDynamicBagId(bagId.asDynamic)
+}
+
+export async function getDynamicBag(
+  store: DatabaseManager,
+  bagId: DynamicBagId,
+  relations?: 'objects'[]
+): Promise<StorageBag> {
+  return getById(store, StorageBag, getDynamicBagId(bagId), relations)
+}
+
+export async function getStaticBag(
+  store: DatabaseManager,
+  bagId: StaticBagId,
+  relations?: 'objects'[]
+): Promise<StorageBag> {
+  const id = getStaticBagId(bagId)
+  const bag = await store.get(StorageBag, { where: { id }, relations })
+  if (!bag) {
+    console.log(`Creating new static bag: ${id}`)
+    const newBag = new StorageBag({
+      id,
+      owner: getStaticBagOwner(bagId),
+    })
+    await store.save<StorageBag>(newBag)
+    return newBag
+  }
+  return bag
+}
+
+export async function getBag(store: DatabaseManager, bagId: BagId, relations?: 'objects'[]): Promise<StorageBag> {
+  return bagId.isStatic
+    ? getStaticBag(store, bagId.asStatic, relations)
+    : getDynamicBag(store, bagId.asDynamic, relations)
+}
+
+export async function getDistributionBucketOperatorWithMetadata(
+  store: DatabaseManager,
+  id: string
+): Promise<DistributionBucketOperator> {
+  const operator = await store.get(DistributionBucketOperator, {
+    where: { id },
+    relations: ['metadata', 'metadata.nodeLocation', 'metadata.nodeLocation.coordinates'],
+  })
+  if (!operator) {
+    throw new Error(`DistributionBucketOperator not found by id: ${id}`)
+  }
+  return operator
+}
+
+export async function getStorageBucketWithOperatorMetadata(store: DatabaseManager, id: string): Promise<StorageBucket> {
+  const bucket = await store.get(StorageBucket, {
+    where: { id },
+    relations: ['operatorMetadata', 'operatorMetadata.nodeLocation', 'operatorMetadata.nodeLocation.coordinates'],
+  })
+  if (!bucket) {
+    throw new Error(`StorageBucket not found by id: ${id}`)
+  }
+  return bucket
+}
+
+export async function getDistributionBucketFamilyWithMetadata(
+  store: DatabaseManager,
+  id: string
+): Promise<DistributionBucketFamily> {
+  const family = await store.get(DistributionBucketFamily, {
+    where: { id },
+    relations: ['metadata', 'metadata.areas'],
+  })
+  if (!family) {
+    throw new Error(`DistributionBucketFamily not found by id: ${id}`)
+  }
+  return family
+}
+
 export async function getStorageSystem(store: DatabaseManager): Promise<StorageSystemParameters> {
   const storageSystem = await store.get(StorageSystemParameters, {})
   if (!storageSystem) {
@@ -19,13 +181,15 @@ export async function getStorageSystem(store: DatabaseManager): Promise<StorageS
 
 export async function createDataObjects(
   store: DatabaseManager,
-  objectsParams: DataObjectCreationParameters[],
-  storageBag: StorageBag,
+  uploadParams: UploadParameters,
+  deletionPrize: Balance,
   objectIds?: BN[]
 ): Promise<StorageDataObject[]> {
   const storageSystem = await getStorageSystem(store)
+  const { objectCreationList, bagId } = uploadParams
+  const storageBag = await getBag(store, bagId)
 
-  const dataObjects = objectsParams.map((objectParams, i) => {
+  const dataObjects = objectCreationList.map((objectParams, i) => {
     const params = new ObjectCreationParams(registry, objectParams.toJSON() as any)
     const objectId = objectIds ? objectIds[i] : storageSystem.nextDataObjectId
     const object = new StorageDataObject({
@@ -33,6 +197,8 @@ export async function createDataObjects(
       isAccepted: false,
       ipfsHash: bytesToString(objectParams.ipfsContentId),
       size: new BN(params.getField('size').toString()),
+      type: new DataObjectTypeUnknown(),
+      deletionPrize,
       storageBag,
     })
     if (objectId.gte(storageSystem.nextDataObjectId)) {
@@ -67,5 +233,5 @@ export async function getMostRecentlyCreatedDataObjects(
 
 export async function removeDataObject(store: DatabaseManager, object: StorageDataObject): Promise<void> {
   await unsetAssetRelations(store, object)
-  await store.save<StorageDataObject>(object)
+  await store.remove<StorageDataObject>(object)
 }

+ 4 - 25
query-node/schemas/content.graphql

@@ -1,21 +1,3 @@
-type AssetExternal @variant {
-  # FIXME: [String!] currnetly not supported in variants
-  "JSON array of the urls"
-  urls: String!
-}
-
-type AssetJoystreamStorage @variant {
-  "Related data object"
-  dataObject: StorageDataObject!
-}
-
-# FIXME: https://github.com/Joystream/hydra/issues/434
-type AssetNone @variant {
-  _phantom: Int
-}
-
-union Asset = AssetExternal | AssetJoystreamStorage | AssetNone
-
 "Category of media channel"
 type ChannelCategory @entity {
   id: ID!
@@ -62,12 +44,11 @@ type Channel @entity {
   "The description of a Channel"
   description: String
 
-  # FIXME: Due to https://github.com/Joystream/hydra/issues/434, Asset is currently non-optional (use AssetNone to unset it)
   "Channel's cover (background) photo asset. Recommended ratio: 16:9."
-  coverPhoto: Asset!
+  coverPhoto: StorageDataObject
 
   "Channel's avatar photo asset."
-  avatarPhoto: Asset!
+  avatarPhoto: StorageDataObject
 
   ##########################
 
@@ -129,9 +110,8 @@ type Video @entity {
   "Video duration in seconds"
   duration: Int
 
-# FIXME: Due to https://github.com/Joystream/hydra/issues/434, Asset is currently non-optional (use AssetNone to unset it)
   "Video thumbnail asset (recommended ratio: 16:9)"
-  thumbnailPhoto: Asset!
+  thumbnailPhoto: StorageDataObject
 
   ##########################
 
@@ -156,9 +136,8 @@ type Video @entity {
   "License under the video is published"
   license: License
 
-  # FIXME: Due to https://github.com/Joystream/hydra/issues/434, Asset is currently non-optional (use AssetNone to unset it)
   "Video media asset"
-  media: Asset!
+  media: StorageDataObject
 
   ##########################
 

+ 77 - 4
query-node/schemas/storage.graphql

@@ -42,11 +42,34 @@ union StorageBucketOperatorStatus = StorageBucketOperatorStatusMissing | Storage
 type GeoCoordinates @entity {
   latitude: Float!
   longitude: Float!
+}
+
+enum Continent {
+  AF
+  NA
+  OC
+  AN
+  AS
+  EU
+  SA
+}
+
+type GeographicalAreaContinent @variant {
+  code: Continent
+}
+
+type GeographicalAreaCountry @variant {
+  "ISO 3166-1 alpha-2 country code"
+  code: String
+}
 
-  "Optional DistributionBucketFamilyMetadata reference in case the coordinates are part of a region boundary"
-  boundarySourceBucketFamilyMeta: DistributionBucketFamilyMetadata
+type GeographicalAreaSubdivistion @variant {
+  "ISO 3166-2 subdivision code"
+  code: String
 }
 
+union GeographicalArea = GeographicalAreaContinent | GeographicalAreaCountry | GeographicalAreaSubdivistion
+
 type NodeLocationMetadata @entity {
   "ISO 3166-1 alpha-2 country code (2 letters)"
   countryCode: String
@@ -168,6 +191,32 @@ type StorageBagDistributionAssignment @entity {
   distributionBucketId: ID
 }
 
+type DataObjectTypeChannelAvatar @variant {
+  "Related channel entity"
+  channel: Channel!
+}
+
+type DataObjectTypeChannelCoverPhoto @variant {
+  "Related channel entity"
+  channel: Channel!
+}
+
+type DataObjectTypeVideoMedia @variant {
+  "Related video entity"
+  video: Video!
+}
+
+type DataObjectTypeVideoThumbnail @variant {
+  "Related video entity"
+  video: Video!
+}
+
+type DataObjectTypeUnknown @variant {
+  _phantom: Int
+}
+
+union DataObjectType = DataObjectTypeChannelAvatar | DataObjectTypeChannelCoverPhoto | DataObjectTypeVideoMedia | DataObjectTypeVideoThumbnail | DataObjectTypeUnknown
+
 type StorageDataObject @entity {
   "Data object runtime id"
   id: ID!
@@ -183,6 +232,27 @@ type StorageDataObject @entity {
 
   "IPFS content hash"
   ipfsHash: String!
+
+  # FIXME: Cannot be optional because: https://github.com/Joystream/hydra/issues/434
+  "The type of the asset that the data object represents (if known)"
+  type: DataObjectType!
+
+  "Prize for removing the data object"
+  deletionPrize: BigInt!
+
+  "If the object is no longer used as an asset - the time at which it was unset (if known)"
+  unsetAt: DateTime
+}
+
+type DistributionBucketFamilyGeographicArea @entity {
+  "{metadataId}-{(C|c|s)}-{code}"
+  id: ID!
+
+  "Geographical area (continent / country / subdivision)"
+  area: GeographicalArea!
+
+  "Related distribution bucket family metadata"
+  distributionBucketFamilyMetadata: DistributionBucketFamilyMetadata!
 }
 
 type DistributionBucketFamilyMetadata @entity {
@@ -192,8 +262,11 @@ type DistributionBucketFamilyMetadata @entity {
   "Optional, more specific description of the region covered by the family"
   description: String
 
-  "Optional region boundary as geocoordiantes polygon"
-  boundary: [GeoCoordinates!] @derivedFrom(field: "boundarySourceBucketFamilyMeta")
+  "Geographical areas covered by the family"
+  areas: [DistributionBucketFamilyGeographicArea!] @derivedFrom(field: "distributionBucketFamilyMetadata")
+
+  "List of targets (hosts/ips) best suited latency measurements for the family"
+  latencyTestTargets: [String]
 }
 
 type DistributionBucketOperatorMetadata @entity {

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
types/augment-codec/all.ts


+ 9 - 0
yarn.lock

@@ -5701,6 +5701,11 @@
   resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83"
   integrity "sha1-GwuBmxY2x7rw1nhdAw0S7fcMPoM= sha512-iTs9HReBu7evG77Q4EC8hZnqRt57irBDkK9nvmHroiOIVwYMQc4IvYvdRgwKfYepunIY7Oh/dBuuld+Gj9uo6w=="
 
+"@types/iso-3166-2@^1.0.0":
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/@types/iso-3166-2/-/iso-3166-2-1.0.0.tgz#98a7b6e505c031e83c5aac13c9c49f9d9f6ca234"
+  integrity sha512-DYDyoRyPyxBeI9bYoTXLfsOZH12m1anrWEj9LU5Sl9rgsJ4soJMYf/7byozM+64Smn6/a1i079eQLGuPykwaHQ==
+
 "@types/isomorphic-fetch@^0.0.35":
   version "0.0.35"
   resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.35.tgz#c1c0d402daac324582b6186b91f8905340ea3361"
@@ -18291,6 +18296,10 @@ iso-639-1@^2.1.9:
   version "2.1.9"
   resolved "https://registry.yarnpkg.com/iso-639-1/-/iso-639-1-2.1.9.tgz#e41b11d4f1808e5316d0252c3fa16eeb9b37bb58"
   integrity sha512-owRu9up+Cpx/hwSzm83j6G8PtC7U99UCtPVItsafefNfEgMl+pi8KBwhXwJkJfp6IouyYWFxj8n24SvCWpKZEQ==
+iso-3166-2@^1.0.0:
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/iso-3166-2/-/iso-3166-2-1.0.0.tgz#20c5cda527b56bfc7409c6802d9bff0119086131"
+  integrity sha512-xLAazfKZzwlsg/Zz/GQGQk3jJez5/2ORrjD3TjSuqz/arMht/xTK49c0GOE3afO/gEd9tHtBVVlfBla01unUng==
 
 iso-constants@^0.1.2:
   version "0.1.2"

Деякі файли не було показано, через те що забагато файлів було змінено