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

content-dir: fix Series types for updating

Mokhtar Naamani 4 роки тому
батько
коміт
804c99bdb3

+ 40 - 37
runtime-modules/content/src/lib.rs

@@ -281,7 +281,7 @@ pub struct VideoUpdateParameters<VideoCategoryId> {
     new_meta: Option<Vec<u8>>,
 }
 
-/// A video which belongs in a channel. A video may be part of a series or playlist.
+/// A video which belongs to a channel. A video may be part of a series or playlist.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct Video<ChannelId, SeriesId, PlaylistId> {
@@ -298,7 +298,7 @@ pub struct Video<ChannelId, SeriesId, PlaylistId> {
     is_featured: bool,
 }
 
-/// Information about plyalist being created.
+/// Information about the plyalist being created.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct PlaylistCreationParameters<VideoId> {
@@ -328,57 +328,50 @@ pub struct Playlist<ChannelId, VideoId> {
     videos: Vec<VideoId>,
 }
 
-/// Information about an episode that is being created.
+/// Information about the episode being created or updated.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
-pub enum EpisodeCreationParameters<VideoCategoryId, VideoId> {
+pub enum EpisodeParameters<VideoCategoryId, VideoId> {
     /// A new video is being added as the episode.
     NewVideo(VideoCreationParameters<VideoCategoryId>),
     /// An existing video is being made into an episode.
     ExistingVideo(VideoId),
 }
 
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
-#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
-pub enum EpisodeUpdateParemters<VideoCategoryId, VideoId> {
-    UpdateVideo(VideoUpdateParameters<VideoCategoryId>),
-    ChangeExistingVideo(VideoId),
-}
-
+/// Information about the season being created or updated.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct SeasonCreationParameters<VideoCategoryId, VideoId> {
-    episodes: Vec<EpisodeCreationParameters<VideoCategoryId, VideoId>>,
-    meta: Vec<u8>,
+pub struct SeasonParameters<VideoCategoryId, VideoId> {
+    // ?? It might just be more straighforward to always provide full list of episodes at cost of larger tx.
+    /// If set, updates the episodes of a season. Extends the number of episodes in a season
+    /// when length of new_episodes is greater than previously set. Last elements must all be
+    /// 'Some' in that case.
+    /// Will truncate existing season when length of new_episodes is less than previously set.
+    episodes: Option<Vec<Option<EpisodeParameters<VideoCategoryId, VideoId>>>>,
+    /// If set, Metadata update for season.
+    meta: Option<Vec<u8>>,
 }
 
+/// Information about the series being created or updated.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct SeasonUpdateParameters<VideoCategoryId, VideoId> {
-    new_episodes: Option<Vec<Option<EpisodeUpdateParemters<VideoCategoryId, VideoId>>>>,
-    new_meta: Option<Vec<u8>>,
+pub struct SeriesParameters<VideoCategoryId, VideoId> {
+    // ?? It might just be more straighforward to always provide full list of seasons at cost of larger tx.
+    /// If set, updates the seasons of a series. Extend a series when length of seasons is
+    /// greater than previoulsy set. Last elements must all be 'Some' in that case.
+    /// Will truncate existing series when length of seasons is less than previously set.
+    seasons: Option<Vec<Option<SeasonParameters<VideoCategoryId, VideoId>>>>,
+    meta: Option<Vec<u8>>,
 }
 
+/// A season is an ordered list of videos (episodes).
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct Season<VideoId> {
     episodes: Vec<VideoId>,
 }
 
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
-#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct SeriesCreationParameters<VideoCategoryId, VideoId> {
-    seasons: Vec<SeasonCreationParameters<VideoCategoryId, VideoId>>,
-    meta: Vec<u8>,
-}
-
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
-#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct SeriesUpdateParameters<VideoCategoryId, VideoId> {
-    seasons: Option<Vec<Option<SeasonUpdateParameters<VideoCategoryId, VideoId>>>>,
-    new_meta: Option<Vec<u8>>,
-}
-
+/// A series is an ordered list of seasons that belongs to a channel.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct Series<ChannelId, VideoId> {
@@ -386,7 +379,7 @@ pub struct Series<ChannelId, VideoId> {
     seasons: Vec<Season<VideoId>>,
 }
 
