@autofleet/sadot 1.6.16 → 1.6.18-beta.0

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 (470) hide show
  1. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorate.mjs +10 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorateMetadata.mjs +7 -0
  3. package/dist/_virtual/rolldown_runtime.mjs +22 -0
  4. package/dist/index.d.mts +26 -0
  5. package/dist/index.mjs +66 -0
  6. package/dist/node_modules/accepts/index.mjs +175 -0
  7. package/dist/node_modules/array-flatten/array-flatten.mjs +56 -0
  8. package/dist/node_modules/body-parser/index.mjs +135 -0
  9. package/dist/node_modules/body-parser/lib/read.mjs +164 -0
  10. package/dist/node_modules/body-parser/lib/types/json.mjs +200 -0
  11. package/dist/node_modules/body-parser/lib/types/raw.mjs +85 -0
  12. package/dist/node_modules/body-parser/lib/types/text.mjs +101 -0
  13. package/dist/node_modules/body-parser/lib/types/urlencoded.mjs +217 -0
  14. package/dist/node_modules/body-parser/node_modules/qs/lib/formats.mjs +29 -0
  15. package/dist/node_modules/body-parser/node_modules/qs/lib/index.mjs +21 -0
  16. package/dist/node_modules/body-parser/node_modules/qs/lib/parse.mjs +182 -0
  17. package/dist/node_modules/body-parser/node_modules/qs/lib/stringify.mjs +187 -0
  18. package/dist/node_modules/body-parser/node_modules/qs/lib/utils.mjs +173 -0
  19. package/dist/node_modules/bytes/index.mjs +121 -0
  20. package/dist/node_modules/call-bind-apply-helpers/actualApply.mjs +20 -0
  21. package/dist/node_modules/call-bind-apply-helpers/functionApply.mjs +12 -0
  22. package/dist/node_modules/call-bind-apply-helpers/functionCall.mjs +12 -0
  23. package/dist/node_modules/call-bind-apply-helpers/index.mjs +23 -0
  24. package/dist/node_modules/call-bind-apply-helpers/reflectApply.mjs +12 -0
  25. package/dist/node_modules/call-bound/index.mjs +22 -0
  26. package/dist/node_modules/content-disposition/index.mjs +309 -0
  27. package/dist/node_modules/content-type/index.mjs +151 -0
  28. package/dist/node_modules/cookie/index.mjs +245 -0
  29. package/dist/node_modules/cookie-signature/index.mjs +48 -0
  30. package/dist/node_modules/debug/node_modules/has-flag/index.mjs +17 -0
  31. package/dist/node_modules/debug/node_modules/supports-color/index.mjs +70 -0
  32. package/dist/node_modules/debug/src/browser.mjs +203 -0
  33. package/dist/node_modules/debug/src/common.mjs +209 -0
  34. package/dist/node_modules/debug/src/index.mjs +18 -0
  35. package/dist/node_modules/debug/src/node.mjs +215 -0
  36. package/dist/node_modules/depd/index.mjs +316 -0
  37. package/dist/node_modules/destroy/index.mjs +155 -0
  38. package/dist/node_modules/dunder-proto/get.mjs +27 -0
  39. package/dist/node_modules/ee-first/index.mjs +75 -0
  40. package/dist/node_modules/encodeurl/index.mjs +56 -0
  41. package/dist/node_modules/es-define-property/index.mjs +18 -0
  42. package/dist/node_modules/es-errors/eval.mjs +12 -0
  43. package/dist/node_modules/es-errors/index.mjs +12 -0
  44. package/dist/node_modules/es-errors/range.mjs +12 -0
  45. package/dist/node_modules/es-errors/ref.mjs +12 -0
  46. package/dist/node_modules/es-errors/syntax.mjs +12 -0
  47. package/dist/node_modules/es-errors/type.mjs +12 -0
  48. package/dist/node_modules/es-errors/uri.mjs +12 -0
  49. package/dist/node_modules/es-object-atoms/index.mjs +12 -0
  50. package/dist/node_modules/escape-html/index.mjs +67 -0
  51. package/dist/node_modules/etag/index.mjs +82 -0
  52. package/dist/node_modules/express/index.mjs +19 -0
  53. package/dist/node_modules/express/lib/application.mjs +503 -0
  54. package/dist/node_modules/express/lib/express.mjs +114 -0
  55. package/dist/node_modules/express/lib/middleware/init.mjs +44 -0
  56. package/dist/node_modules/express/lib/middleware/query.mjs +47 -0
  57. package/dist/node_modules/express/lib/request.mjs +422 -0
  58. package/dist/node_modules/express/lib/response.mjs +867 -0
  59. package/dist/node_modules/express/lib/router/index.mjs +424 -0
  60. package/dist/node_modules/express/lib/router/layer.mjs +140 -0
  61. package/dist/node_modules/express/lib/router/route.mjs +158 -0
  62. package/dist/node_modules/express/lib/utils.mjs +247 -0
  63. package/dist/node_modules/express/lib/view.mjs +135 -0
  64. package/dist/node_modules/express/node_modules/qs/lib/formats.mjs +29 -0
  65. package/dist/node_modules/express/node_modules/qs/lib/index.mjs +21 -0
  66. package/dist/node_modules/express/node_modules/qs/lib/parse.mjs +182 -0
  67. package/dist/node_modules/express/node_modules/qs/lib/stringify.mjs +187 -0
  68. package/dist/node_modules/express/node_modules/qs/lib/utils.mjs +173 -0
  69. package/dist/node_modules/finalhandler/index.mjs +234 -0
  70. package/dist/node_modules/forwarded/index.mjs +67 -0
  71. package/dist/node_modules/fresh/index.mjs +96 -0
  72. package/dist/node_modules/function-bind/implementation.mjs +58 -0
  73. package/dist/node_modules/function-bind/index.mjs +13 -0
  74. package/dist/node_modules/get-intrinsic/index.mjs +357 -0
  75. package/dist/node_modules/get-proto/Object.getPrototypeOf.mjs +14 -0
  76. package/dist/node_modules/get-proto/Reflect.getPrototypeOf.mjs +12 -0
  77. package/dist/node_modules/get-proto/index.mjs +25 -0
  78. package/dist/node_modules/gopd/gOPD.mjs +12 -0
  79. package/dist/node_modules/gopd/index.mjs +19 -0
  80. package/dist/node_modules/has-symbols/index.mjs +21 -0
  81. package/dist/node_modules/has-symbols/shams.mjs +35 -0
  82. package/dist/node_modules/hasown/index.mjs +16 -0
  83. package/dist/node_modules/http-errors/index.mjs +207 -0
  84. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.mjs +321 -0
  85. package/dist/node_modules/iconv-lite/encodings/dbcs-data.mjs +126 -0
  86. package/dist/node_modules/iconv-lite/encodings/index.mjs +32 -0
  87. package/dist/node_modules/iconv-lite/encodings/internal.mjs +135 -0
  88. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.mjs +53 -0
  89. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.mjs +458 -0
  90. package/dist/node_modules/iconv-lite/encodings/sbcs-data.mjs +150 -0
  91. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.mjs +172 -0
  92. package/dist/node_modules/iconv-lite/encodings/tables/cp936.mjs +2587 -0
  93. package/dist/node_modules/iconv-lite/encodings/tables/cp949.mjs +2223 -0
  94. package/dist/node_modules/iconv-lite/encodings/tables/cp950.mjs +230 -0
  95. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.mjs +428 -0
  96. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.mjs +430 -0
  97. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.mjs +232 -0
  98. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.mjs +295 -0
  99. package/dist/node_modules/iconv-lite/encodings/utf16.mjs +107 -0
  100. package/dist/node_modules/iconv-lite/encodings/utf7.mjs +183 -0
  101. package/dist/node_modules/iconv-lite/lib/bom-handling.mjs +45 -0
  102. package/dist/node_modules/iconv-lite/lib/extend-node.mjs +150 -0
  103. package/dist/node_modules/iconv-lite/lib/index.mjs +96 -0
  104. package/dist/node_modules/iconv-lite/lib/streams.mjs +97 -0
  105. package/dist/node_modules/inherits/inherits.mjs +20 -0
  106. package/dist/node_modules/inherits/inherits_browser.mjs +30 -0
  107. package/dist/node_modules/ipaddr.js/lib/ipaddr.mjs +677 -0
  108. package/dist/node_modules/math-intrinsics/abs.mjs +12 -0
  109. package/dist/node_modules/math-intrinsics/floor.mjs +12 -0
  110. package/dist/node_modules/math-intrinsics/isNaN.mjs +14 -0
  111. package/dist/node_modules/math-intrinsics/max.mjs +12 -0
  112. package/dist/node_modules/math-intrinsics/min.mjs +12 -0
  113. package/dist/node_modules/math-intrinsics/pow.mjs +12 -0
  114. package/dist/node_modules/math-intrinsics/round.mjs +12 -0
  115. package/dist/node_modules/math-intrinsics/sign.mjs +17 -0
  116. package/dist/node_modules/merge-descriptors/index.mjs +46 -0
  117. package/dist/node_modules/methods/index.mjs +69 -0
  118. package/dist/node_modules/mime/mime.mjs +79 -0
  119. package/dist/node_modules/mime/types.mjs +1104 -0
  120. package/dist/node_modules/mime-types/index.mjs +123 -0
  121. package/dist/node_modules/mime-types/node_modules/mime-db/db.mjs +7051 -0
  122. package/dist/node_modules/mime-types/node_modules/mime-db/index.mjs +21 -0
  123. package/dist/node_modules/ms/index.mjs +124 -0
  124. package/dist/node_modules/negotiator/index.mjs +76 -0
  125. package/dist/node_modules/negotiator/lib/charset.mjs +132 -0
  126. package/dist/node_modules/negotiator/lib/encoding.mjs +143 -0
  127. package/dist/node_modules/negotiator/lib/language.mjs +138 -0
  128. package/dist/node_modules/negotiator/lib/mediaType.mjs +200 -0
  129. package/dist/node_modules/object-inspect/index.mjs +389 -0
  130. package/dist/node_modules/object-inspect/util.inspect.mjs +11 -0
  131. package/dist/node_modules/on-finished/index.mjs +178 -0
  132. package/dist/node_modules/parseurl/index.mjs +111 -0
  133. package/dist/node_modules/path-to-regexp/index.mjs +118 -0
  134. package/dist/node_modules/proxy-addr/index.mjs +212 -0
  135. package/dist/node_modules/range-parser/index.mjs +110 -0
  136. package/dist/node_modules/raw-body/index.mjs +209 -0
  137. package/dist/node_modules/safe-buffer/index.mjs +46 -0
  138. package/dist/node_modules/safer-buffer/safer.mjs +48 -0
  139. package/dist/node_modules/send/index.mjs +801 -0
  140. package/dist/node_modules/send/node_modules/encodeurl/index.mjs +56 -0
  141. package/dist/node_modules/serve-static/index.mjs +134 -0
  142. package/dist/node_modules/setprototypeof/index.mjs +19 -0
  143. package/dist/node_modules/side-channel/index.mjs +45 -0
  144. package/dist/node_modules/side-channel-list/index.mjs +84 -0
  145. package/dist/node_modules/side-channel-map/index.mjs +62 -0
  146. package/dist/node_modules/side-channel-weakmap/index.mjs +73 -0
  147. package/dist/node_modules/statuses/codes.mjs +75 -0
  148. package/dist/node_modules/statuses/index.mjs +108 -0
  149. package/dist/node_modules/toidentifier/index.mjs +32 -0
  150. package/dist/node_modules/type-is/index.mjs +179 -0
  151. package/dist/node_modules/type-is/node_modules/media-typer/index.mjs +186 -0
  152. package/dist/node_modules/unpipe/index.mjs +50 -0
  153. package/dist/node_modules/utils-merge/index.mjs +28 -0
  154. package/dist/node_modules/vary/index.mjs +95 -0
  155. package/dist/packages/sadot/src/api/index.mjs +11 -0
  156. package/dist/packages/sadot/src/api/v1/definition/index.mjs +112 -0
  157. package/dist/packages/sadot/src/api/v1/definition/validations.mjs +125 -0
  158. package/dist/packages/sadot/src/api/v1/errors.mjs +13 -0
  159. package/dist/packages/sadot/src/api/v1/index.mjs +15 -0
  160. package/dist/packages/sadot/src/api/v1/templates/index.mjs +76 -0
  161. package/dist/packages/sadot/src/api/v1/validator/index.mjs +114 -0
  162. package/dist/{api/v1/validator/validations.d.ts → packages/sadot/src/api/v1/validator/validations.d.mts} +1 -2
  163. package/dist/packages/sadot/src/api/v1/validator/validations.mjs +38 -0
  164. package/dist/packages/sadot/src/errors/index.mjs +55 -0
  165. package/dist/packages/sadot/src/events/index.mjs +50 -0
  166. package/dist/packages/sadot/src/hooks/enrich.mjs +175 -0
  167. package/dist/packages/sadot/src/hooks/find.mjs +22 -0
  168. package/dist/packages/sadot/src/hooks/hooks.mjs +302 -0
  169. package/dist/packages/sadot/src/hooks/index.mjs +5 -0
  170. package/dist/packages/sadot/src/hooks/utils/updateInstanceValues.mjs +27 -0
  171. package/dist/{init-state.d.ts → packages/sadot/src/init-state.d.mts} +1 -2
  172. package/dist/packages/sadot/src/init-state.mjs +55 -0
  173. package/dist/packages/sadot/src/mat-path-state.mjs +9 -0
  174. package/dist/{migrations/001-create-core-tables.js → packages/sadot/src/migrations/001-create-core-tables.mjs} +23 -7
  175. package/dist/{migrations/002-create-custom-field-entries.cjs → packages/sadot/src/migrations/002-create-custom-field-entries.mjs} +14 -4
  176. package/dist/{migrations/003-create-custom-field-model-type-map.js → packages/sadot/src/migrations/003-create-custom-field-model-type-map.mjs} +18 -6
  177. package/dist/packages/sadot/src/migrations/004-create-field-policy-tables.mjs +27 -0
  178. package/dist/packages/sadot/src/migrations/index.mjs +89 -0
  179. package/dist/{models/CustomFieldDefinition.d.ts → packages/sadot/src/models/CustomFieldDefinition.d.mts} +4 -5
  180. package/dist/packages/sadot/src/models/CustomFieldDefinition.mjs +146 -0
  181. package/dist/{models/CustomFieldEntries.d.ts → packages/sadot/src/models/CustomFieldEntries.d.mts} +1 -2
  182. package/dist/packages/sadot/src/models/CustomFieldEntries.mjs +70 -0
  183. package/dist/{models/CustomFieldModelTypeMap.d.cts → packages/sadot/src/models/CustomFieldModelTypeMap.d.mts} +2 -3
  184. package/dist/packages/sadot/src/models/CustomFieldModelTypeMap.mjs +61 -0
  185. package/dist/{models/CustomFieldValue.d.cts → packages/sadot/src/models/CustomFieldValue.d.mts} +3 -4
  186. package/dist/packages/sadot/src/models/CustomFieldValue.mjs +108 -0
  187. package/dist/{models/CustomValidator.d.cts → packages/sadot/src/models/CustomValidator.d.mts} +3 -4
  188. package/dist/packages/sadot/src/models/CustomValidator.mjs +67 -0
  189. package/dist/packages/sadot/src/models/FieldPolicy.d.mts +23 -0
  190. package/dist/packages/sadot/src/models/FieldPolicy.mjs +49 -0
  191. package/dist/packages/sadot/src/models/index.d.mts +7 -0
  192. package/dist/packages/sadot/src/models/index.mjs +161 -0
  193. package/dist/packages/sadot/src/models/tests/AssociatedTestModel.mjs +50 -0
  194. package/dist/packages/sadot/src/models/tests/TestModel.mjs +42 -0
  195. package/dist/packages/sadot/src/models/tests/contextAwareModels/ContextAwareTestModel.mjs +34 -0
  196. package/dist/packages/sadot/src/models/tests/contextAwareModels/ContextTestModel.mjs +32 -0
  197. package/dist/packages/sadot/src/repository/definition.mjs +212 -0
  198. package/dist/packages/sadot/src/repository/entries.mjs +67 -0
  199. package/dist/packages/sadot/src/repository/field-policy.d.mts +29 -0
  200. package/dist/packages/sadot/src/repository/field-policy.mjs +33 -0
  201. package/dist/packages/sadot/src/repository/utils/formatValues.mjs +14 -0
  202. package/dist/packages/sadot/src/repository/validator.mjs +54 -0
  203. package/dist/packages/sadot/src/repository/value.mjs +76 -0
  204. package/dist/{scopes/filter.d.ts → packages/sadot/src/scopes/filter.d.mts} +3 -4
  205. package/dist/packages/sadot/src/scopes/filter.mjs +54 -0
  206. package/dist/{scopes/helpers/filter.helpers.d.ts → packages/sadot/src/scopes/helpers/filter.helpers.d.mts} +1 -2
  207. package/dist/packages/sadot/src/scopes/helpers/filter.helpers.mjs +147 -0
  208. package/dist/packages/sadot/src/scopes/index.mjs +3 -0
  209. package/dist/{types/index.d.cts → packages/sadot/src/types/index.d.mts} +6 -5
  210. package/dist/{utils/constants/index.d.ts → packages/sadot/src/utils/constants/index.d.mts} +1 -2
  211. package/dist/packages/sadot/src/utils/constants/index.mjs +29 -0
  212. package/dist/packages/sadot/src/utils/db/index.mjs +14 -0
  213. package/dist/{utils/helpers/index.d.cts → packages/sadot/src/utils/helpers/index.d.mts} +3 -4
  214. package/dist/packages/sadot/src/utils/helpers/index.mjs +21 -0
  215. package/dist/packages/sadot/src/utils/init.mjs +111 -0
  216. package/dist/packages/sadot/src/utils/logger/index.mjs +12 -0
  217. package/dist/packages/sadot/src/utils/scopeAttributes.mjs +11 -0
  218. package/dist/packages/sadot/src/utils/validations/index.mjs +32 -0
  219. package/dist/{utils/validations/schema/custom-fields.d.ts → packages/sadot/src/utils/validations/schema/custom-fields.d.mts} +1 -2
  220. package/dist/packages/sadot/src/utils/validations/schema/custom-fields.mjs +7 -0
  221. package/dist/packages/sadot/src/utils/validations/schema/validator-schema.mjs +99 -0
  222. package/dist/packages/sadot/src/utils/validations/validators/index.mjs +42 -0
  223. package/dist/packages/sadot/src/utils/validations/validators/multi-select-dropdown.validator.mjs +7 -0
  224. package/dist/packages/sadot/src/utils/validations/validators/multi-select-status.validator.mjs +10 -0
  225. package/dist/packages/sadot/src/utils/validations/validators/multi-select.helpers.mjs +10 -0
  226. package/dist/packages/sadot/src/utils/validations/validators/select.validator.mjs +10 -0
  227. package/dist/packages/sadot/src/utils/validations/validators/status.validator.mjs +10 -0
  228. package/dist/packages/zehut/src/check-permission.d.mts +6 -0
  229. package/dist/packages/zehut/src/errors.d.mts +1 -0
  230. package/dist/packages/zehut/src/index.d.mts +6 -0
  231. package/dist/packages/zehut/src/permissions/SDK/evaluatePermissions.d.mts +1 -0
  232. package/dist/packages/zehut/src/permissions/SDK/types.d.mts +1 -0
  233. package/dist/packages/zehut/src/permissions/index.d.mts +2 -0
  234. package/dist/packages/zehut/src/permissions/middleware/requirePermissions.d.mts +1 -0
  235. package/dist/packages/zehut/src/user/ApiUser.d.mts +59 -0
  236. package/dist/packages/zehut/src/user/fastify.d.mts +8 -0
  237. package/dist/packages/zehut/src/user/index.d.mts +9 -0
  238. package/package.json +3 -3
  239. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorate.cjs +0 -1
  240. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorate.js +0 -1
  241. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorateMetadata.cjs +0 -1
  242. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/decorateMetadata.js +0 -1
  243. package/dist/_virtual/rolldown_runtime.cjs +0 -1
  244. package/dist/_virtual/rolldown_runtime.js +0 -1
  245. package/dist/api/index.cjs +0 -2
  246. package/dist/api/index.cjs.map +0 -1
  247. package/dist/api/index.js +0 -2
  248. package/dist/api/index.js.map +0 -1
  249. package/dist/api/v1/definition/index.cjs +0 -2
  250. package/dist/api/v1/definition/index.cjs.map +0 -1
  251. package/dist/api/v1/definition/index.js +0 -2
  252. package/dist/api/v1/definition/index.js.map +0 -1
  253. package/dist/api/v1/definition/validations.cjs +0 -2
  254. package/dist/api/v1/definition/validations.cjs.map +0 -1
  255. package/dist/api/v1/definition/validations.js +0 -2
  256. package/dist/api/v1/definition/validations.js.map +0 -1
  257. package/dist/api/v1/errors.cjs +0 -2
  258. package/dist/api/v1/errors.cjs.map +0 -1
  259. package/dist/api/v1/errors.js +0 -2
  260. package/dist/api/v1/errors.js.map +0 -1
  261. package/dist/api/v1/index.cjs +0 -2
  262. package/dist/api/v1/index.cjs.map +0 -1
  263. package/dist/api/v1/index.js +0 -2
  264. package/dist/api/v1/index.js.map +0 -1
  265. package/dist/api/v1/validator/index.cjs +0 -2
  266. package/dist/api/v1/validator/index.cjs.map +0 -1
  267. package/dist/api/v1/validator/index.js +0 -2
  268. package/dist/api/v1/validator/index.js.map +0 -1
  269. package/dist/api/v1/validator/validations.cjs +0 -2
  270. package/dist/api/v1/validator/validations.cjs.map +0 -1
  271. package/dist/api/v1/validator/validations.d.cts +0 -23
  272. package/dist/api/v1/validator/validations.js +0 -2
  273. package/dist/api/v1/validator/validations.js.map +0 -1
  274. package/dist/errors/index.cjs +0 -3
  275. package/dist/errors/index.cjs.map +0 -1
  276. package/dist/errors/index.js +0 -3
  277. package/dist/errors/index.js.map +0 -1
  278. package/dist/events/index.cjs +0 -2
  279. package/dist/events/index.cjs.map +0 -1
  280. package/dist/events/index.js +0 -2
  281. package/dist/events/index.js.map +0 -1
  282. package/dist/hooks/enrich.cjs +0 -2
  283. package/dist/hooks/enrich.cjs.map +0 -1
  284. package/dist/hooks/enrich.js +0 -2
  285. package/dist/hooks/enrich.js.map +0 -1
  286. package/dist/hooks/find.cjs +0 -2
  287. package/dist/hooks/find.cjs.map +0 -1
  288. package/dist/hooks/find.js +0 -2
  289. package/dist/hooks/find.js.map +0 -1
  290. package/dist/hooks/hooks.cjs +0 -2
  291. package/dist/hooks/hooks.cjs.map +0 -1
  292. package/dist/hooks/hooks.js +0 -2
  293. package/dist/hooks/hooks.js.map +0 -1
  294. package/dist/hooks/index.cjs +0 -1
  295. package/dist/hooks/index.js +0 -1
  296. package/dist/hooks/utils/updateInstanceValues.cjs +0 -2
  297. package/dist/hooks/utils/updateInstanceValues.cjs.map +0 -1
  298. package/dist/hooks/utils/updateInstanceValues.js +0 -2
  299. package/dist/hooks/utils/updateInstanceValues.js.map +0 -1
  300. package/dist/index.cjs +0 -2
  301. package/dist/index.cjs.map +0 -1
  302. package/dist/index.d.cts +0 -25
  303. package/dist/index.d.ts +0 -25
  304. package/dist/index.js +0 -2
  305. package/dist/index.js.map +0 -1
  306. package/dist/init-state.cjs +0 -2
  307. package/dist/init-state.cjs.map +0 -1
  308. package/dist/init-state.d.cts +0 -36
  309. package/dist/init-state.js +0 -2
  310. package/dist/init-state.js.map +0 -1
  311. package/dist/mat-path-state.cjs +0 -2
  312. package/dist/mat-path-state.cjs.map +0 -1
  313. package/dist/mat-path-state.js +0 -2
  314. package/dist/mat-path-state.js.map +0 -1
  315. package/dist/migrations/001-create-core-tables.cjs +0 -52
  316. package/dist/migrations/001-create-core-tables.cjs.map +0 -1
  317. package/dist/migrations/001-create-core-tables.js.map +0 -1
  318. package/dist/migrations/002-create-custom-field-entries.cjs.map +0 -1
  319. package/dist/migrations/002-create-custom-field-entries.js +0 -15
  320. package/dist/migrations/002-create-custom-field-entries.js.map +0 -1
  321. package/dist/migrations/003-create-custom-field-model-type-map.cjs +0 -21
  322. package/dist/migrations/003-create-custom-field-model-type-map.cjs.map +0 -1
  323. package/dist/migrations/003-create-custom-field-model-type-map.js.map +0 -1
  324. package/dist/migrations/index.cjs +0 -2
  325. package/dist/migrations/index.cjs.map +0 -1
  326. package/dist/migrations/index.js +0 -2
  327. package/dist/migrations/index.js.map +0 -1
  328. package/dist/models/CustomFieldDefinition.cjs +0 -2
  329. package/dist/models/CustomFieldDefinition.cjs.map +0 -1
  330. package/dist/models/CustomFieldDefinition.d.cts +0 -41
  331. package/dist/models/CustomFieldDefinition.js +0 -2
  332. package/dist/models/CustomFieldDefinition.js.map +0 -1
  333. package/dist/models/CustomFieldEntries.cjs +0 -2
  334. package/dist/models/CustomFieldEntries.cjs.map +0 -1
  335. package/dist/models/CustomFieldEntries.d.cts +0 -16
  336. package/dist/models/CustomFieldEntries.js +0 -2
  337. package/dist/models/CustomFieldEntries.js.map +0 -1
  338. package/dist/models/CustomFieldModelTypeMap.cjs +0 -2
  339. package/dist/models/CustomFieldModelTypeMap.cjs.map +0 -1
  340. package/dist/models/CustomFieldModelTypeMap.d.ts +0 -15
  341. package/dist/models/CustomFieldModelTypeMap.js +0 -2
  342. package/dist/models/CustomFieldModelTypeMap.js.map +0 -1
  343. package/dist/models/CustomFieldValue.cjs +0 -2
  344. package/dist/models/CustomFieldValue.cjs.map +0 -1
  345. package/dist/models/CustomFieldValue.d.ts +0 -21
  346. package/dist/models/CustomFieldValue.js +0 -2
  347. package/dist/models/CustomFieldValue.js.map +0 -1
  348. package/dist/models/CustomValidator.cjs +0 -2
  349. package/dist/models/CustomValidator.cjs.map +0 -1
  350. package/dist/models/CustomValidator.d.ts +0 -19
  351. package/dist/models/CustomValidator.js +0 -2
  352. package/dist/models/CustomValidator.js.map +0 -1
  353. package/dist/models/index.cjs +0 -2
  354. package/dist/models/index.cjs.map +0 -1
  355. package/dist/models/index.d.cts +0 -7
  356. package/dist/models/index.d.ts +0 -7
  357. package/dist/models/index.js +0 -2
  358. package/dist/models/index.js.map +0 -1
  359. package/dist/models/tests/AssociatedTestModel.cjs +0 -2
  360. package/dist/models/tests/AssociatedTestModel.cjs.map +0 -1
  361. package/dist/models/tests/AssociatedTestModel.js +0 -2
  362. package/dist/models/tests/AssociatedTestModel.js.map +0 -1
  363. package/dist/models/tests/TestModel.cjs +0 -2
  364. package/dist/models/tests/TestModel.cjs.map +0 -1
  365. package/dist/models/tests/TestModel.js +0 -2
  366. package/dist/models/tests/TestModel.js.map +0 -1
  367. package/dist/models/tests/contextAwareModels/ContextAwareTestModel.cjs +0 -2
  368. package/dist/models/tests/contextAwareModels/ContextAwareTestModel.cjs.map +0 -1
  369. package/dist/models/tests/contextAwareModels/ContextAwareTestModel.js +0 -2
  370. package/dist/models/tests/contextAwareModels/ContextAwareTestModel.js.map +0 -1
  371. package/dist/models/tests/contextAwareModels/ContextTestModel.cjs +0 -2
  372. package/dist/models/tests/contextAwareModels/ContextTestModel.cjs.map +0 -1
  373. package/dist/models/tests/contextAwareModels/ContextTestModel.js +0 -2
  374. package/dist/models/tests/contextAwareModels/ContextTestModel.js.map +0 -1
  375. package/dist/repository/definition.cjs +0 -2
  376. package/dist/repository/definition.cjs.map +0 -1
  377. package/dist/repository/definition.js +0 -2
  378. package/dist/repository/definition.js.map +0 -1
  379. package/dist/repository/entries.cjs +0 -2
  380. package/dist/repository/entries.cjs.map +0 -1
  381. package/dist/repository/entries.js +0 -2
  382. package/dist/repository/entries.js.map +0 -1
  383. package/dist/repository/utils/formatValues.cjs +0 -2
  384. package/dist/repository/utils/formatValues.cjs.map +0 -1
  385. package/dist/repository/utils/formatValues.js +0 -2
  386. package/dist/repository/utils/formatValues.js.map +0 -1
  387. package/dist/repository/validator.cjs +0 -2
  388. package/dist/repository/validator.cjs.map +0 -1
  389. package/dist/repository/validator.js +0 -2
  390. package/dist/repository/validator.js.map +0 -1
  391. package/dist/repository/value.cjs +0 -2
  392. package/dist/repository/value.cjs.map +0 -1
  393. package/dist/repository/value.js +0 -2
  394. package/dist/repository/value.js.map +0 -1
  395. package/dist/scopes/filter.cjs +0 -2
  396. package/dist/scopes/filter.cjs.map +0 -1
  397. package/dist/scopes/filter.d.cts +0 -23
  398. package/dist/scopes/filter.js +0 -2
  399. package/dist/scopes/filter.js.map +0 -1
  400. package/dist/scopes/helpers/filter.helpers.cjs +0 -46
  401. package/dist/scopes/helpers/filter.helpers.cjs.map +0 -1
  402. package/dist/scopes/helpers/filter.helpers.d.cts +0 -17
  403. package/dist/scopes/helpers/filter.helpers.js +0 -46
  404. package/dist/scopes/helpers/filter.helpers.js.map +0 -1
  405. package/dist/scopes/index.cjs +0 -1
  406. package/dist/scopes/index.js +0 -1
  407. package/dist/types/index.d.ts +0 -72
  408. package/dist/utils/constants/index.cjs +0 -2
  409. package/dist/utils/constants/index.cjs.map +0 -1
  410. package/dist/utils/constants/index.d.cts +0 -24
  411. package/dist/utils/constants/index.js +0 -2
  412. package/dist/utils/constants/index.js.map +0 -1
  413. package/dist/utils/db/index.cjs +0 -2
  414. package/dist/utils/db/index.cjs.map +0 -1
  415. package/dist/utils/db/index.js +0 -2
  416. package/dist/utils/db/index.js.map +0 -1
  417. package/dist/utils/helpers/index.cjs +0 -2
  418. package/dist/utils/helpers/index.cjs.map +0 -1
  419. package/dist/utils/helpers/index.d.ts +0 -31
  420. package/dist/utils/helpers/index.js +0 -2
  421. package/dist/utils/helpers/index.js.map +0 -1
  422. package/dist/utils/init.cjs +0 -2
  423. package/dist/utils/init.cjs.map +0 -1
  424. package/dist/utils/init.js +0 -2
  425. package/dist/utils/init.js.map +0 -1
  426. package/dist/utils/logger/index.cjs +0 -2
  427. package/dist/utils/logger/index.cjs.map +0 -1
  428. package/dist/utils/logger/index.js +0 -2
  429. package/dist/utils/logger/index.js.map +0 -1
  430. package/dist/utils/scopeAttributes.cjs +0 -2
  431. package/dist/utils/scopeAttributes.cjs.map +0 -1
  432. package/dist/utils/scopeAttributes.js +0 -2
  433. package/dist/utils/scopeAttributes.js.map +0 -1
  434. package/dist/utils/validations/index.cjs +0 -2
  435. package/dist/utils/validations/index.cjs.map +0 -1
  436. package/dist/utils/validations/index.js +0 -2
  437. package/dist/utils/validations/index.js.map +0 -1
  438. package/dist/utils/validations/schema/custom-fields.cjs +0 -2
  439. package/dist/utils/validations/schema/custom-fields.cjs.map +0 -1
  440. package/dist/utils/validations/schema/custom-fields.d.cts +0 -7
  441. package/dist/utils/validations/schema/custom-fields.js +0 -2
  442. package/dist/utils/validations/schema/custom-fields.js.map +0 -1
  443. package/dist/utils/validations/schema/validator-schema.cjs +0 -2
  444. package/dist/utils/validations/schema/validator-schema.cjs.map +0 -1
  445. package/dist/utils/validations/schema/validator-schema.js +0 -2
  446. package/dist/utils/validations/schema/validator-schema.js.map +0 -1
  447. package/dist/utils/validations/validators/index.cjs +0 -2
  448. package/dist/utils/validations/validators/index.cjs.map +0 -1
  449. package/dist/utils/validations/validators/index.js +0 -2
  450. package/dist/utils/validations/validators/index.js.map +0 -1
  451. package/dist/utils/validations/validators/multi-select-dropdown.validator.cjs +0 -2
  452. package/dist/utils/validations/validators/multi-select-dropdown.validator.cjs.map +0 -1
  453. package/dist/utils/validations/validators/multi-select-dropdown.validator.js +0 -2
  454. package/dist/utils/validations/validators/multi-select-dropdown.validator.js.map +0 -1
  455. package/dist/utils/validations/validators/multi-select-status.validator.cjs +0 -2
  456. package/dist/utils/validations/validators/multi-select-status.validator.cjs.map +0 -1
  457. package/dist/utils/validations/validators/multi-select-status.validator.js +0 -2
  458. package/dist/utils/validations/validators/multi-select-status.validator.js.map +0 -1
  459. package/dist/utils/validations/validators/multi-select.helpers.cjs +0 -2
  460. package/dist/utils/validations/validators/multi-select.helpers.cjs.map +0 -1
  461. package/dist/utils/validations/validators/multi-select.helpers.js +0 -2
  462. package/dist/utils/validations/validators/multi-select.helpers.js.map +0 -1
  463. package/dist/utils/validations/validators/select.validator.cjs +0 -2
  464. package/dist/utils/validations/validators/select.validator.cjs.map +0 -1
  465. package/dist/utils/validations/validators/select.validator.js +0 -2
  466. package/dist/utils/validations/validators/select.validator.js.map +0 -1
  467. package/dist/utils/validations/validators/status.validator.cjs +0 -2
  468. package/dist/utils/validations/validators/status.validator.cjs.map +0 -1
  469. package/dist/utils/validations/validators/status.validator.js +0 -2
  470. package/dist/utils/validations/validators/status.validator.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ //#region \0@oxc-project+runtime@0.103.0/helpers/decorate.js
