Browse Source

feat(server): Implement create & update mutation for Roles

Michael Bromley 7 years ago
parent
commit
821f6ccf5d

File diff suppressed because it is too large
+ 0 - 0
schema.json


+ 1 - 1
server/e2e/auth.e2e-spec.ts

@@ -10,6 +10,7 @@ import {
     CreateRole,
     CreateRoleVariables,
     GetProductList,
+    Permission,
     UpdateProductVariables,
 } from 'shared/generated-types';
 
@@ -25,7 +26,6 @@ import {
     UPDATE_PRODUCT,
 } from '../../admin-ui/src/app/data/definitions/product-definitions';
 import { SUPER_ADMIN_USER_IDENTIFIER, SUPER_ADMIN_USER_PASSWORD } from '../src/common/constants';
-import { Permission } from '../src/entity/role/permission';
 
 import { TestClient } from './test-client';
 import { TestServer } from './test-server';

+ 1 - 1
server/src/api/administrator/administrator.resolver.ts

@@ -1,8 +1,8 @@
 import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
+import { Permission } from 'shared/generated-types';
 import { PaginatedList } from 'shared/shared-types';
 
 import { Administrator } from '../../entity/administrator/administrator.entity';
-import { Permission } from '../../entity/role/permission';
 import { AdministratorService } from '../../service/administrator.service';
 import { ApplyIdCodec } from '../common/apply-id-codec-decorator';
 import { Allow } from '../roles-guard';

+ 1 - 1
server/src/api/auth/auth.resolver.ts

@@ -1,6 +1,6 @@
 import { Args, Context, Mutation, Query, Resolver } from '@nestjs/graphql';
+import { Permission } from 'shared/generated-types';
 
-import { Permission } from '../../entity/role/permission';
 import { User } from '../../entity/user/user.entity';
 import { AuthService } from '../../service/auth.service';
 import { ChannelService } from '../../service/channel.service';

+ 1 - 1
server/src/api/channel/channel.resolver.ts

@@ -1,7 +1,7 @@
 import { Args, Mutation, Resolver } from '@nestjs/graphql';
+import { Permission } from 'shared/generated-types';
 
 import { Channel } from '../../entity/channel/channel.entity';
-import { Permission } from '../../entity/role/permission';
 import { ChannelService } from '../../service/channel.service';
 import { Allow } from '../roles-guard';
 

+ 1 - 1
server/src/api/customer/customer.resolver.ts

@@ -1,9 +1,9 @@
 import { Mutation, Query, ResolveProperty, Resolver } from '@nestjs/graphql';
+import { Permission } from 'shared/generated-types';
 import { PaginatedList } from 'shared/shared-types';
 
 import { Address } from '../../entity/address/address.entity';
 import { Customer } from '../../entity/customer/customer.entity';
-import { Permission } from '../../entity/role/permission';
 import { CustomerService } from '../../service/customer.service';
 import { ApplyIdCodec } from '../common/apply-id-codec-decorator';
 import { Allow } from '../roles-guard';

+ 1 - 1
server/src/api/facet/facet.resolver.ts

@@ -2,6 +2,7 @@ import { Mutation, Query, Resolver } from '@nestjs/graphql';
 import {
     CreateFacetValuesVariables,
     CreateFacetVariables,
+    Permission,
     UpdateFacetValuesVariables,
     UpdateFacetVariables,
 } from 'shared/generated-types';
@@ -11,7 +12,6 @@ import { DEFAULT_LANGUAGE_CODE } from '../../common/constants';
 import { Translated } from '../../common/types/locale-types';
 import { FacetValue } from '../../entity/facet-value/facet-value.entity';
 import { Facet } from '../../entity/facet/facet.entity';
-import { Permission } from '../../entity/role/permission';
 import { I18nError } from '../../i18n/i18n-error';
 import { FacetValueService } from '../../service/facet-value.service';
 import { FacetService } from '../../service/facet.service';

+ 1 - 2
server/src/api/product-option/product-option.resolver.ts

@@ -1,10 +1,9 @@
 import { Mutation, Query, ResolveProperty, Resolver } from '@nestjs/graphql';
