tsondb 0.2.0 → 0.4.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 (228) hide show
  1. package/LICENSE +385 -0
  2. package/README.md +173 -1
  3. package/lib/bin/tsondb.d.ts +8 -0
  4. package/lib/bin/tsondb.js +83 -0
  5. package/lib/index.d.ts +2 -1
  6. package/lib/index.js +1 -1
  7. package/lib/{Schema.d.ts → node/Schema.d.ts} +2 -2
  8. package/lib/{Schema.js → node/Schema.js} +1 -1
  9. package/lib/node/index.d.ts +8 -0
  10. package/lib/node/index.js +62 -0
  11. package/lib/{renderers → node/renderers}/Output.d.ts +1 -1
  12. package/lib/node/renderers/jsonschema/index.d.ts +6 -0
  13. package/lib/node/renderers/jsonschema/index.js +35 -0
  14. package/lib/node/renderers/jsonschema/render.d.ts +9 -0
  15. package/lib/{renderers → node/renderers}/jsonschema/render.js +42 -23
  16. package/lib/node/renderers/ts/index.d.ts +6 -0
  17. package/lib/node/renderers/ts/index.js +42 -0
  18. package/lib/{renderers → node/renderers}/ts/render.d.ts +3 -1
  19. package/lib/node/renderers/ts/render.js +136 -0
  20. package/lib/{schema → node/schema}/Node.d.ts +5 -4
  21. package/lib/{schema → node/schema}/Node.js +11 -6
  22. package/lib/{schema/parameters → node/schema}/TypeParameter.d.ts +3 -2
  23. package/lib/{schema/parameters → node/schema}/TypeParameter.js +2 -2
  24. package/lib/{schema → node/schema}/declarations/Declaration.d.ts +11 -10
  25. package/lib/{schema → node/schema}/declarations/Declaration.js +10 -4
  26. package/lib/{schema → node/schema}/declarations/EntityDecl.d.ts +13 -9
  27. package/lib/{schema → node/schema}/declarations/EntityDecl.js +2 -2
  28. package/lib/{schema → node/schema}/declarations/EnumDecl.d.ts +11 -26
  29. package/lib/node/schema/declarations/EnumDecl.js +52 -0
  30. package/lib/{schema → node/schema}/declarations/TypeAliasDecl.d.ts +8 -7
  31. package/lib/{schema → node/schema}/declarations/TypeAliasDecl.js +3 -3
  32. package/lib/{schema → node/schema}/index.d.ts +4 -3
  33. package/lib/{schema → node/schema}/index.js +3 -3
  34. package/lib/node/schema/types/Type.d.ts +48 -0
  35. package/lib/{schema → node/schema}/types/Type.js +90 -28
  36. package/lib/{schema → node/schema}/types/generic/ArrayType.d.ts +6 -4
  37. package/lib/{schema → node/schema}/types/generic/ArrayType.js +5 -4
  38. package/lib/node/schema/types/generic/EnumType.d.ts +39 -0
  39. package/lib/node/schema/types/generic/EnumType.js +98 -0
  40. package/lib/{schema → node/schema}/types/generic/ObjectType.d.ts +9 -7
  41. package/lib/{schema → node/schema}/types/generic/ObjectType.js +11 -3
  42. package/lib/{schema → node/schema}/types/primitives/BooleanType.d.ts +5 -3
  43. package/lib/{schema → node/schema}/types/primitives/BooleanType.js +1 -0
  44. package/lib/{schema → node/schema}/types/primitives/DateType.d.ts +6 -4
  45. package/lib/{schema → node/schema}/types/primitives/DateType.js +2 -1
  46. package/lib/{schema → node/schema}/types/primitives/FloatType.d.ts +6 -4
  47. package/lib/{schema → node/schema}/types/primitives/FloatType.js +2 -1
  48. package/lib/{schema → node/schema}/types/primitives/IntegerType.d.ts +6 -4
  49. package/lib/{schema → node/schema}/types/primitives/IntegerType.js +2 -1
  50. package/lib/{schema → node/schema}/types/primitives/NumericType.d.ts +2 -2
  51. package/lib/node/schema/types/primitives/PrimitiveType.d.ts +6 -0
  52. package/lib/{schema → node/schema}/types/primitives/StringType.d.ts +6 -4
  53. package/lib/{schema → node/schema}/types/primitives/StringType.js +2 -1
  54. package/lib/{schema → node/schema}/types/references/IncludeIdentifierType.d.ts +11 -8
  55. package/lib/{schema → node/schema}/types/references/IncludeIdentifierType.js +15 -2
  56. package/lib/{schema → node/schema}/types/references/NestedEntityMapType.d.ts +11 -9
  57. package/lib/{schema → node/schema}/types/references/NestedEntityMapType.js +6 -2
  58. package/lib/{schema → node/schema}/types/references/ReferenceIdentifierType.d.ts +8 -6
  59. package/lib/{schema → node/schema}/types/references/ReferenceIdentifierType.js +1 -0
  60. package/lib/node/schema/types/references/TypeArgumentType.d.ts +23 -0
  61. package/lib/node/schema/types/references/TypeArgumentType.js +19 -0
  62. package/lib/node/schema/validation/type.d.ts +4 -0
  63. package/lib/node/server/api/declarations.d.ts +1 -0
  64. package/lib/node/server/api/declarations.js +154 -0
  65. package/lib/node/server/api/git.d.ts +1 -0
  66. package/lib/node/server/api/git.js +178 -0
  67. package/lib/node/server/api/index.d.ts +1 -0
  68. package/lib/node/server/api/index.js +8 -0
  69. package/lib/node/server/api/instanceOperations.d.ts +6 -0
  70. package/lib/node/server/api/instanceOperations.js +91 -0
  71. package/lib/node/server/api/instances.d.ts +1 -0
  72. package/lib/node/server/api/instances.js +27 -0
  73. package/lib/node/server/index.d.ts +28 -0
  74. package/lib/node/server/index.js +53 -0
  75. package/lib/node/server/init.d.ts +5 -0
  76. package/lib/node/server/init.js +56 -0
  77. package/lib/{utils → node/utils}/error.js +4 -1
  78. package/lib/node/utils/git.d.ts +3 -0
  79. package/lib/node/utils/git.js +12 -0
  80. package/lib/node/utils/instances.d.ts +5 -0
  81. package/lib/node/utils/instances.js +21 -0
  82. package/lib/node/utils/path.d.ts +1 -0
  83. package/lib/node/utils/path.js +2 -0
  84. package/lib/node/utils/references.d.ts +7 -0
  85. package/lib/node/utils/references.js +40 -0
  86. package/lib/node/utils/render.d.ts +9 -0
  87. package/lib/node/utils/render.js +34 -0
  88. package/lib/shared/api.d.ts +19 -2
  89. package/lib/shared/utils/array.d.ts +19 -0
  90. package/lib/shared/utils/array.js +30 -0
  91. package/lib/shared/utils/displayName.d.ts +1 -1
  92. package/lib/shared/utils/displayName.js +4 -2
  93. package/lib/shared/utils/git.d.ts +12 -0
  94. package/lib/shared/utils/git.js +98 -0
  95. package/lib/shared/utils/instances.d.ts +10 -0
  96. package/lib/shared/utils/instances.js +8 -1
  97. package/lib/{utils → shared/utils}/lazy.js +1 -1
  98. package/lib/shared/utils/markdown.d.ts +14 -0
  99. package/lib/shared/utils/markdown.js +42 -0
  100. package/lib/shared/utils/object.d.ts +4 -0
  101. package/lib/shared/utils/object.js +5 -0
  102. package/lib/{utils → shared/utils}/result.js +2 -2
  103. package/lib/shared/utils/string.d.ts +1 -0
  104. package/lib/shared/utils/string.js +16 -4
  105. package/lib/shared/utils/validation.js +3 -2
  106. package/lib/shared/validation/number.js +3 -3
  107. package/lib/shared/validation/object.js +4 -3
  108. package/lib/shared/validation/string.js +12 -7
  109. package/lib/web/api.d.ts +24 -0
  110. package/lib/web/api.js +204 -0
  111. package/lib/web/components/Git.d.ts +2 -0
  112. package/lib/web/components/Git.js +160 -0
  113. package/lib/{client → web}/components/Layout.d.ts +1 -1
  114. package/lib/{client → web}/components/Layout.js +2 -1
  115. package/lib/web/components/Select.d.ts +3 -0
  116. package/lib/web/components/Select.js +5 -0
  117. package/lib/web/components/typeInputs/ArrayTypeInput.d.ts +13 -0
  118. package/lib/{client → web}/components/typeInputs/ArrayTypeInput.js +8 -1
  119. package/lib/{client → web}/components/typeInputs/BooleanTypeInput.d.ts +2 -2
  120. package/lib/{client → web}/components/typeInputs/DateTypeInput.d.ts +2 -2
  121. package/lib/web/components/typeInputs/EnumTypeInput.d.ts +13 -0
  122. package/lib/{client/components/typeInputs/utils/EnumDeclField.js → web/components/typeInputs/EnumTypeInput.js} +11 -11
  123. package/lib/{client → web}/components/typeInputs/FloatTypeInput.d.ts +2 -2
  124. package/lib/web/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.d.ts +7 -0
  125. package/lib/{client → web}/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.js +1 -1
  126. package/lib/web/components/typeInputs/IncludeIdentifierTypeInput.d.ts +13 -0
  127. package/lib/web/components/typeInputs/IncludeIdentifierTypeInput.js +9 -0
  128. package/lib/{client → web}/components/typeInputs/IntegerTypeInput.d.ts +2 -2
  129. package/lib/web/components/typeInputs/NestedEntityMapTypeInput.d.ts +13 -0
  130. package/lib/{client → web}/components/typeInputs/NestedEntityMapTypeInput.js +7 -2
  131. package/lib/{client → web}/components/typeInputs/ObjectTypeInput.d.ts +4 -4
  132. package/lib/{client → web}/components/typeInputs/ObjectTypeInput.js +4 -1
  133. package/lib/{client → web}/components/typeInputs/ReferenceIdentifierTypeInput.d.ts +3 -3
  134. package/lib/web/components/typeInputs/ReferenceIdentifierTypeInput.js +11 -0
  135. package/lib/{client → web}/components/typeInputs/StringTypeInput.d.ts +2 -2
  136. package/lib/web/components/typeInputs/TypeInput.d.ts +13 -0
  137. package/lib/{client → web}/components/typeInputs/TypeInput.js +6 -3
  138. package/lib/{client → web}/components/typeInputs/utils/Markdown.d.ts +1 -1
  139. package/lib/web/components/typeInputs/utils/Markdown.js +26 -0
  140. package/lib/{client → web}/components/typeInputs/utils/MismatchingTypeError.d.ts +1 -1
  141. package/lib/{client → web}/components/typeInputs/utils/ValidationErrors.d.ts +1 -1
  142. package/lib/web/hooks/useAPIResource.d.ts +1 -0
  143. package/lib/web/hooks/useAPIResource.js +2 -0
  144. package/lib/{client → web}/hooks/useEntityFromRoute.d.ts +1 -1
  145. package/lib/{client → web}/hooks/useEntityFromRoute.js +1 -1
  146. package/lib/{client → web}/hooks/useInstanceNamesByEntity.d.ts +1 -1
  147. package/lib/{client → web}/hooks/useInstanceNamesByEntity.js +8 -6
  148. package/lib/web/hooks/useMappedAPIResource.d.ts +1 -0
  149. package/lib/web/hooks/useMappedAPIResource.js +17 -0
  150. package/lib/{client → web}/hooks/useSecondaryDeclarations.d.ts +1 -1
  151. package/lib/{client → web}/hooks/useSecondaryDeclarations.js +4 -2
  152. package/lib/{client → web}/routes/CreateInstance.d.ts +1 -1
  153. package/lib/{client → web}/routes/CreateInstance.js +4 -2
  154. package/lib/web/routes/Entity.d.ts +2 -0
  155. package/lib/web/routes/Entity.js +43 -0
  156. package/lib/web/routes/Home.d.ts +2 -0
  157. package/lib/web/routes/Home.js +9 -0
  158. package/lib/{client → web}/routes/Instance.d.ts +1 -1
  159. package/lib/{client → web}/routes/Instance.js +14 -8
  160. package/lib/{client → web}/routes/NotFound.d.ts +1 -1
  161. package/lib/web/utils/typeSkeleton.d.ts +3 -0
  162. package/lib/{client → web}/utils/typeSkeleton.js +14 -17
  163. package/package.json +35 -15
  164. package/public/css/styles.css +200 -1
  165. package/lib/ModelContainer.d.ts +0 -17
  166. package/lib/ModelContainer.js +0 -63
  167. package/lib/client/api.d.ts +0 -11
  168. package/lib/client/api.js +0 -83
  169. package/lib/client/components/Select.d.ts +0 -3
  170. package/lib/client/components/Select.js +0 -2
  171. package/lib/client/components/typeInputs/ArrayTypeInput.d.ts +0 -13
  172. package/lib/client/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.d.ts +0 -7
  173. package/lib/client/components/typeInputs/IncludeIdentifierTypeInput.d.ts +0 -13
  174. package/lib/client/components/typeInputs/IncludeIdentifierTypeInput.js +0 -18
  175. package/lib/client/components/typeInputs/NestedEntityMapTypeInput.d.ts +0 -13
  176. package/lib/client/components/typeInputs/ReferenceIdentifierTypeInput.js +0 -9
  177. package/lib/client/components/typeInputs/TypeInput.d.ts +0 -13
  178. package/lib/client/components/typeInputs/utils/EnumDeclField.d.ts +0 -13
  179. package/lib/client/components/typeInputs/utils/Markdown.js +0 -57
  180. package/lib/client/routes/Entity.d.ts +0 -2
  181. package/lib/client/routes/Entity.js +0 -47
  182. package/lib/client/routes/Home.d.ts +0 -2
  183. package/lib/client/routes/Home.js +0 -18
  184. package/lib/client/utils/typeSkeleton.d.ts +0 -3
  185. package/lib/renderers/jsonschema/index.d.ts +0 -6
  186. package/lib/renderers/jsonschema/index.js +0 -12
  187. package/lib/renderers/jsonschema/render.d.ts +0 -5
  188. package/lib/renderers/ts/index.d.ts +0 -6
  189. package/lib/renderers/ts/index.js +0 -11
  190. package/lib/renderers/ts/render.js +0 -112
  191. package/lib/schema/declarations/EnumDecl.js +0 -115
  192. package/lib/schema/types/Type.d.ts +0 -42
  193. package/lib/schema/types/primitives/PrimitiveType.d.ts +0 -6
  194. package/lib/schema/types/references/GenericArgumentIdentifierType.d.ts +0 -21
  195. package/lib/schema/types/references/GenericArgumentIdentifierType.js +0 -18
  196. package/lib/schema/validation/type.d.ts +0 -4
  197. package/lib/server/index.d.ts +0 -8
  198. package/lib/server/index.js +0 -207
  199. package/lib/server/instanceOperations.d.ts +0 -7
  200. package/lib/server/instanceOperations.js +0 -67
  201. package/lib/tsconfig.tsbuildinfo +0 -1
  202. package/lib/utils/instances.d.ts +0 -4
  203. package/lib/utils/instances.js +0 -12
  204. package/lib/utils/object.d.ts +0 -3
  205. package/lib/utils/object.js +0 -1
  206. package/lib/utils/render.d.ts +0 -4
  207. package/lib/utils/render.js +0 -8
  208. /package/lib/{renderers → node/renderers}/Output.js +0 -0
  209. /package/lib/{schema → node/schema}/types/primitives/NumericType.js +0 -0
  210. /package/lib/{schema → node/schema}/types/primitives/PrimitiveType.js +0 -0
  211. /package/lib/{schema → node/schema}/validation/options.d.ts +0 -0
  212. /package/lib/{schema → node/schema}/validation/options.js +0 -0
  213. /package/lib/{schema → node/schema}/validation/type.js +0 -0
  214. /package/lib/{utils → node/utils}/error.d.ts +0 -0
  215. /package/lib/{utils → shared/utils}/enum.d.ts +0 -0
  216. /package/lib/{utils → shared/utils}/enum.js +0 -0
  217. /package/lib/{utils → shared/utils}/lazy.d.ts +0 -0
  218. /package/lib/{utils → shared/utils}/result.d.ts +0 -0
  219. /package/lib/{client → web}/components/typeInputs/BooleanTypeInput.js +0 -0
  220. /package/lib/{client → web}/components/typeInputs/DateTypeInput.js +0 -0
  221. /package/lib/{client → web}/components/typeInputs/FloatTypeInput.js +0 -0
  222. /package/lib/{client → web}/components/typeInputs/IntegerTypeInput.js +0 -0
  223. /package/lib/{client → web}/components/typeInputs/StringTypeInput.js +0 -0
  224. /package/lib/{client → web}/components/typeInputs/utils/MismatchingTypeError.js +0 -0
  225. /package/lib/{client → web}/components/typeInputs/utils/ValidationErrors.js +0 -0
  226. /package/lib/{client → web}/index.d.ts +0 -0
  227. /package/lib/{client → web}/index.js +0 -0
  228. /package/lib/{client → web}/routes/NotFound.js +0 -0
