(entity: T, ctx: RequestContext) => Promise<T>Assigns a ChannelAware entity to the default Channel as well as any channel
specified in the RequestContext. This method will not save the entity to the database, but
assigns the channels property of the entity.
(ctx: RequestContext, entityType: Type<T>, entityId: ID, channelIds: ID[]) => Promise<T>Assigns the entity to the given Channels and saves all changes to the database.
(ctx: RequestContext, entityType: Type<T>, entityId: ID, channelIds: ID[]) => Promise<T | undefined>Removes the entity from the given Channels and saves.
(token: string) => Promise<Channel>Given a channel token, returns the corresponding Channel if it exists, else will throw a ChannelNotFoundError.
(ctx: RequestContext, token: string) => Promise<Channel>(ctxOrToken: RequestContext | string, token?: string) => Promise<Channel>(ctx?: RequestContext) => Promise<Channel>Returns the default Channel.
(ctx: RequestContext, options?: ListQueryOptions<Channel>, relations?: RelationPaths<Channel>) => Promise<PaginatedList<Channel>>(ctx: RequestContext, id: ID) => Promise<Channel | undefined>(ctx: RequestContext, input: CreateChannelInput) => Promise<ErrorResultUnion<CreateChannelResult, Channel>>Creates a new Channel from the given input, validating the default language code and resolving the default tax and shipping Zones and the Seller if provided.
Since v3.8.0, the new Channel is automatically assigned to the SuperAdmin and Customer roles. Without these assignments a Channel is not administrable (it does not appear in the Dashboard) and cannot support customer accounts, so callers no longer need to assign these roles themselves.
(ctx: RequestContext, input: UpdateChannelInput) => Promise<ErrorResultUnion<UpdateChannelResult, Channel>>Updates a Channel. Throws a ForbiddenError if the active user does not hold the
UpdateChannel permission on the target Channel. A SuperAdmin is exempt. A RequestContext
with no session skips the check.
(ctx: RequestContext, id: ID) => Promise<DeletionResponse>Deletes a Channel. Throws a ForbiddenError if the active user does not hold the
DeleteChannel permission on the target Channel. A SuperAdmin is exempt. A RequestContext
with no session skips the check.
(entity: VendureEntity) => entity is VendureEntity & ChannelAwareType guard method which returns true if the given entity is an instance of a class which implements the ChannelAware interface.
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team