@akbarsafari00/bonyan-types 5.52.1-fa.4

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 (319) hide show
  1. package/LICENSE +37 -0
  2. package/README.md +9 -0
  3. package/dist/core/api.d.ts +3 -0
  4. package/dist/core/api.d.ts.map +1 -0
  5. package/dist/core/commands/index.d.ts +6 -0
  6. package/dist/core/commands/index.d.ts.map +1 -0
  7. package/dist/core/config/admin.d.ts +156 -0
  8. package/dist/core/config/admin.d.ts.map +1 -0
  9. package/dist/core/config/api.d.ts +38 -0
  10. package/dist/core/config/api.d.ts.map +1 -0
  11. package/dist/core/config/database.d.ts +78 -0
  12. package/dist/core/config/database.d.ts.map +1 -0
  13. package/dist/core/config/features.d.ts +14 -0
  14. package/dist/core/config/features.d.ts.map +1 -0
  15. package/dist/core/config/index.d.ts +11 -0
  16. package/dist/core/config/index.d.ts.map +1 -0
  17. package/dist/core/config/middlewares.d.ts +3 -0
  18. package/dist/core/config/middlewares.d.ts.map +1 -0
  19. package/dist/core/config/openapi.d.ts +35 -0
  20. package/dist/core/config/openapi.d.ts.map +1 -0
  21. package/dist/core/config/plugin.d.ts +8 -0
  22. package/dist/core/config/plugin.d.ts.map +1 -0
  23. package/dist/core/config/server.d.ts +102 -0
  24. package/dist/core/config/server.d.ts.map +1 -0
  25. package/dist/core/config/shared.d.ts +8 -0
  26. package/dist/core/config/shared.d.ts.map +1 -0
  27. package/dist/core/config/typescript.d.ts +10 -0
  28. package/dist/core/config/typescript.d.ts.map +1 -0
  29. package/dist/core/container.d.ts +5 -0
  30. package/dist/core/container.d.ts.map +1 -0
  31. package/dist/core/controller.d.ts +7 -0
  32. package/dist/core/controller.d.ts.map +1 -0
  33. package/dist/core/core-api/controller.d.ts +47 -0
  34. package/dist/core/core-api/controller.d.ts.map +1 -0
  35. package/dist/core/core-api/index.d.ts +4 -0
  36. package/dist/core/core-api/index.d.ts.map +1 -0
  37. package/dist/core/core-api/router.d.ts +64 -0
  38. package/dist/core/core-api/router.d.ts.map +1 -0
  39. package/dist/core/core-api/service.d.ts +69 -0
  40. package/dist/core/core-api/service.d.ts.map +1 -0
  41. package/dist/core/index.d.ts +15 -0
  42. package/dist/core/index.d.ts.map +1 -0
  43. package/dist/core/middleware.d.ts +15 -0
  44. package/dist/core/middleware.d.ts.map +1 -0
  45. package/dist/core/module.d.ts +26 -0
  46. package/dist/core/module.d.ts.map +1 -0
  47. package/dist/core/plugin.d.ts +6 -0
  48. package/dist/core/plugin.d.ts.map +1 -0
  49. package/dist/core/policy.d.ts +15 -0
  50. package/dist/core/policy.d.ts.map +1 -0
  51. package/dist/core/route.d.ts +54 -0
  52. package/dist/core/route.d.ts.map +1 -0
  53. package/dist/core/router.d.ts +15 -0
  54. package/dist/core/router.d.ts.map +1 -0
  55. package/dist/core/service.d.ts +4 -0
  56. package/dist/core/service.d.ts.map +1 -0
  57. package/dist/core/strapi.d.ts +162 -0
  58. package/dist/core/strapi.d.ts.map +1 -0
  59. package/dist/data/component.d.ts +21 -0
  60. package/dist/data/component.d.ts.map +1 -0
  61. package/dist/data/constants.d.ts +5 -0
  62. package/dist/data/constants.d.ts.map +1 -0
  63. package/dist/data/content-type.d.ts +26 -0
  64. package/dist/data/content-type.d.ts.map +1 -0
  65. package/dist/data/entity.d.ts +15 -0
  66. package/dist/data/entity.d.ts.map +1 -0
  67. package/dist/data/index.d.ts +5 -0
  68. package/dist/data/index.d.ts.map +1 -0
  69. package/dist/index.d.ts +20 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +3 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/index.mjs +2 -0
  74. package/dist/index.mjs.map +1 -0
  75. package/dist/internal/index.d.ts +13 -0
  76. package/dist/internal/index.d.ts.map +1 -0
  77. package/dist/internal/namespace.d.ts +78 -0
  78. package/dist/internal/namespace.d.ts.map +1 -0
  79. package/dist/internal/registry.d.ts +8 -0
  80. package/dist/internal/registry.d.ts.map +1 -0
  81. package/dist/internal/uid.d.ts +116 -0
  82. package/dist/internal/uid.d.ts.map +1 -0
  83. package/dist/modules/ai.d.ts +34 -0
  84. package/dist/modules/ai.d.ts.map +1 -0
  85. package/dist/modules/audit-logs.d.ts +6 -0
  86. package/dist/modules/audit-logs.d.ts.map +1 -0
  87. package/dist/modules/auth.d.ts +25 -0
  88. package/dist/modules/auth.d.ts.map +1 -0
  89. package/dist/modules/content-api.d.ts +92 -0
  90. package/dist/modules/content-api.d.ts.map +1 -0
  91. package/dist/modules/core-store.d.ts +28 -0
  92. package/dist/modules/core-store.d.ts.map +1 -0
  93. package/dist/modules/cron.d.ts +27 -0
  94. package/dist/modules/cron.d.ts.map +1 -0
  95. package/dist/modules/custom-fields.d.ts +25 -0
  96. package/dist/modules/custom-fields.d.ts.map +1 -0
  97. package/dist/modules/documents/component-extension.d.ts +73 -0
  98. package/dist/modules/documents/component-extension.d.ts.map +1 -0
  99. package/dist/modules/documents/draft-and-publish.d.ts +12 -0
  100. package/dist/modules/documents/draft-and-publish.d.ts.map +1 -0
  101. package/dist/modules/documents/index.d.ts +27 -0
  102. package/dist/modules/documents/index.d.ts.map +1 -0
  103. package/dist/modules/documents/middleware.d.ts +14 -0
  104. package/dist/modules/documents/middleware.d.ts.map +1 -0
  105. package/dist/modules/documents/params/attributes/id.d.ts +4 -0
  106. package/dist/modules/documents/params/attributes/id.d.ts.map +1 -0
  107. package/dist/modules/documents/params/attributes/index.d.ts +79 -0
  108. package/dist/modules/documents/params/attributes/index.d.ts.map +1 -0
  109. package/dist/modules/documents/params/attributes/relations.d.ts +40 -0
  110. package/dist/modules/documents/params/attributes/relations.d.ts.map +1 -0
  111. package/dist/modules/documents/params/data.d.ts +67 -0
  112. package/dist/modules/documents/params/data.d.ts.map +1 -0
  113. package/dist/modules/documents/params/document-engine.d.ts +34 -0
  114. package/dist/modules/documents/params/document-engine.d.ts.map +1 -0
  115. package/dist/modules/documents/params/fields.d.ts +61 -0
  116. package/dist/modules/documents/params/fields.d.ts.map +1 -0
  117. package/dist/modules/documents/params/filters/index.d.ts +61 -0
  118. package/dist/modules/documents/params/filters/index.d.ts.map +1 -0
  119. package/dist/modules/documents/params/filters/operators.d.ts +9 -0
  120. package/dist/modules/documents/params/filters/operators.d.ts.map +1 -0
  121. package/dist/modules/documents/params/index.d.ts +162 -0
  122. package/dist/modules/documents/params/index.d.ts.map +1 -0
  123. package/dist/modules/documents/params/locale.d.ts +4 -0
  124. package/dist/modules/documents/params/locale.d.ts.map +1 -0
  125. package/dist/modules/documents/params/pagination.d.ts +11 -0
  126. package/dist/modules/documents/params/pagination.d.ts.map +1 -0
  127. package/dist/modules/documents/params/populate.d.ts +86 -0
  128. package/dist/modules/documents/params/populate.d.ts.map +1 -0
  129. package/dist/modules/documents/params/search.d.ts +2 -0
  130. package/dist/modules/documents/params/search.d.ts.map +1 -0
  131. package/dist/modules/documents/params/sort.d.ts +87 -0
  132. package/dist/modules/documents/params/sort.d.ts.map +1 -0
  133. package/dist/modules/documents/params/status.d.ts +12 -0
  134. package/dist/modules/documents/params/status.d.ts.map +1 -0
  135. package/dist/modules/documents/plugin.d.ts +11 -0
  136. package/dist/modules/documents/plugin.d.ts.map +1 -0
  137. package/dist/modules/documents/result/document-engine.d.ts +34 -0
  138. package/dist/modules/documents/result/document-engine.d.ts.map +1 -0
  139. package/dist/modules/documents/result/index.d.ts +93 -0
  140. package/dist/modules/documents/result/index.d.ts.map +1 -0
  141. package/dist/modules/documents/service-instance.d.ts +96 -0
  142. package/dist/modules/documents/service-instance.d.ts.map +1 -0
  143. package/dist/modules/entity-service/index.d.ts +87 -0
  144. package/dist/modules/entity-service/index.d.ts.map +1 -0
  145. package/dist/modules/entity-service/params/attributes/id.d.ts +3 -0
  146. package/dist/modules/entity-service/params/attributes/id.d.ts.map +1 -0
  147. package/dist/modules/entity-service/params/attributes/index.d.ts +71 -0
  148. package/dist/modules/entity-service/params/attributes/index.d.ts.map +1 -0
  149. package/dist/modules/entity-service/params/attributes/literals.d.ts +8 -0
  150. package/dist/modules/entity-service/params/attributes/literals.d.ts.map +1 -0
  151. package/dist/modules/entity-service/params/attributes/relation.d.ts +40 -0
  152. package/dist/modules/entity-service/params/attributes/relation.d.ts.map +1 -0
  153. package/dist/modules/entity-service/params/attributes/utils.d.ts +9 -0
  154. package/dist/modules/entity-service/params/attributes/utils.d.ts.map +1 -0
  155. package/dist/modules/entity-service/params/data.d.ts +52 -0
  156. package/dist/modules/entity-service/params/data.d.ts.map +1 -0
  157. package/dist/modules/entity-service/params/fields.d.ts +61 -0
  158. package/dist/modules/entity-service/params/fields.d.ts.map +1 -0
  159. package/dist/modules/entity-service/params/filters/index.d.ts +96 -0
  160. package/dist/modules/entity-service/params/filters/index.d.ts.map +1 -0
  161. package/dist/modules/entity-service/params/filters/operators.d.ts +9 -0
  162. package/dist/modules/entity-service/params/filters/operators.d.ts.map +1 -0
  163. package/dist/modules/entity-service/params/index.d.ts +123 -0
  164. package/dist/modules/entity-service/params/index.d.ts.map +1 -0
  165. package/dist/modules/entity-service/params/pagination.d.ts +10 -0
  166. package/dist/modules/entity-service/params/pagination.d.ts.map +1 -0
  167. package/dist/modules/entity-service/params/populate.d.ts +69 -0
  168. package/dist/modules/entity-service/params/populate.d.ts.map +1 -0
  169. package/dist/modules/entity-service/params/search.d.ts +2 -0
  170. package/dist/modules/entity-service/params/search.d.ts.map +1 -0
  171. package/dist/modules/entity-service/params/sort.d.ts +95 -0
  172. package/dist/modules/entity-service/params/sort.d.ts.map +1 -0
  173. package/dist/modules/entity-service/plugin.d.ts +11 -0
  174. package/dist/modules/entity-service/plugin.d.ts.map +1 -0
  175. package/dist/modules/entity-service/result.d.ts +78 -0
  176. package/dist/modules/entity-service/result.d.ts.map +1 -0
  177. package/dist/modules/entity-validator.d.ts +21 -0
  178. package/dist/modules/entity-validator.d.ts.map +1 -0
  179. package/dist/modules/event-hub.d.ts +16 -0
  180. package/dist/modules/event-hub.d.ts.map +1 -0
  181. package/dist/modules/features.d.ts +12 -0
  182. package/dist/modules/features.d.ts.map +1 -0
  183. package/dist/modules/fetch.d.ts +11 -0
  184. package/dist/modules/fetch.d.ts.map +1 -0
  185. package/dist/modules/index.d.ts +24 -0
  186. package/dist/modules/index.d.ts.map +1 -0
  187. package/dist/modules/mcp.d.ts +216 -0
  188. package/dist/modules/mcp.d.ts.map +1 -0
  189. package/dist/modules/metrics.d.ts +8 -0
  190. package/dist/modules/metrics.d.ts.map +1 -0
  191. package/dist/modules/permissions.d.ts +14 -0
  192. package/dist/modules/permissions.d.ts.map +1 -0
  193. package/dist/modules/request-context.d.ts +6 -0
  194. package/dist/modules/request-context.d.ts.map +1 -0
  195. package/dist/modules/sanitizers.d.ts +8 -0
  196. package/dist/modules/sanitizers.d.ts.map +1 -0
  197. package/dist/modules/server.d.ts +29 -0
  198. package/dist/modules/server.d.ts.map +1 -0
  199. package/dist/modules/session-manager.d.ts +70 -0
  200. package/dist/modules/session-manager.d.ts.map +1 -0
  201. package/dist/modules/validators.d.ts +8 -0
  202. package/dist/modules/validators.d.ts.map +1 -0
  203. package/dist/modules/webhook-runner.d.ts +19 -0
  204. package/dist/modules/webhook-runner.d.ts.map +1 -0
  205. package/dist/modules/webhook-store.d.ts +21 -0
  206. package/dist/modules/webhook-store.d.ts.map +1 -0
  207. package/dist/plugin/config/index.d.ts +3 -0
  208. package/dist/plugin/config/index.d.ts.map +1 -0
  209. package/dist/plugin/config/strapi-admin/index.d.ts +8 -0
  210. package/dist/plugin/config/strapi-admin/index.d.ts.map +1 -0
  211. package/dist/plugin/config/strapi-server/config.d.ts +8 -0
  212. package/dist/plugin/config/strapi-server/config.d.ts.map +1 -0
  213. package/dist/plugin/config/strapi-server/content-types.d.ts +11 -0
  214. package/dist/plugin/config/strapi-server/content-types.d.ts.map +1 -0
  215. package/dist/plugin/config/strapi-server/controllers.d.ts +8 -0
  216. package/dist/plugin/config/strapi-server/controllers.d.ts.map +1 -0
  217. package/dist/plugin/config/strapi-server/index.d.ts +21 -0
  218. package/dist/plugin/config/strapi-server/index.d.ts.map +1 -0
  219. package/dist/plugin/config/strapi-server/lifecycle.d.ts +8 -0
  220. package/dist/plugin/config/strapi-server/lifecycle.d.ts.map +1 -0
  221. package/dist/plugin/config/strapi-server/routes.d.ts +11 -0
  222. package/dist/plugin/config/strapi-server/routes.d.ts.map +1 -0
  223. package/dist/plugin/index.d.ts +40 -0
  224. package/dist/plugin/index.d.ts.map +1 -0
  225. package/dist/public/index.d.ts +6 -0
  226. package/dist/public/index.d.ts.map +1 -0
  227. package/dist/public/registries.d.ts +68 -0
  228. package/dist/public/registries.d.ts.map +1 -0
  229. package/dist/public/shared.d.ts +61 -0
  230. package/dist/public/shared.d.ts.map +1 -0
  231. package/dist/schema/attribute/base.d.ts +92 -0
  232. package/dist/schema/attribute/base.d.ts.map +1 -0
  233. package/dist/schema/attribute/common.d.ts +29 -0
  234. package/dist/schema/attribute/common.d.ts.map +1 -0
  235. package/dist/schema/attribute/constants.d.ts +12 -0
  236. package/dist/schema/attribute/constants.d.ts.map +1 -0
  237. package/dist/schema/attribute/definitions/biginteger.d.ts +19 -0
  238. package/dist/schema/attribute/definitions/biginteger.d.ts.map +1 -0
  239. package/dist/schema/attribute/definitions/blocks.d.ts +80 -0
  240. package/dist/schema/attribute/definitions/blocks.d.ts.map +1 -0
  241. package/dist/schema/attribute/definitions/boolean.d.ts +19 -0
  242. package/dist/schema/attribute/definitions/boolean.d.ts.map +1 -0
  243. package/dist/schema/attribute/definitions/component.d.ts +25 -0
  244. package/dist/schema/attribute/definitions/component.d.ts.map +1 -0
  245. package/dist/schema/attribute/definitions/date-time.d.ts +18 -0
  246. package/dist/schema/attribute/definitions/date-time.d.ts.map +1 -0
  247. package/dist/schema/attribute/definitions/date.d.ts +18 -0
  248. package/dist/schema/attribute/definitions/date.d.ts.map +1 -0
  249. package/dist/schema/attribute/definitions/decimal.d.ts +19 -0
  250. package/dist/schema/attribute/definitions/decimal.d.ts.map +1 -0
  251. package/dist/schema/attribute/definitions/dynamic-zone.d.ts +25 -0
  252. package/dist/schema/attribute/definitions/dynamic-zone.d.ts.map +1 -0
  253. package/dist/schema/attribute/definitions/email.d.ts +19 -0
  254. package/dist/schema/attribute/definitions/email.d.ts.map +1 -0
  255. package/dist/schema/attribute/definitions/enumeration.d.ts +22 -0
  256. package/dist/schema/attribute/definitions/enumeration.d.ts.map +1 -0
  257. package/dist/schema/attribute/definitions/float.d.ts +19 -0
  258. package/dist/schema/attribute/definitions/float.d.ts.map +1 -0
  259. package/dist/schema/attribute/definitions/index.d.ts +23 -0
  260. package/dist/schema/attribute/definitions/index.d.ts.map +1 -0
  261. package/dist/schema/attribute/definitions/integer.d.ts +19 -0
  262. package/dist/schema/attribute/definitions/integer.d.ts.map +1 -0
  263. package/dist/schema/attribute/definitions/json.d.ts +17 -0
  264. package/dist/schema/attribute/definitions/json.d.ts.map +1 -0
  265. package/dist/schema/attribute/definitions/media.d.ts +24 -0
  266. package/dist/schema/attribute/definitions/media.d.ts.map +1 -0
  267. package/dist/schema/attribute/definitions/password.d.ts +18 -0
  268. package/dist/schema/attribute/definitions/password.d.ts.map +1 -0
  269. package/dist/schema/attribute/definitions/relation.d.ts +167 -0
  270. package/dist/schema/attribute/definitions/relation.d.ts.map +1 -0
  271. package/dist/schema/attribute/definitions/richtext.d.ts +18 -0
  272. package/dist/schema/attribute/definitions/richtext.d.ts.map +1 -0
  273. package/dist/schema/attribute/definitions/string.d.ts +28 -0
  274. package/dist/schema/attribute/definitions/string.d.ts.map +1 -0
  275. package/dist/schema/attribute/definitions/text.d.ts +23 -0
  276. package/dist/schema/attribute/definitions/text.d.ts.map +1 -0
  277. package/dist/schema/attribute/definitions/time.d.ts +18 -0
  278. package/dist/schema/attribute/definitions/time.d.ts.map +1 -0
  279. package/dist/schema/attribute/definitions/timestamp.d.ts +18 -0
  280. package/dist/schema/attribute/definitions/timestamp.d.ts.map +1 -0
  281. package/dist/schema/attribute/definitions/uid.d.ts +31 -0
  282. package/dist/schema/attribute/definitions/uid.d.ts.map +1 -0
  283. package/dist/schema/attribute/index.d.ts +7 -0
  284. package/dist/schema/attribute/index.d.ts.map +1 -0
  285. package/dist/schema/attribute/options.d.ts +221 -0
  286. package/dist/schema/attribute/options.d.ts.map +1 -0
  287. package/dist/schema/attribute/utils.d.ts +101 -0
  288. package/dist/schema/attribute/utils.d.ts.map +1 -0
  289. package/dist/schema/index.d.ts +144 -0
  290. package/dist/schema/index.d.ts.map +1 -0
  291. package/dist/struct/index.d.ts +3 -0
  292. package/dist/struct/index.d.ts.map +1 -0
  293. package/dist/struct/schema-definition.d.ts +10 -0
  294. package/dist/struct/schema-definition.d.ts.map +1 -0
  295. package/dist/struct/schema.d.ts +286 -0
  296. package/dist/struct/schema.d.ts.map +1 -0
  297. package/dist/uid/index.d.ts +168 -0
  298. package/dist/uid/index.d.ts.map +1 -0
  299. package/dist/utils/array.d.ts +80 -0
  300. package/dist/utils/array.d.ts.map +1 -0
  301. package/dist/utils/constants.d.ts +67 -0
  302. package/dist/utils/constants.d.ts.map +1 -0
  303. package/dist/utils/expression.d.ts +490 -0
  304. package/dist/utils/expression.d.ts.map +1 -0
  305. package/dist/utils/function.d.ts +21 -0
  306. package/dist/utils/function.d.ts.map +1 -0
  307. package/dist/utils/guard.d.ts +90 -0
  308. package/dist/utils/guard.d.ts.map +1 -0
  309. package/dist/utils/index.d.ts +236 -0
  310. package/dist/utils/index.d.ts.map +1 -0
  311. package/dist/utils/json.d.ts +119 -0
  312. package/dist/utils/json.d.ts.map +1 -0
  313. package/dist/utils/object.d.ts +180 -0
  314. package/dist/utils/object.d.ts.map +1 -0
  315. package/dist/utils/string.d.ts +190 -0
  316. package/dist/utils/string.d.ts.map +1 -0
  317. package/dist/utils/tuple.d.ts +19 -0
  318. package/dist/utils/tuple.d.ts.map +1 -0
  319. package/package.json +68 -0
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Interfaces and types designed for managing attribute options.
3
+ *
4
+ * It includes (but is not limited to) settings for requirements, privacy, uniqueness, default values, configurability,
5
+ * constraints, visibility, and writability of an attribute as well as the provision for custom fields.
6
+ */
7
+ /**
8
+ * Specifies whether an attribute is required to be filled.
9
+ *
10
+ * If not defined, it defaults to false.
11
+ */
12
+ export interface RequiredOption {
13
+ required?: boolean;
14
+ }
15
+ /**
16
+ * Specifies whether an attribute is private and should be included in the content API entries.
17
+ *
18
+ * If not defined, it defaults to false.
19
+ */
20
+ export interface PrivateOption {
21
+ private?: boolean;
22
+ }
23
+ /**
24
+ * Specifies whether an attribute must have unique values for each entry.
25
+ *
26
+ * If not defined, it defaults to false.
27
+ */
28
+ export interface UniqueOption {
29
+ unique?: boolean;
30
+ }
31
+ /**
32
+ * Allow declaring a default value for an attribute's value.
33
+ *
34
+ * If not defined, there is no default value and the field will default to `null`.
35
+ */
36
+ export interface DefaultOption<T> {
37
+ default?: T | (() => T);
38
+ }
39
+ /**
40
+ * Specifies whether an attribute can be configured from the admin panel.
41
+ *
42
+ * If not defined, it defaults to false.
43
+ */
44
+ export interface ConfigurableOption {
45
+ configurable?: boolean;
46
+ }
47
+ /**
48
+ * Sets a minimum and/or maximum constraint for an attribute.
49
+ *
50
+ * If any of the property is undefined, there won't be any limit.
51
+ *
52
+ * @template T - The min/max type
53
+ */
54
+ export interface MinMaxOption<T = number> {
55
+ min?: T;
56
+ max?: T;
57
+ }
58
+ /**
59
+ * Sets a minimum length and/or maximum length constraint for the total length for a text based field.
60
+ *
61
+ * If any of the property is undefined, there won't be any limit.
62
+ */
63
+ export interface MinMaxLengthOption {
64
+ minLength?: number;
65
+ maxLength?: number;
66
+ }
67
+ /**
68
+ * Specified whether an attribute's value can be filled using the content API (REST or GraphQL)
69
+ *
70
+ * If not defined, the attribute is considered writable.
71
+ */
72
+ export interface WritableOption {
73
+ writable?: boolean;
74
+ }
75
+ /**
76
+ * Specifies whether an attribute should be visible in the content-manager.
77
+ *
78
+ * If not defined, the attribute is considered visible.
79
+ */
80
+ export interface VisibleOption {
81
+ visible?: boolean;
82
+ }
83
+ /**
84
+ * Setters for the attributes options
85
+ */
86
+ /**
87
+ * Forces the attribute to be required.
88
+ *
89
+ * @see RequiredOption
90
+ */
91
+ export type Required = {
92
+ required: true;
93
+ };
94
+ /**
95
+ * Forces the attribute to be optional
96
+ *
97
+ * @see RequiredOption
98
+ */
99
+ export type NonRequired = {
100
+ required: false;
101
+ };
102
+ /**
103
+ * Forces the attribute to be private
104
+ *
105
+ * @see PrivateOption
106
+ */
107
+ export type Private = {
108
+ private: true;
109
+ };
110
+ /**
111
+ * Forces the attribute to not be private
112
+ *
113
+ * @see PrivateOption
114
+ */
115
+ export type NonPrivate = {
116
+ private: false;
117
+ };
118
+ /**
119
+ * Forces the attribute to be unique
120
+ *
121
+ * @see UniqueOption
122
+ */
123
+ export type Unique = {
124
+ unique: true;
125
+ };
126
+ /**
127
+ * Forces the attribute not to be unique
128
+ *
129
+ * @see UniqueOption
130
+ */
131
+ export type NonUnique = {
132
+ unique: false;
133
+ };
134
+ /**
135
+ * Forces the attribute not to be configurable
136
+ *
137
+ * @see ConfigurableOption
138
+ */
139
+ export type Configurable = {
140
+ configurable: true;
141
+ };
142
+ /**
143
+ * Forces the attribute not to be configurable
144
+ *
145
+ * @see ConfigurableOption
146
+ */
147
+ export type NonConfigurable = {
148
+ configurable: false;
149
+ };
150
+ /**
151
+ * Forces the attribute to be writable
152
+ *
153
+ * @see WritableOption
154
+ */
155
+ export type Writable = {
156
+ writable: true;
157
+ };
158
+ /**
159
+ * Forces the attribute not to be writable
160
+ *
161
+ * @see WritableOption
162
+ */
163
+ export type NonWritable = {
164
+ writable: false;
165
+ };
166
+ /**
167
+ * Forces the attribute to be visible
168
+ *
169
+ * @see VisibleOption
170
+ */
171
+ export type Visible = {
172
+ visible: true;
173
+ };
174
+ /**
175
+ * Forces the attribute to be invisible
176
+ *
177
+ * @see VisibleOption
178
+ */
179
+ export type NonVisible = {
180
+ visible: false;
181
+ };
182
+ export type CustomField<TKind extends string, TOptions extends object | undefined = undefined> = {
183
+ customField: TKind;
184
+ options?: TOptions;
185
+ };
186
+ /**
187
+ * Creates a {@link MinMaxOption} configuration object with the given values.
188
+ *
189
+ * @template TConfig The min/max configuration
190
+ * @template TType The type of the values.
191
+ *
192
+ * @see MinMaxOption
193
+ */
194
+ export type SetMinMax<TConfig extends MinMaxOption<TType>, TType = number> = TConfig;
195
+ /**
196
+ * Creates a {@link MinMaxLengthOption} configuration object with the given values.
197
+ *
198
+ * @template TConfig The minLength/maxLength configuration
199
+ *
200
+ * @see MinMaxLengthOption
201
+ */
202
+ export type SetMinMaxLength<TConfig extends MinMaxLengthOption> = TConfig;
203
+ /**
204
+ * Creates a plugin options' configuration object with the given values.
205
+ *
206
+ * @template TConfig The plugin options
207
+ */
208
+ export type SetPluginOptions<TConfig extends object = object> = {
209
+ pluginOptions?: TConfig;
210
+ };
211
+ /**
212
+ * Sets a default value for a {@link DefaultOption}
213
+ *
214
+ * @template T
215
+ *
216
+ * @see DefaultOption
217
+ */
218
+ export type DefaultTo<T> = {
219
+ default: T;
220
+ };
221
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/schema/attribute/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;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H,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAA;CAAE,CAAC;AAI9C;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;AAG5C,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,IAAI;IAC/F,WAAW,EAAE,KAAK,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB,CAAC;AAIF;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC;AAIrF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,kBAAkB,IAAI,OAAO,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,IAAI;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type * as UID from '../../uid';
2
+ import type { Constants, Guard, And, Extends, IsNotNever } from '../../utils';
3
+ import type { Attribute } from '..';
4
+ /**
5
+ * Determines if a given attribute type is of a specific kind.
6
+ *
7
+ * @template TAttribute - The attribute type to check.
8
+ * @template TKind - The kind of attribute to compare against.
9
+ */
10
+ export type IsOfType<TAttribute extends Attribute.Attribute, TKind extends Attribute.Kind> = TAttribute extends {
11
+ type: TKind;
12
+ } ? true : false;
13
+ /**
14
+ * Checks whether a given Attribute {@link TAttribute} is populatable.
15
+ *
16
+ * @template TAttribute - The attribute to check.
17
+ *
18
+ * @see {@link PopulatableKind} for more information about populatable attributes.
19
+ */
20
+ export type IsPopulatable<TAttribute extends Attribute.Attribute> = IsOfType<TAttribute, Attribute.PopulatableKind>;
21
+ /**
22
+ * Returns the type (as {@link Kind}) of a given attribute.
23
+ *
24
+ * @template TAttribute - Any attribute
25
+ */
26
+ export type TypeOf<TAttribute extends Attribute.Attribute> = TAttribute['type'];
27
+ /**
28
+ * Extract the target of an attribute.
29
+ *
30
+ * Returns never if the attribute don't have a target.
31
+ *
32
+ * Returns {@link UID.Schema} if a valid target is found
33
+ *
34
+ * @template TAttribute - The attribute to use
35
+ *
36
+ * @remark Targets can only be inferred from relation, component, and media attributes.
37
+ */
38
+ export type Target<TAttribute extends Attribute.Attribute> = Attribute.RelationTarget<TAttribute> | Attribute.ComponentTarget<TAttribute> | Attribute.MediaTarget<TAttribute>;
39
+ /**
40
+ * Extract the potential targets of a polymorphic attribute.
41
+ *
42
+ * Returns never if the attribute don't have any target.
43
+ *
44
+ * Returns {@link UID.Schema} if valid targets are found
45
+ *
46
+ * @template TAttribute - The attribute to use
47
+ *
48
+ * @remark Morph targets can only be inferred from dynamic-zone attributes.
49
+ */
50
+ export type MorphTargets<TAttribute extends Attribute.Attribute> = Attribute.DynamicZoneTargets<TAttribute>;
51
+ /**
52
+ * Checks whether an attribute has a valid target.
53
+ *
54
+ * @template TAttribute - The attribute to check
55
+ *
56
+ * @see Target
57
+ *
58
+ * @remark Targets can only be inferred from relation, component, and media attributes.
59
+ */
60
+ export type HasTarget<TAttribute extends Attribute.Attribute> = Target<TAttribute> extends infer TTarget ? And<IsNotNever<TTarget>, Extends<TTarget, UID.Schema>> : Constants.False;
61
+ /**
62
+ * Checks whether an attribute has valid targets.
63
+ *
64
+ * @template TAttribute - The attribute to check
65
+ *
66
+ * @see MorphTargets
67
+ *
68
+ * @remark Targets can only be inferred from dynamic-zone attributes.
69
+ */
70
+ export type HasMorphTargets<TAttribute extends Attribute.Attribute> = MorphTargets<TAttribute> extends infer TMaybeTargets ? And<IsNotNever<TMaybeTargets>, Extends<TMaybeTargets, UID.Schema>> : Constants.False;
71
+ /**
72
+ * Represents the actual value of a given attribute {@link TAttribute}.
73
+ *
74
+ * @template TAttribute - The attribute to extract the value from.
75
+ * @template TGuard - The fallback type to use if it's not possible to infer the correct type value.
76
+ */
77
+ export type Value<TAttribute extends Attribute.Attribute, TGuard = unknown> = Guard.Never<{
78
+ biginteger: Attribute.GetBigIntegerValue<TAttribute>;
79
+ boolean: Attribute.GetBooleanValue<TAttribute>;
80
+ blocks: Attribute.GetBlocksValue<TAttribute>;
81
+ decimal: Attribute.GetDecimalValue<TAttribute>;
82
+ enumeration: Attribute.GetEnumerationValue<TAttribute>;
83
+ email: Attribute.GetEmailValue<TAttribute>;
84
+ float: Attribute.GetFloatValue<TAttribute>;
85
+ integer: Attribute.GetIntegerValue<TAttribute>;
86
+ json: Attribute.GetJsonValue<TAttribute>;
87
+ password: Attribute.GetPasswordValue<TAttribute>;
88
+ richtext: Attribute.GetRichTextValue<TAttribute>;
89
+ string: Attribute.GetStringValue<TAttribute>;
90
+ text: Attribute.GetTextValue<TAttribute>;
91
+ uid: Attribute.GetUIDValue<TAttribute>;
92
+ date: Attribute.GetDateValue<TAttribute>;
93
+ datetime: Attribute.GetDateTimeValue<TAttribute>;
94
+ time: Attribute.GetTimeValue<TAttribute>;
95
+ timestamp: Attribute.GetTimestampValue<TAttribute>;
96
+ component: Attribute.GetComponentValue<TAttribute>;
97
+ dynamiczone: Attribute.GetDynamicZoneValue<TAttribute>;
98
+ media: Attribute.GetMediaValue<TAttribute>;
99
+ relation: Attribute.GetRelationValue<TAttribute>;
100
+ }[Attribute.TypeOf<TAttribute>], TGuard>;
101
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/schema/attribute/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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S,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACjD,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAEnD,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACnD,WAAW,EAAE,SAAS,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACvD,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;CAClD,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAC/B,MAAM,CACP,CAAC"}
@@ -0,0 +1,144 @@
1
+ import type * as Public from '../public';
2
+ import type * as UID from '../uid';
3
+ import type { If, Object, Guard } from '../utils';
4
+ import type * as Attribute from './attribute';
5
+ export { Attribute };
6
+ /**
7
+ * Combines both content type and component schemas, effectively serving as a consolidated registry of all schemas.
8
+ *
9
+ * Enables mapping between a unique identifier and its corresponding schema.
10
+ *
11
+ @remark Schema definitions are pulled from the public registries
12
+ */
13
+ export type Schemas = Public.ContentTypeSchemas & Public.ComponentSchemas;
14
+ /**
15
+ * Content-type schema definitions.
16
+ *
17
+ * @remark Schema definitions are pulled from the public content-type registries
18
+ */
19
+ export type ContentTypes = Public.ContentTypeSchemas;
20
+ /**
21
+ * Component schema definitions.
22
+ *
23
+ * @remark Schema definitions are pulled from the public component registries
24
+ */
25
+ export type Components = Public.ComponentSchemas;
26
+ export type ContentType<TContentTypeUID extends UID.ContentType = UID.ContentType> = ContentTypes[TContentTypeUID];
27
+ export type Component<TComponentUID extends UID.Component = UID.Component> = Components[TComponentUID];
28
+ /**
29
+ * Returns the Schema data structure associated with the given UID
30
+ *
31
+ * @template TSchemaUID - The unique identifier for the schema.
32
+ *
33
+ * @see Schemas
34
+ */
35
+ export type Schema<TSchemaUID extends UID.Schema = UID.Schema> = Schemas[TSchemaUID];
36
+ /**
37
+ * Returns the `info` property for a given schema.
38
+ *
39
+ * @template TSchemaUID - The targeted schema UID.
40
+ *
41
+ * @see Schema
42
+ */
43
+ export type Info<TSchemaUID extends UID.Schema> = Schema<TSchemaUID>['info'];
44
+ /**
45
+ * Returns the `modelType` property for a given schema.
46
+ *
47
+ * @template TSchemaUID - The targeted schema UID.
48
+ *
49
+ * @see Schema
50
+ */
51
+ export type ModelType<TSchemaUID extends UID.Schema> = Schema<TSchemaUID>['modelType'];
52
+ /**
53
+ * Returns the attribute {@link TAttributeName} from {@link TSchemaUID}'s attributes.
54
+ *
55
+ * @template TSchemaUID - The Schema's UID used to look for attributes.
56
+ * @template TAttributeName - The name of the wanted attribute.
57
+ */
58
+ export type AttributeByName<TSchemaUID extends UID.Schema, TAttributeName extends AttributeNames<TSchemaUID>> = Attributes<TSchemaUID>[TAttributeName];
59
+ /**
60
+ * Represents the value of an attribute based on its name
61
+ *
62
+ * @template TSchemaUID - The Schema's UID used to look for attributes.
63
+ * @template TAttributeName - The name of the wanted attribute.
64
+ */
65
+ export type AttributeValueByName<TSchemaUID extends UID.Schema, TAttributeName extends AttributeNames<TSchemaUID>> = Attribute.Value<AttributeByName<TSchemaUID, TAttributeName>>;
66
+ /**
67
+ * Returns an object containing every attribute within {@link TSchemaUID}.
68
+ *
69
+ * @template TSchemaUID - The Schema's UID used to get its attributes
70
+ */
71
+ export type Attributes<TSchemaUID extends UID.Schema = UID.Schema> = {
72
+ [TUID in TSchemaUID]: Schema<TSchemaUID>['attributes'];
73
+ }[TSchemaUID];
74
+ /**
75
+ * Union type of every attribute name within {@link TSchemaUID}'s attributes
76
+ *
77
+ * @template TSchemaUID - The Schema's UID used to get the attributes names.
78
+ */
79
+ export type AttributeNames<TSchemaUID extends UID.Schema> = Extract<keyof Attributes<TSchemaUID>, string>;
80
+ /**
81
+ * Create an attribute record whose types matches the given ones.
82
+ *
83
+ * @template TSchemaUID - The Schema's UID used to get the attribute names.
84
+ * @template TKind - The kind of attribute we are searching for.
85
+ * @template TCondition - Optional. An additional condition to match additional attributes properties.
86
+ */
87
+ export type AttributesByType<TSchemaUID extends UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Object.PickBy<Attributes<TSchemaUID>, Attribute.OfType<TKind> & Guard.Never<TCondition>>;
88
+ /**
89
+ * Returns a union of attribute names whose type matches the given ones.
90
+ *
91
+ * @template TSchemaUID - The Schema's UID used to get the attribute names.
92
+ * @template TKind - The kind of attribute we are searching for.
93
+ * @template TCondition - Optional. An additional condition to match additional attributes properties.
94
+ */
95
+ export type AttributeNamesByType<TSchemaUID extends UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Object.KeysBy<Attributes<TSchemaUID>, Attribute.OfType<TKind> & Guard.Never<TCondition, unknown>, AttributeNames<TSchemaUID>>;
96
+ /**
97
+ * Provides the names of non-populatable attributes of a Schema.
98
+ *
99
+ * Non-populatable attributes are those which do not need to be populated to get their final value.
100
+ *
101
+ * @template TSchemaUID - The unique identifier of the schema.
102
+ */
103
+ export type NonPopulatableAttributeNames<TSchemaUID extends UID.Schema> = AttributeNamesByType<TSchemaUID, Attribute.NonPopulatableKind>;
104
+ /**
105
+ * Provides the names of populatable attributes of a Schema.
106
+ *
107
+ * Populatable attributes are those which need to be populated to get their final value, such as {@link Attribute.Relation}, {@link Attribute.DynamicZone}, {@link Attribute.Component} or {@link Attribute.Media}.
108
+ *
109
+ * @template TSchemaUID - The unique identifier of the schema.
110
+ */
111
+ export type PopulatableAttributeNames<TSchemaUID extends UID.Schema> = AttributeNamesByType<TSchemaUID, Attribute.PopulatableKind>;
112
+ /**
113
+ * Returns a list of attribute names which have associated targets.
114
+ *
115
+ * @remark `
116
+ AttributeNamesWithTarget` maps over the list of attribute for a given schema and filters those
117
+ * with targets (in other words, attribute names that have associated {@link Attribute.HasTarget} true).
118
+ *
119
+ * @returns a union of each attribute's name matching the condition.
120
+ *
121
+ * @template TSchemaUID - The unique identifier of the schema.
122
+ */
123
+ export type AttributeNamesWithTarget<TSchemaUID extends UID.Schema> = Extract<Object.Values<{
124
+ [TKey in AttributeNames<TSchemaUID>]: If<Attribute.HasTarget<AttributeByName<TSchemaUID, TKey>>, TKey>;
125
+ }>, AttributeNames<TSchemaUID>>;
126
+ /**
127
+ * Extracts the names of all required attributes from a given schema.
128
+ *
129
+ * @remark `RequiredAttributeNames` screens attributes based on the {@link Attribute.Required} property,
130
+ * determining mandatory attributes from the given schema.
131
+ *
132
+ * @template TSchemaUID - The identifier of the schema.
133
+ */
134
+ export type RequiredAttributeNames<TSchemaUID extends UID.Schema> = Object.KeysBy<Attributes<TSchemaUID>, Attribute.Required, AttributeNames<TSchemaUID>>;
135
+ /**
136
+ * Returns a union of every optional attribute name by excluding required attribute keys from the given Schema UID.
137
+ *
138
+ * @remark The `
139
+ OptionalAttributeNames` type utilises the {@link Object.KeysExcept} utility that takes a Schema's attributes and excludes the keys of required attributes.
140
+ *
141
+ * @template TSchemaUID - The unique identifier for the schema.
142
+ */
143
+ export type OptionalAttributeNames<TSchemaUID extends UID.Schema> = Object.KeysExcept<Attributes<TSchemaUID>, Attribute.Required, AttributeNames<TSchemaUID>>;
144
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE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AAC,UAAU,SAAS,GAAG,CAAC,MAAM,IAAI,oBAAoB,CACzF,UAAU,EACV,SAAS,CAAC,eAAe,CAC1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,wBAAwB,CAAC,UAAU,SAAS,GAAG,CAAC,MAAM,IAAI,OAAO,CAC3E,MAAM,CAAC,MAAM,CAAC;KACX,IAAI,IAAI,cAAc,CAAC,UAAU,CAAC,GAAG,EAAE,CACtC,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,EACtD,IAAI,CACL;CACF,CAAC,EACF,cAAc,CAAC,UAAU,CAAC,CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,UAAU,SAAS,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAC/E,UAAU,CAAC,UAAU,CAAC,EACtB,SAAS,CAAC,QAAQ,EAClB,cAAc,CAAC,UAAU,CAAC,CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,UAAU,SAAS,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,CACnF,UAAU,CAAC,UAAU,CAAC,EACtB,SAAS,CAAC,QAAQ,EAClB,cAAc,CAAC,UAAU,CAAC,CAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type * from './schema';
2
+ export type * from './schema-definition';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/struct/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Schema } from './schema';
2
+ /**
3
+ * Represents a generic Schema before being loaded by Strapi (e.g. app or user defined schemas)
4
+ *
5
+ * @internal
6
+ */
7
+ export type SchemaDefinition = Omit<Schema, 'uid' | 'attributes'> & {
8
+ attributes: Record<string, Record<string, unknown>>;
9
+ };
10
+ //# sourceMappingURL=schema-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-definition.d.ts","sourceRoot":"","sources":["../../src/struct/schema-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,YAAY,CAAC,GAAG;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD,CAAC"}