@@ -0,0 +1,21 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import { basename, extname, join } from "node:path";
3
+ import { getGitFileStatusFromStatusResult } from "./git.js";
4
+ export const getInstancesByEntityName = async (dataRoot, entities) => Object.fromEntries(await Promise.all(entities.map(async (entity) => {
5
+ const entityDir = join(dataRoot, entity.name);
6
+ const instanceFileNames = await readdir(entityDir);
7
+ const instances = await Promise.all(instanceFileNames.map(async (instanceFileName) => ({
8
+ fileName: instanceFileName,
9
+ id: basename(instanceFileName, extname(instanceFileName)),
10
+ content: JSON.parse(await readFile(join(entityDir, instanceFileName), "utf-8")),
11
+ })));
12
+ return [entity.name, instances];
13
+ })));
14
+ export const attachGitStatusToInstancesByEntityName = (instancesByEntityName, dataRoot, gitRoot, gitStatus) => {
15
+ Object.entries(instancesByEntityName).forEach(([entityName, instances]) => {
16
+ instancesByEntityName[entityName] = instances.map(instanceContainer => ({
17
+ ...instanceContainer,
18
+ gitStatus: getGitFileStatusFromStatusResult(gitStatus, gitRoot, dataRoot, entityName, instanceContainer.fileName),
19
+ }));
20
+ });
21
+ };
@@ -0,0 +1 @@
1
+ export declare const ensureSpecialDirStart: (path: string) => string;
@@ -0,0 +1,2 @@
1
+ import { sep } from "node:path";
2
+ export const ensureSpecialDirStart = (path) => new RegExp(`^\\.\\.?\\${sep}`).test(path) ? path : `./${path}`;
@@ -0,0 +1,7 @@
1
+ import type { InstanceContainer } from "../../shared/utils/instances.js";
2
+ import type { EntityDecl } from "../schema/declarations/EntityDecl.js";
3
+ export type ReferencesToInstances = {
4
+ [instanceId: string]: string[];
5
+ };
6
+ export declare const getReferencesToInstances: (instancesByEntityName: Record<string, InstanceContainer[]>, entitiesByName: Record<string, EntityDecl>) => ReferencesToInstances;
7
+ export declare const updateReferencesToInstances: (entitiesByName: Record<string, EntityDecl>, referencesToInstances: ReferencesToInstances, entityName: string, instanceId: string, oldInstance: unknown, newInstance: unknown) => ReferencesToInstances;
@@ -0,0 +1,40 @@
1
+ import { difference, removeAt } from "../../shared/utils/array.js";
2
+ import { getReferencesForEntityDecl } from "../schema/declarations/EntityDecl.js";
3
+ const addReference = (acc, reference, instanceId) => ({
4
+ ...acc,
5
+ [reference]: [...(acc[reference] ?? []), instanceId],
6
+ });
7
+ const addReferences = (acc, references, instanceId) => references.reduce((acc1, reference) => addReference(acc1, reference, instanceId), acc);
8
+ const removeReference = (acc, reference, instanceId) => acc[reference]
9
+ ? {
10
+ ...acc,
11
+ [reference]: removeAt(acc[reference], acc[reference].indexOf(instanceId)),
12
+ }
13
+ : acc;
14
+ const removeReferences = (acc, references, instanceId) => references.reduce((acc1, reference) => removeReference(acc1, reference, instanceId), acc);
15
+ export const getReferencesToInstances = (instancesByEntityName, entitiesByName) => Object.entries(instancesByEntityName).reduce((acc, [entityName, instances]) => {
16
+ const entity = entitiesByName[entityName];
17
+ if (entity) {
18
+ return instances.reduce((acc1, instance) => {
19
+ const references = getReferencesForEntityDecl(entity, instance.content);
20
+ return addReferences(acc1, references, instance.id);
21
+ }, acc);
22
+ }
23
+ return acc;
24
+ }, {});
25
+ export const updateReferencesToInstances = (entitiesByName, referencesToInstances, entityName, instanceId, oldInstance, newInstance) => {
26
+ const entity = entitiesByName[entityName];
27
+ if (entity) {
28
+ if (oldInstance === undefined) {
29
+ return addReferences(referencesToInstances, getReferencesForEntityDecl(entity, newInstance), instanceId);
30
+ }
31
+ if (newInstance === undefined) {
32
+ return removeReferences(referencesToInstances, getReferencesForEntityDecl(entity, oldInstance), instanceId);
33
+ }
34
+ const oldReferences = getReferencesForEntityDecl(entity, oldInstance);
35
+ const newReferences = getReferencesForEntityDecl(entity, newInstance);
36
+ const { added, removed } = difference(oldReferences, newReferences);
37
+ return removeReferences(addReferences(referencesToInstances, added, instanceId), removed, instanceId);
38
+ }
39
+ return referencesToInstances;
40
+ };
@@ -0,0 +1,9 @@
1
+ export declare const prefixLines: (prefix: string, text: string, includeEmptyLines?: boolean) => string;
2
+ export declare const applyIndentation: (indentLevel: number, text: string, spaces: number) => string;
3
+ export declare const joinSyntax: (...syntaxes: (string | undefined)[]) => string;
4
+ export type RenderResult = [imports: {
5
+ [sourcePath: string]: string[];
6
+ }, syntax: string];
7
+ export declare const combineSyntaxes: (syntaxes: (RenderResult | string | undefined)[], separator?: string) => RenderResult;
8
+ export declare const syntax: (strings: TemplateStringsArray, ...values: (RenderResult | string | undefined)[]) => RenderResult;
9
+ export declare const indent: (spaces: number, indentLevel: number, text: RenderResult) => RenderResult;
@@ -0,0 +1,34 @@
1
+ import { EOL } from "node:os";
2
+ import { mergeObjects } from "../../shared/utils/object.js";
3
+ export const prefixLines = (prefix, text, includeEmptyLines = false) => text
4
+ .split(EOL)
5
+ .map(line => (includeEmptyLines || line.length > 0 ? prefix + line : line))
6
+ .join(EOL);
7
+ export const applyIndentation = (indentLevel, text, spaces) => prefixLines(" ".repeat(spaces * indentLevel), text);
8
+ export const joinSyntax = (...syntaxes) => syntaxes.filter(syntax => syntax !== undefined).join("");
9
+ const emptyRenderResult = [{}, ""];
10
+ export const combineSyntaxes = (syntaxes, separator = "") => syntaxes
11
+ .filter(syntax => syntax !== undefined)
12
+ .reduce((acc, value, i) => typeof value === "string"
13
+ ? [acc[0], acc[1] + (i === 0 ? "" : separator) + value]
14
+ : [mergeArraysByKey(acc[0], value[0]), acc[1] + (i === 0 ? "" : separator) + value[1]], emptyRenderResult);
15
+ const mergeArraysByKey = (...arrayGroups) => arrayGroups.reduce((acc, arrayGroup) => mergeObjects(acc, arrayGroup, (a, b) => a.concat(b)), {});
16
+ export const syntax = (strings, ...values) => strings.reduce((acc, str, i) => {
17
+ const nextValue = values[i];
18
+ if (typeof nextValue === "string") {
19
+ return [acc[0], acc[1] + str.replace(/\n/g, EOL) + nextValue];
20
+ }
21
+ else if (Array.isArray(nextValue)) {
22
+ return [
23
+ mergeArraysByKey(acc[0], nextValue[0]),
24
+ acc[1] + str.replace(/\n/g, EOL) + nextValue[1],
25
+ ];
26
+ }
27
+ else {
28
+ return [acc[0], acc[1] + str.replace(/\n/g, EOL)];
29
+ }
30
+ }, emptyRenderResult);
31
+ export const indent = (spaces, indentLevel, text) => [
32
+ text[0],
33
+ prefixLines(" ".repeat(spaces * indentLevel), text[1]),
34
+ ];
@@ -1,5 +1,5 @@
1
- import { SerializedDecl } from "../schema/declarations/Declaration.js";
2
- import { InstanceContainer } from "./utils/instances.js";
1
+ import type { SerializedDecl } from "../node/schema/declarations/Declaration.js";
2
+ import type { InstanceContainer, InstanceContainerOverview } from "./utils/instances.js";
3
3
  export interface GetAllDeclarationsResponseBody<D extends SerializedDecl = SerializedDecl> {
4
4
  declarations: {
5
5
  declaration: D;
@@ -40,3 +40,20 @@ export interface GetAllInstancesResponseBody {
40
40
  }[];
41
41
  };
42
42
  }
