0.0.9 • Published 3 months ago

gls-channel-banner-config-plugin v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Plugin de Channel Banner Plugin Vendure

Este é um plugin para o framework de e-commerce Vendure que adiciona funcionalidades relacionadas a banners em canais. Ele permite a criação, atualização, exclusão e listagem de banners associados a canais específicos no Administrator e Lista os banners criados para a loja nos projetos Gseller.

Após configurar o seu projeto Vendure, você pode usar este plugin via npm install:

npm install channel-banner-plugin

e inclua-o no arquivo vendure-config conforme abaixo:

import { ChannelBannerPlugin } from "channel-banner-plugin";
...
export const config: VendureConfig = {
  ...
  plugins: [
    ...,
	ChannelBannerPlugin
  ]
}

Os tipos, entradas e mutações atualizadas após a instalação do plugin são:

Admin Api Main Type

  type CreateChannelBannerReponse {
      active: Boolean
      description: String
      startAt: DateTime
      link: String
      title: String
      endAt: DateTime
      channel: Channel
      assetId: String
      id: Int
    }

    type ChannelBanner {
      active: Boolean
      description: String
      startAt: DateTime
      link: String
      title: String
      endAt: DateTime
      channel: Channel
      assetId: String
      id: Int
      asset: Asset
    }

    type NotUpdatedError {
      errorCode: String!
      message: String!
    }

    type BannerNotDeletedError {
      errorCode: String!
      message: String!
    }

    type ChannelNotFoundError {
       errorCode: String!
       message: String!
    }


    type AssetNotDeletedError {
      errorCode: String!
      message: String!
    }

    type BannerNotFoundError {
      errorCode: String!
      message: String!
    }

    type BannerNotUpdatedError {
      errorCode: String!
      message: String!
    }

    type UpdatedSuccess {
      success: Boolean!
    }

    type DeletedSuccess {
      success: Boolean!
    }

Admin Api Schema Inputs

input CreateChannelBannerInput {
      title: String!
      description: String
      link: String
      startAt: DateTime!
      endAt: DateTime!
      active: Boolean
      asset: Upload!
    }

    input CreateChannelBannerWithAssetIdInput {
      title: String!
      description: String
      link: String
      startAt: String
      endAt: String
      active: Boolean
      assetId: String!
    }

    input UpdateChannelBannerInput {
      title: String
      description: String
      link: String
      startAt: DateTime
      endAt: DateTime
      active: Boolean
      asset: Upload
      bannerId: String
    }

Admin Schema Unions

  union updateChannelBannerResponse =
        NotUpdatedError
      | UpdatedSuccess
      | ChannelNotFoundError
      | BannerNotUpdatedError

    union deleteChannelBannerResponse =
        BannerNotDeletedError
      | DeletedSuccess
      | ChannelNotFoundError
      | AssetNotDeletedError
      | BannerNotFoundError

Admin Mutation and Query

 extend type Mutation {
      setChannelBanner(
        args: CreateChannelBannerInput
      ): CreateChannelBannerReponse

      setChannelBannerWithAssetId(
        args: CreateChannelBannerWithAssetIdInput
      ): CreateChannelBannerReponse

      updateChannelBanner(
        args: UpdateChannelBannerInput
      ): updateChannelBannerResponse!

      deleteChannelBanner(bannerId: String): deleteChannelBannerResponse!
    }

    extend type Query {
      getAllBanners: [ChannelBanner!]!
    }

Shop Api Main Type

 type channelBannersByChannelResponse {
      title: String
      description: String
      link: String
      startAt: DateTime
      endAt: DateTime
      active: Boolean
      assetId: String
      id: Int
      asset: Asset
    }

    type channelBannersResult {
      items: [channelBannersByChannelResponse]
      totalItems: Int
    }

Shop Query

    extend type Query {
      channelBanners: channelBannersResult!
    }
0.0.9

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.6

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago