text: "use strict";
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  var __param = (this && this.__param) || function (paramIndex, decorator) {
      return function (target, key) { decorator(target, key, paramIndex); }
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CountryResolver = void 0;
  const graphql_1 = require("@nestjs/graphql");
  const generated_types_1 = require("@vendure/common/lib/generated-types");
  const country_service_1 = require("../../../service/services/country.service");
  const request_context_1 = require("../../common/request-context");
  const allow_decorator_1 = require("../../decorators/allow.decorator");
  const request_context_decorator_1 = require("../../decorators/request-context.decorator");
  const transaction_decorator_1 = require("../../decorators/transaction.decorator");
  let CountryResolver = class CountryResolver {
      constructor(countryService) {
          this.countryService = countryService;
      }
      countries(ctx, args) {
          return this.countryService.findAll(ctx, args.options || undefined);
      }
      async country(ctx, args) {
          return this.countryService.findOne(ctx, args.id);
      }
      async createCountry(ctx, args) {
          return this.countryService.create(ctx, args.input);
      }
      async updateCountry(ctx, args) {
          return this.countryService.update(ctx, args.input);
      }
      async deleteCountry(ctx, args) {
          return this.countryService.delete(ctx, args.id);
      }
  };
  __decorate([
      graphql_1.Query(),
      allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadCountry),
      __param(0, request_context_decorator_1.Ctx()),
      __param(1, graphql_1.Args()),
      __metadata("design:type", Function),
      __metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
      __metadata("design:returntype", Promise)
  ], CountryResolver.prototype, "countries", null);
  __decorate([
      graphql_1.Query(),
      allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadCountry),
      __param(0, request_context_decorator_1.Ctx()),
      __param(1, graphql_1.Args()),
      __metadata("design:type", Function),
      __metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
      __metadata("design:returntype", Promise)
  ], CountryResolver.prototype, "country", null);
  __decorate([
      transaction_decorator_1.Transaction(),
      graphql_1.Mutation(),
      allow_decorator_1.Allow(generated_types_1.Permission.CreateSettings, generated_types_1.Permission.CreateCountry),
      __param(0, request_context_decorator_1.Ctx()),
      __param(1, graphql_1.Args()),
      __metadata("design:type", Function),
      __metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
      __metadata("design:returntype", Promise)
  ], CountryResolver.prototype, "createCountry", null);
  __decorate([
      transaction_decorator_1.Transaction(),
      graphql_1.Mutation(),
      allow_decorator_1.Allow(generated_types_1.Permission.UpdateSettings, generated_types_1.Permission.UpdateCountry),
      __param(0, request_context_decorator_1.Ctx()),
      __param(1, graphql_1.Args()),
      __metadata("design:type", Function),
      __metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
      __metadata("design:returntype", Promise)
  ], CountryResolver.prototype, "updateCountry", null);
  __decorate([
      transaction_decorator_1.Transaction(),
      graphql_1.Mutation(),
      allow_decorator_1.Allow(generated_types_1.Permission.DeleteSettings, generated_types_1.Permission.DeleteCountry),
      __param(0, request_context_decorator_1.Ctx()),
      __param(1, graphql_1.Args()),
      __metadata("design:type", Function),
      __metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
      __metadata("design:returntype", Promise)
  ], CountryResolver.prototype, "deleteCountry", null);
  CountryResolver = __decorate([
      graphql_1.Resolver('Country'),
      __metadata("design:paramtypes", [country_service_1.CountryService])
  ], CountryResolver);
  exports.CountryResolver = CountryResolver;
  //# sourceMappingURL=country.resolver.js.map