43
+ export interface GitStatusResponseBody {
44
+ commitsAhead: number;
45
+ commitsBehind: number;
46
+ instances: {
47
+ [entity: string]: InstanceContainerOverview[];
48
+ };
49
+ }
50
+ export interface GetAllGitBranchesResponseBody {
51
+ allBranches: string[];
52
+ currentBranch: string;
53
+ }
54
+ export interface CreateCommitRequestBody {
55
+ message: string;
56
+ }
57
+ export interface CreateBranchRequestBody {
58
+ branchName: string;
59
+ }
@@ -0,0 +1,19 @@
1
+ export declare const removeAt: <T>(arr: T[], index: number) => T[];
2
+ export declare const insertAt: <T>(arr: T[], index: number, item: T) => T[];
3
+ /**
4
+ * Calculates the difference between two arrays, including duplicated values.
5
+ * @param oldArr - The original array.
6
+ * @param newArr - The new array to compare against.
7
+ * @returns An object containing the added and removed elements.
8
+ */
9
+ export declare const difference: <T>(oldArr: T[], newArr: T[]) => ArrayDiffResult<T>;
10
+ export interface ArrayDiffResult<T> {
11
+ /**
12
+ * Elements in `newArr` that are not in `oldArr`.
13
+ */
14
+ added: T[];
15
+ /**
16
+ * Elements in `oldArr` that are not in `newArr`.
17
+ */
18
+ removed: T[];
19
+ }
@@ -0,0 +1,30 @@
1
+ export const removeAt = (arr, index) => {
2
+ if (index < 0 || index >= arr.length) {
3
+ throw new RangeError(`index ${index.toString()} is out of bounds for array of length ${arr.length.toString()}`);
4
+ }
5
+ return [...arr.slice(0, index), ...arr.slice(index + 1)];
6
+ };
7
+ export const insertAt = (arr, index, item) => {
8
+ if (index < 0 || index > arr.length) {
9
+ throw new RangeError(`index ${index.toString()} is out of bounds for array of length ${arr.length.toString()}`);
10
+ }
11
+ return [...arr.slice(0, index), item, ...arr.slice(index)];
12
+ };
13
+ /**
14
+ * Calculates the difference between two arrays, including duplicated values.
15
+ * @param oldArr - The original array.
16
+ * @param newArr - The new array to compare against.
17
+ * @returns An object containing the added and removed elements.
18
+ */
19
+ export const difference = (oldArr, newArr) => newArr.reduce((acc, item) => {
20
+ const oldIndex = acc.removed.indexOf(item);
21
+ const newIndex = acc.added.indexOf(item);
22
+ if (oldIndex > -1) {
23
+ return {
24
+ ...acc,
25
+ removed: removeAt(acc.removed, oldIndex),
26
+ added: removeAt(acc.added, newIndex),
27
+ };
28
+ }
29
+ return acc;
30
+ }, { removed: oldArr, added: newArr });
@@ -1,2 +1,2 @@
1
- import { SerializedEntityDecl } from "../../schema/index.js";
1
+ import type { SerializedEntityDecl } from "../../node/schema/index.js";
2
2
  export declare const getDisplayNameFromEntityInstance: (entity: SerializedEntityDecl, instance: unknown, defaultName: string, locales?: string[]) => string;