-// The authenticated origin for Person creation and updating calls
+// The actor the caller/origin is trying to act as for Person creation and update and delete calls.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
 pub enum PersonActor<MemberId, CuratorId> {
@@ -394,7 +387,7 @@ pub enum PersonActor<MemberId, CuratorId> {
     Curator(CuratorId),
 }
 
-/// The authorized "actor" that may update or delete a Person
+/// The authorized actor that may update or delete a Person.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
 pub enum PersonController<MemberId> {
@@ -414,22 +407,29 @@ impl<MemberId> Default for PersonController<MemberId> {
     }
 }
 
+/// Information for Person being created.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct PersonCreationParameters {
+    /// Metadata for person.
     meta: Vec<u8>,
 }
 
+/// Information for Persion being updated.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct PersonUpdateParameters {
+    /// Metadata to update person.
     new_meta: Vec<u8>,
 }
 
+/// A Person represents a real person that may be associated with a video.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct Person<MemberId> {
+    /// Who can update or delete this person.
     controlled_by: PersonController<MemberId>,
+    /// The number of videos this person appears in.
     number_of_videos_person_involed_in: u32,
 }
 
@@ -923,7 +923,7 @@ decl_module! {
             owner: ChannelOwner<T::MemberId, T::CuratorGroupId, T::DAOId>,
             channel_id: T::ChannelId,
             assets: Vec<NewAsset<ContentParameters<T::ContentId, T::DataObjectTypeId>>>,
-            params: SeriesCreationParameters<T::VideoCategoryId, T::VideoId>,
+            params: SeriesParameters<T::VideoCategoryId, T::VideoId>,
         ) -> DispatchResult {
             Ok(())
         }
@@ -934,7 +934,7 @@ decl_module! {
             owner: ChannelOwner<T::MemberId, T::CuratorGroupId, T::DAOId>,
             channel_id: T::ChannelId,
             assets: Vec<NewAsset<ContentParameters<T::ContentId, T::DataObjectTypeId>>>,
-            params: SeriesUpdateParameters<T::VideoCategoryId, T::VideoId>,
+            params: SeriesParameters<T::VideoCategoryId, T::VideoId>,
         ) -> DispatchResult {
             Ok(())
         }
