@tsed/schema 6.102.5 → 6.102.8-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/lib/cjs/constants/httpStatusMessages.js +12 -96
  2. package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
  3. package/lib/cjs/decorators/common/description.js.map +1 -1
  4. package/lib/cjs/decorators/common/ignore.js.map +1 -1
  5. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -1
  6. package/lib/cjs/decorators/operations/in.js +6 -4
  7. package/lib/cjs/decorators/operations/in.js.map +1 -1
  8. package/lib/cjs/domain/JsonMap.js.map +1 -1
  9. package/lib/cjs/domain/JsonOperation.js.map +1 -1
  10. package/lib/cjs/domain/JsonParameter.js.map +1 -1
  11. package/lib/cjs/domain/JsonResponse.js.map +1 -1
  12. package/lib/cjs/domain/JsonSchema.js.map +1 -1
  13. package/lib/cjs/index.js +135 -13
  14. package/lib/cjs/index.js.map +1 -1
  15. package/lib/cjs/package.json +3 -0
  16. package/lib/cjs/utils/from.js +9 -8
  17. package/lib/cjs/utils/from.js.map +1 -1
  18. package/lib/cjs/utils/generics.js.map +1 -1
  19. package/lib/cjs/utils/getJsonSchema.js +1 -1
  20. package/lib/cjs/utils/getJsonSchema.js.map +1 -1
  21. package/lib/cjs/utils/getSpec.js.map +1 -1
  22. package/lib/esm/components/anyMapper.js +4 -4
  23. package/lib/esm/components/classMapper.js +4 -4
  24. package/lib/esm/components/genericsMapper.js +4 -4
  25. package/lib/esm/components/inheritedClassMapper.js +2 -2
  26. package/lib/esm/components/itemMapper.js +1 -1
  27. package/lib/esm/components/lazyRefMapper.js +3 -3
  28. package/lib/esm/components/mapMapper.js +2 -2
  29. package/lib/esm/components/objectMapper.js +3 -3
  30. package/lib/esm/components/ofMapper.js +1 -1
  31. package/lib/esm/components/propertiesMapper.js +1 -1
  32. package/lib/esm/components/schemaMapper.js +6 -6
  33. package/lib/esm/constants/httpStatusMessages.js +11 -96
  34. package/lib/esm/constants/httpStatusMessages.js.map +1 -1
  35. package/lib/esm/decorators/class/children.js +1 -1
  36. package/lib/esm/decorators/collections/collectionContains.js +1 -1
  37. package/lib/esm/decorators/collections/collectionOf.js +1 -1
  38. package/lib/esm/decorators/collections/maxItems.js +1 -1
  39. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  40. package/lib/esm/decorators/collections/minItems.js +1 -1
  41. package/lib/esm/decorators/collections/minProperties.js +1 -1
  42. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  43. package/lib/esm/decorators/common/additionalProperties.js +1 -1
  44. package/lib/esm/decorators/common/allOf.js +1 -1
  45. package/lib/esm/decorators/common/allow.js +2 -2
  46. package/lib/esm/decorators/common/any.js +1 -1
  47. package/lib/esm/decorators/common/anyOf.js +1 -1
  48. package/lib/esm/decorators/common/const.js +1 -1
  49. package/lib/esm/decorators/common/customKey.js +1 -1
  50. package/lib/esm/decorators/common/default.js +1 -1
  51. package/lib/esm/decorators/common/description.js +1 -1
  52. package/lib/esm/decorators/common/description.js.map +1 -1
  53. package/lib/esm/decorators/common/enum.js +1 -1
  54. package/lib/esm/decorators/common/example.js +1 -1
  55. package/lib/esm/decorators/common/examples.js +1 -1
  56. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  57. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  58. package/lib/esm/decorators/common/format.js +2 -2
  59. package/lib/esm/decorators/common/forwardGroups.js +1 -1
  60. package/lib/esm/decorators/common/groups.js +2 -2
  61. package/lib/esm/decorators/common/ignore.js +1 -1
  62. package/lib/esm/decorators/common/ignore.js.map +1 -1
  63. package/lib/esm/decorators/common/integer.js +1 -1
  64. package/lib/esm/decorators/common/jsonEntityFn.js +1 -1
  65. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -1
  66. package/lib/esm/decorators/common/maxLength.js +1 -1
  67. package/lib/esm/decorators/common/maximum.js +1 -1
  68. package/lib/esm/decorators/common/minLength.js +1 -1
  69. package/lib/esm/decorators/common/minimum.js +1 -1
  70. package/lib/esm/decorators/common/multipleOf.js +1 -1
  71. package/lib/esm/decorators/common/name.js +1 -1
  72. package/lib/esm/decorators/common/nullable.js +2 -2
  73. package/lib/esm/decorators/common/oneOf.js +1 -1
  74. package/lib/esm/decorators/common/optional.js +1 -1
  75. package/lib/esm/decorators/common/pattern.js +1 -1
  76. package/lib/esm/decorators/common/property.js +1 -1
  77. package/lib/esm/decorators/common/readOnly.js +1 -1
  78. package/lib/esm/decorators/common/required.js +2 -2
  79. package/lib/esm/decorators/common/requiredGroups.js +2 -2
  80. package/lib/esm/decorators/common/schema.js +1 -1
  81. package/lib/esm/decorators/common/title.js +1 -1
  82. package/lib/esm/decorators/common/writeOnly.js +1 -1
  83. package/lib/esm/decorators/config/jsonEntityComponent.js +1 -1
  84. package/lib/esm/decorators/generics/genericOf.js +2 -2
  85. package/lib/esm/decorators/generics/generics.js +1 -1
  86. package/lib/esm/decorators/operations/acceptMime.js +1 -1
  87. package/lib/esm/decorators/operations/consumes.js +1 -1
  88. package/lib/esm/decorators/operations/contentType.js +1 -1
  89. package/lib/esm/decorators/operations/deprecated.js +1 -1
  90. package/lib/esm/decorators/operations/header.js +1 -1
  91. package/lib/esm/decorators/operations/in.js +3 -1
  92. package/lib/esm/decorators/operations/in.js.map +1 -1
  93. package/lib/esm/decorators/operations/inFile.js +5 -5
  94. package/lib/esm/decorators/operations/location.js +1 -1
  95. package/lib/esm/decorators/operations/operationId.js +1 -1
  96. package/lib/esm/decorators/operations/operationPath.js +1 -1
  97. package/lib/esm/decorators/operations/partial.js +1 -1
  98. package/lib/esm/decorators/operations/path.js +1 -1
  99. package/lib/esm/decorators/operations/produces.js +1 -1
  100. package/lib/esm/decorators/operations/redirect.js +2 -2
  101. package/lib/esm/decorators/operations/returns.js +8 -8
  102. package/lib/esm/decorators/operations/route.js +3 -3
  103. package/lib/esm/decorators/operations/security.js +1 -1
  104. package/lib/esm/decorators/operations/status.js +1 -1
  105. package/lib/esm/decorators/operations/summary.js +1 -1
  106. package/lib/esm/decorators/operations/tags.js +1 -1
  107. package/lib/esm/domain/DecoratorContext.js +1 -1
  108. package/lib/esm/domain/JsonClassStore.js +3 -3
  109. package/lib/esm/domain/JsonLazyRef.js +2 -2
  110. package/lib/esm/domain/JsonMap.js +1 -1
  111. package/lib/esm/domain/JsonMap.js.map +1 -1
  112. package/lib/esm/domain/JsonMethodStore.js +4 -4
  113. package/lib/esm/domain/JsonOperation.js +8 -8
  114. package/lib/esm/domain/JsonOperation.js.map +1 -1
  115. package/lib/esm/domain/JsonOperationPathsMap.js +1 -1
  116. package/lib/esm/domain/JsonOperationRoute.js +1 -1
  117. package/lib/esm/domain/JsonParameter.js +6 -6
  118. package/lib/esm/domain/JsonParameter.js.map +1 -1
  119. package/lib/esm/domain/JsonParameterStore.js +4 -4
  120. package/lib/esm/domain/JsonPropertyStore.js +3 -3
  121. package/lib/esm/domain/JsonRequestBody.js +2 -2
  122. package/lib/esm/domain/JsonResponse.js +4 -4
  123. package/lib/esm/domain/JsonResponse.js.map +1 -1
  124. package/lib/esm/domain/JsonSchema.js +6 -6
  125. package/lib/esm/domain/JsonSchema.js.map +1 -1
  126. package/lib/esm/index.js +142 -20
  127. package/lib/esm/index.js.map +1 -1
  128. package/lib/esm/package.json +3 -0
  129. package/lib/esm/utils/from.js +5 -4
  130. package/lib/esm/utils/from.js.map +1 -1
  131. package/lib/esm/utils/generics.js.map +1 -1
  132. package/lib/esm/utils/getInheritedStores.js +1 -1
  133. package/lib/esm/utils/getJsonEntityStore.js +5 -5
  134. package/lib/esm/utils/getJsonSchema.js +4 -4
  135. package/lib/esm/utils/getJsonSchema.js.map +1 -1
  136. package/lib/esm/utils/getOperationsRoutes.js +3 -3
  137. package/lib/esm/utils/getOperationsStores.js +4 -4
  138. package/lib/esm/utils/getPropertiesStores.js +3 -3
  139. package/lib/esm/utils/getRequiredProperties.js +1 -1
  140. package/lib/esm/utils/getSpec.js +6 -6
  141. package/lib/esm/utils/getSpec.js.map +1 -1
  142. package/lib/esm/utils/mapNullableType.js +1 -1
  143. package/lib/esm/utils/mapRouteOptions.js +1 -1
  144. package/lib/esm/utils/mergeOperation.js +3 -3
  145. package/lib/esm/utils/ref.js +1 -1
  146. package/lib/esm/utils/toJsonMapCollection.js +1 -1
  147. package/lib/types/constants/httpStatusMessages.d.ts +2 -263
  148. package/lib/types/decorators/common/ignore.d.ts +1 -1
  149. package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
  150. package/lib/types/decorators/operations/in.d.ts +1 -1
  151. package/lib/types/domain/JsonMap.d.ts +1 -1
  152. package/lib/types/domain/JsonOperation.d.ts +2 -1
  153. package/lib/types/domain/JsonParameter.d.ts +1 -1
  154. package/lib/types/domain/JsonResponse.d.ts +2 -1
  155. package/lib/types/domain/JsonSchema.d.ts +1 -1
  156. package/lib/types/index.d.ts +135 -13
  157. package/lib/types/utils/generics.d.ts +1 -1
  158. package/lib/types/utils/getJsonSchema.d.ts +2 -2
  159. package/lib/types/utils/getSpec.d.ts +1 -1
  160. package/package.json +21 -8
  161. package/tsconfig.compile.esm.json +1 -0
  162. package/lib/cjs/components/index.js +0 -15
  163. package/lib/cjs/components/index.js.map +0 -1
  164. package/lib/cjs/decorators/index.js +0 -79
  165. package/lib/cjs/decorators/index.js.map +0 -1
  166. package/lib/cjs/domain/index.js +0 -20
  167. package/lib/cjs/domain/index.js.map +0 -1
  168. package/lib/cjs/interfaces/index.js +0 -8
  169. package/lib/cjs/interfaces/index.js.map +0 -1
  170. package/lib/esm/components/index.js +0 -12
  171. package/lib/esm/components/index.js.map +0 -1
  172. package/lib/esm/decorators/index.js +0 -76
  173. package/lib/esm/decorators/index.js.map +0 -1
  174. package/lib/esm/domain/index.js +0 -17
  175. package/lib/esm/domain/index.js.map +0 -1
  176. package/lib/esm/interfaces/index.js +0 -5
  177. package/lib/esm/interfaces/index.js.map +0 -1
  178. package/lib/types/components/index.d.ts +0 -11
  179. package/lib/types/decorators/index.d.ts +0 -70
  180. package/lib/types/domain/index.d.ts +0 -16
  181. package/lib/types/interfaces/index.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"getSpec.js","sourceRoot":"","sources":["../../../src/utils/getSpec.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAErD,mDAA8C;AAE9C,2CAAsC;AACtC,6DAAwD;AACxD,+DAA0D;AAC1D,qDAAgD;AAChD,iEAA4D;AAoC5D;;GAEG;AACH,MAAM,MAAM,GAAqC,IAAI,GAAG,EAAE,CAAC;AAE3D;;GAEG;AACH,SAAS,GAAG,CAAC,KAAgB,EAAE,OAAY,EAAE,EAAO;IAClD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KAC9B;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KACtB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAgBD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,KAAgB,EAAE,UAAiC,EAAE;IAC3E,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACrB,OAAO,CAAC,QAAQ,GAAG,qBAAS,CAAC,OAAO,CAAC;KACtC;IAED,OAAO,GAAG;QACR,GAAG,OAAO;QACV,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,IAAA,2CAAoB,EAAC,OAAO,CAAC,kBAAkB,CAAC;QACtG,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,OAAO,CAAC,QA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AE,EAAE,CAC5B,OAAO,CAAC,oBAAqB,CAC3B,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,EAC5E,cAAc,CAAC,YAAY,EAC3B,IAAI,CACL;qBACJ,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,GAAG,IAAA,aAAM,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YAC/B,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,UAAU,GAAG;oBACpB,OAAO;iBACR,CAAC;aACH;iBAAM;gBACL,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;aAChC;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAhED,0BAgEC","sourcesContent":["import {cleanObject, Type, uniqBy} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {buildPath} from \"./buildPath\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {mergeOperation} from \"./mergeOperation\";\nimport {operationIdFormatter} from \"./operationIdFormatter\";\n\nexport interface SpecSerializerOptions extends JsonSchemaOptions {\n specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;\n /**\n * Paths\n */\n paths?: any;\n /**\n * Root path. This paths will be added to all generated paths Object.\n */\n rootPath?: string;\n /**\n * A function to generate the operationId.\n */\n operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;\n /**\n * A pattern to generate the operationId.\n */\n operationIdPattern?: string;\n}\n\nexport interface OS3SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.OPENAPI;\n}\n\nexport interface OS2SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.SWAGGER;\n}\n\n/**\n * @ignore\n */\nconst caches: Map<Type<any>, Map<string, any>> = new Map();\n\n/**\n * @ignore\n */\nfunction get(model: Type<any>, options: any, cb: any) {\n if (!caches.has(model)) {\n caches.set(model, new Map());\n }\n\n const cache = caches.get(model)!;\n const key = JSON.stringify(options);\n\n if (!cache.has(key)) {\n cache.set(key, cb());\n }\n\n return cache.get(key);\n}\n\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS3SpecSerializerOptions): Partial<OpenSpec3>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions = {}): Partial<OpenSpec2 | OpenSpec3> {\n if (!options.specType) {\n options.specType = SpecTypes.OPENAPI;\n }\n\n options = {\n ...options,\n operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),\n root: false,\n specType: options.specType\n };\n\n return get(model, options, () => {\n const store = getJsonEntityStore(model);\n const {specType = SpecTypes.OPENAPI, schemas = {}, paths = {}, rootPath = \"/\", tags = []} = options;\n const ctrlPath = store.path;\n const defaultTags = cleanObject({\n name: store.schema.getName(),\n description: store.schema.get(\"description\")\n });\n\n const specJson: any = {paths};\n\n getOperationsStores(model).forEach((operationStore) => {\n if (operationStore.store.get(\"hidden\")) {\n return;\n }\n\n const operation = operationStore.operation!.toJSON({...options, specType, schemas});\n\n operationStore.operation!.operationPaths.forEach(({path, method}: {path: string; method: string}) => {\n if (method) {\n mergeOperation(specJson, operation, {\n rootPath: buildPath(rootPath + ctrlPath),\n path,\n method,\n defaultTags,\n tags,\n specType,\n operationId: (path: string) =>\n options.operationIdFormatter!(\n operationStore.parent.schema.get(\"name\") || operationStore.parent.targetName,\n operationStore.propertyName,\n path\n )\n });\n }\n });\n });\n\n specJson.tags = uniqBy(tags, \"name\");\n\n if (Object.keys(schemas).length) {\n if (specType === SpecTypes.OPENAPI) {\n specJson.components = {\n schemas\n };\n } else {\n specJson.definitions = schemas;\n }\n }\n\n return specJson;\n });\n}\n"]}