@@ -23,9 +23,11 @@ export const getDisplayNameFromEntityInstance = (entity, instance, defaultName,
23
23
  const availableLocales = Object.keys(localeMap ?? {});
24
24
  return availableLocales.length === 0
25
25
  ? defaultName
26
- : locales.reduce((name, locale) => name ??
26
+ : (locales.reduce((name, locale) => name ??
27
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
28
  getValueAtPath(localeMap[locale], pathInLocaleMap), undefined) ??
29
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
30
  getValueAtPath(localeMap[availableLocales[0]], pathInLocaleMap) ??
29
- defaultName;
31
+ defaultName);
30
32
  }
31
33
  };
@@ -0,0 +1,12 @@
1
+ export type GitFileStatus = {
2
+ index: GitFileStatusCode;
3
+ workingDir: GitFileStatusCode;
4
+ };
5
+ export declare const isChangedInIndex: (fileStatus: GitFileStatus) => boolean;
6
+ export declare const isChangedInWorkingDir: (fileStatus: GitFileStatus) => boolean;
7
+ export type GitFileStatusCode = " " | "M" | "T" | "A" | "D" | "R" | "C" | "U" | "m" | "?" | "!";
8
+ export declare const isUnchangedStatus: (code: GitFileStatusCode) => boolean;
9
+ export type GitFileStatusForDisplay = "U" | "M" | "A" | "D" | "R" | undefined;
10
+ export declare const hasFileChanges: (fileStatus: GitFileStatus | undefined) => boolean;
11
+ export declare const getGitStatusForDisplay: (fileStatus: GitFileStatus | undefined) => GitFileStatusForDisplay;
12
+ export declare const getLabelForGitStatus: (status: GitFileStatusForDisplay) => string;
@@ -0,0 +1,98 @@
1
+ export const isChangedInIndex = (fileStatus) => {
2
+ const { index } = fileStatus;
3
+ switch (index) {
4
+ case "M":
5
+ case "T":
6
+ case "A":
7
+ case "D":
8
+ case "R":
9
+ case "C":
10
+ case "U":
11
+ return true;
12
+ case " ":
13
+ case "m":
14
+ case "?":
15
+ case "!":
16
+ return false;
17
+ }
18
+ };
19
+ export const isChangedInWorkingDir = (fileStatus) => {
20
+ const { workingDir } = fileStatus;
21
+ switch (workingDir) {
22
+ case "M":
23
+ case "T":
24
+ case "A":
25
+ case "D":
26
+ case "R":
27
+ case "C":
28
+ case "U":
29
+ case "?":
30
+ return true;
31
+ case " ":
32
+ case "m":
33
+ case "!":
34
+ return false;
35
+ }
36
+ };
37
+ const unchangedStatusCodes = new Set([" ", "!", "C", "T", "m", "U"]);
38
+ export const isUnchangedStatus = (code) => unchangedStatusCodes.has(code);
39
+ export const hasFileChanges = (fileStatus) => {
40
+ if (fileStatus === undefined) {
41
+ return false;
42
+ }
43
+ const { index, workingDir } = fileStatus;
44
+ return !isUnchangedStatus(index) || !isUnchangedStatus(workingDir);
45
+ };
46
+ export const getGitStatusForDisplay = (fileStatus) => {
47
+ if (fileStatus === undefined) {
48
+ return undefined;
49
+ }
50
+ const { index, workingDir } = fileStatus;
51
+ switch (workingDir) {
52
+ case " ":
53
+ switch (index) {
54
+ case " ":
55
+ return undefined;
56
+ case "M":
57
+ return "M";
58
+ case "A":
59
+ return "A";
60
+ case "D":
61
+ return "D";
62
+ case "R":
63
+ return "R";
64
+ case "?":
65
+ return "U";
66
+ default:
67
+ return undefined;
68
+ }
69
+ case "M":
70
+ return "M";
71
+ case "A":
72
+ return "A";
73
+ case "D":
74
+ return "D";
75
+ case "R":
76
+ return "R";
77
+ case "?":
78
+ return "U";
79
+ default:
80
+ return undefined;
81
+ }
82
+ };
83
+ export const getLabelForGitStatus = (status) => {
84
+ switch (status) {
85
+ case "U":
86
+ return "untracked";
87
+ case "M":
88
+ return "modified";
89
+ case "A":
90
+ return "sdded";
91
+ case "D":
92
+ return "deleted";
93
+ case "R":
94
+ return "renamed";
95
+ default:
96
+ return "";
97
+ }
98
+ };
@@ -1,6 +1,16 @@
1
+ import type { SerializedEntityDecl } from "../../node/schema/index.js";
2
+ import type { GitFileStatus } from "./git.js";
1
3
  export interface InstanceContainer {
2
4
  fileName: string;
3
5
  id: string;
4
6
  content: unknown;
7
+ gitStatus?: GitFileStatus;
5
8
  }