-import { CreateProductOptionGroupVariables } from 'shared/generated-types';
+import { CreateProductOptionGroupVariables, Permission } from 'shared/generated-types';
 
 import { Translated } from '../../common/types/locale-types';
 import { ProductOptionGroup } from '../../entity/product-option-group/product-option-group.entity';
 import { ProductOption } from '../../entity/product-option/product-option.entity';
-import { Permission } from '../../entity/role/permission';
 import { ProductOptionGroupService } from '../../service/product-option-group.service';
 import { ProductOptionService } from '../../service/product-option.service';
 import { ApplyIdCodec } from '../common/apply-id-codec-decorator';

+ 1 - 1
server/src/api/product/product.resolver.ts

@@ -6,6 +6,7 @@ import {
     GenerateProductVariantsVariables,
     GetProductListVariables,
     GetProductWithVariantsVariables,
+    Permission,
     RemoveOptionGroupFromProductVariables,
     UpdateProductVariables,
     UpdateProductVariantsVariables,
@@ -17,7 +18,6 @@ import { Translated } from '../../common/types/locale-types';
 import { assertFound } from '../../common/utils';
 import { ProductVariant } from '../../entity/product-variant/product-variant.entity';
 import { Product } from '../../entity/product/product.entity';
-import { Permission } from '../../entity/role/permission';
 import { I18nError } from '../../i18n/i18n-error';
 import { FacetValueService } from '../../service/facet-value.service';
 import { ProductVariantService } from '../../service/product-variant.service';

+ 2 - 0
server/src/api/role/role.api.graphql

@@ -6,6 +6,8 @@ type Query {
 type Mutation {
   "Create a new Role"
   createRole(input: CreateRoleInput!): Role!
+  "Update an existing new Role"
+  updateRole(input: UpdateRoleInput!): Role!
 }
 
 type RoleList implements PaginatedList {

+ 19 - 5
server/src/api/role/role.resolver.ts

@@ -1,7 +1,13 @@
 import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
+import {
+    CreateRoleVariables,
+    GetRolesVariables,
+    GetRoleVariables,
+    Permission,
+    UpdateRoleVariables,
+} from 'shared/generated-types';
 import { PaginatedList } from 'shared/shared-types';
 
-import { Permission } from '../../entity/role/permission';
 import { Role } from '../../entity/role/role.entity';
 import { RoleService } from '../../service/role.service';
 import { ApplyIdCodec } from '../common/apply-id-codec-decorator';
@@ -14,22 +20,30 @@ export class RoleResolver {
     @Query()
     @Allow(Permission.ReadAdministrator)
     @ApplyIdCodec()
-    roles(@Args() args: any): Promise<PaginatedList<Role>> {
-        return this.roleService.findAll(args.options);
+    roles(@Args() args: GetRolesVariables): Promise<PaginatedList<Role>> {
+        return this.roleService.findAll(args.options || undefined);
     }
 
     @Query()
     @Allow(Permission.ReadAdministrator)
     @ApplyIdCodec()
-    role(@Args() args: any): Promise<Role | undefined> {
+    role(@Args() args: GetRoleVariables): Promise<Role | undefined> {
         return this.roleService.findOne(args.id);
     }
 
     @Mutation()
     @Allow(Permission.CreateAdministrator)
     @ApplyIdCodec()
-    createRole(_, args): Promise<Role> {
+    createRole(@Args() args: CreateRoleVariables): Promise<Role> {
         const { input } = args;
         return this.roleService.create(input);
     }
+
+    @Mutation()
+    @Allow(Permission.UpdateAdministrator)
+    @ApplyIdCodec()
+    updateRole(@Args() args: UpdateRoleVariables): Promise<Role> {
+        const { input } = args;
+        return this.roleService.update(input);
+    }
 }

+ 1 - 1
server/src/api/roles-guard.ts

@@ -1,10 +1,10 @@
 import { ExecutionContext, Injectable, ReflectMetadata } from '@nestjs/common';
 import { Reflector } from '@nestjs/core';
 import { ExtractJwt, Strategy } from 'passport-jwt';
+import { Permission } from 'shared/generated-types';
 
 import { idsAreEqual } from '../common/utils';
 import { ConfigService } from '../config/config.service';
-import { Permission } from '../entity/role/permission';
 import { User } from '../entity/user/user.entity';
 
 import { RequestContextService } from './common/request-context.service';

+ 1 - 1
server/src/common/types/auth-types.ts

@@ -1,4 +1,4 @@
-import { Permission } from '../../entity/role/permission';
+import { Permission } from 'shared/generated-types';
 
 export interface JwtPayload {
     identifier: string;

+ 27 - 0
server/src/common/types/permission.graphql

@@ -0,0 +1,27 @@
+" Permissions for administrators "
+enum Permission {
+    " The Authenticated role means simply that the user is logged in "
+    Authenticated
+    " SuperAdmin can perform the most sensitive tasks "
+    SuperAdmin
+
+    CreateCatalog
+    ReadCatalog
+    UpdateCatalog
+    DeleteCatalog
+
+    CreateCustomer
+    ReadCustomer
+    UpdateCustomer
+    DeleteCustomer
+
+    CreateAdministrator
+    ReadAdministrator
+    UpdateAdministrator
+    DeleteAdministrator
+
+    CreateOrder
+    ReadOrder
+    UpdateOrder
+    DeleteOrder
+}

+ 0 - 30
server/src/entity/role/permission.ts

@@ -1,30 +0,0 @@
-/**
- * Permissions for administrators.
- */
-export enum Permission {
-    // The Authenticated role means simply that the user is logged in
-    Authenticated = 'Authenticated',
-    // SuperAdmin can perform the most sensitive tasks
-    SuperAdmin = 'SuperAdmin',
-
-    // CRUD permissions on the various classes of entity
-    CreateCatalog = 'CreateCatalog',
-    ReadCatalog = 'ReadCatalog',
-    UpdateCatalog = 'UpdateCatalog',
-    DeleteCatalog = 'DeleteCatalog',
-
-    CreateCustomer = 'CreateCustomer',
-    ReadCustomer = 'ReadCustomer',
-    UpdateCustomer = 'UpdateCustomer',
-    DeleteCustomer = 'DeleteCustomer',
-
-    CreateAdministrator = 'CreateAdministrator',
-    ReadAdministrator = 'ReadAdministrator',
-    UpdateAdministrator = 'UpdateAdministrator',
-    DeleteAdministrator = 'DeleteAdministrator',
-
-    CreateOrder = 'CreateOrder',
-    ReadOrder = 'ReadOrder',
-    UpdateOrder = 'UpdateOrder',
-    DeleteOrder = 'DeleteOrder',
-}

+ 2 - 4
server/src/entity/role/role.entity.ts

@@ -1,12 +1,10 @@
+import { Permission } from 'shared/generated-types';
 import { DeepPartial } from 'shared/shared-types';
-import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from 'typeorm';
+import { Column, Entity, JoinTable, ManyToMany } from 'typeorm';
 
 import { ChannelAware } from '../../common/types/common-types';
 import { VendureEntity } from '../base/base.entity';
 import { Channel } from '../channel/channel.entity';
-import { User } from '../user/user.entity';
-
-import { Permission } from './permission';
 
 @Entity()
 export class Role extends VendureEntity implements ChannelAware {

+ 10 - 2
server/src/entity/role/role.graphql

@@ -2,12 +2,20 @@ type Role implements Node {
     id: ID!
     code: String!
     description: String!
-    permissions: [String!]!
+    permissions: [Permission!]!
     channels: [Channel!]!
 }
 
 input CreateRoleInput {
     code: String!
     description: String!
-    permissions: [String!]!
+    permissions: [Permission!]!
+}
+
+
+input UpdateRoleInput {
+    id: ID!
+    code: String!
+    description: String!
+    permissions: [Permission!]!
 }

+ 1 - 1
server/src/service/auth.service.ts

@@ -1,11 +1,11 @@
 import { Injectable, UnauthorizedException } from '@nestjs/common';
 import { InjectConnection } from '@nestjs/typeorm';
 import * as jwt from 'jsonwebtoken';
+import { Permission } from 'shared/generated-types';
 import { Connection } from 'typeorm';
 
 import { JwtPayload } from '../common/types/auth-types';
 import { ConfigService } from '../config/config.service';
-import { Permission } from '../entity/role/permission';
 import { User } from '../entity/user/user.entity';
 
 import { PasswordService } from './password.service';

+ 20 - 12
server/src/service/role.service.ts

@@ -1,4 +1,5 @@
 import { Injectable } from '@nestjs/common';
+import { CreateRoleInput, Permission, UpdateRoleInput } from 'shared/generated-types';
 import { ID, PaginatedList } from 'shared/shared-types';
 import { Connection } from 'typeorm';
 
@@ -9,7 +10,7 @@ import {
     SUPER_ADMIN_ROLE_DESCRIPTION,
 } from '../common/constants';
 import { ListQueryOptions } from '../common/types/common-types';
-import { Permission } from '../entity/role/permission';
+import { assertFound } from '../common/utils';
 import { Role } from '../entity/role/role.entity';
 import { I18nError } from '../i18n/i18n-error';
 
@@ -17,13 +18,6 @@ import { ChannelService } from './channel.service';
 import { buildListQuery } from './helpers/build-list-query';
 import { ActiveConnection } from './helpers/connection.decorator';
 
-// TODO: replace with generated Input interface
-export interface CreateRoleDto {
-    code: string;
-    description: string;
-    permissions: Permission[];
-}
-
 @Injectable()
 export class RoleService {
     constructor(@ActiveConnection() private connection: Connection, private channelService: ChannelService) {}
@@ -33,8 +27,8 @@ export class RoleService {
         await this.ensureCustomerRoleExists();
     }
 
-    findAll(options: ListQueryOptions<Role>): Promise<PaginatedList<Role>> {
-        return buildListQuery(this.connection, Role, options)
+    findAll(options?: ListQueryOptions<Role>): Promise<PaginatedList<Role>> {
+        return buildListQuery(this.connection, Role, options, ['channels'])
             .getManyAndCount()
             .then(([items, totalItems]) => ({
                 items,
@@ -43,7 +37,9 @@ export class RoleService {
     }
 
     findOne(roleId: ID): Promise<Role | undefined> {
-        return this.connection.manager.findOne(Role, roleId);
+        return this.connection.manager.findOne(Role, roleId, {
+            relations: ['channels'],
+        });
     }
 
     getSuperAdminRole(): Promise<Role> {
@@ -64,12 +60,24 @@ export class RoleService {
         });
     }
 
-    async create(input: CreateRoleDto): Promise<Role> {
+    async create(input: CreateRoleInput): Promise<Role> {
         const role = new Role(input);
         role.channels = [this.channelService.getDefaultChannel()];
         return this.connection.manager.save(role);
     }
 
+    async update(input: UpdateRoleInput): Promise<Role> {
+        const role = await this.findOne(input.id);
+        if (!role) {
+            throw new I18nError(`error.entity-with-id-not-found`, { entityName: 'Role', id: input.id });
+        }
+        role.code = input.code;
+        role.description = input.description;
+        role.permissions = input.permissions;
+        await this.connection.manager.save(role);
+        return assertFound(this.findOne(role.id));
+    }
+
     private getRoleByCode(code: string): Promise<Role | undefined> {
         return this.connection.getRepository(Role).findOne({
             where: { code },

+ 320 - 10
shared/generated-types.ts

@@ -9,7 +9,7 @@ export interface GetAdministrators_administrators_items_user_roles {
   __typename: "Role";
   code: string;
   description: string;
-  permissions: string[];
+  permissions: Permission[];
 }
 
 export interface GetAdministrators_administrators_items_user {
@@ -23,10 +23,10 @@ export interface GetAdministrators_administrators_items_user {
 export interface GetAdministrators_administrators_items {
   __typename: "Administrator";
   id: string;
-  firstName: string | null;
-  lastName: string | null;
-  emailAddress: string | null;
-  user: GetAdministrators_administrators_items_user | null;
+  firstName: string;
+  lastName: string;
+  emailAddress: string;
+  user: GetAdministrators_administrators_items_user;
 }
 
 export interface GetAdministrators_administrators {
@@ -46,6 +46,227 @@ export interface GetAdministratorsVariables {
 /* tslint:disable */
 // This file was automatically generated and should not be edited.
 
+// ====================================================
+// GraphQL mutation operation: CreateAdministrator
+// ====================================================
+
+export interface CreateAdministrator_createAdministrator_user_roles {
+  __typename: "Role";
+  code: string;
+  description: string;
+  permissions: Permission[];
+}
+
+export interface CreateAdministrator_createAdministrator_user {
+  __typename: "User";
+  id: string;
+  identifier: string;
+  lastLogin: string | null;
+  roles: CreateAdministrator_createAdministrator_user_roles[];
+}
+
+export interface CreateAdministrator_createAdministrator {
+  __typename: "Administrator";
+  id: string;
+  firstName: string;
+  lastName: string;
+  emailAddress: string;
+  user: CreateAdministrator_createAdministrator_user;
+}
+
+export interface CreateAdministrator {
+  /**
+   * Create a new Administrator
+   */
+  createAdministrator: CreateAdministrator_createAdministrator;
+}
+
+export interface CreateAdministratorVariables {
+  input: CreateAdministratorInput;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL query operation: GetRoles
+// ====================================================
+
+export interface GetRoles_roles_items_channels {
+  __typename: "Channel";
+  id: string;
+  code: string;
+  token: string;
+}
+
+export interface GetRoles_roles_items {
+  __typename: "Role";
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+  channels: GetRoles_roles_items_channels[];
+}
+
+export interface GetRoles_roles {
+  __typename: "RoleList";
+  items: GetRoles_roles_items[];
+  totalItems: number;
+}
+
+export interface GetRoles {
+  roles: GetRoles_roles;
+}
+
+export interface GetRolesVariables {
+  options?: RoleListOptions | null;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL query operation: GetRole
+// ====================================================
+
+export interface GetRole_role_channels {
+  __typename: "Channel";
+  id: string;
+  code: string;
+  token: string;
+}
+
+export interface GetRole_role {
+  __typename: "Role";
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+  channels: GetRole_role_channels[];
+}
+
+export interface GetRole {
+  role: GetRole_role | null;
+}
+
+export interface GetRoleVariables {
+  id: string;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL mutation operation: CreateRole
+// ====================================================
+
+export interface CreateRole_createRole_channels {
+  __typename: "Channel";
+  id: string;
+  code: string;
+  token: string;
+}
+
+export interface CreateRole_createRole {
+  __typename: "Role";
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+  channels: CreateRole_createRole_channels[];
+}
+
+export interface CreateRole {
+  /**
+   * Create a new Role
+   */
+  createRole: CreateRole_createRole;
+}
+
+export interface CreateRoleVariables {
+  input: CreateRoleInput;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL mutation operation: UpdateRole
+// ====================================================
+
+export interface UpdateRole_updateRole_channels {
+  __typename: "Channel";
+  id: string;
+  code: string;
+  token: string;
+}
+
+export interface UpdateRole_updateRole {
+  __typename: "Role";
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+  channels: UpdateRole_updateRole_channels[];
+}
+
+export interface UpdateRole {
+  /**
+   * Update an existing new Role
+   */
+  updateRole: UpdateRole_updateRole;
+}
+
+export interface UpdateRoleVariables {
+  input: UpdateRoleInput;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL mutation operation: AssignRoleToAdministrator
+// ====================================================
+
+export interface AssignRoleToAdministrator_assignRoleToAdministrator_user_roles {
+  __typename: "Role";
+  code: string;
+  description: string;
+  permissions: Permission[];
+}
+
+export interface AssignRoleToAdministrator_assignRoleToAdministrator_user {
+  __typename: "User";
+  id: string;
+  identifier: string;
+  lastLogin: string | null;
+  roles: AssignRoleToAdministrator_assignRoleToAdministrator_user_roles[];
+}
+
+export interface AssignRoleToAdministrator_assignRoleToAdministrator {
+  __typename: "Administrator";
+  id: string;
+  firstName: string;
+  lastName: string;
+  emailAddress: string;
+  user: AssignRoleToAdministrator_assignRoleToAdministrator_user;
+}
+
+export interface AssignRoleToAdministrator {
+  /**
+   * Assign a Role to an Administrator
+   */
+  assignRoleToAdministrator: AssignRoleToAdministrator_assignRoleToAdministrator;
+}
+
+export interface AssignRoleToAdministratorVariables {
+  administratorId: string;
+  roleId: string;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
 // ====================================================
 // GraphQL mutation operation: AttemptLogin
 // ====================================================
@@ -1127,7 +1348,7 @@ export interface Administrator_user_roles {
   __typename: "Role";
   code: string;
   description: string;
-  permissions: string[];
+  permissions: Permission[];
 }
 
 export interface Administrator_user {
@@ -1141,10 +1362,33 @@ export interface Administrator_user {
 export interface Administrator {
   __typename: "Administrator";
   id: string;
-  firstName: string | null;
-  lastName: string | null;
-  emailAddress: string | null;
-  user: Administrator_user | null;
+  firstName: string;
+  lastName: string;
+  emailAddress: string;
+  user: Administrator_user;
+}
+
+/* tslint:disable */
+// This file was automatically generated and should not be edited.
+
+// ====================================================
+// GraphQL fragment: Role
+// ====================================================
+
+export interface Role_channels {
+  __typename: "Channel";
+  id: string;
+  code: string;
+  token: string;
+}
+
+export interface Role {
+  __typename: "Role";
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+  channels: Role_channels[];
 }
 
 /* tslint:disable */
@@ -1571,6 +1815,30 @@ export enum LanguageCode {
   zu = "zu",
 }
 
+/**
+ *  Permissions for administrators 
+ */
+export enum Permission {
+  Authenticated = "Authenticated",
+  CreateAdministrator = "CreateAdministrator",
+  CreateCatalog = "CreateCatalog",
+  CreateCustomer = "CreateCustomer",
+  CreateOrder = "CreateOrder",
+  DeleteAdministrator = "DeleteAdministrator",
+  DeleteCatalog = "DeleteCatalog",
+  DeleteCustomer = "DeleteCustomer",
+  DeleteOrder = "DeleteOrder",
+  ReadAdministrator = "ReadAdministrator",
+  ReadCatalog = "ReadCatalog",
+  ReadCustomer = "ReadCustomer",
+  ReadOrder = "ReadOrder",
+  SuperAdmin = "SuperAdmin",
+  UpdateAdministrator = "UpdateAdministrator",
+  UpdateCatalog = "UpdateCatalog",
+  UpdateCustomer = "UpdateCustomer",
+  UpdateOrder = "UpdateOrder",
+}
+
 export enum SortOrder {
   ASC = "ASC",
   DESC = "DESC",
@@ -1604,6 +1872,13 @@ export interface BooleanOperators {
   eq?: boolean | null;
 }
 
+export interface CreateAdministratorInput {
+  firstName?: string | null;
+  lastName?: string | null;
+  emailAddress: string;
+  password: string;
+}
+
 export interface CreateFacetCustomFieldsInput {
   searchable?: boolean | null;
 }
@@ -1657,6 +1932,12 @@ export interface CreateProductOptionInput {
   customFields?: any | null;
 }
 
+export interface CreateRoleInput {
+  code: string;
+  description: string;
+  permissions: Permission[];
+}
+
 export interface DateOperators {
   eq?: any | null;
   before?: any | null;
@@ -1765,6 +2046,28 @@ export interface ProductVariantTranslationInput {
   customFields?: any | null;
 }
 
+export interface RoleFilterParameter {
+  code?: StringOperators | null;
+  description?: StringOperators | null;
+  createdAt?: DateOperators | null;
+  updatedAt?: DateOperators | null;
+}
+
+export interface RoleListOptions {
+  take?: number | null;
+  skip?: number | null;
+  sort?: RoleSortParameter | null;
+  filter?: RoleFilterParameter | null;
+}
+
+export interface RoleSortParameter {
+  id?: SortOrder | null;
+  createdAt?: SortOrder | null;
+  updatedAt?: SortOrder | null;
+  code?: SortOrder | null;
+  description?: SortOrder | null;
+}
+
 export interface StringOperators {
   eq?: string | null;
   contains?: string | null;
@@ -1815,6 +2118,13 @@ export interface UpdateProductVariantInput {
   customFields?: any | null;
 }
 
+export interface UpdateRoleInput {
+  id: string;
+  code: string;
+  description: string;
+  permissions: Permission[];
+}
+
 //==============================================================
 // END Enums and Input Objects
 //==============================================================

Some files were not shown because too many files changed in this diff