tsondb 0.5.4 → 0.5.7

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 (203) hide show
  1. package/README.md +45 -8
  2. package/{lib → dist/src}/bin/tsondb.js +20 -4
  3. package/{lib → dist/src}/node/Schema.d.ts +2 -2
  4. package/{lib → dist/src}/node/index.d.ts +8 -3
  5. package/{lib → dist/src}/node/index.js +15 -14
  6. package/{lib → dist/src}/node/renderers/Output.d.ts +1 -1
  7. package/{lib → dist/src}/node/renderers/jsonschema/index.d.ts +2 -2
  8. package/{lib → dist/src}/node/renderers/jsonschema/render.d.ts +1 -1
  9. package/{lib → dist/src}/node/renderers/ts/index.d.ts +2 -2
  10. package/{lib → dist/src}/node/renderers/ts/render.d.ts +1 -1
  11. package/{lib → dist/src}/node/schema/Node.d.ts +4 -4
  12. package/{lib → dist/src}/node/schema/Node.js +12 -9
  13. package/{lib → dist/src}/node/schema/TypeParameter.d.ts +3 -3
  14. package/{lib → dist/src}/node/schema/declarations/Declaration.d.ts +8 -8
  15. package/{lib → dist/src}/node/schema/declarations/EntityDecl.d.ts +10 -10
  16. package/{lib → dist/src}/node/schema/declarations/EnumDecl.d.ts +9 -9
  17. package/{lib → dist/src}/node/schema/declarations/TypeAliasDecl.d.ts +7 -7
  18. package/dist/src/node/schema/index.d.ts +21 -0
  19. package/{lib → dist/src}/node/schema/types/Type.d.ts +16 -16
  20. package/{lib → dist/src}/node/schema/types/generic/ArrayType.d.ts +5 -5
  21. package/{lib → dist/src}/node/schema/types/generic/ArrayType.js +3 -2
  22. package/{lib → dist/src}/node/schema/types/generic/EnumType.d.ts +5 -5
  23. package/{lib → dist/src}/node/schema/types/generic/EnumType.js +6 -5
  24. package/{lib → dist/src}/node/schema/types/generic/ObjectType.d.ts +6 -6
  25. package/{lib → dist/src}/node/schema/types/generic/ObjectType.js +4 -3
  26. package/{lib → dist/src}/node/schema/types/primitives/BooleanType.d.ts +4 -4
  27. package/{lib → dist/src}/node/schema/types/primitives/BooleanType.js +2 -1
  28. package/{lib → dist/src}/node/schema/types/primitives/DateType.d.ts +5 -5
  29. package/{lib → dist/src}/node/schema/types/primitives/DateType.js +2 -1
  30. package/{lib → dist/src}/node/schema/types/primitives/FloatType.d.ts +5 -5
  31. package/{lib → dist/src}/node/schema/types/primitives/FloatType.js +2 -1
  32. package/{lib → dist/src}/node/schema/types/primitives/IntegerType.d.ts +5 -5
  33. package/{lib → dist/src}/node/schema/types/primitives/IntegerType.js +2 -1
  34. package/{lib → dist/src}/node/schema/types/primitives/NumericType.d.ts +4 -4
  35. package/{lib → dist/src}/node/schema/types/primitives/PrimitiveType.d.ts +4 -4
  36. package/{lib → dist/src}/node/schema/types/primitives/StringType.d.ts +5 -5
  37. package/{lib → dist/src}/node/schema/types/primitives/StringType.js +2 -1
  38. package/{lib → dist/src}/node/schema/types/references/IncludeIdentifierType.d.ts +9 -9
  39. package/{lib → dist/src}/node/schema/types/references/NestedEntityMapType.d.ts +8 -8
  40. package/{lib → dist/src}/node/schema/types/references/NestedEntityMapType.js +3 -2
  41. package/{lib → dist/src}/node/schema/types/references/ReferenceIdentifierType.d.ts +6 -6
  42. package/{lib → dist/src}/node/schema/types/references/TypeArgumentType.d.ts +5 -5
  43. package/{lib → dist/src}/node/schema/validation/type.d.ts +2 -2
  44. package/{lib → dist/src}/node/server/api/instanceOperations.d.ts +3 -3
  45. package/{lib → dist/src}/node/server/index.d.ts +4 -4
  46. package/{lib → dist/src}/node/server/init.d.ts +2 -2
  47. package/dist/src/node/utils/errorFormatting.d.ts +3 -0
  48. package/dist/src/node/utils/errorFormatting.js +4 -0
  49. package/{lib → dist/src}/node/utils/git.d.ts +1 -1
  50. package/{lib → dist/src}/node/utils/instances.d.ts +2 -2
  51. package/{lib → dist/src}/node/utils/references.d.ts +2 -2
  52. package/{lib → dist/src}/shared/api.d.ts +2 -2
  53. package/{lib → dist/src}/shared/utils/displayName.d.ts +1 -1
  54. package/{lib → dist/src}/shared/utils/instances.d.ts +2 -2
  55. package/{lib → dist/src}/web/api.d.ts +2 -2
  56. package/{lib → dist/src}/web/components/typeInputs/ArrayTypeInput.d.ts +3 -3
  57. package/{lib → dist/src}/web/components/typeInputs/BooleanTypeInput.d.ts +1 -1
  58. package/{lib → dist/src}/web/components/typeInputs/DateTypeInput.d.ts +1 -1
  59. package/{lib → dist/src}/web/components/typeInputs/EnumTypeInput.d.ts +3 -3
  60. package/{lib → dist/src}/web/components/typeInputs/FloatTypeInput.d.ts +1 -1
  61. package/{lib → dist/src}/web/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.d.ts +1 -1
  62. package/{lib → dist/src}/web/components/typeInputs/IncludeIdentifierTypeInput.d.ts +3 -3
  63. package/{lib → dist/src}/web/components/typeInputs/IntegerTypeInput.d.ts +1 -1
  64. package/{lib → dist/src}/web/components/typeInputs/NestedEntityMapTypeInput.d.ts +3 -3
  65. package/{lib → dist/src}/web/components/typeInputs/ObjectTypeInput.d.ts +3 -3
  66. package/{lib → dist/src}/web/components/typeInputs/ReferenceIdentifierTypeInput.d.ts +2 -2
  67. package/{lib → dist/src}/web/components/typeInputs/StringTypeInput.d.ts +1 -1
  68. package/{lib → dist/src}/web/components/typeInputs/TypeInput.d.ts +3 -3
  69. package/{lib → dist/src}/web/hooks/useEntityFromRoute.d.ts +1 -1
  70. package/{lib → dist/src}/web/hooks/useInstanceNamesByEntity.d.ts +1 -1
  71. package/{lib → dist/src}/web/hooks/useSecondaryDeclarations.d.ts +1 -1
  72. package/{lib → dist/src}/web/utils/typeSkeleton.d.ts +2 -2
  73. package/package.json +20 -23
  74. package/lib/node/schema/index.d.ts +0 -21
  75. /package/{lib → dist/src}/bin/tsondb.d.ts +0 -0
  76. /package/{lib → dist/src}/index.d.ts +0 -0
  77. /package/{lib → dist/src}/index.js +0 -0
  78. /package/{lib → dist/src}/node/Schema.js +0 -0
  79. /package/{lib → dist/src}/node/renderers/Output.js +0 -0
  80. /package/{lib → dist/src}/node/renderers/jsonschema/index.js +0 -0
  81. /package/{lib → dist/src}/node/renderers/jsonschema/render.js +0 -0
  82. /package/{lib → dist/src}/node/renderers/ts/index.js +0 -0
  83. /package/{lib → dist/src}/node/renderers/ts/render.js +0 -0
  84. /package/{lib → dist/src}/node/schema/TypeParameter.js +0 -0
  85. /package/{lib → dist/src}/node/schema/declarations/Declaration.js +0 -0
  86. /package/{lib → dist/src}/node/schema/declarations/EntityDecl.js +0 -0
  87. /package/{lib → dist/src}/node/schema/declarations/EnumDecl.js +0 -0
  88. /package/{lib → dist/src}/node/schema/declarations/TypeAliasDecl.js +0 -0
  89. /package/{lib → dist/src}/node/schema/index.js +0 -0
  90. /package/{lib → dist/src}/node/schema/types/Type.js +0 -0
  91. /package/{lib → dist/src}/node/schema/types/primitives/NumericType.js +0 -0
  92. /package/{lib → dist/src}/node/schema/types/primitives/PrimitiveType.js +0 -0
  93. /package/{lib → dist/src}/node/schema/types/references/IncludeIdentifierType.js +0 -0
  94. /package/{lib → dist/src}/node/schema/types/references/ReferenceIdentifierType.js +0 -0
  95. /package/{lib → dist/src}/node/schema/types/references/TypeArgumentType.js +0 -0
  96. /package/{lib → dist/src}/node/schema/validation/options.d.ts +0 -0
  97. /package/{lib → dist/src}/node/schema/validation/options.js +0 -0
  98. /package/{lib → dist/src}/node/schema/validation/type.js +0 -0
  99. /package/{lib → dist/src}/node/server/api/declarations.d.ts +0 -0
  100. /package/{lib → dist/src}/node/server/api/declarations.js +0 -0
  101. /package/{lib → dist/src}/node/server/api/git.d.ts +0 -0
  102. /package/{lib → dist/src}/node/server/api/git.js +0 -0
  103. /package/{lib → dist/src}/node/server/api/index.d.ts +0 -0
  104. /package/{lib → dist/src}/node/server/api/index.js +0 -0
  105. /package/{lib → dist/src}/node/server/api/instanceOperations.js +0 -0
  106. /package/{lib → dist/src}/node/server/api/instances.d.ts +0 -0
  107. /package/{lib → dist/src}/node/server/api/instances.js +0 -0
  108. /package/{lib → dist/src}/node/server/index.js +0 -0
  109. /package/{lib → dist/src}/node/server/init.js +0 -0
  110. /package/{lib → dist/src}/node/utils/error.d.ts +0 -0
  111. /package/{lib → dist/src}/node/utils/error.js +0 -0
  112. /package/{lib → dist/src}/node/utils/git.js +0 -0
  113. /package/{lib → dist/src}/node/utils/instances.js +0 -0
  114. /package/{lib → dist/src}/node/utils/path.d.ts +0 -0
  115. /package/{lib → dist/src}/node/utils/path.js +0 -0
  116. /package/{lib → dist/src}/node/utils/references.js +0 -0
  117. /package/{lib → dist/src}/node/utils/render.d.ts +0 -0
  118. /package/{lib → dist/src}/node/utils/render.js +0 -0
  119. /package/{lib → dist/src}/shared/api.js +0 -0
  120. /package/{lib → dist/src}/shared/enum.d.ts +0 -0
  121. /package/{lib → dist/src}/shared/enum.js +0 -0
  122. /package/{lib → dist/src}/shared/utils/array.d.ts +0 -0
  123. /package/{lib → dist/src}/shared/utils/array.js +0 -0
  124. /package/{lib → dist/src}/shared/utils/compare.d.ts +0 -0
  125. /package/{lib → dist/src}/shared/utils/compare.js +0 -0
  126. /package/{lib → dist/src}/shared/utils/displayName.js +0 -0
  127. /package/{lib → dist/src}/shared/utils/enum.d.ts +0 -0
  128. /package/{lib → dist/src}/shared/utils/enum.js +0 -0
  129. /package/{lib → dist/src}/shared/utils/git.d.ts +0 -0
  130. /package/{lib → dist/src}/shared/utils/git.js +0 -0
  131. /package/{lib → dist/src}/shared/utils/instances.js +0 -0
  132. /package/{lib → dist/src}/shared/utils/lazy.d.ts +0 -0
  133. /package/{lib → dist/src}/shared/utils/lazy.js +0 -0
  134. /package/{lib → dist/src}/shared/utils/markdown.d.ts +0 -0
  135. /package/{lib → dist/src}/shared/utils/markdown.js +0 -0
  136. /package/{lib → dist/src}/shared/utils/object.d.ts +0 -0
  137. /package/{lib → dist/src}/shared/utils/object.js +0 -0
  138. /package/{lib → dist/src}/shared/utils/result.d.ts +0 -0
  139. /package/{lib → dist/src}/shared/utils/result.js +0 -0
  140. /package/{lib → dist/src}/shared/utils/string.d.ts +0 -0
  141. /package/{lib → dist/src}/shared/utils/string.js +0 -0
  142. /package/{lib → dist/src}/shared/utils/typeSafety.d.ts +0 -0
  143. /package/{lib → dist/src}/shared/utils/typeSafety.js +0 -0
  144. /package/{lib → dist/src}/shared/utils/validation.d.ts +0 -0
  145. /package/{lib → dist/src}/shared/utils/validation.js +0 -0
  146. /package/{lib → dist/src}/shared/validation/array.d.ts +0 -0
  147. /package/{lib → dist/src}/shared/validation/array.js +0 -0
  148. /package/{lib → dist/src}/shared/validation/date.d.ts +0 -0
  149. /package/{lib → dist/src}/shared/validation/date.js +0 -0
  150. /package/{lib → dist/src}/shared/validation/identifier.d.ts +0 -0
  151. /package/{lib → dist/src}/shared/validation/identifier.js +0 -0
  152. /package/{lib → dist/src}/shared/validation/number.d.ts +0 -0
  153. /package/{lib → dist/src}/shared/validation/number.js +0 -0
  154. /package/{lib → dist/src}/shared/validation/object.d.ts +0 -0
  155. /package/{lib → dist/src}/shared/validation/object.js +0 -0
  156. /package/{lib → dist/src}/shared/validation/string.d.ts +0 -0
  157. /package/{lib → dist/src}/shared/validation/string.js +0 -0
  158. /package/{lib → dist/src}/web/api.js +0 -0
  159. /package/{lib → dist/src}/web/components/Git.d.ts +0 -0
  160. /package/{lib → dist/src}/web/components/Git.js +0 -0
  161. /package/{lib → dist/src}/web/components/Layout.d.ts +0 -0
  162. /package/{lib → dist/src}/web/components/Layout.js +0 -0
  163. /package/{lib → dist/src}/web/components/Select.d.ts +0 -0
  164. /package/{lib → dist/src}/web/components/Select.js +0 -0
  165. /package/{lib → dist/src}/web/components/typeInputs/ArrayTypeInput.js +0 -0
  166. /package/{lib → dist/src}/web/components/typeInputs/BooleanTypeInput.js +0 -0
  167. /package/{lib → dist/src}/web/components/typeInputs/DateTypeInput.js +0 -0
  168. /package/{lib → dist/src}/web/components/typeInputs/EnumTypeInput.js +0 -0
  169. /package/{lib → dist/src}/web/components/typeInputs/FloatTypeInput.js +0 -0
  170. /package/{lib → dist/src}/web/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.js +0 -0
  171. /package/{lib → dist/src}/web/components/typeInputs/IncludeIdentifierTypeInput.js +0 -0
  172. /package/{lib → dist/src}/web/components/typeInputs/IntegerTypeInput.js +0 -0
  173. /package/{lib → dist/src}/web/components/typeInputs/NestedEntityMapTypeInput.js +0 -0
  174. /package/{lib → dist/src}/web/components/typeInputs/ObjectTypeInput.js +0 -0
  175. /package/{lib → dist/src}/web/components/typeInputs/ReferenceIdentifierTypeInput.js +0 -0
  176. /package/{lib → dist/src}/web/components/typeInputs/StringTypeInput.js +0 -0
  177. /package/{lib → dist/src}/web/components/typeInputs/TypeInput.js +0 -0
  178. /package/{lib → dist/src}/web/components/typeInputs/utils/MismatchingTypeError.d.ts +0 -0
  179. /package/{lib → dist/src}/web/components/typeInputs/utils/MismatchingTypeError.js +0 -0
  180. /package/{lib → dist/src}/web/components/typeInputs/utils/ValidationErrors.d.ts +0 -0
  181. /package/{lib → dist/src}/web/components/typeInputs/utils/ValidationErrors.js +0 -0
  182. /package/{lib → dist/src}/web/hooks/useAPIResource.d.ts +0 -0
  183. /package/{lib → dist/src}/web/hooks/useAPIResource.js +0 -0
  184. /package/{lib → dist/src}/web/hooks/useEntityFromRoute.js +0 -0
  185. /package/{lib → dist/src}/web/hooks/useInstanceNamesByEntity.js +0 -0
  186. /package/{lib → dist/src}/web/hooks/useMappedAPIResource.d.ts +0 -0
  187. /package/{lib → dist/src}/web/hooks/useMappedAPIResource.js +0 -0
  188. /package/{lib → dist/src}/web/hooks/useSecondaryDeclarations.js +0 -0
  189. /package/{lib → dist/src}/web/index.d.ts +0 -0
  190. /package/{lib → dist/src}/web/index.js +0 -0
  191. /package/{lib → dist/src}/web/routes/CreateInstance.d.ts +0 -0
  192. /package/{lib → dist/src}/web/routes/CreateInstance.js +0 -0
  193. /package/{lib → dist/src}/web/routes/Entity.d.ts +0 -0
  194. /package/{lib → dist/src}/web/routes/Entity.js +0 -0
  195. /package/{lib → dist/src}/web/routes/Home.d.ts +0 -0
  196. /package/{lib → dist/src}/web/routes/Home.js +0 -0
  197. /package/{lib → dist/src}/web/routes/Instance.d.ts +0 -0
  198. /package/{lib → dist/src}/web/routes/Instance.js +0 -0
  199. /package/{lib → dist/src}/web/routes/NotFound.d.ts +0 -0
  200. /package/{lib → dist/src}/web/routes/NotFound.js +0 -0
  201. /package/{lib → dist/src}/web/utils/Markdown.d.ts +0 -0
  202. /package/{lib → dist/src}/web/utils/Markdown.js +0 -0
  203. /package/{lib → dist/src}/web/utils/typeSkeleton.js +0 -0