9
+ export interface InstanceContainerOverview {
10
+ fileName: string;
11
+ id: string;
12
+ gitStatus?: GitFileStatus;
13
+ displayName: string;
14
+ }
15
+ export declare const getInstanceContainerOverview: (entity: SerializedEntityDecl, instanceContainer: InstanceContainer, locales?: string[]) => InstanceContainerOverview;
6
16
  export type InstancesByEntityName = Record<string, InstanceContainer[]>;
@@ -1 +1,8 @@
1
- export {};
1
+ import { getDisplayNameFromEntityInstance } from "./displayName.js";
2
+ export const getInstanceContainerOverview = (entity, instanceContainer, locales) => {
3
+ const { content: _, ...rest } = instanceContainer;
4
+ return {
5
+ ...rest,
6
+ displayName: getDisplayNameFromEntityInstance(entity, instanceContainer.content, instanceContainer.id, locales),
7
+ };
8
+ };
@@ -1,4 +1,4 @@
1
- import { assertExhaustive } from "../shared/utils/typeSafety.js";
1
+ import { assertExhaustive } from "./typeSafety.js";
2
2
  /**
3
3
  * A lazy value that is only evaluated when it is needed.
4
4
  */
@@ -0,0 +1,14 @@
1
+ type TextNode = {
2
+ kind: "text";
3
+ content: string;
4
+ };
5
+ export type InlineMarkdownNode = {
6
+ kind: "bold" | "italic";
7
+ content: InlineMarkdownNode[];
8
+ } | TextNode;
9
+ export type BlockMarkdownNode = {
10
+ kind: "paragraph";
11
+ content: InlineMarkdownNode[];
12
+ } | TextNode;
13
+ export declare const parseBlockMarkdown: (text: string) => BlockMarkdownNode[];
14
+ export {};
@@ -0,0 +1,42 @@
1
+ const boldWithItalicRule = {
2
+ pattern: /\*\*(.*?\*.+?\*.*?)\*\*/,
3
+ map: (result, parseInside) => ({ kind: "bold", content: parseInside(result[1] ?? "") }),
4
+ };
5
+ const italicWithBoldRule = {
6
+ pattern: /\*(.*?\*\*.+?\*\*.*?)\*/,
7
+ map: (result, parseInside) => ({ kind: "italic", content: parseInside(result[1] ?? "") }),
8
+ };
9
+ const boldRule = {
10
+ pattern: /\*\*(.+?)\*\*/,
11
+ map: (result, parseInside) => ({ kind: "bold", content: parseInside(result[1] ?? "") }),
12
+ };
13
+ const italicRule = {
14
+ pattern: /\*(.+?)\*/,
15
+ map: (result, parseInside) => ({ kind: "italic", content: parseInside(result[1] ?? "") }),
16
+ };
17
+ const rules = [boldWithItalicRule, italicWithBoldRule, boldRule, italicRule];
18
+ export const parseBlockMarkdown = (text) => text.split(/\n{2,}/).map(par => ({ kind: "paragraph", content: parseInlineMarkdown(par) }));
19
+ const parseForRules = (rules, text) => {
20
+ if (text.length === 0) {
21
+ return [];
22
+ }
23
+ const activeRule = rules[0];
24
+ if (activeRule === undefined) {
25
+ return [{ kind: "text", content: text }];
26
+ }
27
+ const res = activeRule.pattern.exec(text);
28
+ if (res && (activeRule.predicate?.(res) ?? true)) {
29
+ const { index } = res;
30
+ const before = text.slice(0, index);
31
+ const after = text.slice(index + res[0].length);
32
+ return [
33
+ ...(before.length > 0 ? parseForRules(rules.slice(1), before) : []),
34
+ activeRule.map(res, text => parseForRules(rules.slice(1), text)),
35
+ ...(after.length > 0 ? parseForRules(rules, after) : []),
36
+ ];
37
+ }
38
+ else {
39
+ return parseForRules(rules.slice(1), text);
40
+ }
41
+ };
42
+ const parseInlineMarkdown = (text) => parseForRules(rules, text);
@@ -1,2 +1,6 @@
1
1
  export declare const sortObjectKeys: (obj: Record<string, unknown>, keys: string[]) => Record<string, unknown>;