1
+ {"version":3,"file":"getSpec.js","sourceRoot":"","sources":["../../../src/utils/getSpec.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAErD,mDAA8C;AAE9C,2CAAsC;AACtC,6DAAwD;AACxD,+DAA0D;AAC1D,qDAAgD;AAChD,iEAA4D;AAoC5D;;GAEG;AACH,MAAM,MAAM,GAAqC,IAAI,GAAG,EAAE,CAAC;AAE3D;;GAEG;AACH,SAAS,GAAG,CAAC,KAAgB,EAAE,OAAY,EAAE,EAAO;IAClD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KAC9B;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KACtB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAgBD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,KAAgB,EAAE,UAAiC,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,CAAC,CAAC,EAAC,IAAI,EAAE,MAAM,EAAiC,EAAE,EAAE;gBAClG,IAAI,MAAM,EAAE;oBACV,IAAA,+BAAc,EAAC,QAAQ,EAAE,SAAS,EAAE;wBAClC,QAAQ,EAAE,IAAA,qBAAS,EAAC,QAAQ,GAAG,QAAQ,CAAC;wBACxC,IAAI;wBACJ,MAAM;wBACN,WAAW;wBACX,IAAI;wBACJ,QAAQ;wBACR,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAC5B,OAAO,CAAC,oBAAqB,CAC3B,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,EAC5E,cAAc,CAAC,YAAY,EAC3B,IAAI,CACL;qBACJ,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,GAAG,IAAA,aAAM,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YAC/B,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,UAAU,GAAG;oBACpB,OAAO;iBACR,CAAC;aACH;iBAAM;gBACL,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;aAChC;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAhED,0BAgEC","sourcesContent":["import {cleanObject, Type, uniqBy} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {buildPath} from \"./buildPath\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {mergeOperation} from \"./mergeOperation\";\nimport {operationIdFormatter} from \"./operationIdFormatter\";\n\nexport interface SpecSerializerOptions extends JsonSchemaOptions {\n specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;\n /**\n * Paths\n */\n paths?: any;\n /**\n * Root path. This paths will be added to all generated paths Object.\n */\n rootPath?: string;\n /**\n * A function to generate the operationId.\n */\n operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;\n /**\n * A pattern to generate the operationId.\n */\n operationIdPattern?: string;\n}\n\nexport interface OS3SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.OPENAPI;\n}\n\nexport interface OS2SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.SWAGGER;\n}\n\n/**\n * @ignore\n */\nconst caches: Map<Type<any>, Map<string, any>> = new Map();\n\n/**\n * @ignore\n */\nfunction get(model: Type<any>, options: any, cb: any) {\n if (!caches.has(model)) {\n caches.set(model, new Map());\n }\n\n const cache = caches.get(model)!;\n const key = JSON.stringify(options);\n\n if (!cache.has(key)) {\n cache.set(key, cb());\n }\n\n return cache.get(key);\n}\n\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS3SpecSerializerOptions): Partial<OpenSpec3>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions = {}): Partial<OpenSpec2 | OpenSpec3> {\n if (!options.specType) {\n options.specType = SpecTypes.OPENAPI;\n }\n\n options = {\n ...options,\n operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),\n root: false,\n specType: options.specType\n };\n\n return get(model, options, () => {\n const store = getJsonEntityStore(model);\n const {specType = SpecTypes.OPENAPI, schemas = {}, paths = {}, rootPath = \"/\", tags = []} = options;\n const ctrlPath = store.path;\n const defaultTags = cleanObject({\n name: store.schema.getName(),\n description: store.schema.get(\"description\")\n });\n\n const specJson: any = {paths};\n\n getOperationsStores(model).forEach((operationStore) => {\n if (operationStore.store.get(\"hidden\")) {\n return;\n }\n\n const operation = operationStore.operation!.toJSON({...options, specType, schemas});\n\n operationStore.operation!.operationPaths.forEach(({path, method}: {path: string; method: string}) => {\n if (method) {\n mergeOperation(specJson, operation, {\n rootPath: buildPath(rootPath + ctrlPath),\n path,\n method,\n defaultTags,\n tags,\n specType,\n operationId: (path: string) =>\n options.operationIdFormatter!(\n operationStore.parent.schema.get(\"name\") || operationStore.parent.targetName,\n operationStore.propertyName,\n path\n )\n });\n }\n });\n });\n\n specJson.tags = uniqBy(tags, \"name\");\n\n if (Object.keys(schemas).length) {\n if (specType === SpecTypes.OPENAPI) {\n specJson.components = {\n schemas\n };\n } else {\n specJson.definitions = schemas;\n }\n }\n\n return specJson;\n });\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { JsonLazyRef } from "../domain/JsonLazyRef";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { mapGenericsOptions } from "../utils/generics";
4
- import { toRef } from "../utils/ref";
1
+ import { JsonLazyRef } from "../domain/JsonLazyRef.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { mapGenericsOptions } from "../utils/generics.js";
4
+ import { toRef } from "../utils/ref.js";
5
5
  export function anyMapper(input, options = {}) {
6
6
  if (typeof input !== "object" || input === null) {
7
7
  return input;
@@ -1,7 +1,7 @@
1
- import { JsonEntityStore } from "../domain/JsonEntityStore";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { mapGenericsOptions, popGenerics } from "../utils/generics";
4
- import { createRef, createRefName } from "../utils/ref";
1
+ import { JsonEntityStore } from "../domain/JsonEntityStore.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { mapGenericsOptions, popGenerics } from "../utils/generics.js";
4
+ import { createRef, createRefName } from "../utils/ref.js";
5
5
  export function classMapper(value, options) {
6
6
  const store = JsonEntityStore.from(value.class);
7
7
  const name = createRefName(store.schema.getName() || value.getName(), options);
@@ -1,8 +1,8 @@
1
1
  import { isClass, isPrimitiveClass } from "@tsed/core";
2
- import { JsonEntityStore } from "../domain/JsonEntityStore";
3
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
- import { popGenerics } from "../utils/generics";
5
- import { getJsonType } from "../utils/getJsonType";
2
+ import { JsonEntityStore } from "../domain/JsonEntityStore.js";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
4
+ import { popGenerics } from "../utils/generics.js";
5
+ import { getJsonType } from "../utils/getJsonType.js";
6
6
  /**
7
7
  * @ignore
8
8
  */
@@ -1,6 +1,6 @@
1
1
  import { classOf, deepMerge } from "@tsed/core";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { getInheritedStores } from "../utils/getInheritedStores";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { getInheritedStores } from "../utils/getInheritedStores.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function itemMapper(value, options) {
3
3
  return value && value.isClass ? execMapper("class", value, options) : execMapper("any", value, options);
4
4
  }
@@ -1,6 +1,6 @@
1
- import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
2
- import { mapGenericsOptions } from "../utils/generics";
3
- import { createRef, toRef } from "../utils/ref";
1
+ import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
+ import { mapGenericsOptions } from "../utils/generics.js";
3
+ import { createRef, toRef } from "../utils/ref.js";
4
4
  export function lazyRefMapper(input, options) {
5
5
  var _a;
6
6
  const name = input.name;
@@ -1,5 +1,5 @@
1
- import { mapGenericsOptions } from "../utils/generics";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { mapGenericsOptions } from "../utils/generics.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
3
  /**
4
4
  * Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter.
5
5
  * @param input
@@ -1,7 +1,7 @@
1
1
  import { isArray } from "@tsed/core";
2
- import { alterIgnore } from "../hooks/alterIgnore";
3
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
- import { mapNullableType } from "../utils/mapNullableType";
2
+ import { alterIgnore } from "../hooks/alterIgnore.js";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
4
+ import { mapNullableType } from "../utils/mapNullableType.js";
5
5
  /**
6
6
  * Serialize Any object to a json schema
7
7
  * @param input
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function ofMapper(input, options, parent) {
3
3
  return input.map((value) => {
4
4
  return execMapper("item", value, {
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function propertiesMapper(input, options, parent) {
3
3
  if (input.isClass) {
4
4
  return execMapper("class", input, options);
@@ -1,10 +1,10 @@
1
1
  import { isObject } from "@tsed/core";
2
- import { mapAliasedProperties } from "../domain/JsonAliasMap";
3
- import { SpecTypes } from "../domain/SpecTypes";
4
- import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
5
- import { getRequiredProperties } from "../utils/getRequiredProperties";
6
- import { alterOneOf } from "../hooks/alterOneOf";
7
- import { mapNullableType } from "../utils/mapNullableType";
2
+ import { mapAliasedProperties } from "../domain/JsonAliasMap.js";
3
+ import { SpecTypes } from "../domain/SpecTypes.js";
4
+ import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
5
+ import { getRequiredProperties } from "../utils/getRequiredProperties.js";
6
+ import { alterOneOf } from "../hooks/alterOneOf.js";
7
+ import { mapNullableType } from "../utils/mapNullableType.js";
8
8
  /**
9
9
  * @ignore
10
10
  */
@@ -1,99 +1,14 @@
1
- export const HTTP_STATUS_MESSAGES = {
2
- "100": { label: "Continue", code: "CONTINUE" },
3
- "101": { label: "Switching Protocols", code: "SWITCHING_PROTOCOLS" },
4
- "102": { label: "Processing", code: "PROCESSING" },
5
- "103": { label: "Early Hints", code: "EARLY_HINTS" },
6
- "200": { label: "Success", code: "SUCCESS" },
7
- "201": { label: "Created", code: "CREATED" },
8
- "202": { label: "Accepted", code: "ACCEPTED" },
9
- "203": {
10
- label: "Non-Authoritative Information",
11
- code: "NON_AUTHORITATIVE_INFORMATION"
12
- },
13
- "204": { label: "No Content", code: "NO_CONTENT" },
14
- "205": { label: "Reset Content", code: "RESET_CONTENT" },
15
- "206": { label: "Partial Content", code: "PARTIAL_CONTENT" },
16
- "207": { label: "Multi-Status", code: "MULTI_STATUS" },
17
- "208": { label: "Already Reported", code: "ALREADY_REPORTED" },
18
- "226": { label: "IM Used", code: "IM_USED" },
19
- "300": { label: "Multiple Choices", code: "MULTIPLE_CHOICES" },
20
- "301": { label: "Moved Permanently", code: "MOVED_PERMANENTLY" },
21
- "302": { label: "Found", code: "FOUND" },
22
- "303": { label: "See Other", code: "SEE_OTHER" },
23
- "304": { label: "Not Modified", code: "NOT_MODIFIED" },
24
- "305": { label: "Use Proxy", code: "USE_PROXY" },
25
- "306": { label: "(Unused)", code: "UNUSED" },
26
- "307": { label: "Temporary Redirect", code: "TEMPORARY_REDIRECT" },
27
- "308": { label: "Permanent Redirect", code: "PERMANENT_REDIRECT" },
28
- "310": { label: "Too Many Redirects", code: "TOO_MANY_REDIRECTS" },
29
- "400": { label: "Bad Request", code: "BAD_REQUEST" },
30
- "401": { label: "Unauthorized", code: "UNAUTHORIZED" },
31
- "402": { label: "Payment Required", code: "PAYMENT_REQUIRED" },
32
- "403": { label: "Forbidden", code: "FORBIDDEN" },
33
- "404": { label: "Not Found", code: "NOT_FOUND" },
34
- "405": { label: "Method Not Allowed", code: "METHOD_NOT_ALLOWED" },
35
- "406": { label: "Not Acceptable", code: "NOT_ACCEPTABLE" },
36
- "407": {
37
- label: "Proxy Authentication Required",
38
- code: "PROXY_AUTHENTICATION_REQUIRED"
39
- },
40
- "408": { label: "Request Timeout", code: "REQUEST_TIMEOUT" },
41
- "409": { label: "Conflict", code: "CONFLICT" },
42
- "410": { label: "Gone", code: "GONE" },
43
- "411": { label: "Length Required", code: "LENGTH_REQUIRED" },
44
- "412": { label: "Precondition Failed", code: "PRECONDITION_FAILED" },
45
- "413": {
46
- label: "Request Entity Too Large",
47
- code: "REQUEST_ENTITY_TOO_LARGE"
48
- },
49
- "414": { label: "Request URI Too Long", code: "REQUEST_URI_TOO_LONG" },
50
- "415": { label: "Unsupported Media Type", code: "UNSUPPORTED_MEDIA_TYPE" },
51
- "416": {
52
- label: "Request Range Unsatisfiable",
53
- code: "REQUEST_RANGE_UNSATISFIABLE"
54
- },
55
- "417": { label: "Expectation Failed", code: "EXPECTATION_FAILED" },
56
- "418": { label: "I'm a Teapot", code: "I_M_A_TEAPOT" },
57
- "421": { label: "Misdirected Request", code: "MISDIRECTED_REQUEST" },
58
- "422": { label: "Unprocessable Entity", code: "UNPROCESSABLE_ENTITY" },
59
- "423": { label: "Locked", code: "LOCKED" },
60
- "424": { label: "Failed Dependency", code: "FAILED_DEPENDENCY" },
61
- "425": { label: "Too Early", code: "TOO_EARLY" },
62
- "426": { label: "Upgrade Required", code: "UPGRADE_REQUIRED" },
63
- "427": { label: "Unassigned", code: "UNASSIGNED" },
64
- "428": { label: "Precondition Required", code: "PRECONDITION_REQUIRED" },
65
- "429": { label: "Too Many Requests", code: "TOO_MANY_REQUESTS" },
66
- "430": { label: "Unassigned", code: "UNASSIGNED" },
67
- "431": {
68
- label: "Request Header Fields Too Large",
69
- code: "REQUEST_HEADER_FIELDS_TOO_LARGE"
70
- },
71
- "451": {
72
- label: "Unavailable For Legal Reasons",
73
- code: "UNAVAILABLE_FOR_LEGAL_REASONS"
74
- },
75
- "500": { label: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" },
76
- "501": { label: "Not Implemented", code: "NOT_IMPLEMENTED" },
77
- "502": { label: "Bad Gateway", code: "BAD_GATEWAY" },
78
- "503": { label: "Service Unavailable", code: "SERVICE_UNAVAILABLE" },
79
- "504": { label: "Gateway Timeout", code: "GATEWAY_TIMEOUT" },
80
- "505": {
81
- label: "HTTP Version Not Supported",
82
- code: "HTTP_VERSION_NOT_SUPPORTED"
83
- },
84
- "506": { label: "Variant Also Negotiates", code: "VARIANT_ALSO_NEGOTIATES" },
85
- "507": { label: "Insufficient Storage", code: "INSUFFICIENT_STORAGE" },
86
- "508": { label: "Loop Detected", code: "LOOP_DETECTED" },
87
- "509": {
88
- label: "Bandwidth Limit Exceeded",
89
- code: "BANDWIDTH_LIMIT_EXCEEDED"
90
- },
91
- "510": { label: "Not Extended", code: "NOT_EXTENDED" },
92
- "511": {
93
- label: "Network Authentication Required",
94
- code: "NETWORK_AUTHENTICATION_REQUIRED"
95
- }
96
- };
1
+ import statuses from "statuses";
2
+ import { constantCase } from "change-case";
3
+ export const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map, code) => {
4
+ const message = String(statuses(code));
5
+ return {
6
+ ...map,
7
+ [String(code)]: { label: message, code: constantCase(message) }
8
+ };
9
+ }, {});
10
+ HTTP_STATUS_MESSAGES["200"].label = "Success";
11
+ HTTP_STATUS_MESSAGES["200"].code = "SUCCESS";
97
12
  export function getStatusConstant(status) {
98
13
  var _a;
99
14
  return (_a = HTTP_STATUS_MESSAGES[status]) === null || _a === void 0 ? void 0 : _a.code;
@@ -1 +1 @@
1
- {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE,EAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,EAAC;IAClE,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAC;IAClD,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE;QACL,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,+BAA+B;KACtC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAC;IAC1D,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAA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AI,EAAE,4BAA4B;KACnC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,yBAAyB,EAAC;IAC1E,KAAK,EAAE,EAAC,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAsB,EAAC;IACpE,KAAK,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE;QACL,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,0BAA0B;KACjC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAC;IACpD,KAAK,EAAE;QACL,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,iCAAiC;KACxC;CACF,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC","sourcesContent":["export const HTTP_STATUS_MESSAGES = {\n \"100\": {label: \"Continue\", code: \"CONTINUE\"},\n \"101\": {label: \"Switching Protocols\", code: \"SWITCHING_PROTOCOLS\"},\n \"102\": {label: \"Processing\", code: \"PROCESSING\"},\n \"103\": {label: \"Early Hints\", code: \"EARLY_HINTS\"},\n \"200\": {label: \"Success\", code: \"SUCCESS\"},\n \"201\": {label: \"Created\", code: \"CREATED\"},\n \"202\": {label: \"Accepted\", code: \"ACCEPTED\"},\n \"203\": {\n label: \"Non-Authoritative Information\",\n code: \"NON_AUTHORITATIVE_INFORMATION\"\n },\n \"204\": {label: \"No Content\", code: \"NO_CONTENT\"},\n \"205\": {label: \"Reset Content\", code: \"RESET_CONTENT\"},\n \"206\": {label: \"Partial Content\", code: \"PARTIAL_CONTENT\"},\n \"207\": {label: \"Multi-Status\", code: \"MULTI_STATUS\"},\n \"208\": {label: \"Already Reported\", code: \"ALREADY_REPORTED\"},\n \"226\": {label: \"IM Used\", code: \"IM_USED\"},\n \"300\": {label: \"Multiple Choices\", code: \"MULTIPLE_CHOICES\"},\n \"301\": {label: \"Moved Permanently\", code: \"MOVED_PERMANENTLY\"},\n \"302\": {label: \"Found\", code: \"FOUND\"},\n \"303\": {label: \"See Other\", code: \"SEE_OTHER\"},\n \"304\": {label: \"Not Modified\", code: \"NOT_MODIFIED\"},\n \"305\": {label: \"Use Proxy\", code: \"USE_PROXY\"},\n \"306\": {label: \"(Unused)\", code: \"UNUSED\"},\n \"307\": {label: \"Temporary Redirect\", code: \"TEMPORARY_REDIRECT\"},\n \"308\": {label: \"Permanent Redirect\", code: \"PERMANENT_REDIRECT\"},\n \"310\": {label: \"Too Many Redirects\", code: \"TOO_MANY_REDIRECTS\"},\n \"400\": {label: \"Bad Request\", code: \"BAD_REQUEST\"},\n \"401\": {label: \"Unauthorized\", code: \"UNAUTHORIZED\"},\n \"402\": {label: \"Payment Required\", code: \"PAYMENT_REQUIRED\"},\n \"403\": {label: \"Forbidden\", code: \"FORBIDDEN\"},\n \"404\": {label: \"Not Found\", code: \"NOT_FOUND\"},\n \"405\": {label: \"Method Not Allowed\", code: \"METHOD_NOT_ALLOWED\"},\n \"406\": {label: \"Not Acceptable\", code: \"NOT_ACCEPTABLE\"},\n \"407\": {\n label: \"Proxy Authentication Required\",\n code: \"PROXY_AUTHENTICATION_REQUIRED\"\n },\n \"408\": {label: \"Request Timeout\", code: \"REQUEST_TIMEOUT\"},\n \"409\": {label: \"Conflict\", code: \"CONFLICT\"},\n \"410\": {label: \"Gone\", code: \"GONE\"},\n \"411\": {label: \"Length Required\", code: \"LENGTH_REQUIRED\"},\n \"412\": {label: \"Precondition Failed\", code: \"PRECONDITION_FAILED\"},\n \"413\": {\n label: \"Request Entity Too Large\",\n code: \"REQUEST_ENTITY_TOO_LARGE\"\n },\n \"414\": {label: \"Request URI Too Long\", code: \"REQUEST_URI_TOO_LONG\"},\n \"415\": {label: \"Unsupported Media Type\", code: \"UNSUPPORTED_MEDIA_TYPE\"},\n \"416\": {\n label: \"Request Range Unsatisfiable\",\n code: \"REQUEST_RANGE_UNSATISFIABLE\"\n },\n \"417\": {label: \"Expectation Failed\", code: \"EXPECTATION_FAILED\"},\n \"418\": {label: \"I'm a Teapot\", code: \"I_M_A_TEAPOT\"},\n \"421\": {label: \"Misdirected Request\", code: \"MISDIRECTED_REQUEST\"},\n \"422\": {label: \"Unprocessable Entity\", code: \"UNPROCESSABLE_ENTITY\"},\n \"423\": {label: \"Locked\", code: \"LOCKED\"},\n \"424\": {label: \"Failed Dependency\", code: \"FAILED_DEPENDENCY\"},\n \"425\": {label: \"Too Early\", code: \"TOO_EARLY\"},\n \"426\": {label: \"Upgrade Required\", code: \"UPGRADE_REQUIRED\"},\n \"427\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"428\": {label: \"Precondition Required\", code: \"PRECONDITION_REQUIRED\"},\n \"429\": {label: \"Too Many Requests\", code: \"TOO_MANY_REQUESTS\"},\n \"430\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"431\": {\n label: \"Request Header Fields Too Large\",\n code: \"REQUEST_HEADER_FIELDS_TOO_LARGE\"\n },\n \"451\": {\n label: \"Unavailable For Legal Reasons\",\n code: \"UNAVAILABLE_FOR_LEGAL_REASONS\"\n },\n \"500\": {label: \"Internal Server Error\", code: \"INTERNAL_SERVER_ERROR\"},\n \"501\": {label: \"Not Implemented\", code: \"NOT_IMPLEMENTED\"},\n \"502\": {label: \"Bad Gateway\", code: \"BAD_GATEWAY\"},\n \"503\": {label: \"Service Unavailable\", code: \"SERVICE_UNAVAILABLE\"},\n \"504\": {label: \"Gateway Timeout\", code: \"GATEWAY_TIMEOUT\"},\n \"505\": {\n label: \"HTTP Version Not Supported\",\n code: \"HTTP_VERSION_NOT_SUPPORTED\"\n },\n \"506\": {label: \"Variant Also Negotiates\", code: \"VARIANT_ALSO_NEGOTIATES\"},\n \"507\": {label: \"Insufficient Storage\", code: \"INSUFFICIENT_STORAGE\"},\n \"508\": {label: \"Loop Detected\", code: \"LOOP_DETECTED\"},\n \"509\": {\n label: \"Bandwidth Limit Exceeded\",\n code: \"BANDWIDTH_LIMIT_EXCEEDED\"\n },\n \"510\": {label: \"Not Extended\", code: \"NOT_EXTENDED\"},\n \"511\": {\n label: \"Network Authentication Required\",\n code: \"NETWORK_AUTHENTICATION_REQUIRED\"\n }\n};\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
1
+ {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAkD,EAAE,IAAY,EAAE,EAAE;IAC7H,MAAM,OAAO,GAAW,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,OAAO;QACL,GAAG,GAAG;QACN,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAC;KAC9D,CAAC;AACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AAEP,oBAAoB,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC9C,oBAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;AAE7C,MAAM,UAAU,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC","sourcesContent":["import statuses from \"statuses\";\nimport {constantCase} from \"change-case\";\n\nexport const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map: Record<string, {label: string; code: string}>, code: number) => {\n const message: string = String(statuses(code));\n return {\n ...map,\n [String(code)]: {label: message, code: constantCase(message)}\n };\n}, {});\n\nHTTP_STATUS_MESSAGES[\"200\"].label = \"Success\";\nHTTP_STATUS_MESSAGES[\"200\"].code = \"SUCCESS\";\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Store } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add Children class to compose routes
5
5
  *
@@ -1,4 +1,4 @@
1
- import { CollectionOf } from "./collectionOf";
1
+ import { CollectionOf } from "./collectionOf.js";
2
2
  /**
3
3
  * Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityStore } from "../../domain/JsonEntityStore";
1
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
2
  /**
3
3
  * Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * The value `maxItems` MUST be a non-negative integer.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An object instance is valid against `maxProperties` if its number of properties is less than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An array instance is valid against `minItems` if its size is greater than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An object instance is valid against `minProperties` if its number of properties is less than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Accept unknown properties on the deserialized model.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { DecoratorTypes, isClass, useDecorators } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
3
- import { Property } from "./property";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
+ import { Property } from "./property.js";
4
4
  /**
5
5
  * Add allowed values when the property or parameters is required.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set the type of the array items.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The const keyword is used to restrict a value to a fixed value.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set a custom key on JsonSchema that is not a part of the official spec.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * There are no restrictions placed on the value of this keyword.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { decoratorTypeOf, DecoratorTypes } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * Add a description to the class, method or property
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../src/decorators/common/description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB;IAC1C,OAAO,YAAY,CAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;;QACxE,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,cAAc,CAAC,IAAI,CAAC;YACzB,KAAK,cAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACtC,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACjE,MAAM;YAER,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAC,KAAyB,CAAC,SAAS,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;gBAC/D,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonMethodStore, JsonParameterStore} from \"../../domain\";\n\n/**\n * Add a description to the class, method or property\n *\n * ## Examples\n * ### On class\n *\n * ```typescript\n * @Description(\"description\")\n * class Model {\n *\n * }\n * ```\n *\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * @Description(\"description\")\n * async method() {}\n * }\n * ```\n *\n * ### On parameter\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * async method(@Description(\"description\") @PathParam(\"id\") id: string) {}\n * }\n * ```\n *\n * ### On property\n *\n * ```typescript\n * class Model {\n * @Description(\"description\")\n * id: string;\n * }\n * ```\n *\n * @param {string} description\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @methodDecorator\n * @propertyDecorator\n * @parameterDecorator\n */\nexport function Description(description: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PROP:\n case DecoratorTypes.CLASS:\n store.schema.description(description);\n break;\n\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.description(description);\n break;\n\n case DecoratorTypes.METHOD:\n (store as JsonMethodStore).operation?.description(description);\n break;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../src/decorators/common/description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB;IAC1C,OAAO,YAAY,CAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;;QACxE,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,cAAc,CAAC,IAAI,CAAC;YACzB,KAAK,cAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACtC,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACjE,MAAM;YAER,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAC,KAAyB,CAAC,SAAS,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;gBAC/D,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonMethodStore} from \"../../domain/JsonMethodStore\";\nimport type {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add a description to the class, method or property\n *\n * ## Examples\n * ### On class\n *\n * ```typescript\n * @Description(\"description\")\n * class Model {\n *\n * }\n * ```\n *\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * @Description(\"description\")\n * async method() {}\n * }\n * ```\n *\n * ### On parameter\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * async method(@Description(\"description\") @PathParam(\"id\") id: string) {}\n * }\n * ```\n *\n * ### On property\n *\n * ```typescript\n * class Model {\n * @Description(\"description\")\n * id: string;\n * }\n * ```\n *\n * @param {string} description\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @methodDecorator\n * @propertyDecorator\n * @parameterDecorator\n */\nexport function Description(description: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PROP:\n case DecoratorTypes.CLASS:\n store.schema.description(description);\n break;\n\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.description(description);\n break;\n\n case DecoratorTypes.METHOD:\n (store as JsonMethodStore).operation?.description(description);\n break;\n }\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  export function Enum(enumValue, ...enumValues) {
3
3
  return JsonEntityFn((store) => {
4
4
  store.itemSchema.enum(enumValue, ...enumValues);
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Add a example metadata on the decorated element.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Add a examples metadata on the decorated element.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Maximum } from "./maximum";
1
+ import { Maximum } from "./maximum.js";
2
2
  /**
3
3
  * The value of `exclusiveMaximum` MUST be number, representing an exclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Minimum } from "./minimum";
1
+ import { Minimum } from "./minimum.js";
2
2
  /**
3
3
  * The value of `exclusiveMinimum` MUST be number, representing an exclusive upper limit for a numeric instance.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { JsonFormatTypes } from "../../domain/JsonFormatTypes";
2
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonFormatTypes } from "../../domain/JsonFormatTypes.js";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * The following formats are supported for string validation with `format` keyword:
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Allow to forward group on specific property.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { DecoratorTypes } from "@tsed/core";
2
- import { matchGroups } from "../../utils/matchGroups";
3
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { matchGroups } from "../../utils/matchGroups.js";
3
+ import { JsonEntityFn } from "./jsonEntityFn.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * @ignore
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/decorators/common/ignore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,UAAU,MAAM,CAAC,KAA+B,SAAS;IAC7D,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {IgnoreCallback} from \"../../interfaces\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * @ignore\n */\nconst defaultCB = (value: any, ctx: any) => ctx.mongoose !== true;\n\n/**\n * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.\n *\n * ::: warning\n * Swagger will not generate documentation for the ignored property.\n * :::\n *\n * ```typescript\n * class User {\n * @Ignore()\n * _id: string;\n *\n * @Property()\n * firstName: string;\n *\n * @Property()\n * lastName: string;\n *\n * @Ignore((value, ctx) => !ctx.mongoose) // don't ignore prop only if mongoose\n * password: string;\n * }\n * ```\n *\n * The controller:\n * ```typescript\n * import {Post, Controller, BodyParams} from \"@tsed/common\";\n * import {Person} from \"../models/Person\";\n *\n * @Controller(\"/\")\n * export class UsersCtrl {\n * @Get(\"/\")\n * get(): User {\n * const user = new User();\n * user._id = \"12345\";\n * user.firstName = \"John\";\n * user.lastName = \"Doe\";\n * user.password = \"secretpassword\";\n * return\n * }\n * }\n * ```\n *\n * The expected json object:\n *\n * ```json\n * {\n * \"firstName\": \"John\",\n * \"lastName\": \"Doe\"\n * }\n * ```\n * @param cb Callback to know if the property must be ignored\n * @decorator\n * @validation\n * @swagger\n * @schema\n */\nexport function Ignore(cb: boolean | IgnoreCallback = defaultCB) {\n return JsonEntityFn((store) => {\n store.schema.ignore(cb);\n });\n}\n"]}
1
+ {"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/decorators/common/ignore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,UAAU,MAAM,CAAC,KAA+B,SAAS;IAC7D,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {IgnoreCallback} from \"../../interfaces/IgnoreCallback\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * @ignore\n */\nconst defaultCB = (value: any, ctx: any) => ctx.mongoose !== true;\n\n/**\n * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.\n *\n * ::: warning\n * Swagger will not generate documentation for the ignored property.\n * :::\n *\n * ```typescript\n * class User {\n * @Ignore()\n * _id: string;\n *\n * @Property()\n * firstName: string;\n *\n * @Property()\n * lastName: string;\n *\n * @Ignore((value, ctx) => !ctx.mongoose) // don't ignore prop only if mongoose\n * password: string;\n * }\n * ```\n *\n * The controller:\n * ```typescript\n * import {Post, Controller, BodyParams} from \"@tsed/common\";\n * import {Person} from \"../models/Person\";\n *\n * @Controller(\"/\")\n * export class UsersCtrl {\n * @Get(\"/\")\n * get(): User {\n * const user = new User();\n * user._id = \"12345\";\n * user.firstName = \"John\";\n * user.lastName = \"Doe\";\n * user.password = \"secretpassword\";\n * return\n * }\n * }\n * ```\n *\n * The expected json object:\n *\n * ```json\n * {\n * \"firstName\": \"John\",\n * \"lastName\": \"Doe\"\n * }\n * ```\n * @param cb Callback to know if the property must be ignored\n * @decorator\n * @validation\n * @swagger\n * @schema\n */\nexport function Ignore(cb: boolean | IgnoreCallback = defaultCB) {\n return JsonEntityFn((store) => {\n store.schema.ignore(cb);\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set integer type.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { getJsonEntityStore } from "../../utils/getJsonEntityStore";
1
+ import { getJsonEntityStore } from "../../utils/getJsonEntityStore.js";
2
2
  /**
3
3
  * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"jsonEntityFn.js","sourceRoot":"","sources":["../../../../src/decorators/common/jsonEntityFn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAC1B,EAAuD;IAEvD,OAAO,CAAC,GAAG,UAA+B,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAQ,EAAE,CAAC,kBAAkB,CAAI,GAAG,UAAU,CAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport type {JsonEntityStore} from \"../../domain\";\nimport {getJsonEntityStore} from \"../../utils/getJsonEntityStore\";\n\n/**\n * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.\n *\n * ## Usage\n *\n * ```typescript\n * export function Description(description: any) {\n * return JsonEntityFn((entity: JsonEntityStore, args: DecoratorParameters) => {\n * entity.itemSchema.description(description)\n * });\n * }\n * ```\n *\n * @param fn\n * @decorator\n * @utils\n * @model\n */\nexport function JsonEntityFn<T extends JsonEntityStore = JsonEntityStore>(\n fn: (entity: T, parameters: DecoratorParameters) => any\n): (...args: any[]) => any {\n return (...parameters: DecoratorParameters) => {\n const result: any = fn(getJsonEntityStore<T>(...parameters) as T, parameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"jsonEntityFn.js","sourceRoot":"","sources":["../../../../src/decorators/common/jsonEntityFn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAC1B,EAAuD;IAEvD,OAAO,CAAC,GAAG,UAA+B,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAQ,EAAE,CAAC,kBAAkB,CAAI,GAAG,UAAU,CAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport type {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {getJsonEntityStore} from \"../../utils/getJsonEntityStore\";\n\n/**\n * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.\n *\n * ## Usage\n *\n * ```typescript\n * export function Description(description: any) {\n * return JsonEntityFn((entity: JsonEntityStore, args: DecoratorParameters) => {\n * entity.itemSchema.description(description)\n * });\n * }\n * ```\n *\n * @param fn\n * @decorator\n * @utils\n * @model\n */\nexport function JsonEntityFn<T extends JsonEntityStore = JsonEntityStore>(\n fn: (entity: T, parameters: DecoratorParameters) => any\n): (...args: any[]) => any {\n return (...parameters: DecoratorParameters) => {\n const result: any = fn(getJsonEntityStore<T>(...parameters) as T, parameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The value of `maximum` MUST be a number, representing an inclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  *
4
4
  * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * A numeric instance is valid only if division by this keyword's value results in an integer.
4
4
  *