{"version":3,"sources":["jsdelivr-header.js","/npm/@globalart/nestjs-swagger@1.2.6/src/constants.ts","/npm/node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/decorateMetadata.js","/npm/node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js","/npm/@globalart/nestjs-swagger@1.2.6/src/dtos/index.ts","/npm/@globalart/nestjs-swagger@1.2.6/src/decorators/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ioCCNA,MAAa,yBACX,qSAEW,mBAAqB,CAChC,YAAa,qCACb,aAAc,0BACd,UAAW,gBACX,UAAW,qBACX,SAAU,+CACV,qBAAsB,mBACtB,oBAAqB,yCACrB,sBAAuB,wBACvB,oBAAqB,mC,0KCNtB,EAAO,QAJR,SAA4B,EAAG,GAC7B,GAAuB,iBAAZ,SAAoD,mBAArB,QAAQ,SAAyB,OAAO,QAAQ,SAAS,EAAG,E,EAIrG,EAAO,QAAQ,YAAa,EAC5B,EAAO,QAAQ,QAAa,EAAO,O,0JCYrC,EAAO,QAlBR,SAAoB,EAAY,EAAQ,EAAK,GAC3C,IAOE,EAPE,EAAI,UAAU,OAChB,EACE,EAAI,EACA,EACS,OAAT,EACG,EAAO,OAAO,yBAAyB,EAAQ,GAChD,EAEV,GAAuB,iBAAZ,SAAoD,mBAArB,QAAQ,SAChD,EAAI,QAAQ,SAAS,EAAY,EAAQ,EAAK,QAE9C,IAAK,IAAI,EAAI,EAAW,OAAS,EAAG,GAAK,EAAG,KACrC,EAAI,EAAW,MAClB,GAAK,EAAI,EAAI,EAAE,GAAK,EAAI,EAAI,EAAE,EAAQ,EAAK,GAAK,EAAE,EAAQ,KAAS,GACzE,OAAO,EAAI,GAAK,GAAK,OAAO,eAAe,EAAQ,EAAK,GAAI,C,EAI3D,EAAO,QAAQ,YAAa,EAC5B,EAAO,QAAQ,QAAa,EAAO,O,gHCpBzB,qBAAb,MAC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eAEpC,CAAE,KAAM,cAAc,EAAK,cAC/B,YAAa,2BAEf,eAAe,EAAK,cAGtB,EAAW,KACT,cAAc,CACZ,YAAa,4BAKZ,mBAAmB,EAAW,S","file":"/npm/@globalart/nestjs-swagger@1.2.6/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@globalart/nestjs-swagger@1.2.6/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export const API_RESPONSE_DESCRIPTION =\n  \"If the server is available, it always responds with code 200 or 201. Error code 400 and higher will replace the ok field: it equals false and the error text in the error field. If the input data does not pass validation, the error field contains an object with invalid fields and error text\";\n\nexport const ERROR_DESCRIPTIONS = {\n  BAD_REQUEST: \"Invalid request data or parameters\",\n  UNAUTHORIZED: \"Authentication required\",\n  FORBIDDEN: \"Access denied\",\n  NOT_FOUND: \"Resource not found\",\n  CONFLICT: \"Resource already exists or conflict detected\",\n  UNPROCESSABLE_ENTITY: \"Validation error\",\n  RATE_LIMIT_EXCEEDED: \"Rate limit exceeded. Too many requests\",\n  INTERNAL_SERVER_ERROR: \"Internal server error\",\n  SERVICE_UNAVAILABLE: \"Service temporarily unavailable\",\n};\n","// Copy from https://github.com/microsoft/TypeScript/blob/d85767abfd83880cea17cea70f9913e9c4496dcc/src/compiler/factory/emitHelpers.ts#L744-L753\n\nfunction __decorateMetadata(k, v) {\n  if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n(module.exports = __decorateMetadata),\n  (module.exports.__esModule = true),\n  (module.exports[\"default\"] = module.exports);\n","// Copy from https://github.com/microsoft/TypeScript/blob/d85767abfd83880cea17cea70f9913e9c4496dcc/src/compiler/factory/emitHelpers.ts#L730-L742\n\nfunction __decorate(decorators, target, key, desc) {\n  var c = arguments.length,\n    r =\n      c < 3\n        ? target\n        : desc === null\n          ? (desc = Object.getOwnPropertyDescriptor(target, key))\n          : desc,\n    d;\n  if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n    r = Reflect.decorate(decorators, target, key, desc);\n  else\n    for (var i = decorators.length - 1; i >= 0; i--)\n      if ((d = decorators[i]))\n        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\n(module.exports = __decorate),\n  (module.exports.__esModule = true),\n  (module.exports[\"default\"] = module.exports);\n","import { ApiProperty } from \"@nestjs/swagger\";\n\nexport class PaginatedResponseDto<T> {\n  data!: T[];\n\n  @ApiProperty()\n  totalCount!: number;\n\n  @ApiProperty()\n  offset!: number;\n\n  @ApiProperty()\n  limit!: number;\n}\n","import { applyDecorators } from \"@nestjs/common\";\nimport {\n  ApiBadRequestResponse,\n  ApiConflictResponse,\n  ApiExtraModels,\n  ApiForbiddenResponse,\n  ApiInternalServerErrorResponse,\n  ApiNotFoundResponse,\n  ApiOkResponse,\n  ApiOperation,\n  ApiServiceUnavailableResponse,\n  ApiTooManyRequestsResponse,\n  ApiUnauthorizedResponse,\n  ApiUnprocessableEntityResponse,\n  getSchemaPath,\n} from \"@nestjs/swagger\";\nimport { API_RESPONSE_DESCRIPTION } from \"../constants\";\nimport { PaginatedResponseDto } from \"../dtos\";\nimport { SwaggerDocumentationOptions } from \"../interfaces\";\nimport { createHash } from \"crypto\";\n\n// SwaggerDocumentation is a decorator function to generate Swagger documentation for endpoints based on the provided options.\nexport const SwaggerDocumentation = (data: SwaggerDocumentationOptions) => {\n  const operationId =\n    data.operationId ||\n    createHash(\"md5\").update(`${data.endpointSummary}`).digest(\"hex\");\n\n  const decorators = [\n    ApiOperation({\n      operationId,\n      description: data.endpointDescription,\n      summary: data.endpointSummary,\n      deprecated: data.deprecated,\n    }),\n  ];\n\n  if (data.error400Description) {\n    decorators.push(\n      ApiBadRequestResponse({\n        description: data.error400Description,\n      })\n    );\n  }\n\n  if (data.error401Description) {\n    decorators.push(\n      ApiUnauthorizedResponse({\n        description: data.error401Description,\n      })\n    );\n  }\n\n  if (data.error403Description) {\n    decorators.push(\n      ApiForbiddenResponse({\n        description: data.error403Description,\n      })\n    );\n  }\n\n  if (data.error404Description) {\n    decorators.push(\n      ApiNotFoundResponse({\n        description: data.error404Description,\n      })\n    );\n  }\n\n  if (data.error409Description) {\n    decorators.push(\n      ApiConflictResponse({\n        description: data.error409Description,\n      })\n    );\n  }\n\n  if (data.error422Description) {\n    decorators.push(\n      ApiUnprocessableEntityResponse({\n        description: data.error422Description,\n      })\n    );\n  }\n\n  if (data.error429Description) {\n    decorators.push(\n      ApiTooManyRequestsResponse({\n        description: data.error429Description,\n      })\n    );\n  }\n\n  if (data.error500Description) {\n    decorators.push(\n      ApiInternalServerErrorResponse({\n        description: data.error500Description,\n      })\n    );\n  }\n\n  if (data.error503Description) {\n    decorators.push(\n      ApiServiceUnavailableResponse({\n        description: data.error503Description,\n      })\n    );\n  }\n\n  if (data.isPaginated && data.responseDto) {\n    decorators.push(\n      ApiOkResponse({\n        schema: {\n          allOf: [\n            { $ref: getSchemaPath(PaginatedResponseDto) },\n            {\n              properties: {\n                data: {\n                  type: \"array\",\n                  items: {\n                    $ref: getSchemaPath(data.responseDto),\n                  },\n                },\n              },\n            },\n          ],\n        },\n        description: API_RESPONSE_DESCRIPTION,\n      }),\n      ApiExtraModels(data.responseDto, PaginatedResponseDto)\n    );\n  } else if (data.responseDto) {\n    decorators.push(\n      ApiOkResponse({\n        schema: data.isArray\n          ? {\n              type: \"array\",\n              items: { $ref: getSchemaPath(data.responseDto) },\n            }\n          : { $ref: getSchemaPath(data.responseDto) },\n        description: API_RESPONSE_DESCRIPTION,\n      }),\n      ApiExtraModels(data.responseDto)\n    );\n  } else {\n    decorators.push(\n      ApiOkResponse({\n        description: API_RESPONSE_DESCRIPTION,\n      })\n    );\n  }\n\n  return applyDecorators(...decorators);\n};\n"]}