2
2
  export declare const sortObjectKeysAlphabetically: (obj: Record<string, unknown>) => Record<string, unknown>;
3
+ export declare const mergeObjects: <T>(obj1: Record<string, T>, obj2: Record<string, T>, solveConflict: (a: T, b: T) => T) => Record<string, T>;
4
+ export type Leaves<T> = T extends object ? {
5
+ [K in keyof T]: T[K] extends unknown[] ? never : `${Exclude<K, symbol>}${Leaves<T[K]> extends never ? "" : `.${Leaves<T[K]>}`}`;
6
+ }[keyof T] : never;
@@ -1,2 +1,7 @@
1
1
  export const sortObjectKeys = (obj, keys) => Object.fromEntries(keys.flatMap(key => (obj[key] === undefined ? [] : [[key, obj[key]]])));
2
2
  export const sortObjectKeysAlphabetically = (obj) => Object.fromEntries(Object.entries(obj).sort(([keyA], [keyB]) => keyA.localeCompare(keyB)));
3
+ export const mergeObjects = (obj1, obj2, solveConflict) => Object.entries(obj2).reduce((acc, [key, value]) => ({
4
+ ...acc,
5
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
6
+ [key]: Object.hasOwn(acc, key) ? solveConflict(acc[key], value) : value,
7
+ }), obj1);
@@ -24,11 +24,11 @@ export const reduce = (result, fok, ferror) => (isOk(result) ? fok(result.value)
24
24
  /**
25
25
  * Maps the value of a result to a new value.
26
26
  */
27
- export const map = (result, f) => (isOk(result) ? ok(f(result.value)) : result);
27
+ export const map = (result, f) => isOk(result) ? ok(f(result.value)) : result;
28
28
  /**
29
29
  * Maps an error to a new error.
30
30
  */
31
- export const mapError = (result, f) => (isError(result) ? error(f(result.error)) : result);
31
+ export const mapError = (result, f) => isError(result) ? error(f(result.error)) : result;
32
32
  export const combine = (result1, result2, fok, ferror) => isOk(result1)
33
33
  ? isOk(result2)
34
34
  ? ok(fok(result1.value, result2.value))
@@ -4,3 +4,4 @@ export declare const toCamelCase: (str: string) => string;
4
4
  export declare const toKebabCase: (str: string) => string;
5
5
  export declare const toSnakeCase: (str: string) => string;
6
6
  export declare const toTitleCase: (str: string) => string;
7
+ export declare const commonPrefix: (...strs: string[]) => string;
@@ -5,14 +5,17 @@ const separator = /[^a-z0-9]/;
5
5
  const lastChar = (str) => str[str.length - 1];
6
6
  const lastElement = (arr) => arr[arr.length - 1];
7
7
  const isAllUppercase = (str) => str === str.toUpperCase();
8
- export const splitStringParts = (str) => [...str].reduce((acc, char, i, strArr) => {
8
+ export const splitStringParts = (str) => [...new Intl.Segmenter().segment(str)].reduce((acc, segment, i, strArr) => {
9
+ const char = segment.segment;
9
10
  if (acc.length === 0) {
10
11
  return letterOrDigit.test(char) ? [char] : acc;
11
12
  }
13
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12
14
  const lastPart = lastElement(acc);
13
15
  if (uppercase.test(char)) {
14
16
  const lastCharOfLastPart = lastChar(lastPart);
15
- const nextChar = strArr[i + 1];
17
+ const nextSegment = strArr[i + 1];
18
+ const nextChar = nextSegment?.segment;
16
19
  if (lastCharOfLastPart === undefined ||
17
20
  (uppercase.test(lastCharOfLastPart) && (nextChar === undefined || separator.test(nextChar)))) {
18
21
  return [...acc.slice(0, -1), lastPart + char];
@@ -47,6 +50,15 @@ export const toKebabCase = (str) => splitStringParts(str)
47
50
  export const toSnakeCase = (str) => splitStringParts(str)
48
51
  .map(part => part.toLowerCase())
49
52
  .join("_");
50
- export const toTitleCase = (str) => splitStringParts(str)
51
- .map(part => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
53
+ export const toTitleCase = (str) => splitStringParts(isAllUppercase(str) ? str.toLowerCase() : str)
54
+ .map(part => isAllUppercase(part) ? part : part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
52
55
  .join(" ");
56
+ export const commonPrefix = (...strs) => {
57
+ if (strs.length === 0) {
58
+ return "";
59
+ }
60
+ return strs.reduce((accPrefix, str) => {
61
+ const indexOfDifference = Array.from(accPrefix).findIndex((char, i) => str[i] !== char);
62
+ return indexOfDifference === -1 ? accPrefix : accPrefix.slice(0, indexOfDifference);
63
+ });
64
+ };
@@ -1,14 +1,15 @@
1
1
  import { gte, lte } from "./compare.js";
2
2
  export const parallelizeErrors = (errors) => errors.filter(error => error !== undefined);
3
+ const normalizeLabel = (label) => Array.isArray(label) ? label : [label, label + "s"];
3
4
  export const validateLengthRangeBound = (end, label, rangeBound, value) => {
4
5
  if (rangeBound === undefined) {
5
6
  return;
6
7
  }
7
8
  const [operator, description] = end === "lower" ? [gte, "least"] : [lte, "most"];
8
9
  const length = value.length;
9
- const normalizedLabel = Array.isArray(label) ? label : [label, label + "s"];
10
+ const normalizedLabel = normalizeLabel(label);
10
11
  if (!operator(length, rangeBound)) {
11
- return RangeError(`Expected at ${description} ${rangeBound} ${normalizedLabel[rangeBound === 1 ? 0 : 1]}, but got ${length} ${normalizedLabel[length === 1 ? 0 : 1]}`);
12
+ return RangeError(`expected at ${description} ${rangeBound.toString()} ${normalizedLabel[rangeBound === 1 ? 0 : 1]}, but got ${length.toString()} ${normalizedLabel[length === 1 ? 0 : 1]}`);
12
13
  }
13
14
  return;
14
15
  };
@@ -18,8 +18,8 @@ export const validateRangeBound = (end, rangeBound, value) => {
18
18
  : normalizedRangeBound.isExclusive
19
19
  ? [lt, "less than"]
20
20
  : [lte, "less than or equal"];
21
- if (operator(value, normalizedRangeBound.value)) {
22
- return RangeError(`expected a value ${description} ${normalizedRangeBound.value}, but got ${value}`);
21
+ if (!operator(value, normalizedRangeBound.value)) {
22
+ return RangeError(`expected a value ${description} ${normalizedRangeBound.value.toString()}, but got ${value.toString()}`);
23
23
  }
24
24
  return;
25
25
  };
@@ -28,7 +28,7 @@ export const validateMultipleOf = (multipleOf, value) => {
28
28
  return;
29
29
  }
30
30
  if (value % multipleOf !== 0) {
31
- return RangeError(`expected a value that is a multiple of ${multipleOf}, but got ${value}`);
31
+ return RangeError(`expected a value that is a multiple of ${multipleOf.toString()}, but got ${value.toString()}`);
32
32
  }
33
33
  return;
34
34
  };
@@ -1,11 +1,12 @@
1
1
  import { parallelizeErrors, validateLengthRangeBound } from "../utils/validation.js";
2
2
  export const validateObjectConstraints = (constraints, expectedKeys, value) => {
3
3
  const label = ["property", "properties"];
4
+ const actualKeys = Object.keys(value);
4
5
  return parallelizeErrors([
5
- validateLengthRangeBound("lower", label, constraints.minProperties, expectedKeys),
6
- validateLengthRangeBound("upper", label, constraints.maxProperties, expectedKeys),
6
+ validateLengthRangeBound("lower", label, constraints.minProperties, actualKeys),
7
+ validateLengthRangeBound("upper", label, constraints.maxProperties, actualKeys),
7
8
  ...(constraints.additionalProperties !== true
8
- ? Object.keys(value).flatMap(valueKey => expectedKeys.includes(valueKey)
9
+ ? actualKeys.flatMap(valueKey => expectedKeys.includes(valueKey)
9
10
  ? []
10
11
  : [TypeError(`object does not allow unknown keys and key "${valueKey}" is not known`)])
11
12
  : []),
@@ -1,15 +1,20 @@
1
1
  import { parallelizeErrors } from "../utils/validation.js";
2
2
  export const validateStringConstraints = (constraints, value) => parallelizeErrors([
3
3
  constraints.minLength !== undefined && value.length < constraints.minLength
4
- ? RangeError(`expected a string with at least ${constraints.minLength} character${constraints.minLength === 1 ? "" : "s"}, but got ${value.length} character${value.length === 1 ? "" : "s"}`)
4
+ ? RangeError(`expected a string with at least ${constraints.minLength.toString()} character${constraints.minLength === 1 ? "" : "s"}, but got ${value.length.toString()} character${value.length === 1 ? "" : "s"}`)
5
5
  : undefined,
6
6
  constraints.maxLength !== undefined && value.length > constraints.maxLength
7
- ? RangeError(`expected a string with at most ${constraints.maxLength} character${constraints.maxLength === 1 ? "" : "s"}, but got ${value.length} character${value.length === 1 ? "" : "s"}`)
7
+ ? RangeError(`expected a string with at most ${constraints.maxLength.toString()} character${constraints.maxLength === 1 ? "" : "s"}, but got ${value.length.toString()} character${value.length === 1 ? "" : "s"}`)
8
8
  : undefined,
9
- constraints.pattern !== undefined &&
10
- !(typeof constraints.pattern === "string"
9
+ (() => {
10
+ if (constraints.pattern === undefined) {
11
+ return undefined;
12
+ }
13
+ const pattern = typeof constraints.pattern === "string"
11
14
  ? new RegExp(constraints.pattern)
12
- : constraints.pattern).test(value)
13
- ? TypeError(`string does not match the pattern ${constraints.pattern}`)
14
- : undefined,
15
+ : constraints.pattern;
16
+ return !pattern.test(value)
17
+ ? TypeError(`string does not match the pattern ${pattern.toString()}`)
18
+ : undefined;
19
+ })(),
15
20
  ]);
@@ -0,0 +1,24 @@
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";
3
+ export declare const getAllDeclarations: (kind?: "Entity" | "Enum" | "TypeAlias") => Promise<GetAllDeclarationsResponseBody>;
4
+ export declare const getAllEntities: () => Promise<GetAllDeclarationsResponseBody<SerializedEntityDecl>>;
5
+ export declare const getEntityByName: (name: string) => Promise<GetDeclarationResponseBody<SerializedEntityDecl>>;
6
+ export declare const getInstancesByEntityName: (name: string) => Promise<GetAllInstancesOfEntityResponseBody>;
7
+ export declare const createInstanceByEntityNameAndId: (name: string, content: unknown, id?: string) => Promise<CreateInstanceOfEntityResponseBody>;
8
+ export declare const getInstanceByEntityNameAndId: (name: string, id: string) => Promise<GetInstanceOfEntityResponseBody>;
9
+ export declare const updateInstanceByEntityNameAndId: (name: string, id: string, content: unknown) => Promise<UpdateInstanceOfEntityResponseBody>;
10
+ export declare const deleteInstanceByEntityNameAndId: (name: string, id: string) => Promise<DeleteInstanceOfEntityResponseBody>;
11
+ export declare const getAllInstances: (locales: string[]) => Promise<GetAllInstancesResponseBody>;
12
+ export declare const getGitStatus: (locales: string[]) => Promise<GitStatusResponseBody>;
13
+ export declare const stageAllFiles: () => Promise<void>;
14
+ export declare const stageAllFilesOfEntity: (entityName: string) => Promise<void>;
15
+ export declare const stageFileOfEntity: (entityName: string, id: string) => Promise<void>;
16
+ export declare const unstageAllFiles: () => Promise<void>;
17
+ export declare const unstageAllFilesOfEntity: (entityName: string) => Promise<void>;
18
+ export declare const unstageFileOfEntity: (entityName: string, id: string) => Promise<void>;
19
+ export declare const commitStagedFiles: (message: string) => Promise<DeleteInstanceOfEntityResponseBody>;
20
+ export declare const pushCommits: () => Promise<DeleteInstanceOfEntityResponseBody>;
21
+ export declare const pullCommits: () => Promise<DeleteInstanceOfEntityResponseBody>;
22
+ export declare const getBranches: () => Promise<GetAllGitBranchesResponseBody>;
23
+ export declare const createBranch: (branchName: string) => Promise<void>;
24
+ export declare const switchBranch: (branchName: string) => Promise<void>;