@@ -2,6 +2,7 @@ import { sortObjectKeys } from "../../../../shared/utils/object.js";
2
2
  import { parallelizeErrors } from "../../../../shared/utils/validation.js";
3
3
  import { validateObjectConstraints } from "../../../../shared/validation/object.js";
4
4
  import { wrapErrorsIfAny } from "../../../utils/error.js";
5
+ import { json, key as keyColor } from "../../../utils/errorFormatting.js";
5
6
  import { getNestedDeclarations } from "../../declarations/Declaration.js";
6
7
  import { NodeKind } from "../../Node.js";
7
8
  import { validateOption } from "../../validation/options.js";
@@ -29,7 +30,7 @@ export const isObjectType = (node) => node.kind === NodeKind.ObjectType;
29
30
  export const getNestedDeclarationsInObjectType = (addedDecls, type) => Object.values(type.properties).reduce((acc, prop) => getNestedDeclarations(acc, prop.type), addedDecls);
30
31
  export const validateObjectType = (helpers, type, value) => {
31
32
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
32
- return [TypeError(`expected an object, but got ${JSON.stringify(value)}`)];
33
+ return [TypeError(`expected an object, but got ${json(value)}`)];
33
34
  }
34
35
  const expectedKeys = Object.keys(type.properties);
35
36
  return parallelizeErrors([
@@ -38,10 +39,10 @@ export const validateObjectType = (helpers, type, value) => {
38
39
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
39
40
  const prop = type.properties[key];
40
41
  if (prop.isRequired && !(key in value)) {
41
- return TypeError(`missing required property "${key}"`);
42
+ return TypeError(`missing required property ${keyColor(`"${key}"`)}`);
42
43
  }
43
44
  else if (prop.isRequired || value[key] !== undefined) {
44
- return wrapErrorsIfAny(`at object key "${key}"`, validate(helpers, prop.type, value[key]));
45
+ return wrapErrorsIfAny(`at object key ${keyColor(`"${key}"`)}`, validate(helpers, prop.type, value[key]));
45
46
  }
46
47
  return undefined;
47
48
  }),
@@ -1,7 +1,7 @@
1
- import type { GetReferences, Node, Serializer } from "../../Node.js";
2
- import { NodeKind } from "../../Node.js";
3
- import type { Validator } from "../../validation/type.js";
4
- import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.js";
1
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
2
+ import { NodeKind } from "../../Node.ts";
3
+ import type { Validator } from "../../validation/type.ts";
4
+ import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.ts";
5
5
  export interface BooleanType extends BaseType {
6
6
  kind: NodeKind["BooleanType"];
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { json } from "../../../utils/errorFormatting.js";
1
2
  import { NodeKind } from "../../Node.js";
2
3
  import { removeParentKey } from "../Type.js";
3
4
  export const BooleanType = () => ({
@@ -7,7 +8,7 @@ export { BooleanType as Boolean };
7
8
  export const isBooleanType = (node) => node.kind === NodeKind.BooleanType;
8
9
  export const validateBooleanType = (_helpers, _type, value) => {
9
10
  if (typeof value !== "boolean") {
10
- return [TypeError(`expected a boolean value, but got ${JSON.stringify(value)}`)];
11
+ return [TypeError(`expected a boolean value, but got ${json(value)}`)];
11
12
  }
12
13
  return [];
13
14
  };
@@ -1,8 +1,8 @@
1
- import type { DateConstraints } from "../../../../shared/validation/date.js";
2
- import type { GetReferences, Node, Serializer } from "../../Node.js";
3
- import { NodeKind } from "../../Node.js";
4
- import type { Validator } from "../../validation/type.js";
5
- import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.js";
1
+ import type { DateConstraints } from "../../../../shared/validation/date.ts";
2
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
3
+ import { NodeKind } from "../../Node.ts";
4
+ import type { Validator } from "../../validation/type.ts";
5
+ import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.ts";
6
6
  export interface DateType extends BaseType, DateConstraints {
7
7
  kind: NodeKind["DateType"];
8
8
  }
@@ -1,4 +1,5 @@
1
1
  import { validateDateConstraints } from "../../../../shared/validation/date.js";
2
+ import { json } from "../../../utils/errorFormatting.js";
2
3
  import { NodeKind } from "../../Node.js";
3
4
  import { removeParentKey } from "../Type.js";
4
5
  export const DateType = (options) => ({
@@ -9,7 +10,7 @@ export { DateType as Date };
9
10
  export const isDateType = (node) => node.kind === NodeKind.DateType;
10
11
  export const validateDateType = (_helpers, type, value) => {
11
12
  if (typeof value !== "string") {
12
- return [TypeError(`expected a string, but got ${JSON.stringify(value)}`)];
13
+ return [TypeError(`expected a string, but got ${json(value)}`)];
13
14
  }
14
15
  return validateDateConstraints(type, value);
15
16
  };
@@ -1,8 +1,8 @@
1
- import type { RangeBound } from "../../../../shared/validation/number.js";
2
- import type { GetReferences, Node, Serializer } from "../../Node.js";
3
- import { NodeKind } from "../../Node.js";
4
- import type { Validator } from "../../validation/type.js";
5
- import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.js";
1
+ import type { RangeBound } from "../../../../shared/validation/number.ts";
2
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
3
+ import { NodeKind } from "../../Node.ts";
4
+ import type { Validator } from "../../validation/type.ts";
5
+ import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.ts";
6
6
  export interface FloatType extends BaseType {
7
7
  kind: NodeKind["FloatType"];
8
8
  minimum?: RangeBound;
@@ -1,4 +1,5 @@
1
1
  import { validateNumberConstraints } from "../../../../shared/validation/number.js";
2
+ import { json } from "../../../utils/errorFormatting.js";
2
3
  import { NodeKind } from "../../Node.js";
3
4
  import { removeParentKey } from "../Type.js";
4
5
  export const FloatType = (options = {}) => ({
@@ -9,7 +10,7 @@ export { FloatType as Float };
9
10
  export const isFloatType = (node) => node.kind === NodeKind.FloatType;
10
11
  export const validateFloatType = (_helpers, type, value) => {
11
12
  if (typeof value !== "number") {
12
- return [TypeError(`expected a floating-point number, but got ${JSON.stringify(value)}`)];
13
+ return [TypeError(`expected a floating-point number, but got ${json(value)}`)];
13
14
  }
14
15
  return validateNumberConstraints(type, value);
15
16
  };
@@ -1,8 +1,8 @@
1
- import type { RangeBound } from "../../../../shared/validation/number.js";
2
- import type { GetReferences, Node, Serializer } from "../../Node.js";
3
- import { NodeKind } from "../../Node.js";
4
- import type { Validator } from "../../validation/type.js";
5
- import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.js";
1
+ import type { RangeBound } from "../../../../shared/validation/number.ts";
2
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
3
+ import { NodeKind } from "../../Node.ts";
4
+ import type { Validator } from "../../validation/type.ts";
5
+ import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.ts";
6
6
  export interface IntegerType extends BaseType {
7
7
  kind: NodeKind["IntegerType"];
8
8
  minimum?: RangeBound;
@@ -1,4 +1,5 @@
1
1
  import { validateNumberConstraints } from "../../../../shared/validation/number.js";
2
+ import { json } from "../../../utils/errorFormatting.js";
2
3
  import { NodeKind } from "../../Node.js";
3
4
  import { validateOption } from "../../validation/options.js";
4
5
  import { removeParentKey } from "../Type.js";
@@ -13,7 +14,7 @@ export { IntegerType as Integer };
13
14
  export const isIntegerType = (node) => node.kind === NodeKind.IntegerType;
14
15
  export const validateIntegerType = (_helpers, type, value) => {
15
16
  if (typeof value !== "number" || !Number.isInteger(value)) {
16
- return [TypeError(`expected an integer, but got ${JSON.stringify(value)}`)];
17
+ return [TypeError(`expected an integer, but got ${json(value)}`)];
17
18
  }
18
19
  return validateNumberConstraints(type, value);
19
20
  };
@@ -1,6 +1,6 @@
1
- import type { FloatType, SerializedFloatType } from "./FloatType.js";
2
- import type { IntegerType, SerializedIntegerType } from "./IntegerType.js";
1
+ import type { FloatType, SerializedFloatType } from "./FloatType.ts";
2
+ import type { IntegerType, SerializedIntegerType } from "./IntegerType.ts";
3
3
  export type NumericType = FloatType | IntegerType;
4
4
  export type SerializedNumericType = SerializedFloatType | SerializedIntegerType;
5
- export * from "./FloatType.js";
6
- export * from "./IntegerType.js";
5
+ export * from "./FloatType.ts";
6
+ export * from "./IntegerType.ts";
@@ -1,6 +1,6 @@
1
- import type { BooleanType, SerializedBooleanType } from "./BooleanType.js";
2
- import type { DateType, SerializedDateType } from "./DateType.js";
3
- import type { NumericType, SerializedNumericType } from "./NumericType.js";
4
- import type { SerializedStringType, StringType } from "./StringType.js";
1
+ import type { BooleanType, SerializedBooleanType } from "./BooleanType.ts";
2
+ import type { DateType, SerializedDateType } from "./DateType.ts";
3
+ import type { NumericType, SerializedNumericType } from "./NumericType.ts";
4
+ import type { SerializedStringType, StringType } from "./StringType.ts";
5
5
  export type PrimitiveType = BooleanType | DateType | NumericType | StringType;
6
6
  export type SerializedPrimitiveType = SerializedBooleanType | SerializedDateType | SerializedNumericType | SerializedStringType;
@@ -1,8 +1,8 @@
1
- import type { StringConstraints } from "../../../../shared/validation/string.js";
2
- import type { GetReferences, Node, Serializer } from "../../Node.js";
3
- import { NodeKind } from "../../Node.js";
4
- import type { Validator } from "../../validation/type.js";
5
- import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.js";
1
+ import type { StringConstraints } from "../../../../shared/validation/string.ts";
2
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
3
+ import { NodeKind } from "../../Node.ts";
4
+ import type { Validator } from "../../validation/type.ts";
5
+ import type { BaseType, SerializedBaseType, StructureFormatter } from "../Type.ts";
6
6
  export interface StringType extends BaseType, StringConstraints {
7
7
  kind: NodeKind["StringType"];
8
8
  pattern?: RegExp;
@@ -1,4 +1,5 @@
1
1
  import { validateStringConstraints } from "../../../../shared/validation/string.js";
2
+ import { json } from "../../../utils/errorFormatting.js";
2
3
  import { NodeKind } from "../../Node.js";
3
4
  import { removeParentKey } from "../Type.js";
4
5
  export const StringType = (options = {}) => ({
@@ -9,7 +10,7 @@ export { StringType as String };
9
10
  export const isStringType = (node) => node.kind === NodeKind.StringType;
10
11
  export const validateStringType = (_helpers, type, value) => {
11
12
  if (typeof value !== "string") {
12
- return [TypeError(`expected a string, but got ${JSON.stringify(value)}`)];
13
+ return [TypeError(`expected a string, but got ${json(value)}`)];
13
14
  }
14
15
  return validateStringConstraints(type, value);
15
16
  };
@@ -1,12 +1,12 @@
1
- import type { GetNestedDeclarations, SerializedTypeArguments, TypeArguments } from "../../declarations/Declaration.js";
2
- import type { EnumDecl } from "../../declarations/EnumDecl.js";
3
- import type { TypeAliasDecl } from "../../declarations/TypeAliasDecl.js";
4
- import type { GetReferences, Node, Serializer } from "../../Node.js";
5
- import { NodeKind } from "../../Node.js";
6
- import type { SerializedTypeParameter, TypeParameter } from "../../TypeParameter.js";
7
- import type { Validator } from "../../validation/type.js";
8
- import type { EnumCaseDecl } from "../generic/EnumType.js";
9
- import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.js";
1
+ import type { GetNestedDeclarations, SerializedTypeArguments, TypeArguments } from "../../declarations/Declaration.ts";
2
+ import type { EnumDecl } from "../../declarations/EnumDecl.ts";
3
+ import type { TypeAliasDecl } from "../../declarations/TypeAliasDecl.ts";
4
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
5
+ import { NodeKind } from "../../Node.ts";
6
+ import type { SerializedTypeParameter, TypeParameter } from "../../TypeParameter.ts";
7
+ import type { Validator } from "../../validation/type.ts";
8
+ import type { EnumCaseDecl } from "../generic/EnumType.ts";
9
+ import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.ts";
10
10
  type TConstraint<Params extends TypeParameter[]> = TypeAliasDecl<string, Type, Params> | EnumDecl<string, Record<string, EnumCaseDecl>, Params>;
11
11
  export interface IncludeIdentifierType<Params extends TypeParameter[] = TypeParameter[], T extends TConstraint<Params> = TConstraint<Params>> extends BaseType {
12
12
  kind: NodeKind["IncludeIdentifierType"];
@@ -1,11 +1,11 @@
1
- import { Lazy } from "../../../../shared/utils/lazy.js";
2
- import type { GetNestedDeclarations } from "../../declarations/Declaration.js";
3
- import type { EntityDecl } from "../../declarations/EntityDecl.js";
4
- import type { GetReferences, Node, Serializer } from "../../Node.js";
5
- import { NodeKind } from "../../Node.js";
6
- import type { Validator } from "../../validation/type.js";
7
- import type { MemberDecl, ObjectType, SerializedMemberDecl, SerializedObjectType } from "../generic/ObjectType.js";
8
- import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.js";
1
+ import { Lazy } from "../../../../shared/utils/lazy.ts";
2
+ import type { GetNestedDeclarations } from "../../declarations/Declaration.ts";
3
+ import type { EntityDecl } from "../../declarations/EntityDecl.ts";
4
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
5
+ import { NodeKind } from "../../Node.ts";
6
+ import type { Validator } from "../../validation/type.ts";
7
+ import type { MemberDecl, ObjectType, SerializedMemberDecl, SerializedObjectType } from "../generic/ObjectType.ts";
8
+ import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.ts";
9
9
  type TConstraint = Record<string, MemberDecl>;
10
10
  export interface NestedEntityMapType<Name extends string = string, T extends TConstraint = TConstraint> extends BaseType {
11
11
  kind: NodeKind["NestedEntityMapType"];
@@ -2,6 +2,7 @@ import { Lazy } from "../../../../shared/utils/lazy.js";
2
2
  import { sortObjectKeysAlphabetically } from "../../../../shared/utils/object.js";
3
3
  import { parallelizeErrors } from "../../../../shared/utils/validation.js";
4
4
  import { wrapErrorsIfAny } from "../../../utils/error.js";
5
+ import { entity, json, key as keyColor } from "../../../utils/errorFormatting.js";
5
6
  import { NodeKind } from "../../Node.js";
6
7
  import { getNestedDeclarationsInObjectType, getReferencesForObjectType, resolveTypeArgumentsInObjectType, serializeObjectType, validateObjectType, } from "../generic/ObjectType.js";
7
8
  import { formatValue, removeParentKey, setParent } from "../Type.js";
@@ -26,9 +27,9 @@ export const isNestedEntityMapType = (node) => node.kind === NodeKind.NestedEnti
26
27
  export const getNestedDeclarationsInNestedEntityMapType = (addedDecls, type) => getNestedDeclarationsInObjectType(addedDecls.includes(type.secondaryEntity) ? addedDecls : [type.secondaryEntity, ...addedDecls], type.type.value);
27
28
  export const validateNestedEntityMapType = (helpers, type, value) => {
28
29
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
29
- return [TypeError(`expected an object, but got ${JSON.stringify(value)}`)];
30
+ return [TypeError(`expected an object, but got ${json(value)}`)];
30
31
  }
31
- return parallelizeErrors(Object.keys(value).map(key => wrapErrorsIfAny(`at nested entity map "${type.name}" at key "${key}"`, validateObjectType(helpers, type.type.value, value[key]).concat(helpers.checkReferentialIntegrity({
32
+ return parallelizeErrors(Object.keys(value).map(key => wrapErrorsIfAny(`at nested entity map ${entity(`"${type.name}"`)} at key ${keyColor(`"${key}"`)}`, validateObjectType(helpers, type.type.value, value[key]).concat(helpers.checkReferentialIntegrity({
32
33
  name: type.secondaryEntity.name,
33
34
  value: key,
34
35
  })))));
@@ -1,9 +1,9 @@
1
- import type { GetNestedDeclarations } from "../../declarations/Declaration.js";
2
- import type { EntityDecl } from "../../declarations/EntityDecl.js";
3
- import type { GetReferences, Node, Serializer } from "../../Node.js";
4
- import { NodeKind } from "../../Node.js";
5
- import type { Validator } from "../../validation/type.js";
6
- import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.js";
1
+ import type { GetNestedDeclarations } from "../../declarations/Declaration.ts";
2
+ import type { EntityDecl } from "../../declarations/EntityDecl.ts";
3
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
4
+ import { NodeKind } from "../../Node.ts";
5
+ import type { Validator } from "../../validation/type.ts";
6
+ import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.ts";
7
7
  export interface ReferenceIdentifierType extends BaseType {
8
8
  kind: NodeKind["ReferenceIdentifierType"];
9
9
  entity: EntityDecl;
@@ -1,8 +1,8 @@
1
- import type { GetReferences, Node, Serializer } from "../../Node.js";
2
- import { NodeKind } from "../../Node.js";
3
- import type { SerializedTypeParameter, TypeParameter } from "../../TypeParameter.js";
4
- import type { Validator } from "../../validation/type.js";
5
- import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.js";
1
+ import type { GetReferences, Node, Serializer } from "../../Node.ts";
2
+ import { NodeKind } from "../../Node.ts";
3
+ import type { SerializedTypeParameter, TypeParameter } from "../../TypeParameter.ts";
4
+ import type { Validator } from "../../validation/type.ts";
5
+ import type { BaseType, SerializedBaseType, StructureFormatter, Type } from "../Type.ts";
6
6
  type TConstraint = TypeParameter;
7
7
  export interface TypeArgumentType<T extends TConstraint = TConstraint> extends BaseType {
8
8
  kind: NodeKind["TypeArgumentType"];
@@ -1,4 +1,4 @@
1
- import type { Validators } from "../Node.js";
2
- import type { Type } from "../types/Type.js";
1
+ import type { Validators } from "../Node.ts";
2
+ import type { Type } from "../types/Type.ts";
3
3
  export type ValidatorHelpers = Validators;
4
4
  export type Validator<T extends Type, Args extends unknown[] = []> = (helpers: ValidatorHelpers, type: T, value: unknown, ...args: Args) => Error[];
@@ -1,6 +1,6 @@
1
- import type { InstanceContainer } from "../../../shared/utils/instances.js";
2
- import type { Result } from "../../../shared/utils/result.js";
3
- import type { TSONDBRequestLocals } from "../index.js";
1
+ import type { InstanceContainer } from "../../../shared/utils/instances.ts";
2
+ import type { Result } from "../../../shared/utils/result.ts";
3
+ import type { TSONDBRequestLocals } from "../index.ts";
4
4
  export declare const createInstance: (locals: TSONDBRequestLocals, entityName: string, instance: unknown, idQueryParam: unknown) => Promise<Result<InstanceContainer, [code: number, message: string]>>;
5
5
  export declare const updateInstance: (locals: TSONDBRequestLocals, entityName: string, instanceId: string, instance: unknown) => Promise<Result<InstanceContainer, [code: number, message: string]>>;
6
6
  export declare const deleteInstance: (locals: TSONDBRequestLocals, entityName: string, instanceId: string) => Promise<Result<InstanceContainer, [code: number, message: string]>>;
@@ -1,9 +1,9 @@
1
1
  import type { SimpleGit } from "simple-git";
2
- import type { InstancesByEntityName } from "../../shared/utils/instances.js";
2
+ import type { InstancesByEntityName } from "../../shared/utils/instances.ts";
3
3
  import type { Schema } from "../Schema.ts";
4
- import type { Decl } from "../schema/declarations/Declaration.js";
5
- import type { EntityDecl } from "../schema/declarations/EntityDecl.js";
6
- import type { ReferencesToInstances } from "../utils/references.js";
4
+ import type { Decl } from "../schema/declarations/Declaration.ts";
5
+ import type { EntityDecl } from "../schema/declarations/EntityDecl.ts";
6
+ import type { ReferencesToInstances } from "../utils/references.ts";
7
7
  export type ServerOptions = {
8
8
  port: number;
9
9
  };
@@ -1,5 +1,5 @@
1
- import type { InstancesByEntityName } from "../../shared/utils/instances.js";
1
+ import type { InstancesByEntityName } from "../../shared/utils/instances.ts";
2
2
  import type { Schema } from "../Schema.ts";
3
- import type { TSONDBRequestLocals } from "./index.js";
3
+ import type { TSONDBRequestLocals } from "./index.ts";
4
4
  export declare const init: (schema: Schema, dataRootPath: string, instancesByEntityName: InstancesByEntityName) => Promise<TSONDBRequestLocals>;
5
5
  export declare const reinit: (locals: TSONDBRequestLocals) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ export declare const json: (value: unknown) => string;
2
+ export declare const key: (str: string) => string;
3
+ export declare const entity: (str: string) => string;
@@ -0,0 +1,4 @@
1
+ import { styleText } from "node:util";
2
+ export const json = (value) => styleText("blue", JSON.stringify(value, undefined, 2));
3
+ export const key = (str) => styleText(["yellow", "bold"], str);
4
+ export const entity = (str) => styleText("green", str);
@@ -1,3 +1,3 @@
1
1
  import type { StatusResult } from "simple-git";
2
- import type { GitFileStatus } from "../../shared/utils/git.js";
2
+ import type { GitFileStatus } from "../../shared/utils/git.ts";
3
3
  export declare const getGitFileStatusFromStatusResult: (statusResult: StatusResult, repoRoot: string, dataRoot: string, entityName: string, fileName: string) => GitFileStatus | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { StatusResult } from "simple-git";
2
- import type { InstancesByEntityName } from "../../shared/utils/instances.js";
3
- import type { EntityDecl } from "../schema/declarations/EntityDecl.js";
2
+ import type { InstancesByEntityName } from "../../shared/utils/instances.ts";
3
+ import type { EntityDecl } from "../schema/declarations/EntityDecl.ts";
4
4
  export declare const getInstancesByEntityName: (dataRoot: string, entities: readonly EntityDecl[]) => Promise<InstancesByEntityName>;
5
5
  export declare const attachGitStatusToInstancesByEntityName: (instancesByEntityName: InstancesByEntityName, dataRoot: string, gitRoot: string, gitStatus: StatusResult) => void;
6
6
  export declare const formatInstance: (entity: EntityDecl, instanceContent: unknown) => string;
@@ -1,5 +1,5 @@
1
- import type { InstanceContainer } from "../../shared/utils/instances.js";
2
- import type { EntityDecl } from "../schema/declarations/EntityDecl.js";
1
+ import type { InstanceContainer } from "../../shared/utils/instances.ts";
2
+ import type { EntityDecl } from "../schema/declarations/EntityDecl.ts";
3
3
  export type ReferencesToInstances = {
4
4
  [instanceId: string]: string[];
5
5
  };
@@ -1,5 +1,5 @@
1
- import type { SerializedDecl } from "../node/schema/declarations/Declaration.js";
2
- import type { InstanceContainer, InstanceContainerOverview } from "./utils/instances.js";
1
+ import type { SerializedDecl } from "../node/schema/declarations/Declaration.ts";
2
+ import type { InstanceContainer, InstanceContainerOverview } from "./utils/instances.ts";
3
3
  export interface GetAllDeclarationsResponseBody<D extends SerializedDecl = SerializedDecl> {
4
4
  declarations: {
5
5
  declaration: D;
@@ -1,2 +1,2 @@
1
- import type { SerializedEntityDecl } from "../../node/schema/index.js";
1
+ import type { SerializedEntityDecl } from "../../node/schema/index.ts";
2
2
  export declare const getDisplayNameFromEntityInstance: (entity: SerializedEntityDecl, instance: unknown, defaultName: string, locales?: string[]) => string;
@@ -1,5 +1,5 @@
1
- import type { SerializedEntityDecl } from "../../node/schema/index.js";
2
- import type { GitFileStatus } from "./git.js";
1
+ import type { SerializedEntityDecl } from "../../node/schema/index.ts";
2
+ import type { GitFileStatus } from "./git.ts";
3
3
  export interface InstanceContainer {
4
4
  fileName: string;
5
5
  id: string;
@@ -1,5 +1,5 @@
1
- import type { SerializedEntityDecl } from "../node/schema/declarations/EntityDecl.js";
2
- import type { CreateInstanceOfEntityResponseBody, DeleteInstanceOfEntityResponseBody, GetAllDeclarationsResponseBody, GetAllGitBranchesResponseBody, GetAllInstancesOfEntityResponseBody, GetAllInstancesResponseBody, GetDeclarationResponseBody, GetInstanceOfEntityResponseBody, GitStatusResponseBody, UpdateInstanceOfEntityResponseBody } from "../shared/api.js";
1
+ import type { SerializedEntityDecl } from "../node/schema/declarations/EntityDecl.ts";
2
+ import type { CreateInstanceOfEntityResponseBody, DeleteInstanceOfEntityResponseBody, GetAllDeclarationsResponseBody, GetAllGitBranchesResponseBody, GetAllInstancesOfEntityResponseBody, GetAllInstancesResponseBody, GetDeclarationResponseBody, GetInstanceOfEntityResponseBody, GitStatusResponseBody, UpdateInstanceOfEntityResponseBody } from "../shared/api.ts";
3
3
  export declare const getAllDeclarations: (kind?: "Entity" | "Enum" | "TypeAlias") => Promise<GetAllDeclarationsResponseBody>;
4
4
  export declare const getAllEntities: () => Promise<GetAllDeclarationsResponseBody<SerializedEntityDecl>>;
5
5
  export declare const getEntityByName: (name: string) => Promise<GetDeclarationResponseBody<SerializedEntityDecl>>;
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedArrayType } from "../../../node/schema/types/generic/ArrayType.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedArrayType } from "../../../node/schema/types/generic/ArrayType.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedArrayType;
7
7
  value: unknown[];
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedBooleanType } from "../../../node/schema/types/primitives/BooleanType.js";
2
+ import type { SerializedBooleanType } from "../../../node/schema/types/primitives/BooleanType.ts";
3
3
  type Props = {
4
4
  type: SerializedBooleanType;
5
5
  value: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedDateType } from "../../../node/schema/types/primitives/DateType.js";
2
+ import type { SerializedDateType } from "../../../node/schema/types/primitives/DateType.ts";
3
3
  type Props = {
4
4
  type: SerializedDateType;
5
5
  value: string;
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedEnumType } from "../../../node/schema/types/generic/EnumType.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedEnumType } from "../../../node/schema/types/generic/EnumType.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedEnumType;
7
7
  value: unknown;
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedFloatType } from "../../../node/schema/types/primitives/FloatType.js";
2
+ import type { SerializedFloatType } from "../../../node/schema/types/primitives/FloatType.ts";
3
3
  type Props = {
4
4
  type: SerializedFloatType;
5
5
  value: number;
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedTypeArgumentType } from "../../../node/schema/types/references/TypeArgumentType.js";
2
+ import type { SerializedTypeArgumentType } from "../../../node/schema/types/references/TypeArgumentType.ts";
3
3
  type Props = {
4
4
  type: SerializedTypeArgumentType;
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedIncludeIdentifierType } from "../../../node/schema/index.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedIncludeIdentifierType } from "../../../node/schema/index.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedIncludeIdentifierType;
7
7
  value: unknown;
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedIntegerType } from "../../../node/schema/types/primitives/IntegerType.js";
2
+ import type { SerializedIntegerType } from "../../../node/schema/types/primitives/IntegerType.ts";
3
3
  type Props = {
4
4
  type: SerializedIntegerType;
5
5
  value: number;
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedNestedEntityMapType } from "../../../node/schema/types/references/NestedEntityMapType.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedNestedEntityMapType } from "../../../node/schema/types/references/NestedEntityMapType.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedNestedEntityMapType;
7
7
  value: Record<string, unknown>;
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedObjectType } from "../../../node/schema/types/generic/ObjectType.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedObjectType } from "../../../node/schema/types/generic/ObjectType.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedObjectType;
7
7
  value: Record<string, unknown>;
@@ -1,6 +1,6 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedReferenceIdentifierType } from "../../../node/schema/types/references/ReferenceIdentifierType.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
2
+ import type { SerializedReferenceIdentifierType } from "../../../node/schema/types/references/ReferenceIdentifierType.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
4
  type Props = {
5
5
  type: SerializedReferenceIdentifierType;
6
6
  value: string;
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedStringType } from "../../../node/schema/types/primitives/StringType.js";
2
+ import type { SerializedStringType } from "../../../node/schema/types/primitives/StringType.ts";
3
3
  type Props = {
4
4
  type: SerializedStringType;
5
5
  value: string;
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from "preact";
2
- import type { SerializedType } from "../../../node/schema/types/Type.js";
3
- import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.js";
4
- import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.js";
2
+ import type { SerializedType } from "../../../node/schema/types/Type.ts";
3
+ import type { InstanceNamesByEntity } from "../../hooks/useInstanceNamesByEntity.ts";
4
+ import type { GetDeclFromDeclName } from "../../hooks/useSecondaryDeclarations.ts";
5
5
  type Props = {
6
6
  type: SerializedType;
7
7
  value: unknown;
@@ -1,4 +1,4 @@
1
- import type { SerializedEntityDecl } from "../../node/schema/declarations/EntityDecl.js";
1
+ import type { SerializedEntityDecl } from "../../node/schema/declarations/EntityDecl.ts";
2
2
  export declare const useEntityFromRoute: () => {
3
3
  entity: SerializedEntityDecl;
4
4
  isLocaleEntity: boolean;
@@ -1,3 +1,3 @@
1
- import type { GetAllInstancesResponseBody } from "../../shared/api.js";
1
+ import type { GetAllInstancesResponseBody } from "../../shared/api.ts";
2
2
  export type InstanceNamesByEntity = GetAllInstancesResponseBody["instances"];
3
3
  export declare const useInstanceNamesByEntity: (locales?: string[]) => [InstanceNamesByEntity, () => void];
@@ -1,3 +1,3 @@
1
- import type { SerializedSecondaryDecl } from "../../node/schema/declarations/Declaration.js";
1
+ import type { SerializedSecondaryDecl } from "../../node/schema/declarations/Declaration.ts";
2
2
  export type GetDeclFromDeclName = (name: string) => SerializedSecondaryDecl | undefined;
3
3
  export declare const useGetDeclFromDeclName: () => GetDeclFromDeclName;
@@ -1,3 +1,3 @@
1
- import type { SerializedType } from "../../node/schema/types/Type.js";
2
- import type { GetDeclFromDeclName } from "../hooks/useSecondaryDeclarations.js";
1
+ import type { SerializedType } from "../../node/schema/types/Type.ts";
2
+ import type { GetDeclFromDeclName } from "../hooks/useSecondaryDeclarations.ts";
3
3
  export declare const createTypeSkeleton: (getDeclFromDeclName: GetDeclFromDeclName, type: SerializedType) => unknown;