@knime/hub-features 1.7.4 → 1.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @knime/hub-features
2
2
 
3
+ ## 1.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e88dcfd]
8
+ - @knime/components@1.27.0
9
+
10
+ ## 1.8.0
11
+
12
+ ### Minor Changes
13
+
14
+ - add restoreVersion to versionsApi
15
+
3
16
  ## 1.7.4
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/hub-features",
3
- "version": "1.7.4",
3
+ "version": "1.8.1",
4
4
  "description": "Vue components & composables for shared hub features",
5
5
  "homepage": "https://knime.github.io/webapps-common/",
6
6
  "license": "GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE)",
@@ -31,8 +31,8 @@
31
31
  "lodash-es": "4.17.21",
32
32
  "ofetch": "^1.4.1",
33
33
  "typescript": "^5.4.5",
34
+ "@knime/components": "1.27.0",
34
35
  "@knime/styles": "1.4.0",
35
- "@knime/components": "1.26.0",
36
36
  "@knime/utils": "1.4.0"
37
37
  },
38
38
  "peerDependencies": {
@@ -89,27 +89,42 @@ export const useVersionsApi = ({
89
89
  };
90
90
 
91
91
  const deleteVersion = ({
92
- projectItemId,
92
+ itemId,
93
93
  version,
94
94
  }: {
95
- projectItemId: string;
95
+ itemId: string;
96
96
  version: NamedItemVersion["version"];
97
97
  }) => {
98
- return doHubRequest(`/repository/${projectItemId}/versions/${version}`, {
98
+ return doHubRequest(`/repository/${itemId}/versions/${version}`, {
99
99
  method: "DELETE",
100
100
  });
101
101
  };
102
102
 
103
+ const restoreVersion = ({
104
+ itemId,
105
+ version,
106
+ }: {
107
+ itemId: string;
108
+ version: NamedItemVersion["version"];
109
+ }) => {
110
+ return doHubRequest(
111
+ `/repository/${itemId}/workingArea?fromVersion=${version}`,
112
+ {
113
+ method: "POST",
114
+ },
115
+ );
116
+ };
117
+
103
118
  const createVersion = ({
104
- projectItemId,
119
+ itemId,
105
120
  title,
106
121
  description,
107
122
  }: {
108
- projectItemId: string;
123
+ itemId: string;
109
124
  title: string;
110
125
  description: string;
111
126
  }): Promise<NamedItemVersion> => {
112
- return doHubRequest(`/repository/${projectItemId}/versions`, {
127
+ return doHubRequest(`/repository/${itemId}/versions`, {
113
128
  method: "POST",
114
129
  body: JSON.stringify({
115
130
  title,
@@ -202,6 +217,7 @@ export const useVersionsApi = ({
202
217
  fetchPermissions,
203
218
  loadSavepointMetadata,
204
219
  deleteVersion,
220
+ restoreVersion,
205
221
  createVersion,
206
222
  getAvatar,
207
223
  };