ソースを参照

query node - storage provider / working group generalization

ondratra 3 年 前
コミット
b7d59a003e

+ 109 - 99
query-node/generated/graphql-server/generated/binding.ts

@@ -34,9 +34,6 @@ export interface Query {
     membersByHandle: <T = Array<MembersByHandleFTSOutput>>(args: { whereMembership?: MembershipWhereInput | null, skip?: Int | null, limit?: Int | null, text: String }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     search: <T = Array<SearchFTSOutput>>(args: { whereVideo?: VideoWhereInput | null, whereChannel?: ChannelWhereInput | null, skip?: Int | null, limit?: Int | null, text: String }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     videoCategoriesByName: <T = Array<VideoCategoriesByNameFTSOutput>>(args: { whereVideoCategory?: VideoCategoryWhereInput | null, skip?: Int | null, limit?: Int | null, text: String }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
-    storageProviders: <T = Array<StorageProvider>>(args: { offset?: Int | null, limit?: Int | null, where?: StorageProviderWhereInput | null, orderBy?: StorageProviderOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
-    storageProviderByUniqueInput: <T = StorageProvider | null>(args: { where: StorageProviderWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T | null> ,
-    storageProvidersConnection: <T = StorageProviderConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: StorageProviderWhereInput | null, orderBy?: StorageProviderOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     videoCategories: <T = Array<VideoCategory>>(args: { offset?: Int | null, limit?: Int | null, where?: VideoCategoryWhereInput | null, orderBy?: VideoCategoryOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     videoCategoryByUniqueInput: <T = VideoCategory | null>(args: { where: VideoCategoryWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T | null> ,
     videoCategoriesConnection: <T = VideoCategoryConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: VideoCategoryWhereInput | null, orderBy?: VideoCategoryOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
@@ -48,7 +45,10 @@ export interface Query {
     videoMediaMetadataConnection: <T = VideoMediaMetadataConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: VideoMediaMetadataWhereInput | null, orderBy?: VideoMediaMetadataOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     videos: <T = Array<Video>>(args: { offset?: Int | null, limit?: Int | null, where?: VideoWhereInput | null, orderBy?: VideoOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
     videoByUniqueInput: <T = Video | null>(args: { where: VideoWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T | null> ,
-    videosConnection: <T = VideoConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: VideoWhereInput | null, orderBy?: VideoOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> 
+    videosConnection: <T = VideoConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: VideoWhereInput | null, orderBy?: VideoOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
+    workers: <T = Array<Worker>>(args: { offset?: Int | null, limit?: Int | null, where?: WorkerWhereInput | null, orderBy?: WorkerOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
+    workerByUniqueInput: <T = Worker | null>(args: { where: WorkerWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T | null> ,
+    workersConnection: <T = WorkerConnection>(args: { first?: Int | null, after?: String | null, last?: Int | null, before?: String | null, where?: WorkerWhereInput | null, orderBy?: WorkerOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> 
   }
 
 export interface Mutation {}
@@ -224,22 +224,6 @@ export type MembershipOrderByInput =   'createdAt_ASC' |
   'subscription_ASC' |
   'subscription_DESC'
 
-export type StorageProviderOrderByInput =   'createdAt_ASC' |
-  'createdAt_DESC' |
-  'updatedAt_ASC' |
-  'updatedAt_DESC' |
-  'deletedAt_ASC' |
-  'deletedAt_DESC' |
-  'isActive_ASC' |
-  'isActive_DESC' |
-  'type_ASC' |
-  'type_DESC' |
-  'metadata_ASC' |
-  'metadata_DESC'
-
-export type StorageProviderType =   'GATEWAY' |
-  'STORAGE'
-
 export type VideoCategoryOrderByInput =   'createdAt_ASC' |
   'createdAt_DESC' |
   'updatedAt_ASC' |
@@ -326,6 +310,24 @@ export type VideoOrderByInput =   'createdAt_ASC' |
   'isFeatured_ASC' |
   'isFeatured_DESC'
 
+export type WorkerOrderByInput =   'createdAt_ASC' |
+  'createdAt_DESC' |
+  'updatedAt_ASC' |
+  'updatedAt_DESC' |
+  'deletedAt_ASC' |
+  'deletedAt_DESC' |
+  'isActive_ASC' |
+  'isActive_DESC' |
+  'workerId_ASC' |
+  'workerId_DESC' |
+  'type_ASC' |
+  'type_DESC' |
+  'metadata_ASC' |
+  'metadata_DESC'
+
+export type WorkerType =   'GATEWAY' |
+  'STORAGE'
+
 export interface BaseWhereInput {
   id_eq?: String | null
   id_in?: String[] | String | null
@@ -1127,58 +1129,6 @@ export interface MembershipWhereUniqueInput {
   handle?: String | null
 }
 
-export interface StorageProviderCreateInput {
-  isActive: Boolean
-  type: StorageProviderType
-  metadata?: String | null
-}
-
-export interface StorageProviderUpdateInput {
-  isActive?: Boolean | null
-  type?: StorageProviderType | null
-  metadata?: String | null
-}
-
-export interface StorageProviderWhereInput {
-  id_eq?: ID_Input | null
-  id_in?: ID_Output[] | ID_Output | null
-  createdAt_eq?: DateTime | null
-  createdAt_lt?: DateTime | null
-  createdAt_lte?: DateTime | null
-  createdAt_gt?: DateTime | null
-  createdAt_gte?: DateTime | null
-  createdById_eq?: ID_Input | null
-  createdById_in?: ID_Output[] | ID_Output | null
-  updatedAt_eq?: DateTime | null
-  updatedAt_lt?: DateTime | null
-  updatedAt_lte?: DateTime | null
-  updatedAt_gt?: DateTime | null
-  updatedAt_gte?: DateTime | null
-  updatedById_eq?: ID_Input | null
-  updatedById_in?: ID_Output[] | ID_Output | null
-  deletedAt_all?: Boolean | null
-  deletedAt_eq?: DateTime | null
-  deletedAt_lt?: DateTime | null
-  deletedAt_lte?: DateTime | null
-  deletedAt_gt?: DateTime | null
-  deletedAt_gte?: DateTime | null
-  deletedById_eq?: ID_Input | null
-  deletedById_in?: ID_Output[] | ID_Output | null
-  isActive_eq?: Boolean | null
-  isActive_in?: Boolean[] | Boolean | null
-  type_eq?: StorageProviderType | null
-  type_in?: StorageProviderType[] | StorageProviderType | null
-  metadata_eq?: String | null
-  metadata_contains?: String | null
-  metadata_startsWith?: String | null
-  metadata_endsWith?: String | null
-  metadata_in?: String[] | String | null
-}
-
-export interface StorageProviderWhereUniqueInput {
-  id: ID_Output
-}
-
 export interface VideoCategoryCreateInput {
   name?: String | null
   createdInBlock: Float
@@ -1496,6 +1446,65 @@ export interface VideoWhereUniqueInput {
   id: ID_Output
 }
 
+export interface WorkerCreateInput {
+  isActive: Boolean
+  workerId: String
+  type: WorkerType
+  metadata?: String | null
+}
+
+export interface WorkerUpdateInput {
+  isActive?: Boolean | null
+  workerId?: String | null
+  type?: WorkerType | null
+  metadata?: String | null
+}
+
+export interface WorkerWhereInput {
+  id_eq?: ID_Input | null
+  id_in?: ID_Output[] | ID_Output | null
+  createdAt_eq?: DateTime | null
+  createdAt_lt?: DateTime | null
+  createdAt_lte?: DateTime | null
+  createdAt_gt?: DateTime | null
+  createdAt_gte?: DateTime | null
+  createdById_eq?: ID_Input | null
+  createdById_in?: ID_Output[] | ID_Output | null
+  updatedAt_eq?: DateTime | null
+  updatedAt_lt?: DateTime | null
+  updatedAt_lte?: DateTime | null
+  updatedAt_gt?: DateTime | null
+  updatedAt_gte?: DateTime | null
+  updatedById_eq?: ID_Input | null
+  updatedById_in?: ID_Output[] | ID_Output | null
+  deletedAt_all?: Boolean | null
+  deletedAt_eq?: DateTime | null
+  deletedAt_lt?: DateTime | null
+  deletedAt_lte?: DateTime | null
+  deletedAt_gt?: DateTime | null
+  deletedAt_gte?: DateTime | null
+  deletedById_eq?: ID_Input | null
+  deletedById_in?: ID_Output[] | ID_Output | null
+  isActive_eq?: Boolean | null
+  isActive_in?: Boolean[] | Boolean | null
+  workerId_eq?: String | null
+  workerId_contains?: String | null
+  workerId_startsWith?: String | null
+  workerId_endsWith?: String | null
+  workerId_in?: String[] | String | null
+  type_eq?: WorkerType | null
+  type_in?: WorkerType[] | WorkerType | null
+  metadata_eq?: String | null
+  metadata_contains?: String | null
+  metadata_startsWith?: String | null
+  metadata_endsWith?: String | null
+  metadata_in?: String[] | String | null
+}
+
+export interface WorkerWhereUniqueInput {
+  id: ID_Output
+}
+
 export interface BaseGraphQLObject {
   id: ID_Output
   createdAt: DateTime
@@ -1656,7 +1665,7 @@ export interface DataObject extends BaseGraphQLObject {
   createdInBlock: Int
   typeId: Int
   size: Int
-  liaison?: StorageProvider | null
+  liaison?: Worker | null
   liaisonId?: String | null
   liaisonJudgement: LiaisonJudgement
   ipfsContentId: String
@@ -1843,32 +1852,6 @@ export interface StandardDeleteResponse {
   id: ID_Output
 }
 
-export interface StorageProvider extends BaseGraphQLObject {
-  id: ID_Output
-  createdAt: DateTime
-  createdById: String
-  updatedAt?: DateTime | null
-  updatedById?: String | null
-  deletedAt?: DateTime | null
-  deletedById?: String | null
-  version: Int
-  isActive: Boolean
-  type: StorageProviderType
-  metadata?: String | null
-  dataObjects: Array<DataObject>
-}
-
-export interface StorageProviderConnection {
-  totalCount: Int
-  edges: Array<StorageProviderEdge>
-  pageInfo: PageInfo
-}
-
-export interface StorageProviderEdge {
-  node: StorageProvider
-  cursor: String
-}
-
 export interface Video extends BaseGraphQLObject {
   id: ID_Output
   createdAt: DateTime
@@ -2007,6 +1990,33 @@ export interface VideoMediaMetadataEdge {
   cursor: String
 }
 
+export interface Worker extends BaseGraphQLObject {
+  id: ID_Output
+  createdAt: DateTime
+  createdById: String
+  updatedAt?: DateTime | null
+  updatedById?: String | null
+  deletedAt?: DateTime | null
+  deletedById?: String | null
+  version: Int
+  isActive: Boolean
+  workerId: String
+  type: WorkerType
+  metadata?: String | null
+  dataObjects: Array<DataObject>
+}
+
+export interface WorkerConnection {
+  totalCount: Int
+  edges: Array<WorkerEdge>
+  pageInfo: PageInfo
+}
+
+export interface WorkerEdge {
+  node: Worker
+  cursor: String
+}
+
 /*
 The `Boolean` scalar type represents `true` or `false`.
 */

+ 317 - 293
query-node/generated/graphql-server/generated/classes.ts

@@ -23,17 +23,17 @@ const { GraphQLJSONObject } = require('graphql-type-json');
 // @ts-ignore
 import { BaseWhereInput, JsonObject, PaginationArgs, DateOnlyString, DateTimeString, BigInt, Bytes } from 'warthog';
 
-import { MembershipEntryMethod } from "../src/modules/membership/membership.model";
-import { StorageProviderType } from "../src/modules/storage-provider/storage-provider.model";
+import { WorkerType } from "../src/modules/worker/worker.model";
 import { AssetAvailability } from "../src/modules/video/video.model";
 import { LiaisonJudgement } from "../src/modules/data-object/data-object.model";
+import { MembershipEntryMethod } from "../src/modules/membership/membership.model";
 
-// @ts-ignore
-import { Membership } from "../src/modules/membership/membership.model";
 // @ts-ignore
 import { CuratorGroup } from "../src/modules/curator-group/curator-group.model";
 // @ts-ignore
-import { StorageProvider } from "../src/modules/storage-provider/storage-provider.model";
+import { ChannelCategory } from "../src/modules/channel-category/channel-category.model";
+// @ts-ignore
+import { Worker } from "../src/modules/worker/worker.model";
 // @ts-ignore
 import { VideoCategory } from "../src/modules/video-category/video-category.model";
 // @ts-ignore
@@ -53,9 +53,9 @@ import { DataObject } from "../src/modules/data-object/data-object.model";
 // @ts-ignore
 import { Channel } from "../src/modules/channel/channel.model";
 // @ts-ignore
-import { ChannelCategory } from "../src/modules/channel-category/channel-category.model";
+import { Membership } from "../src/modules/membership/membership.model";
 
-export enum MembershipOrderByEnum {
+export enum CuratorGroupOrderByEnum {
   createdAt_ASC = "createdAt_ASC",
   createdAt_DESC = "createdAt_DESC",
 
@@ -65,37 +65,16 @@ export enum MembershipOrderByEnum {
   deletedAt_ASC = "deletedAt_ASC",
   deletedAt_DESC = "deletedAt_DESC",
 
-  handle_ASC = "handle_ASC",
-  handle_DESC = "handle_DESC",
-
-  avatarUri_ASC = "avatarUri_ASC",
-  avatarUri_DESC = "avatarUri_DESC",
-
-  about_ASC = "about_ASC",
-  about_DESC = "about_DESC",
-
-  controllerAccount_ASC = "controllerAccount_ASC",
-  controllerAccount_DESC = "controllerAccount_DESC",
-
-  rootAccount_ASC = "rootAccount_ASC",
-  rootAccount_DESC = "rootAccount_DESC",
-
-  createdInBlock_ASC = "createdInBlock_ASC",
-  createdInBlock_DESC = "createdInBlock_DESC",
-
-  entry_ASC = "entry_ASC",
-  entry_DESC = "entry_DESC",
-
-  subscription_ASC = "subscription_ASC",
-  subscription_DESC = "subscription_DESC"
+  isActive_ASC = "isActive_ASC",
+  isActive_DESC = "isActive_DESC"
 }
 
-registerEnumType(MembershipOrderByEnum, {
-  name: "MembershipOrderByInput"
+registerEnumType(CuratorGroupOrderByEnum, {
+  name: "CuratorGroupOrderByInput"
 });
 
 @TypeGraphQLInputType()
-export class MembershipWhereInput {
+export class CuratorGroupWhereInput {
   @TypeGraphQLField(() => ID, { nullable: true })
   id_eq?: string;
 
@@ -168,209 +147,59 @@ export class MembershipWhereInput {
   @TypeGraphQLField(() => [ID], { nullable: true })
   deletedById_in?: string[];
 
-  @TypeGraphQLField({ nullable: true })
-  handle_eq?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  handle_contains?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  handle_startsWith?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  handle_endsWith?: string;
-
-  @TypeGraphQLField(() => [String], { nullable: true })
-  handle_in?: string[];
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri_eq?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri_contains?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri_startsWith?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri_endsWith?: string;
-
-  @TypeGraphQLField(() => [String], { nullable: true })
-  avatarUri_in?: string[];
-
-  @TypeGraphQLField({ nullable: true })
-  about_eq?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  about_contains?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  about_startsWith?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  about_endsWith?: string;
-
-  @TypeGraphQLField(() => [String], { nullable: true })
-  about_in?: string[];
-
-  @TypeGraphQLField({ nullable: true })
-  controllerAccount_eq?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  controllerAccount_contains?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  controllerAccount_startsWith?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  controllerAccount_endsWith?: string;
-
-  @TypeGraphQLField(() => [String], { nullable: true })
-  controllerAccount_in?: string[];
-
-  @TypeGraphQLField({ nullable: true })
-  rootAccount_eq?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  rootAccount_contains?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  rootAccount_startsWith?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  rootAccount_endsWith?: string;
-
-  @TypeGraphQLField(() => [String], { nullable: true })
-  rootAccount_in?: string[];
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  createdInBlock_eq?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  createdInBlock_gt?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  createdInBlock_gte?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  createdInBlock_lt?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  createdInBlock_lte?: number;
-
-  @TypeGraphQLField(() => [Int], { nullable: true })
-  createdInBlock_in?: number[];
-
-  @TypeGraphQLField(() => MembershipEntryMethod, { nullable: true })
-  entry_eq?: MembershipEntryMethod;
-
-  @TypeGraphQLField(() => [MembershipEntryMethod], { nullable: true })
-  entry_in?: MembershipEntryMethod[];
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  subscription_eq?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  subscription_gt?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  subscription_gte?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  subscription_lt?: number;
-
-  @TypeGraphQLField(() => Int, { nullable: true })
-  subscription_lte?: number;
+  @TypeGraphQLField(() => Boolean, { nullable: true })
+  isActive_eq?: Boolean;
 
-  @TypeGraphQLField(() => [Int], { nullable: true })
-  subscription_in?: number[];
+  @TypeGraphQLField(() => [Boolean], { nullable: true })
+  isActive_in?: Boolean[];
 }
 
 @TypeGraphQLInputType()
-export class MembershipWhereUniqueInput {
-  @TypeGraphQLField(() => ID, { nullable: true })
+export class CuratorGroupWhereUniqueInput {
+  @TypeGraphQLField(() => ID)
   id?: string;
-
-  @TypeGraphQLField(() => String, { nullable: true })
-  handle?: string;
 }
 
 @TypeGraphQLInputType()
-export class MembershipCreateInput {
-  @TypeGraphQLField()
-  handle!: string;
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  about?: string;
-
-  @TypeGraphQLField()
-  controllerAccount!: string;
-
-  @TypeGraphQLField()
-  rootAccount!: string;
+export class CuratorGroupCreateInput {
+  @TypeGraphQLField(() => [Int])
+  curatorIds!: number[];
 
   @TypeGraphQLField()
-  createdInBlock!: number;
-
-  @TypeGraphQLField(() => MembershipEntryMethod)
-  entry!: MembershipEntryMethod;
-
-  @TypeGraphQLField({ nullable: true })
-  subscription?: number;
+  isActive!: boolean;
 }
 
 @TypeGraphQLInputType()
-export class MembershipUpdateInput {
-  @TypeGraphQLField({ nullable: true })
-  handle?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  avatarUri?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  about?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  controllerAccount?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  rootAccount?: string;
-
-  @TypeGraphQLField({ nullable: true })
-  createdInBlock?: number;
-
-  @TypeGraphQLField(() => MembershipEntryMethod, { nullable: true })
-  entry?: MembershipEntryMethod;
+export class CuratorGroupUpdateInput {
+  @TypeGraphQLField(() => [Int], { nullable: true })
+  curatorIds?: number[];
 
   @TypeGraphQLField({ nullable: true })
-  subscription?: number;
+  isActive?: boolean;
 }
 
 @ArgsType()
-export class MembershipWhereArgs extends PaginationArgs {
-  @TypeGraphQLField(() => MembershipWhereInput, { nullable: true })
-  where?: MembershipWhereInput;
+export class CuratorGroupWhereArgs extends PaginationArgs {
+  @TypeGraphQLField(() => CuratorGroupWhereInput, { nullable: true })
+  where?: CuratorGroupWhereInput;
 
-  @TypeGraphQLField(() => MembershipOrderByEnum, { nullable: true })
-  orderBy?: MembershipOrderByEnum;
+  @TypeGraphQLField(() => CuratorGroupOrderByEnum, { nullable: true })
+  orderBy?: CuratorGroupOrderByEnum;
 }
 
 @ArgsType()
-export class MembershipCreateManyArgs {
-  @TypeGraphQLField(() => [MembershipCreateInput])
-  data!: MembershipCreateInput[];
+export class CuratorGroupCreateManyArgs {
+  @TypeGraphQLField(() => [CuratorGroupCreateInput])
+  data!: CuratorGroupCreateInput[];
 }
 
 @ArgsType()
-export class MembershipUpdateArgs {
-  @TypeGraphQLField() data!: MembershipUpdateInput;
-  @TypeGraphQLField() where!: MembershipWhereUniqueInput;
+export class CuratorGroupUpdateArgs {
+  @TypeGraphQLField() data!: CuratorGroupUpdateInput;
+  @TypeGraphQLField() where!: CuratorGroupWhereUniqueInput;
 }
 
-export enum CuratorGroupOrderByEnum {
+export enum ChannelCategoryOrderByEnum {
   createdAt_ASC = "createdAt_ASC",
   createdAt_DESC = "createdAt_DESC",
 
@@ -380,16 +209,19 @@ export enum CuratorGroupOrderByEnum {
   deletedAt_ASC = "deletedAt_ASC",
   deletedAt_DESC = "deletedAt_DESC",
 
-  isActive_ASC = "isActive_ASC",
-  isActive_DESC = "isActive_DESC"
+  name_ASC = "name_ASC",
+  name_DESC = "name_DESC",
+
+  createdInBlock_ASC = "createdInBlock_ASC",
+  createdInBlock_DESC = "createdInBlock_DESC"
 }
 
-registerEnumType(CuratorGroupOrderByEnum, {
-  name: "CuratorGroupOrderByInput"
+registerEnumType(ChannelCategoryOrderByEnum, {
+  name: "ChannelCategoryOrderByInput"
 });
 
 @TypeGraphQLInputType()
-export class CuratorGroupWhereInput {
+export class ChannelCategoryWhereInput {
   @TypeGraphQLField(() => ID, { nullable: true })
   id_eq?: string;
 
@@ -462,56 +294,83 @@ export class CuratorGroupWhereInput {
   @TypeGraphQLField(() => [ID], { nullable: true })
   deletedById_in?: string[];
 
-  @TypeGraphQLField(() => Boolean, { nullable: true })
-  isActive_eq?: Boolean;
+  @TypeGraphQLField({ nullable: true })
+  name_eq?: string;
 
-  @TypeGraphQLField(() => [Boolean], { nullable: true })
-  isActive_in?: Boolean[];
+  @TypeGraphQLField({ nullable: true })
+  name_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  name_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  name_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  name_in?: string[];
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  createdInBlock_eq?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  createdInBlock_gt?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  createdInBlock_gte?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  createdInBlock_lt?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  createdInBlock_lte?: number;
+
+  @TypeGraphQLField(() => [Int], { nullable: true })
+  createdInBlock_in?: number[];
 }
 
 @TypeGraphQLInputType()
-export class CuratorGroupWhereUniqueInput {
+export class ChannelCategoryWhereUniqueInput {
   @TypeGraphQLField(() => ID)
   id?: string;
 }
 
 @TypeGraphQLInputType()
-export class CuratorGroupCreateInput {
-  @TypeGraphQLField(() => [Int])
-  curatorIds!: number[];
+export class ChannelCategoryCreateInput {
+  @TypeGraphQLField({ nullable: true })
+  name?: string;
 
   @TypeGraphQLField()
-  isActive!: boolean;
+  createdInBlock!: number;
 }
 
 @TypeGraphQLInputType()
-export class CuratorGroupUpdateInput {
-  @TypeGraphQLField(() => [Int], { nullable: true })
-  curatorIds?: number[];
+export class ChannelCategoryUpdateInput {
+  @TypeGraphQLField({ nullable: true })
+  name?: string;
 
   @TypeGraphQLField({ nullable: true })
-  isActive?: boolean;
+  createdInBlock?: number;
 }
 
 @ArgsType()
-export class CuratorGroupWhereArgs extends PaginationArgs {
-  @TypeGraphQLField(() => CuratorGroupWhereInput, { nullable: true })
-  where?: CuratorGroupWhereInput;
+export class ChannelCategoryWhereArgs extends PaginationArgs {
+  @TypeGraphQLField(() => ChannelCategoryWhereInput, { nullable: true })
+  where?: ChannelCategoryWhereInput;
 
-  @TypeGraphQLField(() => CuratorGroupOrderByEnum, { nullable: true })
-  orderBy?: CuratorGroupOrderByEnum;
+  @TypeGraphQLField(() => ChannelCategoryOrderByEnum, { nullable: true })
+  orderBy?: ChannelCategoryOrderByEnum;
 }
 
 @ArgsType()
-export class CuratorGroupCreateManyArgs {
-  @TypeGraphQLField(() => [CuratorGroupCreateInput])
-  data!: CuratorGroupCreateInput[];
+export class ChannelCategoryCreateManyArgs {
+  @TypeGraphQLField(() => [ChannelCategoryCreateInput])
+  data!: ChannelCategoryCreateInput[];
 }
 
 @ArgsType()
-export class CuratorGroupUpdateArgs {
-  @TypeGraphQLField() data!: CuratorGroupUpdateInput;
-  @TypeGraphQLField() where!: CuratorGroupWhereUniqueInput;
+export class ChannelCategoryUpdateArgs {
+  @TypeGraphQLField() data!: ChannelCategoryUpdateInput;
+  @TypeGraphQLField() where!: ChannelCategoryWhereUniqueInput;
 }
 
 export enum DataObjectOwnerChannelOrderByEnum {
@@ -1322,7 +1181,7 @@ export class DataObjectOwnerWorkingGroupUpdateArgs {
   @TypeGraphQLField() where!: DataObjectOwnerWorkingGroupWhereUniqueInput;
 }
 
-export enum StorageProviderOrderByEnum {
+export enum WorkerOrderByEnum {
   createdAt_ASC = "createdAt_ASC",
   createdAt_DESC = "createdAt_DESC",
 
@@ -1335,6 +1194,9 @@ export enum StorageProviderOrderByEnum {
   isActive_ASC = "isActive_ASC",
   isActive_DESC = "isActive_DESC",
 
+  workerId_ASC = "workerId_ASC",
+  workerId_DESC = "workerId_DESC",
+
   type_ASC = "type_ASC",
   type_DESC = "type_DESC",
 
@@ -1342,12 +1204,12 @@ export enum StorageProviderOrderByEnum {
   metadata_DESC = "metadata_DESC"
 }
 
-registerEnumType(StorageProviderOrderByEnum, {
-  name: "StorageProviderOrderByInput"
+registerEnumType(WorkerOrderByEnum, {
+  name: "WorkerOrderByInput"
 });
 
 @TypeGraphQLInputType()
-export class StorageProviderWhereInput {
+export class WorkerWhereInput {
   @TypeGraphQLField(() => ID, { nullable: true })
   id_eq?: string;
 
@@ -1426,11 +1288,26 @@ export class StorageProviderWhereInput {
   @TypeGraphQLField(() => [Boolean], { nullable: true })
   isActive_in?: Boolean[];
 
-  @TypeGraphQLField(() => StorageProviderType, { nullable: true })
-  type_eq?: StorageProviderType;
+  @TypeGraphQLField({ nullable: true })
+  workerId_eq?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  workerId_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  workerId_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  workerId_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  workerId_in?: string[];
+
+  @TypeGraphQLField(() => WorkerType, { nullable: true })
+  type_eq?: WorkerType;
 
-  @TypeGraphQLField(() => [StorageProviderType], { nullable: true })
-  type_in?: StorageProviderType[];
+  @TypeGraphQLField(() => [WorkerType], { nullable: true })
+  type_in?: WorkerType[];
 
   @TypeGraphQLField({ nullable: true })
   metadata_eq?: string;
@@ -1449,54 +1326,60 @@ export class StorageProviderWhereInput {
 }
 
 @TypeGraphQLInputType()
-export class StorageProviderWhereUniqueInput {
+export class WorkerWhereUniqueInput {
   @TypeGraphQLField(() => ID)
   id?: string;
 }
 
 @TypeGraphQLInputType()
-export class StorageProviderCreateInput {
+export class WorkerCreateInput {
   @TypeGraphQLField()
   isActive!: boolean;
 
-  @TypeGraphQLField(() => StorageProviderType)
-  type!: StorageProviderType;
+  @TypeGraphQLField()
+  workerId!: string;
+
+  @TypeGraphQLField(() => WorkerType)
+  type!: WorkerType;
 
   @TypeGraphQLField({ nullable: true })
   metadata?: string;
 }
 
 @TypeGraphQLInputType()
-export class StorageProviderUpdateInput {
+export class WorkerUpdateInput {
   @TypeGraphQLField({ nullable: true })
   isActive?: boolean;
 
-  @TypeGraphQLField(() => StorageProviderType, { nullable: true })
-  type?: StorageProviderType;
+  @TypeGraphQLField({ nullable: true })
+  workerId?: string;
+
+  @TypeGraphQLField(() => WorkerType, { nullable: true })
+  type?: WorkerType;
 
   @TypeGraphQLField({ nullable: true })
   metadata?: string;
 }
 
 @ArgsType()
-export class StorageProviderWhereArgs extends PaginationArgs {
-  @TypeGraphQLField(() => StorageProviderWhereInput, { nullable: true })
-  where?: StorageProviderWhereInput;
+export class WorkerWhereArgs extends PaginationArgs {
+  @TypeGraphQLField(() => WorkerWhereInput, { nullable: true })
+  where?: WorkerWhereInput;
 
-  @TypeGraphQLField(() => StorageProviderOrderByEnum, { nullable: true })
-  orderBy?: StorageProviderOrderByEnum;
+  @TypeGraphQLField(() => WorkerOrderByEnum, { nullable: true })
+  orderBy?: WorkerOrderByEnum;
 }
 
 @ArgsType()
-export class StorageProviderCreateManyArgs {
-  @TypeGraphQLField(() => [StorageProviderCreateInput])
-  data!: StorageProviderCreateInput[];
+export class WorkerCreateManyArgs {
+  @TypeGraphQLField(() => [WorkerCreateInput])
+  data!: WorkerCreateInput[];
 }
 
 @ArgsType()
-export class StorageProviderUpdateArgs {
-  @TypeGraphQLField() data!: StorageProviderUpdateInput;
-  @TypeGraphQLField() where!: StorageProviderWhereUniqueInput;
+export class WorkerUpdateArgs {
+  @TypeGraphQLField() data!: WorkerUpdateInput;
+  @TypeGraphQLField() where!: WorkerWhereUniqueInput;
 }
 
 export enum VideoCategoryOrderByEnum {
@@ -3770,7 +3653,7 @@ export class ChannelUpdateArgs {
   @TypeGraphQLField() where!: ChannelWhereUniqueInput;
 }
 
-export enum ChannelCategoryOrderByEnum {
+export enum MembershipOrderByEnum {
   createdAt_ASC = "createdAt_ASC",
   createdAt_DESC = "createdAt_DESC",
 
@@ -3780,19 +3663,37 @@ export enum ChannelCategoryOrderByEnum {
   deletedAt_ASC = "deletedAt_ASC",
   deletedAt_DESC = "deletedAt_DESC",
 
-  name_ASC = "name_ASC",
-  name_DESC = "name_DESC",
+  handle_ASC = "handle_ASC",
+  handle_DESC = "handle_DESC",
+
+  avatarUri_ASC = "avatarUri_ASC",
+  avatarUri_DESC = "avatarUri_DESC",
+
+  about_ASC = "about_ASC",
+  about_DESC = "about_DESC",
+
+  controllerAccount_ASC = "controllerAccount_ASC",
+  controllerAccount_DESC = "controllerAccount_DESC",
+
+  rootAccount_ASC = "rootAccount_ASC",
+  rootAccount_DESC = "rootAccount_DESC",
 
   createdInBlock_ASC = "createdInBlock_ASC",
-  createdInBlock_DESC = "createdInBlock_DESC"
+  createdInBlock_DESC = "createdInBlock_DESC",
+
+  entry_ASC = "entry_ASC",
+  entry_DESC = "entry_DESC",
+
+  subscription_ASC = "subscription_ASC",
+  subscription_DESC = "subscription_DESC"
 }
 
-registerEnumType(ChannelCategoryOrderByEnum, {
-  name: "ChannelCategoryOrderByInput"
+registerEnumType(MembershipOrderByEnum, {
+  name: "MembershipOrderByInput"
 });
 
 @TypeGraphQLInputType()
-export class ChannelCategoryWhereInput {
+export class MembershipWhereInput {
   @TypeGraphQLField(() => ID, { nullable: true })
   id_eq?: string;
 
@@ -3866,19 +3767,79 @@ export class ChannelCategoryWhereInput {
   deletedById_in?: string[];
 
   @TypeGraphQLField({ nullable: true })
-  name_eq?: string;
+  handle_eq?: string;
 
   @TypeGraphQLField({ nullable: true })
-  name_contains?: string;
+  handle_contains?: string;
 
   @TypeGraphQLField({ nullable: true })
-  name_startsWith?: string;
+  handle_startsWith?: string;
 
   @TypeGraphQLField({ nullable: true })
-  name_endsWith?: string;
+  handle_endsWith?: string;
 
   @TypeGraphQLField(() => [String], { nullable: true })
-  name_in?: string[];
+  handle_in?: string[];
+
+  @TypeGraphQLField({ nullable: true })
+  avatarUri_eq?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  avatarUri_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  avatarUri_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  avatarUri_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  avatarUri_in?: string[];
+
+  @TypeGraphQLField({ nullable: true })
+  about_eq?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  about_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  about_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  about_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  about_in?: string[];
+
+  @TypeGraphQLField({ nullable: true })
+  controllerAccount_eq?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  controllerAccount_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  controllerAccount_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  controllerAccount_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  controllerAccount_in?: string[];
+
+  @TypeGraphQLField({ nullable: true })
+  rootAccount_eq?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  rootAccount_contains?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  rootAccount_startsWith?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  rootAccount_endsWith?: string;
+
+  @TypeGraphQLField(() => [String], { nullable: true })
+  rootAccount_in?: string[];
 
   @TypeGraphQLField(() => Int, { nullable: true })
   createdInBlock_eq?: number;
@@ -3897,49 +3858,112 @@ export class ChannelCategoryWhereInput {
 
   @TypeGraphQLField(() => [Int], { nullable: true })
   createdInBlock_in?: number[];
+
+  @TypeGraphQLField(() => MembershipEntryMethod, { nullable: true })
+  entry_eq?: MembershipEntryMethod;
+
+  @TypeGraphQLField(() => [MembershipEntryMethod], { nullable: true })
+  entry_in?: MembershipEntryMethod[];
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  subscription_eq?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  subscription_gt?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  subscription_gte?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  subscription_lt?: number;
+
+  @TypeGraphQLField(() => Int, { nullable: true })
+  subscription_lte?: number;
+
+  @TypeGraphQLField(() => [Int], { nullable: true })
+  subscription_in?: number[];
 }
 
 @TypeGraphQLInputType()
-export class ChannelCategoryWhereUniqueInput {
-  @TypeGraphQLField(() => ID)
+export class MembershipWhereUniqueInput {
+  @TypeGraphQLField(() => ID, { nullable: true })
   id?: string;
+
+  @TypeGraphQLField(() => String, { nullable: true })
+  handle?: string;
 }
 
 @TypeGraphQLInputType()
-export class ChannelCategoryCreateInput {
+export class MembershipCreateInput {
+  @TypeGraphQLField()
+  handle!: string;
+
   @TypeGraphQLField({ nullable: true })
-  name?: string;
+  avatarUri?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  about?: string;
+
+  @TypeGraphQLField()
+  controllerAccount!: string;
+
+  @TypeGraphQLField()
+  rootAccount!: string;
 
   @TypeGraphQLField()
   createdInBlock!: number;
+
+  @TypeGraphQLField(() => MembershipEntryMethod)
+  entry!: MembershipEntryMethod;
+
+  @TypeGraphQLField({ nullable: true })
+  subscription?: number;
 }
 
 @TypeGraphQLInputType()
-export class ChannelCategoryUpdateInput {
+export class MembershipUpdateInput {
   @TypeGraphQLField({ nullable: true })
-  name?: string;
+  handle?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  avatarUri?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  about?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  controllerAccount?: string;
+
+  @TypeGraphQLField({ nullable: true })
+  rootAccount?: string;
 
   @TypeGraphQLField({ nullable: true })
   createdInBlock?: number;
+
+  @TypeGraphQLField(() => MembershipEntryMethod, { nullable: true })
+  entry?: MembershipEntryMethod;
+
+  @TypeGraphQLField({ nullable: true })
+  subscription?: number;
 }
 
 @ArgsType()
-export class ChannelCategoryWhereArgs extends PaginationArgs {
-  @TypeGraphQLField(() => ChannelCategoryWhereInput, { nullable: true })
-  where?: ChannelCategoryWhereInput;
+export class MembershipWhereArgs extends PaginationArgs {
+  @TypeGraphQLField(() => MembershipWhereInput, { nullable: true })
+  where?: MembershipWhereInput;
 
-  @TypeGraphQLField(() => ChannelCategoryOrderByEnum, { nullable: true })
-  orderBy?: ChannelCategoryOrderByEnum;
+  @TypeGraphQLField(() => MembershipOrderByEnum, { nullable: true })
+  orderBy?: MembershipOrderByEnum;
 }
 
 @ArgsType()
-export class ChannelCategoryCreateManyArgs {
-  @TypeGraphQLField(() => [ChannelCategoryCreateInput])
-  data!: ChannelCategoryCreateInput[];
+export class MembershipCreateManyArgs {
+  @TypeGraphQLField(() => [MembershipCreateInput])
+  data!: MembershipCreateInput[];
 }
 
 @ArgsType()
-export class ChannelCategoryUpdateArgs {
-  @TypeGraphQLField() data!: ChannelCategoryUpdateInput;
-  @TypeGraphQLField() where!: ChannelCategoryWhereUniqueInput;
+export class MembershipUpdateArgs {
+  @TypeGraphQLField() data!: MembershipUpdateInput;
+  @TypeGraphQLField() where!: MembershipWhereUniqueInput;
 }

+ 120 - 104
query-node/generated/graphql-server/generated/schema.graphql

@@ -478,7 +478,7 @@ type DataObject implements BaseGraphQLObject {
 
   """Content size in bytes"""
   size: Int!
-  liaison: StorageProvider
+  liaison: Worker
   liaisonId: String
 
   """Storage provider as liaison judgment"""
@@ -1407,9 +1407,6 @@ type Query {
   membersByHandle(whereMembership: MembershipWhereInput, skip: Int = 0, limit: Int = 5, text: String!): [MembersByHandleFTSOutput!]!
   search(whereVideo: VideoWhereInput, whereChannel: ChannelWhereInput, skip: Int = 0, limit: Int = 5, text: String!): [SearchFTSOutput!]!
   videoCategoriesByName(whereVideoCategory: VideoCategoryWhereInput, skip: Int = 0, limit: Int = 5, text: String!): [VideoCategoriesByNameFTSOutput!]!
-  storageProviders(offset: Int, limit: Int = 50, where: StorageProviderWhereInput, orderBy: StorageProviderOrderByInput): [StorageProvider!]!
-  storageProviderByUniqueInput(where: StorageProviderWhereUniqueInput!): StorageProvider
-  storageProvidersConnection(first: Int, after: String, last: Int, before: String, where: StorageProviderWhereInput, orderBy: StorageProviderOrderByInput): StorageProviderConnection!
   videoCategories(offset: Int, limit: Int = 50, where: VideoCategoryWhereInput, orderBy: VideoCategoryOrderByInput): [VideoCategory!]!
   videoCategoryByUniqueInput(where: VideoCategoryWhereUniqueInput!): VideoCategory
   videoCategoriesConnection(first: Int, after: String, last: Int, before: String, where: VideoCategoryWhereInput, orderBy: VideoCategoryOrderByInput): VideoCategoryConnection!
@@ -1422,6 +1419,9 @@ type Query {
   videos(offset: Int, limit: Int = 50, where: VideoWhereInput, orderBy: VideoOrderByInput): [Video!]!
   videoByUniqueInput(where: VideoWhereUniqueInput!): Video
   videosConnection(first: Int, after: String, last: Int, before: String, where: VideoWhereInput, orderBy: VideoOrderByInput): VideoConnection!
+  workers(offset: Int, limit: Int = 50, where: WorkerWhereInput, orderBy: WorkerOrderByInput): [Worker!]!
+  workerByUniqueInput(where: WorkerWhereUniqueInput!): Worker
+  workersConnection(first: Int, after: String, last: Int, before: String, where: WorkerWhereInput, orderBy: WorkerOrderByInput): WorkerConnection!
 }
 
 type SearchFTSOutput {
@@ -1437,106 +1437,6 @@ type StandardDeleteResponse {
   id: ID!
 }
 
-type StorageProvider implements BaseGraphQLObject {
-  id: ID!
-  createdAt: DateTime!
-  createdById: String!
-  updatedAt: DateTime
-  updatedById: String
-  deletedAt: DateTime
-  deletedById: String
-  version: Int!
-  isActive: Boolean!
-  type: StorageProviderType!
-
-  """Custom metadata set by provider"""
-  metadata: String
-  dataObjects: [DataObject!]!
-}
-
-type StorageProviderConnection {
-  totalCount: Int!
-  edges: [StorageProviderEdge!]!
-  pageInfo: PageInfo!
-}
-
-input StorageProviderCreateInput {
-  isActive: Boolean!
-  type: StorageProviderType!
-  metadata: String
-}
-
-type StorageProviderEdge {
-  node: StorageProvider!
-  cursor: String!
-}
-
-enum StorageProviderOrderByInput {
-  createdAt_ASC
-  createdAt_DESC
-  updatedAt_ASC
-  updatedAt_DESC
-  deletedAt_ASC
-  deletedAt_DESC
-  isActive_ASC
-  isActive_DESC
-  type_ASC
-  type_DESC
-  metadata_ASC
-  metadata_DESC
-}
-
-enum StorageProviderType {
-  GATEWAY
-  STORAGE
-}
-
-input StorageProviderUpdateInput {
-  isActive: Boolean
-  type: StorageProviderType
-  metadata: String
-}
-
-input StorageProviderWhereInput {
-  id_eq: ID
-  id_in: [ID!]
-  createdAt_eq: DateTime
-  createdAt_lt: DateTime
-  createdAt_lte: DateTime
-  createdAt_gt: DateTime
-  createdAt_gte: DateTime
-  createdById_eq: ID
-  createdById_in: [ID!]
-  updatedAt_eq: DateTime
-  updatedAt_lt: DateTime
-  updatedAt_lte: DateTime
-  updatedAt_gt: DateTime
-  updatedAt_gte: DateTime
-  updatedById_eq: ID
-  updatedById_in: [ID!]
-  deletedAt_all: Boolean
-  deletedAt_eq: DateTime
-  deletedAt_lt: DateTime
-  deletedAt_lte: DateTime
-  deletedAt_gt: DateTime
-  deletedAt_gte: DateTime
-  deletedById_eq: ID
-  deletedById_in: [ID!]
-  isActive_eq: Boolean
-  isActive_in: [Boolean!]
-  type_eq: StorageProviderType
-  type_in: [StorageProviderType!]
-  metadata_eq: String
-  metadata_contains: String
-  metadata_startsWith: String
-  metadata_endsWith: String
-  metadata_in: [String!]
-}
-
-input StorageProviderWhereUniqueInput {
-  id: ID!
-}
-
 type Subscription {
   stateSubscription: ProcessorState!
 }
@@ -2133,3 +2033,119 @@ input VideoWhereInput {
 input VideoWhereUniqueInput {
   id: ID!
 }
+
+type Worker implements BaseGraphQLObject {
+  id: ID!
+  createdAt: DateTime!
+  createdById: String!
+  updatedAt: DateTime
+  updatedById: String
+  deletedAt: DateTime
+  deletedById: String
+  version: Int!
+
+  """Sign of worker still being active"""
+  isActive: Boolean!
+
+  """Runtime identifier"""
+  workerId: String!
+
+  """Associated working group"""
+  type: WorkerType!
+
+  """Custom metadata set by provider"""
+  metadata: String
+  dataObjects: [DataObject!]!
+}
+
+type WorkerConnection {
+  totalCount: Int!
+  edges: [WorkerEdge!]!
+  pageInfo: PageInfo!
+}
+
+input WorkerCreateInput {
+  isActive: Boolean!
+  workerId: String!
+  type: WorkerType!
+  metadata: String
+}
+
+type WorkerEdge {
+  node: Worker!
+  cursor: String!
+}
+
+enum WorkerOrderByInput {
+  createdAt_ASC
+  createdAt_DESC
+  updatedAt_ASC
+  updatedAt_DESC
+  deletedAt_ASC
+  deletedAt_DESC
+  isActive_ASC
+  isActive_DESC
+  workerId_ASC
+  workerId_DESC
+  type_ASC
+  type_DESC
+  metadata_ASC
+  metadata_DESC
+}
+
+enum WorkerType {
+  GATEWAY
+  STORAGE
+}
+
+input WorkerUpdateInput {
+  isActive: Boolean
+  workerId: String
+  type: WorkerType
+  metadata: String
+}
+
+input WorkerWhereInput {
+  id_eq: ID
+  id_in: [ID!]
+  createdAt_eq: DateTime
+  createdAt_lt: DateTime
+  createdAt_lte: DateTime
+  createdAt_gt: DateTime
+  createdAt_gte: DateTime
+  createdById_eq: ID
+  createdById_in: [ID!]
+  updatedAt_eq: DateTime
+  updatedAt_lt: DateTime
+  updatedAt_lte: DateTime
+  updatedAt_gt: DateTime
+  updatedAt_gte: DateTime
+  updatedById_eq: ID
+  updatedById_in: [ID!]
+  deletedAt_all: Boolean
+  deletedAt_eq: DateTime
+  deletedAt_lt: DateTime
+  deletedAt_lte: DateTime
+  deletedAt_gt: DateTime
+  deletedAt_gte: DateTime
+  deletedById_eq: ID
+  deletedById_in: [ID!]
+  isActive_eq: Boolean
+  isActive_in: [Boolean!]
+  workerId_eq: String
+  workerId_contains: String
+  workerId_startsWith: String
+  workerId_endsWith: String
+  workerId_in: [String!]
+  type_eq: WorkerType
+  type_in: [WorkerType!]
+  metadata_eq: String
+  metadata_contains: String
+  metadata_startsWith: String
+  metadata_endsWith: String
+  metadata_in: [String!]
+}
+
+input WorkerWhereUniqueInput {
+  id: ID!
+}

+ 4 - 4
query-node/generated/graphql-server/model/index.ts

@@ -14,8 +14,6 @@ import { License } from '../src/modules/license/license.model';
 export { License };
 import { Membership } from '../src/modules/membership/membership.model';
 export { Membership };
-import { StorageProvider } from '../src/modules/storage-provider/storage-provider.model';
-export { StorageProvider };
 import { Video } from '../src/modules/video/video.model';
 export { Video };
 import { VideoCategory } from '../src/modules/video-category/video-category.model';
@@ -24,6 +22,8 @@ import { VideoMediaEncoding } from '../src/modules/video-media-encoding/video-me
 export { VideoMediaEncoding };
 import { VideoMediaMetadata } from '../src/modules/video-media-metadata/video-media-metadata.model';
 export { VideoMediaMetadata };
+import { Worker } from '../src/modules/worker/worker.model';
+export { Worker };
 
 import { Network } from '../src/modules/enums/enums';
 export { Network };
@@ -33,8 +33,8 @@ import { AssetAvailability } from '../src/modules/enums/enums';
 export { AssetAvailability };
 import { LiaisonJudgement } from '../src/modules/enums/enums';
 export { LiaisonJudgement };
-import { StorageProviderType } from '../src/modules/enums/enums';
-export { StorageProviderType };
+import { WorkerType } from '../src/modules/enums/enums';
+export { WorkerType };
 
 import { DataObjectOwnerChannel } from '../src/modules/variants/variants.model';
 export { DataObjectOwnerChannel };

+ 3 - 3
query-node/generated/graphql-server/src/modules/data-object/data-object.model.ts

@@ -6,7 +6,7 @@ import { WarthogField } from 'warthog';
 
 import { DataObjectOwner } from '../variants/variants.model';
 
-import { StorageProvider } from '../storage-provider/storage-provider.model';
+import { Worker } from '../worker/worker.model';
 import { Channel } from '../channel/channel.model';
 import { Video } from '../video/video.model';
 
@@ -37,11 +37,11 @@ export class DataObject extends BaseModel {
   })
   size!: number;
 
-  @ManyToOne(() => StorageProvider, (param: StorageProvider) => param.dataObjects, {
+  @ManyToOne(() => Worker, (param: Worker) => param.dataObjects, {
     skipGraphQLField: true,
     nullable: true,
   })
-  liaison?: StorageProvider;
+  liaison?: Worker;
 
   @EnumField('LiaisonJudgement', LiaisonJudgement, {
     description: `Storage provider as liaison judgment`,

+ 3 - 3
query-node/generated/graphql-server/src/modules/data-object/data-object.resolver.ts

@@ -30,7 +30,7 @@ import {
 import { DataObject } from './data-object.model';
 import { DataObjectService } from './data-object.service';
 
-import { StorageProvider } from '../storage-provider/storage-provider.model';
+import { Worker } from '../worker/worker.model';
 import { Channel } from '../channel/channel.model';
 import { Video } from '../video/video.model';
 import { getConnection } from 'typeorm';
@@ -131,8 +131,8 @@ export class DataObjectResolver {
     return result as Promise<DataObjectConnection>;
   }
 
-  @FieldResolver(() => StorageProvider)
-  async liaison(@Root() r: DataObject): Promise<StorageProvider | null> {
+  @FieldResolver(() => Worker)
+  async liaison(@Root() r: DataObject): Promise<Worker | null> {
     const result = await getConnection()
       .getRepository(DataObject)
       .findOne(r.id, { relations: ['liaison'] });

+ 1 - 1
query-node/generated/graphql-server/src/modules/enums/enums.ts

@@ -17,7 +17,7 @@ export enum LiaisonJudgement {
   PENDING = 'PENDING',
   ACCEPTED = 'ACCEPTED',
 }
-export enum StorageProviderType {
+export enum WorkerType {
   GATEWAY = 'GATEWAY',
   STORAGE = 'STORAGE',
 }

+ 17 - 8
query-node/generated/graphql-server/src/modules/storage-provider/storage-provider.model.ts → query-node/generated/graphql-server/src/modules/worker/worker.model.ts

@@ -2,16 +2,25 @@ import { BaseModel, BooleanField, Model, OneToMany, EnumField, StringField } fro
 
 import { DataObject } from '../data-object/data-object.model';
 
-import { StorageProviderType } from '../enums/enums';
-export { StorageProviderType };
+import { WorkerType } from '../enums/enums';
+export { WorkerType };
 
 @Model({ api: {} })
-export class StorageProvider extends BaseModel {
-  @BooleanField({})
+export class Worker extends BaseModel {
+  @BooleanField({
+    description: `Sign of worker still being active`,
+  })
   isActive!: boolean;
 
-  @EnumField('StorageProviderType', StorageProviderType, {})
-  type!: StorageProviderType;
+  @StringField({
+    description: `Runtime identifier`,
+  })
+  workerId!: string;
+
+  @EnumField('WorkerType', WorkerType, {
+    description: `Associated working group`,
+  })
+  type!: WorkerType;
 
   @StringField({
     nullable: true,
@@ -19,10 +28,10 @@ export class StorageProvider extends BaseModel {
   })
   metadata?: string;
 
-  @OneToMany(() => DataObject, (param: DataObject) => param.liaison, { cascade: ["insert", "update"] })
+  @OneToMany(() => DataObject, (param: DataObject) => param.liaison)
   dataObjects?: DataObject[];
 
-  constructor(init?: Partial<StorageProvider>) {
+  constructor(init?: Partial<Worker>) {
     super();
     Object.assign(this, init);
   }

+ 40 - 40
query-node/generated/graphql-server/src/modules/storage-provider/storage-provider.resolver.ts → query-node/generated/graphql-server/src/modules/worker/worker.resolver.ts

@@ -18,37 +18,37 @@ import { Min } from 'class-validator';
 import { Fields, StandardDeleteResponse, UserId, PageInfo, RawFields } from 'warthog';
 
 import {
-  StorageProviderCreateInput,
-  StorageProviderCreateManyArgs,
-  StorageProviderUpdateArgs,
-  StorageProviderWhereArgs,
-  StorageProviderWhereInput,
-  StorageProviderWhereUniqueInput,
-  StorageProviderOrderByEnum,
+  WorkerCreateInput,
+  WorkerCreateManyArgs,
+  WorkerUpdateArgs,
+  WorkerWhereArgs,
+  WorkerWhereInput,
+  WorkerWhereUniqueInput,
+  WorkerOrderByEnum,
 } from '../../../generated';
 
-import { StorageProvider } from './storage-provider.model';
-import { StorageProviderService } from './storage-provider.service';
+import { Worker } from './worker.model';
+import { WorkerService } from './worker.service';
 
 import { DataObject } from '../data-object/data-object.model';
 import { getConnection } from 'typeorm';
 
 @ObjectType()
-export class StorageProviderEdge {
-  @Field(() => StorageProvider, { nullable: false })
-  node!: StorageProvider;
+export class WorkerEdge {
+  @Field(() => Worker, { nullable: false })
+  node!: Worker;
 
   @Field(() => String, { nullable: false })
   cursor!: string;
 }
 
 @ObjectType()
-export class StorageProviderConnection {
+export class WorkerConnection {
   @Field(() => Int, { nullable: false })
   totalCount!: number;
 
-  @Field(() => [StorageProviderEdge], { nullable: false })
-  edges!: StorageProviderEdge[];
+  @Field(() => [WorkerEdge], { nullable: false })
+  edges!: WorkerEdge[];
 
   @Field(() => PageInfo, { nullable: false })
   pageInfo!: PageInfo;
@@ -72,40 +72,40 @@ export class ConnectionPageInputOptions {
 }
 
 @ArgsType()
-export class StorageProviderConnectionWhereArgs extends ConnectionPageInputOptions {
-  @Field(() => StorageProviderWhereInput, { nullable: true })
-  where?: StorageProviderWhereInput;
+export class WorkerConnectionWhereArgs extends ConnectionPageInputOptions {
+  @Field(() => WorkerWhereInput, { nullable: true })
+  where?: WorkerWhereInput;
 
-  @Field(() => StorageProviderOrderByEnum, { nullable: true })
-  orderBy?: StorageProviderOrderByEnum;
+  @Field(() => WorkerOrderByEnum, { nullable: true })
+  orderBy?: WorkerOrderByEnum;
 }
 
-@Resolver(StorageProvider)
-export class StorageProviderResolver {
-  constructor(@Inject('StorageProviderService') public readonly service: StorageProviderService) {}
+@Resolver(Worker)
+export class WorkerResolver {
+  constructor(@Inject('WorkerService') public readonly service: WorkerService) {}
 
-  @Query(() => [StorageProvider])
-  async storageProviders(
-    @Args() { where, orderBy, limit, offset }: StorageProviderWhereArgs,
+  @Query(() => [Worker])
+  async workers(
+    @Args() { where, orderBy, limit, offset }: WorkerWhereArgs,
     @Fields() fields: string[]
-  ): Promise<StorageProvider[]> {
-    return this.service.find<StorageProviderWhereInput>(where, orderBy, limit, offset, fields);
+  ): Promise<Worker[]> {
+    return this.service.find<WorkerWhereInput>(where, orderBy, limit, offset, fields);
   }
 
-  @Query(() => StorageProvider, { nullable: true })
-  async storageProviderByUniqueInput(
-    @Arg('where') where: StorageProviderWhereUniqueInput,
+  @Query(() => Worker, { nullable: true })
+  async workerByUniqueInput(
+    @Arg('where') where: WorkerWhereUniqueInput,
     @Fields() fields: string[]
-  ): Promise<StorageProvider | null> {
+  ): Promise<Worker | null> {
     const result = await this.service.find(where, undefined, 1, 0, fields);
     return result && result.length >= 1 ? result[0] : null;
   }
 
-  @Query(() => StorageProviderConnection)
-  async storageProvidersConnection(
-    @Args() { where, orderBy, ...pageOptions }: StorageProviderConnectionWhereArgs,
+  @Query(() => WorkerConnection)
+  async workersConnection(
+    @Args() { where, orderBy, ...pageOptions }: WorkerConnectionWhereArgs,
     @Info() info: any
-  ): Promise<StorageProviderConnection> {
+  ): Promise<WorkerConnection> {
     const rawFields = graphqlFields(info, {}, { excludedFields: ['__typename'] });
 
     let result: any = {
@@ -119,20 +119,20 @@ export class StorageProviderResolver {
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog
     try {
-      result = await this.service.findConnection<StorageProviderWhereInput>(where, orderBy, pageOptions, rawFields);
+      result = await this.service.findConnection<WorkerWhereInput>(where, orderBy, pageOptions, rawFields);
     } catch (err) {
       console.log(err);
       // TODO: should continue to return this on `Error: Items is empty` or throw the error
       if (!(err.message as string).includes('Items is empty')) throw err;
     }
 
-    return result as Promise<StorageProviderConnection>;
+    return result as Promise<WorkerConnection>;
   }
 
   @FieldResolver(() => DataObject)
-  async dataObjects(@Root() r: StorageProvider): Promise<DataObject[] | null> {
+  async dataObjects(@Root() r: Worker): Promise<DataObject[] | null> {
     const result = await getConnection()
-      .getRepository(StorageProvider)
+      .getRepository(Worker)
       .findOne(r.id, { relations: ['dataObjects'] });
     if (result && result.dataObjects !== undefined) {
       return result.dataObjects;

+ 6 - 6
query-node/generated/graphql-server/src/modules/storage-provider/storage-provider.service.ts → query-node/generated/graphql-server/src/modules/worker/worker.service.ts

@@ -3,12 +3,12 @@ import { Repository } from 'typeorm';
 import { InjectRepository } from 'typeorm-typedi-extensions';
 import { BaseService, WhereInput } from 'warthog';
 
-import { StorageProvider } from './storage-provider.model';
+import { Worker } from './worker.model';
 
-@Service('StorageProviderService')
-export class StorageProviderService extends BaseService<StorageProvider> {
-  constructor(@InjectRepository(StorageProvider) protected readonly repository: Repository<StorageProvider>) {
-    super(StorageProvider, repository);
+@Service('WorkerService')
+export class WorkerService extends BaseService<Worker> {
+  constructor(@InjectRepository(Worker) protected readonly repository: Repository<Worker>) {
+    super(Worker, repository);
   }
 
   async find<W extends WhereInput>(
@@ -17,7 +17,7 @@ export class StorageProviderService extends BaseService<StorageProvider> {
     limit?: number,
     offset?: number,
     fields?: string[]
-  ): Promise<StorageProvider[]> {
+  ): Promise<Worker[]> {
     let f = fields;
     if (f == undefined) {
       f = [];

+ 11 - 5
query-node/mappings/src/storage.ts

@@ -34,7 +34,8 @@ import {
   DataObjectOwnerCouncil,
   DataObjectOwnerWorkingGroup,
   LiaisonJudgement,
-  StorageProvider,
+  Worker,
+  WorkerType,
 } from 'query-node'
 
 export async function dataDirectory_ContentAdded(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
@@ -89,15 +90,20 @@ export async function dataDirectory_ContentAccepted(db: DatabaseManager, event:
   }
 
   // load storage provider
-  const storageProvider = await db.get(StorageProvider, { where: { id: storageProviderId.toString() } as FindConditions<StorageProvider>})
+  const worker = await db.get(Worker, {
+    where: {
+      workerId: storageProviderId.toString(),
+      type: WorkerType.STORAGE,
+    } as FindConditions<Worker>
+  })
 
   // ensure object exists
-  if (!storageProvider) {
-    return inconsistentState('Non-existing content acceptation requested', storageProviderId)
+  if (!worker) {
+    return inconsistentState('Missing Storage Provider Id', storageProviderId)
   }
 
   // update object
-  dataObject.liaison = storageProvider
+  dataObject.liaison = worker
   dataObject.liaisonJudgement = LiaisonJudgement.ACCEPTED
 
   // set last update time

+ 49 - 64
query-node/mappings/src/workingGroup.ts

@@ -10,8 +10,8 @@ import {
 
 import {
   Channel,
-  StorageProvider,
-  StorageProviderType,
+  Worker,
+  WorkerType,
 } from 'query-node'
 import {
   GatewayWorkingGroup,
@@ -30,31 +30,31 @@ export async function storageWorkingGroup_OpeningFilled(db: DatabaseManager, eve
   const {applicationIdToWorkerIdMap} = new StorageWorkingGroup.OpeningFilledEvent(event).data
 
   // call generic processing
-  await workingGroup_OpeningFilled(db, StorageProviderType.STORAGE, applicationIdToWorkerIdMap)
+  await workingGroup_OpeningFilled(db, WorkerType.STORAGE, applicationIdToWorkerIdMap)
 }
 
 export async function storageWorkingGroup_WorkerStorageUpdated(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId, bytes: newMetadata} = new StorageWorkingGroup.WorkerStorageUpdatedEvent(event).data
+  const {workerId, bytes: newMetadata} = new StorageWorkingGroup.WorkerStorageUpdatedEvent(event).data
 
   // call generic processing
-  await workingGroup_WorkerStorageUpdated(db, storageProviderId, newMetadata)
+  await workingGroup_WorkerStorageUpdated(db, workerId, newMetadata)
 }
 
 export async function storageWorkingGroup_TerminatedWorker(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId} = new StorageWorkingGroup.TerminatedWorkerEvent(event).data
+  const {workerId} = new StorageWorkingGroup.TerminatedWorkerEvent(event).data
 
   // call generic processing
-  await workingGroup_TerminatedWorker(db, storageProviderId)
+  await workingGroup_TerminatedWorker(db, workerId)
 }
 
 export async function storageWorkingGroup_WorkerExited(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId} = new StorageWorkingGroup.WorkerExitedEvent(event).data
+  const {workerId} = new StorageWorkingGroup.WorkerExitedEvent(event).data
 
   // call generic processing
-  await workingGroup_WorkerExited(db, storageProviderId)
+  await workingGroup_WorkerExited(db, workerId)
 }
 
 /////////////////// Gateway working group //////////////////////////////////////
@@ -64,117 +64,102 @@ export async function gatewayWorkingGroup_OpeningFilled(db: DatabaseManager, eve
   const {applicationIdToWorkerIdMap} = new GatewayWorkingGroup.OpeningFilledEvent(event).data
 
   // call generic processing
-  await workingGroup_OpeningFilled(db, StorageProviderType.GATEWAY, applicationIdToWorkerIdMap)
+  await workingGroup_OpeningFilled(db, WorkerType.GATEWAY, applicationIdToWorkerIdMap)
 }
 
 export async function gatewayWorkingGroup_WorkerStorageUpdated(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId, bytes: newMetadata} = new GatewayWorkingGroup.WorkerStorageUpdatedEvent(event).data
+  const {workerId, bytes: newMetadata} = new GatewayWorkingGroup.WorkerStorageUpdatedEvent(event).data
 
   // call generic processing
-  await workingGroup_WorkerStorageUpdated(db, storageProviderId, newMetadata)
+  await workingGroup_WorkerStorageUpdated(db, workerId, newMetadata)
 }
 
 export async function gatewayWorkingGroup_TerminatedWorker(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId} = new StorageWorkingGroup.TerminatedWorkerEvent(event).data
+  const {workerId} = new StorageWorkingGroup.TerminatedWorkerEvent(event).data
 
   // call generic processing
-  await workingGroup_TerminatedWorker(db, storageProviderId)
+  await workingGroup_TerminatedWorker(db, workerId)
 }
 
 export async function gatewayWorkingGroup_WorkerExited(db: DatabaseManager, event: SubstrateEvent): Promise<void> {
   // read event data
-  const {workerId: storageProviderId} = new StorageWorkingGroup.WorkerExitedEvent(event).data
+  const {workerId} = new StorageWorkingGroup.WorkerExitedEvent(event).data
 
   // call generic processing
-  await workingGroup_WorkerExited(db, storageProviderId)
+  await workingGroup_WorkerExited(db, workerId)
 }
 
 /////////////////// Generic working group processing ///////////////////////////
 
 export async function workingGroup_OpeningFilled(
   db: DatabaseManager,
-  storageProviderType: StorageProviderType,
+  workerType: WorkerType,
   applicationIdToWorkerIdMap: ApplicationIdToWorkerIdMap
 ): Promise<void> {
-  const storageProviderIds = [...applicationIdToWorkerIdMap.values()]
-
-  for (const storageProviderId of storageProviderIds) {
-    // load storage provider
-    const storageProvider = await db.get(StorageProvider, { where: { id: storageProviderId.toString() } as FindConditions<StorageProvider> })
-
-    // reactivate storage provider if it already exists
-    if (storageProvider) {
-      await reactivateStorageProvider(db, storageProvider)
-      continue
-    }
-
-    // create new storage provider
-    const newStorageProvider = new StorageProvider({
-      id: storageProviderId.toString(),
-      type: storageProviderType,
+  const workerIds = [...applicationIdToWorkerIdMap.values()]
+
+  for (const workerId of workerIds) {
+    // create new worker
+    const newWorker = new Worker({
+      workerId: workerId.toString(),
+      type: workerType,
       isActive: true,
     })
 
-    await db.save<StorageProvider>(newStorageProvider)
+    await db.save<Worker>(newWorker)
   }
 
   // emit log event
-  logger.info("Storage provider has beed created", {ids: storageProviderIds.map(item => item.toString())})
+  logger.info("Worker has been created", {ids: workerIds.map(item => item.toString())})
 }
 
-export async function workingGroup_WorkerStorageUpdated(db: DatabaseManager, storageProviderId: WorkerId, newMetadata: Bytes): Promise<void> {
-  // load storage provider
-  const storageProvider = await db.get(StorageProvider, { where: { id: storageProviderId.toString() } as FindConditions<StorageProvider> })
+export async function workingGroup_WorkerStorageUpdated(db: DatabaseManager, workerId: WorkerId, newMetadata: Bytes): Promise<void> {
+  // load worker
+  const worker = await db.get(Worker, { where: { id: workerId.toString() } as FindConditions<Worker> })
 
-  // ensure storageProvider exists
-  if (!storageProvider) {
-    return inconsistentState('Non-existing storage provider update requested', storageProviderId)
+  // ensure worker exists
+  if (!worker) {
+    return inconsistentState('Non-existing worker update requested', workerId)
   }
 
-  storageProvider.metadata = newMetadata.toUtf8()
+  worker.metadata = newMetadata.toUtf8()
 
-  await db.save<StorageProvider>(storageProvider)
+  await db.save<Worker>(worker)
 
   // emit log event
-  logger.info("Storage provider has been updated", {id: storageProviderId})
+  logger.info("Storage provider has been updated", {id: workerId})
 }
 
-export async function workingGroup_TerminatedWorker(db: DatabaseManager, storageProviderId: WorkerId): Promise<void> {
+export async function workingGroup_TerminatedWorker(db: DatabaseManager, workerId: WorkerId): Promise<void> {
   // do removal logic
-  await deactivateStorageProvider(db, storageProviderId)
+  await deactivateWorker(db, workerId)
 
   // emit log event
-  logger.info("Storage provider has beed removed (worker terminated)", {id: storageProviderId})
+  logger.info("Storage provider has beed removed (worker terminated)", {id: workerId})
 }
 
-export async function workingGroup_WorkerExited(db: DatabaseManager, storageProviderId: WorkerId): Promise<void> {
+export async function workingGroup_WorkerExited(db: DatabaseManager, workerId: WorkerId): Promise<void> {
   // do removal logic
-  await deactivateStorageProvider(db, storageProviderId)
+  await deactivateWorker(db, workerId)
 
   // emit log event
-  logger.info("Storage provider has beed removed (worker exited)", {id: storageProviderId})
+  logger.info("Storage provider has beed removed (worker exited)", {id: workerId})
 }
 
 /////////////////// Helpers ////////////////////////////////////////////////////
 
-async function reactivateStorageProvider(db: DatabaseManager, storageProvider: StorageProvider) {
-  storageProvider.isActive = true
-
-  await db.save<StorageProvider>(storageProvider)
-}
-
-async function deactivateStorageProvider(db: DatabaseManager, storageProviderId: WorkerId) {
-  // load storage provider
-  const storageProvider = await db.get(StorageProvider, { where: { id: storageProviderId.toString() } as FindConditions<StorageProvider> })
+async function deactivateWorker(db: DatabaseManager, workerId: WorkerId) {
+  // load worker
+  const worker = await db.get(Worker, { where: { id: workerId.toString() } as FindConditions<Worker> })
 
-  // ensure storageProvider exists
-  if (!storageProvider) {
-    return inconsistentState('Non-existing storage provider deletion requested', storageProviderId)
+  // ensure worker exists
+  if (!worker) {
+    return inconsistentState('Non-existing worker deletion requested', workerId)
   }
 
-  storageProvider.isActive = false
+  worker.isActive = false
 
-  await db.save<StorageProvider>(storageProvider)
+  await db.save<Worker>(worker)
 }

+ 16 - 11
query-node/schema.graphql

@@ -90,7 +90,7 @@ type DataObject @entity {
   size: Int!
 
   "Storage provider id of the liaison"
-  liaison: StorageProvider # liaison is unset until storage provider accepts or rejects the content
+  liaison: Worker # liaison is unset until storage provider accepts or rejects the content
 
   "Storage provider as liaison judgment"
   liaisonJudgement: LiaisonJudgement!
@@ -228,7 +228,7 @@ type Channel @entity {
 }
 
 type CuratorGroup @entity {
-  "Runtime entity identifier (EntityId)"
+  "Runtime identifier"
   id: ID!
 
   "Curators belonging to this group"
@@ -241,7 +241,7 @@ type CuratorGroup @entity {
 }
 
 type VideoCategory @entity {
-  "Runtime entity identifier (EntityId)"
+  "Runtime identifier"
   id: ID!
 
   "The name of the category"
@@ -253,7 +253,7 @@ type VideoCategory @entity {
 }
 
 type Video @entity {
-  "Runtime entity identifier (EntityId)"
+  "Runtime identifier"
   id: ID!
 
   "Reference to member's channel"
@@ -334,7 +334,7 @@ type Video @entity {
 }
 
 type VideoMediaMetadata @entity {
-  "Runtime entity identifier (EntityId)"
+  "Unique identifier"
   id: ID!
 
   "Encoding of the video media object"
@@ -366,7 +366,7 @@ type VideoMediaEncoding @entity {
 }
 
 type License @entity {
-  "Runtime entity identifier (EntityId)"
+  "Unique identifier"
   id: ID!
 
   "License code defined by Joystream"
@@ -380,25 +380,30 @@ type License @entity {
 }
 
 type FeaturedVideo @entity {
-  "Runtime entity identifier (EntityId)"
+  "Unique identifier"
   id: ID!
 
   "Reference to a video"
   video: Video!
 }
 
-enum StorageProviderType {
+enum WorkerType {
   GATEWAY
   STORAGE
 }
 
-type StorageProvider @entity {
-  "Runtime entity identifier (EntityId)"
+type Worker @entity {
+  "Unique identifier"
   id: ID!
 
+  "Sign of worker still being active"
   isActive: Boolean!
 
-  type: StorageProviderType!
+  "Runtime identifier"
+  workerId: String!
+
+  "Associated working group"
+  type: WorkerType!
 
   "Custom metadata set by provider"
   metadata: String