2
+ function __decorate(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ }
8
+
9
+ //#endregion
10
+ export { __decorate };
@@ -0,0 +1,7 @@
1
+ //#region \0@oxc-project+runtime@0.103.0/helpers/decorateMetadata.js
2
+ function __decorateMetadata(k, v) {
3
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4
+ }
5
+
6
+ //#endregion
7
+ export { __decorateMetadata };
@@ -0,0 +1,22 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __defProp = Object.defineProperty;
5
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
6
+ var __export = (all, symbols) => {
7
+ let target = {};
8
+ for (var name in all) {
9
+ __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ }
14
+ if (symbols) {
15
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ }
17
+ return target;
18
+ };
19
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
+
21
+ //#endregion
22
+ export { __commonJSMin, __export, __require };
@@ -0,0 +1,26 @@
1
+ import { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, supportedEntities } from "./packages/sadot/src/utils/constants/index.mjs";
2
+ import { CustomFieldValue } from "./packages/sadot/src/models/CustomFieldValue.mjs";
3
+ import { CustomFieldDefinition } from "./packages/sadot/src/models/CustomFieldDefinition.mjs";
4
+ import { CustomValidator } from "./packages/sadot/src/models/CustomValidator.mjs";
5
+ import { CustomFieldOptions, ModelFetcher, Models } from "./packages/sadot/src/types/index.mjs";
6
+ import { SadotInitializationState } from "./packages/sadot/src/init-state.mjs";
7
+ import { CustomFieldsSchema } from "./packages/sadot/src/utils/validations/schema/custom-fields.mjs";
8
+ import { generateCustomFieldSearchQueryPayload, generateRandomString } from "./packages/sadot/src/utils/helpers/index.mjs";
9
+ import { customFieldsSortScope } from "./packages/sadot/src/scopes/filter.mjs";
10
+ import { CustomFieldEntries } from "./packages/sadot/src/models/CustomFieldEntries.mjs";
11
+ import "./packages/sadot/src/models/index.mjs";
12
+ import { FieldPolicy, ModelInclusion, ModelMode } from "./packages/sadot/src/models/FieldPolicy.mjs";
13
+ import { field_policy_d_exports } from "./packages/sadot/src/repository/field-policy.mjs";
14
+ import { Sequelize } from "sequelize-typescript";
15
+ import { Application } from "express";
16
+
17
+ //#region src/index.d.ts
18
+ declare const sadotInitState: SadotInitializationState;
19
+ /**
20
+ * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file
21
+ * @see {@link 'custom-fields/config'} for configurations
22
+ */
23
+ declare const useCustomFields: (app: Pick<Application, "use"> | null, getModel: ModelFetcher, options: CustomFieldOptions) => Promise<Sequelize>;
24
+ declare const disableCustomFields: (models: Models[], getModel: ModelFetcher) => void;
25
+ //#endregion
26
+ export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinition, CustomFieldDefinitionType, CustomFieldEntries, CustomFieldValue, CustomFieldsSchema, CustomValidator, FieldPolicy, field_policy_d_exports as FieldPolicyRepo, type ModelInclusion, type ModelMode, customFieldsSortScope, useCustomFields as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, sadotInitState, supportedEntities };
package/dist/index.mjs ADDED
@@ -0,0 +1,66 @@
1
+ import logger_default, { tryAddingTraceIdMiddleware } from "./packages/sadot/src/utils/logger/index.mjs";
2
+ import { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, supportedEntities } from "./packages/sadot/src/utils/constants/index.mjs";
3
+ import CustomFieldValue_default from "./packages/sadot/src/models/CustomFieldValue.mjs";
4
+ import CustomFieldDefinition_default from "./packages/sadot/src/models/CustomFieldDefinition.mjs";
5
+ import CustomFieldEntries_default from "./packages/sadot/src/models/CustomFieldEntries.mjs";
6
+ import CustomValidator_default from "./packages/sadot/src/models/CustomValidator.mjs";
7
+ import { runSadotMigrations } from "./packages/sadot/src/migrations/index.mjs";
8
+ import { initTables, initTestModels } from "./packages/sadot/src/models/index.mjs";
9
+ import { matPathState } from "./packages/sadot/src/mat-path-state.mjs";
10
+ import FieldPolicy_default from "./packages/sadot/src/models/FieldPolicy.mjs";
11
+ import { field_policy_exports } from "./packages/sadot/src/repository/field-policy.mjs";
12
+ import templates_default from "./packages/sadot/src/api/v1/templates/index.mjs";
13
+ import api_default from "./packages/sadot/src/api/index.mjs";
14
+ import db_default from "./packages/sadot/src/utils/db/index.mjs";
15
+ import { generateCustomFieldSearchQueryPayload, generateRandomString } from "./packages/sadot/src/utils/helpers/index.mjs";
16
+ import { customFieldsSortScope } from "./packages/sadot/src/scopes/filter.mjs";
17
+ import { addHooks, addScopes, applyCustomAssociation, removeHooks } from "./packages/sadot/src/utils/init.mjs";
18
+ import { SadotInitializationState } from "./packages/sadot/src/init-state.mjs";
19
+ import { CustomFieldsSchema } from "./packages/sadot/src/utils/validations/schema/custom-fields.mjs";
20
+
21
+ //#region src/index.ts
22
+ const sadotInitState = new SadotInitializationState();
23
+ /**
24
+ * Internal implementation of custom fields initialization
25
+ * Contains all the business logic without state tracking
26
+ */
27
+ const internalUseCustomFields = async (app, getModel, options) => {
28
+ tryAddingTraceIdMiddleware();
29
+ const { models, useCustomFieldsEntries, useModelTypeMapping, isMatPathEnabled, runLegacyMigrations } = options;
30
+ matPathState.isMatPathEnabled = isMatPathEnabled;
31
+ if (app) {
32
+ app.use("/api", api_default);
33
+ app.use("/api/v1/templates", templates_default);
34
+ }
35
+ const sequelize = options.sequelize ?? db_default(options.databaseConfig);
36
+ if (process.env.NODE_ENV === "test") await initTestModels(sequelize);
37
+ sequelize.addModels([FieldPolicy_default]);
38
+ addHooks(models, getModel, { useCustomFieldsEntries });
39
+ await initTables(sequelize, options.getUser, {
40
+ useCustomFieldsEntries,
41
+ useModelTypeMapping,
42
+ isMatPathEnabled,
43
+ runLegacyMigrations
44
+ });
45
+ await runSadotMigrations(sequelize);
46
+ addScopes(models, getModel, { useCustomFieldsEntries });
47
+ applyCustomAssociation(models);
48
+ logger_default.debug("sadot - custom fields finished initializing with models", models);
49
+ return sequelize;
50
+ };
51
+ /**
52
+ * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file
53
+ * @see {@link 'custom-fields/config'} for configurations
54
+ */
55
+ const useCustomFields = async (app, getModel, options) => {
56
+ const initPromise = internalUseCustomFields(app, getModel, options);
57
+ sadotInitState.setInitPromise(initPromise, !options.sequelize);
58
+ return await initPromise;
59
+ };
60
+ var src_default = useCustomFields;
61
+ const disableCustomFields = (models, getModel) => {
62
+ removeHooks(models, getModel);
63
+ };
64
+
65
+ //#endregion
66
+ export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinition_default as CustomFieldDefinition, CustomFieldDefinitionType, CustomFieldEntries_default as CustomFieldEntries, CustomFieldValue_default as CustomFieldValue, CustomFieldsSchema, CustomValidator_default as CustomValidator, FieldPolicy_default as FieldPolicy, field_policy_exports as FieldPolicyRepo, customFieldsSortScope, src_default as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, sadotInitState, supportedEntities };
@@ -0,0 +1,175 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
2
+ import { require_mime_types } from "../mime-types/index.mjs";
3
+ import { require_negotiator } from "../negotiator/index.mjs";
4
+
5
+ //#region ../../node_modules/accepts/index.js
6
+ /*!
7
+ * accepts
8
+ * Copyright(c) 2014 Jonathan Ong
9
+ * Copyright(c) 2015 Douglas Christopher Wilson
10
+ * MIT Licensed
11
+ */
12
+ var require_accepts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13
+ /**
14
+ * Module dependencies.
15
+ * @private
16
+ */
17
+ var Negotiator = require_negotiator();
18
+ var mime = require_mime_types();
19
+ /**
20
+ * Module exports.
21
+ * @public
22
+ */
23
+ module.exports = Accepts;
24
+ /**
25
+ * Create a new Accepts object for the given req.
26
+ *
27
+ * @param {object} req
28
+ * @public
29
+ */
30
+ function Accepts(req) {
31
+ if (!(this instanceof Accepts)) return new Accepts(req);
32
+ this.headers = req.headers;
33
+ this.negotiator = new Negotiator(req);
34
+ }
35
+ /**
36
+ * Check if the given `type(s)` is acceptable, returning
37
+ * the best match when true, otherwise `undefined`, in which
38
+ * case you should respond with 406 "Not Acceptable".
39
+ *
40
+ * The `type` value may be a single mime type string
41
+ * such as "application/json", the extension name
42
+ * such as "json" or an array `["json", "html", "text/plain"]`. When a list
43
+ * or array is given the _best_ match, if any is returned.
44
+ *
45
+ * Examples:
46
+ *
47
+ * // Accept: text/html
48
+ * this.types('html');
49
+ * // => "html"
50
+ *
51
+ * // Accept: text/*, application/json
52
+ * this.types('html');
53
+ * // => "html"
54
+ * this.types('text/html');
55
+ * // => "text/html"
56
+ * this.types('json', 'text');
57
+ * // => "json"
58
+ * this.types('application/json');
59
+ * // => "application/json"
60
+ *
61
+ * // Accept: text/*, application/json
62
+ * this.types('image/png');
63
+ * this.types('png');
64
+ * // => undefined
65
+ *
66
+ * // Accept: text/*;q=.5, application/json
67
+ * this.types(['html', 'json']);
68
+ * this.types('html', 'json');
69
+ * // => "json"
70
+ *
71
+ * @param {String|Array} types...
72
+ * @return {String|Array|Boolean}
73
+ * @public
74
+ */
75
+ Accepts.prototype.type = Accepts.prototype.types = function(types_) {
76
+ var types = types_;
77
+ if (types && !Array.isArray(types)) {
78
+ types = new Array(arguments.length);
79
+ for (var i = 0; i < types.length; i++) types[i] = arguments[i];
80
+ }
81
+ if (!types || types.length === 0) return this.negotiator.mediaTypes();
82
+ if (!this.headers.accept) return types[0];
83
+ var mimes = types.map(extToMime);
84
+ var first = this.negotiator.mediaTypes(mimes.filter(validMime))[0];
85
+ return first ? types[mimes.indexOf(first)] : false;
86
+ };
87
+ /**
88
+ * Return accepted encodings or best fit based on `encodings`.
89
+ *
90
+ * Given `Accept-Encoding: gzip, deflate`
91
+ * an array sorted by quality is returned:
92
+ *
93
+ * ['gzip', 'deflate']
94
+ *
95
+ * @param {String|Array} encodings...
96
+ * @return {String|Array}
97
+ * @public
98
+ */
99
+ Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) {
100
+ var encodings = encodings_;
101
+ if (encodings && !Array.isArray(encodings)) {
102
+ encodings = new Array(arguments.length);
103
+ for (var i = 0; i < encodings.length; i++) encodings[i] = arguments[i];
104
+ }
105
+ if (!encodings || encodings.length === 0) return this.negotiator.encodings();
106
+ return this.negotiator.encodings(encodings)[0] || false;
107
+ };
108
+ /**
109
+ * Return accepted charsets or best fit based on `charsets`.
110
+ *
111
+ * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
112
+ * an array sorted by quality is returned:
113
+ *
114
+ * ['utf-8', 'utf-7', 'iso-8859-1']
115
+ *
116
+ * @param {String|Array} charsets...
117
+ * @return {String|Array}
118
+ * @public
119
+ */
120
+ Accepts.prototype.charset = Accepts.prototype.charsets = function(charsets_) {
121
+ var charsets = charsets_;
122
+ if (charsets && !Array.isArray(charsets)) {
123
+ charsets = new Array(arguments.length);
124
+ for (var i = 0; i < charsets.length; i++) charsets[i] = arguments[i];
125
+ }
126
+ if (!charsets || charsets.length === 0) return this.negotiator.charsets();
127
+ return this.negotiator.charsets(charsets)[0] || false;
128
+ };
129
+ /**
130
+ * Return accepted languages or best fit based on `langs`.
131
+ *
132
+ * Given `Accept-Language: en;q=0.8, es, pt`
133
+ * an array sorted by quality is returned:
134
+ *
135
+ * ['es', 'pt', 'en']
136
+ *
137
+ * @param {String|Array} langs...
138
+ * @return {Array|String}
139
+ * @public
140
+ */
141
+ Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function(languages_) {
142
+ var languages = languages_;
143
+ if (languages && !Array.isArray(languages)) {
144
+ languages = new Array(arguments.length);
145
+ for (var i = 0; i < languages.length; i++) languages[i] = arguments[i];
146
+ }
147
+ if (!languages || languages.length === 0) return this.negotiator.languages();
148
+ return this.negotiator.languages(languages)[0] || false;
149
+ };
150
+ /**
151
+ * Convert extnames to mime.
152
+ *
153
+ * @param {String} type
154
+ * @return {String}
155
+ * @private
156
+ */
157
+ function extToMime(type) {
158
+ return type.indexOf("/") === -1 ? mime.lookup(type) : type;
159
+ }
160
+ /**
161
+ * Check if mime is valid.
162
+ *
163
+ * @param {String} type
164
+ * @return {String}
165
+ * @private
166
+ */
167
+ function validMime(type) {
168
+ return typeof type === "string";
169
+ }
170
+ }));
171
+
172
+ //#endregion
173
+ export default require_accepts();
174
+
175
+ export { require_accepts };
@@ -0,0 +1,56 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
2
+
3
+ //#region ../../node_modules/array-flatten/array-flatten.js
4
+ var require_array_flatten = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ /**
6
+ * Expose `arrayFlatten`.
7
+ */
8
+ module.exports = arrayFlatten;
9
+ /**
10
+ * Recursive flatten function with depth.
11
+ *
12
+ * @param {Array} array
13
+ * @param {Array} result
14
+ * @param {Number} depth
15
+ * @return {Array}
16
+ */
17
+ function flattenWithDepth(array, result, depth) {
18
+ for (var i = 0; i < array.length; i++) {
19
+ var value = array[i];
20
+ if (depth > 0 && Array.isArray(value)) flattenWithDepth(value, result, depth - 1);
21
+ else result.push(value);
22
+ }
23
+ return result;
24
+ }
25
+ /**
26
+ * Recursive flatten function. Omitting depth is slightly faster.
27
+ *
28
+ * @param {Array} array
29
+ * @param {Array} result
30
+ * @return {Array}
31
+ */
32
+ function flattenForever(array, result) {
33
+ for (var i = 0; i < array.length; i++) {
34
+ var value = array[i];
35
+ if (Array.isArray(value)) flattenForever(value, result);
36
+ else result.push(value);
37
+ }
38
+ return result;
39
+ }
40
+ /**
41
+ * Flatten an array, with the ability to define a depth.
42
+ *
43
+ * @param {Array} array
44
+ * @param {Number} depth
45
+ * @return {Array}
46
+ */
47
+ function arrayFlatten(array, depth) {
48
+ if (depth == null) return flattenForever(array, []);
49
+ return flattenWithDepth(array, [], depth);
50
+ }
51
+ }));
52
+
53
+ //#endregion
54
+ export default require_array_flatten();
55
+
56
+ export { require_array_flatten };
@@ -0,0 +1,135 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
2
+ import { require_depd } from "../depd/index.mjs";
3
+ import { require_json } from "./lib/types/json.mjs";
4
+ import { require_raw } from "./lib/types/raw.mjs";
5
+ import { require_text } from "./lib/types/text.mjs";
6
+ import { require_urlencoded } from "./lib/types/urlencoded.mjs";
7
+
8
+ //#region ../../node_modules/body-parser/index.js
9
+ /*!
10
+ * body-parser
11
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
12
+ * MIT Licensed
13
+ */
14
+ var require_body_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15
+ /**
16
+ * Module dependencies.
17
+ * @private
18
+ */
19
+ var deprecate = require_depd()("body-parser");
20
+ /**
21
+ * Cache of loaded parsers.
22
+ * @private
23
+ */
24
+ var parsers = Object.create(null);
25
+ /**
26
+ * @typedef Parsers
27
+ * @type {function}
28
+ * @property {function} json
29
+ * @property {function} raw
30
+ * @property {function} text
31
+ * @property {function} urlencoded
32
+ */
33
+ /**
34
+ * Module exports.
35
+ * @type {Parsers}
36
+ */
37
+ exports = module.exports = deprecate.function(bodyParser, "bodyParser: use individual json/urlencoded middlewares");
38
+ /**
39
+ * JSON parser.
40
+ * @public
41
+ */
42
+ Object.defineProperty(exports, "json", {
43
+ configurable: true,
44
+ enumerable: true,
45
+ get: createParserGetter("json")
46
+ });
47
+ /**
48
+ * Raw parser.
49
+ * @public
50
+ */
51
+ Object.defineProperty(exports, "raw", {
52
+ configurable: true,
53
+ enumerable: true,
54
+ get: createParserGetter("raw")
55
+ });
56
+ /**
57
+ * Text parser.
58
+ * @public
59
+ */
60
+ Object.defineProperty(exports, "text", {
61
+ configurable: true,
62
+ enumerable: true,
63
+ get: createParserGetter("text")
64
+ });
65
+ /**
66
+ * URL-encoded parser.
67
+ * @public
68
+ */
69
+ Object.defineProperty(exports, "urlencoded", {
70
+ configurable: true,
71
+ enumerable: true,
72
+ get: createParserGetter("urlencoded")
73
+ });
74
+ /**
75
+ * Create a middleware to parse json and urlencoded bodies.
76
+ *
77
+ * @param {object} [options]
78
+ * @return {function}
79
+ * @deprecated
80
+ * @public
81
+ */
82
+ function bodyParser(options) {
83
+ var opts = Object.create(options || null, { type: {
84
+ configurable: true,
85
+ enumerable: true,
86
+ value: void 0,
87
+ writable: true
88
+ } });
89
+ var _urlencoded = exports.urlencoded(opts);
90
+ var _json = exports.json(opts);
91
+ return function bodyParser(req, res, next) {
92
+ _json(req, res, function(err) {
93
+ if (err) return next(err);
94
+ _urlencoded(req, res, next);
95
+ });
96
+ };
97
+ }
98
+ /**
99
+ * Create a getter for loading a parser.
100
+ * @private
101
+ */
102
+ function createParserGetter(name) {
103
+ return function get() {
104
+ return loadParser(name);
105
+ };
106
+ }
107
+ /**
108
+ * Load a parser module.
109
+ * @private
110
+ */
111
+ function loadParser(parserName) {
112
+ var parser = parsers[parserName];
113
+ if (parser !== void 0) return parser;
114
+ switch (parserName) {
115
+ case "json":
116
+ parser = require_json();
117
+ break;
118
+ case "raw":
119
+ parser = require_raw();
120
+ break;
121
+ case "text":
122
+ parser = require_text();
123
+ break;
124
+ case "urlencoded":
125
+ parser = require_urlencoded();
126
+ break;
127
+ }
128
+ return parsers[parserName] = parser;
129
+ }
130
+ }));
131
+
132
+ //#endregion
133
+ export default require_body_parser();
134
+
135
+ export { require_body_parser };
@@ -0,0 +1,164 @@
1
+ import { __commonJSMin, __require } from "../../../_virtual/rolldown_runtime.mjs";
2
+ import { require_http_errors } from "../../http-errors/index.mjs";
3
+ import { require_destroy } from "../../destroy/index.mjs";
4
+ import { require_lib } from "../../iconv-lite/lib/index.mjs";
5
+ import { require_unpipe } from "../../unpipe/index.mjs";
6
+ import { require_raw_body } from "../../raw-body/index.mjs";
7
+ import { require_on_finished } from "../../on-finished/index.mjs";
8
+
9
+ //#region ../../node_modules/body-parser/lib/read.js
10
+ /*!
11
+ * body-parser
12
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
13
+ * MIT Licensed
14
+ */
15
+ var require_read = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16
+ /**
17
+ * Module dependencies.
18
+ * @private
19
+ */
20
+ var createError = require_http_errors();
21
+ var destroy = require_destroy();
22
+ var getBody = require_raw_body();
23
+ var iconv = require_lib();
24
+ var onFinished = require_on_finished();
25
+ var unpipe = require_unpipe();
26
+ var zlib = __require("zlib");
27
+ /**
28
+ * Module exports.
29
+ */
30
+ module.exports = read;
31
+ /**
32
+ * Read a request into a buffer and parse.
33
+ *
34
+ * @param {object} req
35
+ * @param {object} res
36
+ * @param {function} next
37
+ * @param {function} parse
38
+ * @param {function} debug
39
+ * @param {object} options
40
+ * @private
41
+ */
42
+ function read(req, res, next, parse, debug, options) {
43
+ var length;
44
+ var opts = options;
45
+ var stream;
46
+ req._body = true;
47
+ var encoding = opts.encoding !== null ? opts.encoding : null;
48
+ var verify = opts.verify;
49
+ try {
50
+ stream = contentstream(req, debug, opts.inflate);
51
+ length = stream.length;
52
+ stream.length = void 0;
53
+ } catch (err) {
54
+ return next(err);
55
+ }
56
+ opts.length = length;
57
+ opts.encoding = verify ? null : encoding;
58
+ if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) return next(createError(415, "unsupported charset \"" + encoding.toUpperCase() + "\"", {
59
+ charset: encoding.toLowerCase(),
60
+ type: "charset.unsupported"
61
+ }));
62
+ debug("read body");
63
+ getBody(stream, opts, function(error, body) {
64
+ if (error) {
65
+ var _error;
66
+ if (error.type === "encoding.unsupported") _error = createError(415, "unsupported charset \"" + encoding.toUpperCase() + "\"", {
67
+ charset: encoding.toLowerCase(),
68
+ type: "charset.unsupported"
69
+ });
70
+ else _error = createError(400, error);
71
+ if (stream !== req) {
72
+ unpipe(req);
73
+ destroy(stream, true);
74
+ }
75
+ dump(req, function onfinished() {
76
+ next(createError(400, _error));
77
+ });
78
+ return;
79
+ }
80
+ if (verify) try {
81
+ debug("verify body");
82
+ verify(req, res, body, encoding);
83
+ } catch (err) {
84
+ next(createError(403, err, {
85
+ body,
86
+ type: err.type || "entity.verify.failed"
87
+ }));
88
+ return;
89
+ }
90
+ var str = body;
91
+ try {
92
+ debug("parse body");
93
+ str = typeof body !== "string" && encoding !== null ? iconv.decode(body, encoding) : body;
94
+ req.body = parse(str);
95
+ } catch (err) {
96
+ next(createError(400, err, {
97
+ body: str,
98
+ type: err.type || "entity.parse.failed"
99
+ }));
100
+ return;
101
+ }
102
+ next();
103
+ });
104
+ }
105
+ /**
106
+ * Get the content stream of the request.
107
+ *
108
+ * @param {object} req
109
+ * @param {function} debug
110
+ * @param {boolean} [inflate=true]
111
+ * @return {object}
112
+ * @api private
113
+ */
114
+ function contentstream(req, debug, inflate) {
115
+ var encoding = (req.headers["content-encoding"] || "identity").toLowerCase();
116
+ var length = req.headers["content-length"];
117
+ var stream;
118
+ debug("content-encoding \"%s\"", encoding);
119
+ if (inflate === false && encoding !== "identity") throw createError(415, "content encoding unsupported", {
120
+ encoding,
121
+ type: "encoding.unsupported"
122
+ });
123
+ switch (encoding) {
124
+ case "deflate":
125
+ stream = zlib.createInflate();
126
+ debug("inflate body");
127
+ req.pipe(stream);
128
+ break;
129
+ case "gzip":
130
+ stream = zlib.createGunzip();
131
+ debug("gunzip body");
132
+ req.pipe(stream);
133
+ break;
134
+ case "identity":
135
+ stream = req;
136
+ stream.length = length;
137
+ break;
138
+ default: throw createError(415, "unsupported content encoding \"" + encoding + "\"", {
139
+ encoding,
140
+ type: "encoding.unsupported"
141
+ });
142
+ }
143
+ return stream;
144
+ }
145
+ /**
146
+ * Dump the contents of a request.
147
+ *
148
+ * @param {object} req
149
+ * @param {function} callback
150
+ * @api private
151
+ */
152
+ function dump(req, callback) {
153
+ if (onFinished.isFinished(req)) callback(null);
154
+ else {
155
+ onFinished(req, callback);
156
+ req.resume();
157
+ }
158
+ }
159
+ }));
160
+
161
+ //#endregion
162
+ export default require_read();
163
+
164
+ export { require_read };