@@ -1053,6 +1053,7 @@ decl_event!(
         PersonId = <T as Trait>::PersonId,
         DAOId = <T as StorageOwnership>::DAOId,
         ChannelOwnershipTransferRequest = ChannelOwnershipTransferRequest<T>,
+        Series = Series<<T as StorageOwnership>::ChannelId, <T as Trait>::VideoId>,
     {
         // Curators
         CuratorGroupCreated(CuratorGroupId),
@@ -1120,12 +1121,14 @@ decl_event!(
         SeriesCreated(
             SeriesId,
             Vec<NewAsset>,
-            SeriesCreationParameters<VideoCategoryId, VideoId>,
+            SeriesParameters<VideoCategoryId, VideoId>,
+            Series,
         ),
         SeriesUpdated(
             SeriesId,
             Vec<NewAsset>,
-            SeriesUpdateParameters<VideoCategoryId, VideoId>,
+            SeriesParameters<VideoCategoryId, VideoId>,
+            Series,
         ),
         SeriesDeleted(SeriesId),
 

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


+ 39 - 8
types/augment-codec/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VoteKind, WorkerId, WorkingGroup } from './all';
+import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwner, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, NewAsset, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PostId, ProposalId, RewardPolicy, SeriesId, SeriesParameters, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
 import { Heartbeat } from '@polkadot/types/interfaces/imOnline';
@@ -99,26 +99,57 @@ declare module '@polkadot/api/types/submittable' {
       transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     content: {
-      /**
-       * Add new curator group to runtime storage
-       **/
-      addCuratorGroup: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      acceptChannelTransfer: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, requestId: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Add curator to curator group under given `curator_group_id`
        **/
       addCuratorToGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addPersonToVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, person: PersonId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      cancelChannelTransferRequest: AugmentedSubmittable<(requestId: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: ChannelCreationParameters | { in_category?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, params: ChannelCategoryCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
-       * Remove curator from a given curator group
+       * Add new curator group to runtime storage
        **/
-      removeCuratorFromGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createCuratorGroup: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      createPerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PersonCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createPlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PlaylistCreationParameters | { videos?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: SeriesParameters | { seasons?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: VideoCreationParameters | { in_category?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, params: VideoCategoryCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      curateChannel: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      curateVideo: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: ChannelCategoryId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Remove curator group under given `curator_group_id` from runtime storage
        **/
-      removeCuratorGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteCuratorGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deletePerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, person: PersonId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deletePlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, playlist: PlaylistId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, series: SeriesId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, video: VideoId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: VideoCategoryId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove curator from a given curator group
+       **/
+      removeCuratorFromGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      removePersonFromVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      requestChannelTransfer: AugmentedSubmittable<(newOwner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, payment: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Set `is_active` status for curator group under given `curator_group_id`
        **/
       setCuratorGroupStatus: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, isActive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setFeaturedVideos: AugmentedSubmittable<(list: Vec<VideoId> | (VideoId | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      uncurateChannel: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      uncurateVideo: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, newAssets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: ChannelUpdateParameters | { new_in_category?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: ChannelCategoryId | AnyNumber | Uint8Array, params: ChannelCategoryUpdateParameters | { new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updatePerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, person: PersonId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PersonUpdateParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updatePlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, playlist: PlaylistId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PlaylistUpdateParameters | { new_videos?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: SeriesParameters | { seasons?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, video: VideoId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: VideoUpdateParameters | { new_in_category?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: VideoCategoryId | AnyNumber | Uint8Array, params: VideoCategoryUpdateParameters | { new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     contentDirectoryWorkingGroup: {
       /**

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


+ 7 - 21
types/augment/all/defs.json

@@ -818,33 +818,19 @@
     "Season": {
         "episodes": "Vec<VideoId>"
     },
-    "SeriesCreationParameters": {
-        "seasons": "Vec<SeasonCreationParameters>",
-        "meta": "Bytes"
+    "SeriesParameters": {
+        "seasons": "Option<Vec<Option<SeasonParameters>>>",
+        "meta": "Option<Bytes>"
     },
-    "SeriesUpdateParameters": {
-        "new_seasons": "Option<Vec<Option<SeasonUpdateParameters>>>",
-        "new_meta": "Option<Bytes>"
+    "SeasonParameters": {
+        "episodes": "Option<Vec<Option<EpisodeParemters>>>",
+        "meta": "Option<Bytes>"
     },
-    "SeasonCreationParameters": {
-        "episodes": "Vec<EpisodeCreationParameters>",
-        "meta": "Bytes"
-    },
-    "SeasonUpdateParameters": {
-        "new_episodes": "Option<Vec<Option<EpisodeUpdateParemters>>>",
-        "new_meta": "Option<Bytes>"
-    },
-    "EpisodeCreationParameters": {
+    "EpisodeParemters": {
         "_enum": {
             "NewVideo": "VideoCreationParameters",
             "ExistingVideo": "VideoId"
         }
     },
-    "EpisodeUpdateParemters": {
-        "_enum": {
-            "UpdateVideo": "VideoUpdateParameters",
-            "ChangeExistingVideo": "VideoId"
-        }
-    },
     "MaxNumber": "u32"
 }

+ 10 - 30
types/augment/all/types.ts

@@ -472,22 +472,14 @@ export interface EntryMethod extends Enum {
   readonly isGenesis: boolean;
 }
 
-/** @name EpisodeCreationParameters */
-export interface EpisodeCreationParameters extends Enum {
+/** @name EpisodeParemters */
+export interface EpisodeParemters extends Enum {
   readonly isNewVideo: boolean;
   readonly asNewVideo: VideoCreationParameters;
   readonly isExistingVideo: boolean;
   readonly asExistingVideo: VideoId;
 }
 
-/** @name EpisodeUpdateParemters */
-export interface EpisodeUpdateParemters extends Enum {
-  readonly isUpdateVideo: boolean;
-  readonly asUpdateVideo: VideoUpdateParameters;
-  readonly isChangeExistingVideo: boolean;
-  readonly asChangeExistingVideo: VideoId;
-}
-
 /** @name ExecutionFailed */
 export interface ExecutionFailed extends Struct {
   readonly error: Text;
@@ -1032,16 +1024,10 @@ export interface Season extends Struct {
   readonly episodes: Vec<VideoId>;
 }
 
-/** @name SeasonCreationParameters */
-export interface SeasonCreationParameters extends Struct {
-  readonly episodes: Vec<EpisodeCreationParameters>;
-  readonly meta: Bytes;
-}
-
-/** @name SeasonUpdateParameters */
-export interface SeasonUpdateParameters extends Struct {
-  readonly new_episodes: Option<Vec<Option<EpisodeUpdateParemters>>>;
-  readonly new_meta: Option<Bytes>;
+/** @name SeasonParameters */
+export interface SeasonParameters extends Struct {
+  readonly episodes: Option<Vec<Option<EpisodeParemters>>>;
+  readonly meta: Option<Bytes>;
 }
 
 /** @name Seat */
@@ -1060,19 +1046,13 @@ export interface Series extends Struct {
   readonly seasons: Vec<Season>;
 }
 
-/** @name SeriesCreationParameters */
-export interface SeriesCreationParameters extends Struct {
-  readonly seasons: Vec<SeasonCreationParameters>;
-  readonly meta: Bytes;
-}
-
 /** @name SeriesId */
 export interface SeriesId extends u64 {}
 
-/** @name SeriesUpdateParameters */
-export interface SeriesUpdateParameters extends Struct {
-  readonly new_seasons: Option<Vec<Option<SeasonUpdateParameters>>>;
-  readonly new_meta: Option<Bytes>;
+/** @name SeriesParameters */
+export interface SeriesParameters extends Struct {
+  readonly seasons: Option<Vec<Option<SeasonParameters>>>;
+  readonly meta: Option<Bytes>;
 }
 
 /** @name ServiceProviderRecord */

+ 39 - 8
types/augment/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VoteKind, WorkerId, WorkingGroup } from './all';
+import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ChannelCategoryCreationParameters, ChannelCategoryId, ChannelCategoryUpdateParameters, ChannelCreationParameters, ChannelId, ChannelOwner, ChannelOwnershipTransferRequestId, ChannelUpdateParameters, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, NewAsset, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PersonActor, PersonCreationParameters, PersonId, PersonUpdateParameters, PlaylistCreationParameters, PlaylistId, PlaylistUpdateParameters, PostId, ProposalId, RewardPolicy, SeriesId, SeriesParameters, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VideoCategoryCreationParameters, VideoCategoryId, VideoCategoryUpdateParameters, VideoCreationParameters, VideoId, VideoUpdateParameters, VoteKind, WorkerId, WorkingGroup } from './all';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
 import { Heartbeat } from '@polkadot/types/interfaces/imOnline';
@@ -99,26 +99,57 @@ declare module '@polkadot/api/types/submittable' {
       transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     content: {
-      /**
-       * Add new curator group to runtime storage
-       **/
-      addCuratorGroup: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      acceptChannelTransfer: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, requestId: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Add curator to curator group under given `curator_group_id`
        **/
       addCuratorToGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addPersonToVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, person: PersonId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      cancelChannelTransferRequest: AugmentedSubmittable<(requestId: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: ChannelCreationParameters | { in_category?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, params: ChannelCategoryCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
-       * Remove curator from a given curator group
+       * Add new curator group to runtime storage
        **/
-      removeCuratorFromGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createCuratorGroup: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      createPerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PersonCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createPlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PlaylistCreationParameters | { videos?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: SeriesParameters | { seasons?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: VideoCreationParameters | { in_category?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      createVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, params: VideoCategoryCreationParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      curateChannel: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      curateVideo: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: ChannelCategoryId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Remove curator group under given `curator_group_id` from runtime storage
        **/
-      removeCuratorGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteCuratorGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deletePerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, person: PersonId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deletePlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, playlist: PlaylistId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, series: SeriesId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, video: VideoId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      deleteVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: VideoCategoryId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove curator from a given curator group
+       **/
+      removeCuratorFromGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      removePersonFromVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      requestChannelTransfer: AugmentedSubmittable<(newOwner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, payment: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Set `is_active` status for curator group under given `curator_group_id`
        **/
       setCuratorGroupStatus: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, isActive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setFeaturedVideos: AugmentedSubmittable<(list: Vec<VideoId> | (VideoId | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      uncurateChannel: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      uncurateVideo: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, videoId: VideoId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateChannel: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, newAssets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: ChannelUpdateParameters | { new_in_category?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateChannelCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: ChannelCategoryId | AnyNumber | Uint8Array, params: ChannelCategoryUpdateParameters | { new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updatePerson: AugmentedSubmittable<(actor: PersonActor | { Member: any } | { Curator: any } | string | Uint8Array, person: PersonId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PersonUpdateParameters | { meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updatePlaylist: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, playlist: PlaylistId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: PlaylistUpdateParameters | { new_videos?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateSeries: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: SeriesParameters | { seasons?: any; meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateVideo: AugmentedSubmittable<(owner: ChannelOwner | { Nobody: any } | { Member: any } | { Curators: any } | { Dao: any } | string | Uint8Array, video: VideoId | AnyNumber | Uint8Array, assets: Vec<NewAsset> | (NewAsset | { Upload: any } | { Uri: any } | string | Uint8Array)[], params: VideoUpdateParameters | { new_in_category?: any; new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      updateVideoCategory: AugmentedSubmittable<(curator: CuratorId | AnyNumber | Uint8Array, category: VideoCategoryId | AnyNumber | Uint8Array, params: VideoCategoryUpdateParameters | { new_meta?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
     contentDirectoryWorkingGroup: {
       /**

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


+ 10 - 28
types/src/content/index.ts

@@ -117,28 +117,18 @@ export class PlaylistUpdateParameters extends JoyStructDecorated({
   new_meta: Option.with(Bytes),
 }) {}
 
-export class EpisodeCreationParameters extends JoyEnum({
+export class EpisodeParemters extends JoyEnum({
   NewVideo: VideoCreationParameters,
   ExistingVideo: VideoId,
 }) {}
 
-export class EpisodeUpdateParemters extends JoyEnum({
-  UpdateVideo: VideoUpdateParameters,
-  ChangeExistingVideo: VideoId,
-}) {}
-
 export class Season extends JoyStructDecorated({
   episodes: Vec.with(VideoId),
 }) {}
 
-export class SeasonCreationParameters extends JoyStructDecorated({
-  episodes: Vec.with(EpisodeCreationParameters),
-  meta: Bytes,
-}) {}
-
-export class SeasonUpdateParameters extends JoyStructDecorated({
-  new_episodes: Option.with(Vec.with(Option.with(EpisodeUpdateParemters))),
-  new_meta: Option.with(Bytes),
+export class SeasonParameters extends JoyStructDecorated({
+  episodes: Option.with(Vec.with(Option.with(EpisodeParemters))),
+  meta: Option.with(Bytes),
 }) {}
 
 export class Series extends JoyStructDecorated({
@@ -146,14 +136,9 @@ export class Series extends JoyStructDecorated({
   seasons: Vec.with(Season),
 }) {}
 
-export class SeriesCreationParameters extends JoyStructDecorated({
-  seasons: Vec.with(SeasonCreationParameters),
-  meta: Bytes,
-}) {}
-
-export class SeriesUpdateParameters extends JoyStructDecorated({
-  new_seasons: Option.with(Vec.with(Option.with(SeasonUpdateParameters))),
-  new_meta: Option.with(Bytes),
+export class SeriesParameters extends JoyStructDecorated({
+  seasons: Option.with(Vec.with(Option.with(SeasonParameters))),
+  meta: Option.with(Bytes),
 }) {}
 
 export class PersonController extends JoyEnum({
@@ -222,12 +207,9 @@ export const contentDirectoryTypes = {
   SeriesId,
   Series,
   Season,
-  SeriesCreationParameters,
-  SeriesUpdateParameters,
-  SeasonCreationParameters,
-  SeasonUpdateParameters,
-  EpisodeCreationParameters,
-  EpisodeUpdateParemters,
+  SeriesParameters,
+  SeasonParameters,
+  EpisodeParemters,
   MaxNumber,
 }
 

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