tsondb 0.5.19 → 0.6.1
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.
- package/dist/src/bin/tsondb.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/node/config.d.ts +20 -0
- package/dist/src/node/config.js +5 -0
- package/dist/src/node/index.d.ts +3 -2
- package/dist/src/node/index.js +13 -8
- package/dist/src/node/renderers/jsonschema/render.d.ts +1 -1
- package/dist/src/node/renderers/jsonschema/render.js +12 -7
- package/dist/src/node/renderers/ts/render.d.ts +1 -1
- package/dist/src/node/renderers/ts/render.js +12 -6
- package/dist/src/node/schema/Node.d.ts +100 -29
- package/dist/src/node/schema/Node.js +268 -61
- package/dist/src/node/schema/Schema.js +96 -1
- package/dist/src/node/schema/TypeParameter.d.ts +7 -9
- package/dist/src/node/schema/TypeParameter.js +7 -5
- package/dist/src/node/schema/declarations/Declaration.d.ts +10 -28
- package/dist/src/node/schema/declarations/Declaration.js +8 -110
- package/dist/src/node/schema/declarations/EntityDecl.d.ts +48 -48
- package/dist/src/node/schema/declarations/EntityDecl.js +15 -12
- package/dist/src/node/schema/declarations/EnumDecl.d.ts +14 -17
- package/dist/src/node/schema/declarations/EnumDecl.js +12 -12
- package/dist/src/node/schema/declarations/TypeAliasDecl.d.ts +8 -14
- package/dist/src/node/schema/declarations/TypeAliasDecl.js +10 -11
- package/dist/src/node/schema/index.d.ts +0 -2
- package/dist/src/node/schema/index.js +0 -1
- package/dist/src/node/schema/types/Type.d.ts +19 -42
- package/dist/src/node/schema/types/Type.js +29 -167
- package/dist/src/node/schema/types/generic/ArrayType.d.ts +5 -14
- package/dist/src/node/schema/types/generic/ArrayType.js +15 -20
- package/dist/src/node/schema/types/generic/EnumType.d.ts +5 -17
- package/dist/src/node/schema/types/generic/EnumType.js +12 -20
- package/dist/src/node/schema/types/generic/ObjectType.d.ts +5 -19
- package/dist/src/node/schema/types/generic/ObjectType.js +11 -15
- package/dist/src/node/schema/types/primitives/BooleanType.d.ts +7 -8
- package/dist/src/node/schema/types/primitives/BooleanType.js +5 -4
- package/dist/src/node/schema/types/primitives/DateType.d.ts +6 -8
- package/dist/src/node/schema/types/primitives/DateType.js +5 -4
- package/dist/src/node/schema/types/primitives/FloatType.d.ts +9 -21
- package/dist/src/node/schema/types/primitives/FloatType.js +5 -4
- package/dist/src/node/schema/types/primitives/IntegerType.d.ts +9 -21
- package/dist/src/node/schema/types/primitives/IntegerType.js +5 -4
- package/dist/src/node/schema/types/primitives/StringType.d.ts +6 -10
- package/dist/src/node/schema/types/primitives/StringType.js +5 -4
- package/dist/src/node/schema/types/references/ChildEntitiesType.d.ts +18 -0
- package/dist/src/node/schema/types/references/ChildEntitiesType.js +18 -0
- package/dist/src/node/schema/types/references/IncludeIdentifierType.d.ts +7 -13
- package/dist/src/node/schema/types/references/IncludeIdentifierType.js +12 -12
- package/dist/src/node/schema/types/references/NestedEntityMapType.d.ts +7 -17
- package/dist/src/node/schema/types/references/NestedEntityMapType.js +11 -13
- package/dist/src/node/schema/types/references/ReferenceIdentifierType.d.ts +4 -10
- package/dist/src/node/schema/types/references/ReferenceIdentifierType.js +3 -5
- package/dist/src/node/schema/types/references/TypeArgumentType.d.ts +5 -10
- package/dist/src/node/schema/types/references/TypeArgumentType.js +10 -5
- package/dist/src/node/server/api/declarations.js +24 -6
- package/dist/src/node/server/api/index.js +11 -0
- package/dist/src/node/server/api/instances.js +9 -6
- package/dist/src/node/server/index.d.ts +6 -1
- package/dist/src/node/server/index.js +7 -3
- package/dist/src/node/server/init.d.ts +2 -1
- package/dist/src/node/server/init.js +11 -11
- package/dist/src/node/server/utils/childInstances.d.ts +4 -0
- package/dist/src/node/server/utils/childInstances.js +41 -0
- package/dist/src/node/server/utils/instanceOperations.d.ts +8 -0
- package/dist/src/node/server/utils/instanceOperations.js +107 -0
- package/dist/src/node/server/utils/locales.d.ts +2 -0
- package/dist/src/node/server/utils/locales.js +8 -0
- package/dist/src/node/utils/childInstances.d.ts +32 -0
- package/dist/src/node/utils/childInstances.js +164 -0
- package/dist/src/node/utils/displayName.d.ts +2 -1
- package/dist/src/node/utils/displayName.js +5 -4
- package/dist/src/node/utils/files.d.ts +5 -0
- package/dist/src/node/utils/files.js +9 -0
- package/dist/src/node/utils/instanceOperations.d.ts +14 -0
- package/dist/src/node/utils/instanceOperations.js +88 -0
- package/dist/src/node/utils/instances.d.ts +1 -1
- package/dist/src/node/utils/instances.js +12 -6
- package/dist/src/node/utils/references.d.ts +3 -1
- package/dist/src/node/utils/references.js +43 -18
- package/dist/src/node/utils/referencesWorker.d.ts +5 -0
- package/dist/src/node/utils/referencesWorker.js +22 -0
- package/dist/src/node/utils/workers.d.ts +15 -0
- package/dist/src/node/utils/workers.js +90 -0
- package/dist/src/shared/api.d.ts +14 -1
- package/dist/src/shared/schema/Node.d.ts +63 -0
- package/dist/src/shared/schema/Node.js +128 -0
- package/dist/src/shared/schema/TypeParameter.d.ts +9 -0
- package/dist/src/shared/schema/TypeParameter.js +2 -0
- package/dist/src/shared/schema/declarations/Declaration.d.ts +21 -0
- package/dist/src/shared/schema/declarations/Declaration.js +4 -0
- package/dist/src/shared/schema/declarations/EntityDecl.d.ts +32 -0
- package/dist/src/shared/schema/declarations/EntityDecl.js +8 -0
- package/dist/src/shared/schema/declarations/EnumDecl.d.ts +11 -0
- package/dist/src/shared/schema/declarations/EnumDecl.js +9 -0
- package/dist/src/shared/schema/declarations/TypeAliasDecl.d.ts +11 -0
- package/dist/src/shared/schema/declarations/TypeAliasDecl.js +7 -0
- package/dist/src/shared/schema/types/ArrayType.d.ts +11 -0
- package/dist/src/shared/schema/types/ArrayType.js +8 -0
- package/dist/src/shared/schema/types/BooleanType.d.ts +7 -0
- package/dist/src/shared/schema/types/BooleanType.js +2 -0
- package/dist/src/shared/schema/types/ChildEntitiesType.d.ts +8 -0
- package/dist/src/shared/schema/types/ChildEntitiesType.js +2 -0
- package/dist/src/shared/schema/types/DateType.d.ts +8 -0
- package/dist/src/shared/schema/types/DateType.js +2 -0
- package/dist/src/shared/schema/types/EnumType.d.ts +14 -0
- package/dist/src/shared/schema/types/EnumType.js +28 -0
- package/dist/src/shared/schema/types/FloatType.d.ts +11 -0
- package/dist/src/shared/schema/types/FloatType.js +2 -0
- package/dist/src/shared/schema/types/IncludeIdentifierType.d.ts +11 -0
- package/dist/src/shared/schema/types/IncludeIdentifierType.js +13 -0
- package/dist/src/shared/schema/types/IntegerType.d.ts +11 -0
- package/dist/src/shared/schema/types/IntegerType.js +2 -0
- package/dist/src/shared/schema/types/NestedEntityMapType.d.ts +17 -0
- package/dist/src/shared/schema/types/NestedEntityMapType.js +14 -0
- package/dist/src/shared/schema/types/ObjectType.d.ts +19 -0
- package/dist/src/shared/schema/types/ObjectType.js +14 -0
- package/dist/src/shared/schema/types/ReferenceIdentifierType.d.ts +8 -0
- package/dist/src/shared/schema/types/ReferenceIdentifierType.js +2 -0
- package/dist/src/shared/schema/types/StringType.d.ts +10 -0
- package/dist/src/shared/schema/types/StringType.js +2 -0
- package/dist/src/shared/schema/types/Type.d.ts +20 -0
- package/dist/src/shared/schema/types/TypeArgumentType.d.ts +12 -0
- package/dist/src/shared/schema/types/TypeArgumentType.js +7 -0
- package/dist/src/shared/utils/array.d.ts +4 -0
- package/dist/src/shared/utils/array.js +30 -0
- package/dist/src/shared/utils/async.d.ts +8 -0
- package/dist/src/shared/utils/async.js +35 -0
- package/dist/src/shared/utils/compare.js +3 -3
- package/dist/src/shared/utils/displayName.d.ts +6 -2
- package/dist/src/shared/utils/displayName.js +21 -8
- package/dist/src/shared/utils/instances.d.ts +2 -3
- package/dist/src/shared/utils/instances.js +3 -1
- package/dist/src/shared/utils/markdown.d.ts +4 -0
- package/dist/src/shared/utils/markdown.js +91 -4
- package/dist/src/shared/utils/object.d.ts +2 -0
- package/dist/src/shared/utils/object.js +2 -0
- package/dist/src/shared/utils/result.d.ts +8 -2
- package/dist/src/shared/utils/result.js +1 -1
- package/dist/src/web/api/declarations.d.ts +26 -0
- package/dist/src/web/api/declarations.js +51 -0
- package/dist/src/web/api/git.d.ts +14 -0
- package/dist/src/web/api/git.js +20 -0
- package/dist/src/web/api/index.d.ts +1 -0
- package/dist/src/web/api/index.js +2 -0
- package/dist/src/web/api/instances.d.ts +2 -0
- package/dist/src/web/api/instances.js +2 -0
- package/dist/src/web/components/Git.js +19 -16
- package/dist/src/web/components/InstanceRouteSkeleton.d.ts +42 -0
- package/dist/src/web/components/InstanceRouteSkeleton.js +114 -0
- package/dist/src/web/components/Layout.js +3 -2
- package/dist/src/web/components/ModalDialog.d.ts +2 -0
- package/dist/src/web/components/ModalDialog.js +16 -0
- package/dist/src/web/components/Select.d.ts +1 -2
- package/dist/src/web/components/Settings.d.ts +2 -0
- package/dist/src/web/components/Settings.js +47 -0
- package/dist/src/web/components/typeInputs/ArrayTypeInput.d.ts +3 -11
- package/dist/src/web/components/typeInputs/ArrayTypeInput.js +5 -4
- package/dist/src/web/components/typeInputs/BooleanTypeInput.d.ts +3 -6
- package/dist/src/web/components/typeInputs/BooleanTypeInput.js +2 -2
- package/dist/src/web/components/typeInputs/ChildEntitiesTypeInput.d.ts +6 -0
- package/dist/src/web/components/typeInputs/ChildEntitiesTypeInput.js +27 -0
- package/dist/src/web/components/typeInputs/DateTypeInput.d.ts +3 -6
- package/dist/src/web/components/typeInputs/DateTypeInput.js +2 -2
- package/dist/src/web/components/typeInputs/EnumTypeInput.d.ts +3 -11
- package/dist/src/web/components/typeInputs/EnumTypeInput.js +55 -22
- package/dist/src/web/components/typeInputs/FloatTypeInput.d.ts +3 -6
- package/dist/src/web/components/typeInputs/FloatTypeInput.js +2 -2
- package/dist/src/web/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.d.ts +3 -4
- package/dist/src/web/components/typeInputs/IncludeIdentifierTypeInput.d.ts +3 -11
- package/dist/src/web/components/typeInputs/IncludeIdentifierTypeInput.js +3 -2
- package/dist/src/web/components/typeInputs/IntegerTypeInput.d.ts +3 -6
- package/dist/src/web/components/typeInputs/IntegerTypeInput.js +2 -2
- package/dist/src/web/components/typeInputs/NestedEntityMapTypeInput.d.ts +3 -11
- package/dist/src/web/components/typeInputs/NestedEntityMapTypeInput.js +5 -4
- package/dist/src/web/components/typeInputs/ObjectTypeInput.d.ts +3 -11
- package/dist/src/web/components/typeInputs/ObjectTypeInput.js +8 -5
- package/dist/src/web/components/typeInputs/ReferenceIdentifierTypeInput.d.ts +3 -8
- package/dist/src/web/components/typeInputs/ReferenceIdentifierTypeInput.js +2 -2
- package/dist/src/web/components/typeInputs/StringTypeInput.d.ts +3 -6
- package/dist/src/web/components/typeInputs/StringTypeInput.js +3 -3
- package/dist/src/web/components/typeInputs/TypeInput.d.ts +12 -4
- package/dist/src/web/components/typeInputs/TypeInput.js +22 -17
- package/dist/src/web/components/typeInputs/utils/ValidationErrors.d.ts +1 -0
- package/dist/src/web/components/typeInputs/utils/ValidationErrors.js +1 -3
- package/dist/src/web/context/config.d.ts +11 -0
- package/dist/src/web/context/config.js +6 -0
- package/dist/src/web/context/entities.d.ts +8 -5
- package/dist/src/web/context/entities.js +1 -1
- package/dist/src/web/context/settings.d.ts +8 -0
- package/dist/src/web/context/settings.js +10 -0
- package/dist/src/web/hooks/useEntityFromRoute.d.ts +1 -1
- package/dist/src/web/hooks/useEntityFromRoute.js +2 -2
- package/dist/src/web/hooks/useInstanceNamesByEntity.d.ts +1 -1
- package/dist/src/web/hooks/useInstanceNamesByEntity.js +4 -2
- package/dist/src/web/hooks/useMappedAPIResource.js +2 -4
- package/dist/src/web/hooks/useSecondaryDeclarations.d.ts +1 -1
- package/dist/src/web/hooks/useSecondaryDeclarations.js +8 -4
- package/dist/src/web/hooks/useSettings.d.ts +10 -0
- package/dist/src/web/hooks/useSettings.js +51 -0
- package/dist/src/web/index.js +11 -5
- package/dist/src/web/routes/CreateInstance.js +40 -79
- package/dist/src/web/routes/Entity.js +42 -19
- package/dist/src/web/routes/Home.js +24 -5
- package/dist/src/web/routes/Instance.js +34 -85
- package/dist/src/web/utils/InlineMarkdown.d.ts +1 -1
- package/dist/src/web/utils/InlineMarkdown.js +13 -1
- package/dist/src/web/utils/api.d.ts +25 -0
- package/dist/src/web/utils/api.js +34 -0
- package/dist/src/web/utils/typeSkeleton.d.ts +1 -1
- package/dist/src/web/utils/typeSkeleton.js +2 -0
- package/package.json +14 -13
- package/public/css/styles.css +171 -12
- package/dist/src/node/schema/types/primitives/NumericType.d.ts +0 -6
- package/dist/src/node/schema/types/primitives/NumericType.js +0 -2
- package/dist/src/node/schema/types/primitives/PrimitiveType.d.ts +0 -6
- package/dist/src/node/schema/validation/type.d.ts +0 -4
- package/dist/src/node/schema/validation/type.js +0 -1
- package/dist/src/node/server/api/instanceOperations.d.ts +0 -6
- package/dist/src/node/server/api/instanceOperations.js +0 -93
- package/dist/src/shared/config.d.ts +0 -11
- package/dist/src/shared/config.js +0 -1
- package/dist/src/web/api.d.ts +0 -24
- package/dist/src/web/api.js +0 -201
- /package/dist/src/{node/schema/types/primitives/PrimitiveType.js → shared/schema/types/Type.js} +0 -0
package/dist/src/web/api.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
export const getAllDeclarations = async (kind) => {
|
|
2
|
-
const url = new URL("/api/declarations", window.location.origin);
|
|
3
|
-
if (kind) {
|
|
4
|
-
url.searchParams.append("kind", kind);
|
|
5
|
-
}
|
|
6
|
-
const response = await fetch(url);
|
|
7
|
-
if (!response.ok) {
|
|
8
|
-
throw new Error(await response.text());
|
|
9
|
-
}
|
|
10
|
-
return response.json();
|
|
11
|
-
};
|
|
12
|
-
export const getAllEntities = () => getAllDeclarations("Entity");
|
|
13
|
-
export const getEntityByName = async (name) => {
|
|
14
|
-
const response = await fetch(`/api/declarations/${name}`);
|
|
15
|
-
if (!response.ok) {
|
|
16
|
-
throw new Error(await response.text());
|
|
17
|
-
}
|
|
18
|
-
return response.json();
|
|
19
|
-
};
|
|
20
|
-
export const getInstancesByEntityName = async (name) => {
|
|
21
|
-
const response = await fetch(`/api/declarations/${name}/instances`);
|
|
22
|
-
if (!response.ok) {
|
|
23
|
-
throw new Error(await response.text());
|
|
24
|
-
}
|
|
25
|
-
return response.json();
|
|
26
|
-
};
|
|
27
|
-
export const createInstanceByEntityNameAndId = async (name, content, id) => {
|
|
28
|
-
const url = new URL(`/api/declarations/${name}/instances`, window.location.origin);
|
|
29
|
-
if (id) {
|
|
30
|
-
url.searchParams.append("id", id);
|
|
31
|
-
}
|
|
32
|
-
const response = await fetch(url, {
|
|
33
|
-
method: "POST",
|
|
34
|
-
body: JSON.stringify(content),
|
|
35
|
-
headers: {
|
|
36
|
-
"Content-Type": "application/json",
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
if (!response.ok) {
|
|
40
|
-
throw new Error(await response.text());
|
|
41
|
-
}
|
|
42
|
-
return response.json();
|
|
43
|
-
};
|
|
44
|
-
export const getInstanceByEntityNameAndId = async (name, id) => {
|
|
45
|
-
const response = await fetch(`/api/declarations/${name}/instances/${id}`);
|
|
46
|
-
if (!response.ok) {
|
|
47
|
-
throw new Error(await response.text());
|
|
48
|
-
}
|
|
49
|
-
return response.json();
|
|
50
|
-
};
|
|
51
|
-
export const updateInstanceByEntityNameAndId = async (name, id, content) => {
|
|
52
|
-
const response = await fetch(`/api/declarations/${name}/instances/${id}`, {
|
|
53
|
-
method: "PUT",
|
|
54
|
-
body: JSON.stringify(content),
|
|
55
|
-
headers: {
|
|
56
|
-
"Content-Type": "application/json",
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
if (!response.ok) {
|
|
60
|
-
throw new Error(await response.text());
|
|
61
|
-
}
|
|
62
|
-
return response.json();
|
|
63
|
-
};
|
|
64
|
-
export const deleteInstanceByEntityNameAndId = async (name, id) => {
|
|
65
|
-
const response = await fetch(`/api/declarations/${name}/instances/${id}`, {
|
|
66
|
-
method: "DELETE",
|
|
67
|
-
});
|
|
68
|
-
if (!response.ok) {
|
|
69
|
-
throw new Error(await response.text());
|
|
70
|
-
}
|
|
71
|
-
return response.json();
|
|
72
|
-
};
|
|
73
|
-
export const getAllInstances = async (locales) => {
|
|
74
|
-
const url = new URL("/api/instances", window.location.origin);
|
|
75
|
-
for (const locale of locales) {
|
|
76
|
-
url.searchParams.append("locales", locale);
|
|
77
|
-
}
|
|
78
|
-
const response = await fetch(url);
|
|
79
|
-
if (!response.ok) {
|
|
80
|
-
throw new Error(await response.text());
|
|
81
|
-
}
|
|
82
|
-
return response.json();
|
|
83
|
-
};
|
|
84
|
-
export const getGitStatus = async () => {
|
|
85
|
-
const url = new URL("/api/git/status", window.location.origin);
|
|
86
|
-
const response = await fetch(url);
|
|
87
|
-
if (!response.ok) {
|
|
88
|
-
throw new Error(await response.text());
|
|
89
|
-
}
|
|
90
|
-
return response.json();
|
|
91
|
-
};
|
|
92
|
-
export const stageAllFiles = async () => {
|
|
93
|
-
const response = await fetch(`/api/git/stage`, {
|
|
94
|
-
method: "POST",
|
|
95
|
-
});
|
|
96
|
-
if (!response.ok) {
|
|
97
|
-
throw new Error(await response.text());
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
export const stageAllFilesOfEntity = async (entityName) => {
|
|
101
|
-
const response = await fetch(`/api/git/stage/${entityName}`, {
|
|
102
|
-
method: "POST",
|
|
103
|
-
});
|
|
104
|
-
if (!response.ok) {
|
|
105
|
-
throw new Error(await response.text());
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
export const stageFileOfEntity = async (entityName, id) => {
|
|
109
|
-
const response = await fetch(`/api/git/stage/${entityName}/${id}`, {
|
|
110
|
-
method: "POST",
|
|
111
|
-
});
|
|
112
|
-
if (!response.ok) {
|
|
113
|
-
throw new Error(await response.text());
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
export const unstageAllFiles = async () => {
|
|
117
|
-
const response = await fetch(`/api/git/unstage`, {
|
|
118
|
-
method: "POST",
|
|
119
|
-
});
|
|
120
|
-
if (!response.ok) {
|
|
121
|
-
throw new Error(await response.text());
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
export const unstageAllFilesOfEntity = async (entityName) => {
|
|
125
|
-
const response = await fetch(`/api/git/unstage/${entityName}`, {
|
|
126
|
-
method: "POST",
|
|
127
|
-
});
|
|
128
|
-
if (!response.ok) {
|
|
129
|
-
throw new Error(await response.text());
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
export const unstageFileOfEntity = async (entityName, id) => {
|
|
133
|
-
const response = await fetch(`/api/git/unstage/${entityName}/${id}`, {
|
|
134
|
-
method: "POST",
|
|
135
|
-
});
|
|
136
|
-
if (!response.ok) {
|
|
137
|
-
throw new Error(await response.text());
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
export const commitStagedFiles = async (message) => {
|
|
141
|
-
const body = { message };
|
|
142
|
-
const response = await fetch(`/api/git/commit`, {
|
|
143
|
-
method: "POST",
|
|
144
|
-
body: JSON.stringify(body),
|
|
145
|
-
headers: {
|
|
146
|
-
"Content-Type": "application/json",
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
if (!response.ok) {
|
|
150
|
-
throw new Error(await response.text());
|
|
151
|
-
}
|
|
152
|
-
return response.json();
|
|
153
|
-
};
|
|
154
|
-
export const pushCommits = async () => {
|
|
155
|
-
const response = await fetch(`/api/git/push`, {
|
|
156
|
-
method: "POST",
|
|
157
|
-
});
|
|
158
|
-
if (!response.ok) {
|
|
159
|
-
throw new Error(await response.text());
|
|
160
|
-
}
|
|
161
|
-
return response.json();
|
|
162
|
-
};
|
|
163
|
-
export const pullCommits = async () => {
|
|
164
|
-
const response = await fetch(`/api/git/pull`, {
|
|
165
|
-
method: "POST",
|
|
166
|
-
});
|
|
167
|
-
if (!response.ok) {
|
|
168
|
-
throw new Error(await response.text());
|
|
169
|
-
}
|
|
170
|
-
return response.json();
|
|
171
|
-
};
|
|
172
|
-
export const getBranches = async () => {
|
|
173
|
-
const response = await fetch(`/api/git/branch`, {
|
|
174
|
-
method: "GET",
|
|
175
|
-
});
|
|
176
|
-
if (!response.ok) {
|
|
177
|
-
throw new Error(await response.text());
|
|
178
|
-
}
|
|
179
|
-
return response.json();
|
|
180
|
-
};
|
|
181
|
-
export const createBranch = async (branchName) => {
|
|
182
|
-
const body = { branchName };
|
|
183
|
-
const response = await fetch(`/api/git/branch`, {
|
|
184
|
-
method: "POST",
|
|
185
|
-
body: JSON.stringify(body),
|
|
186
|
-
headers: {
|
|
187
|
-
"Content-Type": "application/json",
|
|
188
|
-
},
|
|
189
|
-
});
|
|
190
|
-
if (!response.ok) {
|
|
191
|
-
throw new Error(await response.text());
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
export const switchBranch = async (branchName) => {
|
|
195
|
-
const response = await fetch(`/api/git/branch/${branchName}`, {
|
|
196
|
-
method: "POST",
|
|
197
|
-
});
|
|
198
|
-
if (!response.ok) {
|
|
199
|
-
throw new Error(await response.text());
|
|
200
|
-
}
|
|
201
|
-
};
|
/package/dist/src/{node/schema/types/primitives/PrimitiveType.js → shared/schema/types/Type.js}
RENAMED
|
File without changes
|