Ver Fonte

Merge pull request #1556 from Lezek123/joystream-types-babylon-aliases

@joystream/types - add EnityOf, ClassOf aliases
Mokhtar Naamani há 4 anos atrás
pai
commit
a760de3c0c

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
types/augment-codec/all.ts


+ 3 - 3
types/augment-codec/augment-api-query.ts

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
 import { Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u32, u64 } from '@polkadot/types/primitive';
-import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorGroup, CuratorGroupId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityController, EntityCreationVoucher, EntityId, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, PropertyId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
+import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassOf, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorGroup, CuratorGroupId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityController, EntityCreationVoucher, EntityId, EntityOf, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, PropertyId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
 import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
 import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
 import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
@@ -131,7 +131,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map, representing ClassId -> Class relation
        **/
-      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<Class>>;
+      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<ClassOf>>;
       /**
        * Map, representing  CuratorGroupId -> CuratorGroup relation
        **/
@@ -139,7 +139,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map, representing EntityId -> Entity relation
        **/
-      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<Entity>>;
+      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<EntityOf>>;
       entityCreationVouchers: AugmentedQueryDoubleMap<ApiType, (key1: ClassId | AnyNumber | Uint8Array, key2: EntityController | { Maintainers: any } | { Member: any } | { Lead: any } | string | Uint8Array) => Observable<EntityCreationVoucher>>;
       /**
        * Next runtime storage values used to maintain next id value, used on creation of respective curator groups, classes and entities

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
types/augment-codec/augment-types.ts


+ 17 - 0
types/augment/all/defs.json

@@ -794,6 +794,16 @@
         "current_number_of_entities": "EntityId",
         "default_entity_creation_voucher_upper_bound": "EntityId"
     },
+    "ClassOf": {
+        "class_permissions": "ClassPermissions",
+        "properties": "Vec<Property>",
+        "schemas": "Vec<Schema>",
+        "name": "Text",
+        "description": "Text",
+        "maximum_entities_count": "EntityId",
+        "current_number_of_entities": "EntityId",
+        "default_entity_creation_voucher_upper_bound": "EntityId"
+    },
     "EntityController": {
         "_enum": {
             "Maintainers": "Null",
@@ -855,6 +865,13 @@
         "values": "BTreeMap<PropertyId,StoredPropertyValue>",
         "reference_counter": "InboundReferenceCounter"
     },
+    "EntityOf": {
+        "entity_permissions": "EntityPermissions",
+        "class_id": "ClassId",
+        "supported_schemas": "Vec<SchemaId>",
+        "values": "BTreeMap<PropertyId,StoredPropertyValue>",
+        "reference_counter": "InboundReferenceCounter"
+    },
     "CuratorGroup": {
         "curators": "Vec<u64>",
         "active": "bool",

+ 20 - 0
types/augment/all/types.ts

@@ -247,6 +247,18 @@ export interface Class extends Struct {
 /** @name ClassId */
 export interface ClassId extends u64 {}
 
+/** @name ClassOf */
+export interface ClassOf extends Struct {
+  readonly class_permissions: ClassPermissions;
+  readonly properties: Vec<Property>;
+  readonly schemas: Vec<Schema>;
+  readonly name: Text;
+  readonly description: Text;
+  readonly maximum_entities_count: EntityId;
+  readonly current_number_of_entities: EntityId;
+  readonly default_entity_creation_voucher_upper_bound: EntityId;
+}
+
 /** @name ClassPermissions */
 export interface ClassPermissions extends Struct {
   readonly any_member: bool;
@@ -478,6 +490,14 @@ export interface EntityCreationVoucher extends Struct {
 /** @name EntityId */
 export interface EntityId extends u64 {}
 
+/** @name EntityOf */
+export interface EntityOf extends Struct {
+  readonly entity_permissions: EntityPermissions;
+  readonly class_id: ClassId;
+  readonly supported_schemas: Vec<SchemaId>;
+  readonly reference_counter: InboundReferenceCounter;
+}
+
 /** @name EntityPermissions */
 export interface EntityPermissions extends Struct {
   readonly controller: EntityController;

+ 3 - 3
types/augment/augment-api-query.ts

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
 import { Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u32, u64 } from '@polkadot/types/primitive';
-import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorGroup, CuratorGroupId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityController, EntityCreationVoucher, EntityId, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, PropertyId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
+import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassOf, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorGroup, CuratorGroupId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityController, EntityCreationVoucher, EntityId, EntityOf, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, PropertyId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
 import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
 import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
 import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
@@ -131,7 +131,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map, representing ClassId -> Class relation
        **/
-      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<Class>>;
+      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<ClassOf>>;
       /**
        * Map, representing  CuratorGroupId -> CuratorGroup relation
        **/
@@ -139,7 +139,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Map, representing EntityId -> Entity relation
        **/
-      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<Entity>>;
+      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<EntityOf>>;
       entityCreationVouchers: AugmentedQueryDoubleMap<ApiType, (key1: ClassId | AnyNumber | Uint8Array, key2: EntityController | { Maintainers: any } | { Member: any } | { Lead: any } | string | Uint8Array) => Observable<EntityCreationVoucher>>;
       /**
        * Next runtime storage values used to maintain next id value, used on creation of respective curator groups, classes and entities

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
types/augment/augment-types.ts


+ 2 - 0
types/src/content-directory/index.ts

@@ -288,6 +288,7 @@ export const contentDirectoryTypes = {
   Property,
   Schema,
   Class,
+  ClassOf: Class,
   EntityController,
   EntityPermissions,
   StoredValue,
@@ -296,6 +297,7 @@ export const contentDirectoryTypes = {
   StoredPropertyValue,
   InboundReferenceCounter,
   Entity,
+  EntityOf: Entity,
   CuratorGroup,
   EntityCreationVoucher,
   Actor,

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff