@microtronics/studio-cli 0.22.0 → 0.23.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.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,18 @@
1
1
 
2
2
 
3
- ## 0.22.0 (2025-02-25)
3
+ ## 0.23.0 (2025-02-25)
4
4
 
5
5
 
6
6
  ### Features
7
7
 
8
+ * **studio-cli:** support to create an application with an existing id ([3dbde64](https://bitbucket.org/microtronics-core/vscode-studio/commits/3dbde64241244a2493b8452ed47f3a37dc90cc71))
9
+ * **studio-cli:** use semver api calls for `wynni` environment ([3fa1af3](https://bitbucket.org/microtronics-core/vscode-studio/commits/3fa1af3343c6cda3b73862797ee37d4c696da547))
10
+
11
+ ## 0.22.0 (2025-02-25)
12
+
13
+
14
+ ### Features
15
+
8
16
  * **studio-cli:** use semver api calls for `wynni` environment ([dcc6695](https://bitbucket.org/microtronics-core/vscode-studio/commits/dcc6695ecf7b76acea9d70f5d85b125167d4c874))
9
17
 
10
18
  ## 0.21.1 (2025-02-25)
@@ -167,6 +167,11 @@ declare interface components {
167
167
  */
168
168
  TargetSystem: "myDatanet" | "ONE" | "MT360";
169
169
  NewApplication: {
170
+ /**
171
+ * Format: uuid
172
+ * @description Only in "wynni" environment available! Allows creating an application with an predefined id
173
+ */
174
+ id?: string;
170
175
  /** @description The project name */
171
176
  name: string;
172
177
  type?: components["schemas"]["ApplicationType"];
package/out/manifest.js CHANGED
@@ -412,7 +412,7 @@ function validateAddonSupported(manifest) {
412
412
  * @param env
413
413
  */
414
414
  function validateProjectVersion(manifest, env) {
415
- if (env === globals_1.Globals.ENV.lucky || Manifest.isLibrary(manifest)) {
415
+ if ([globals_1.Globals.ENV.lucky, globals_1.Globals.ENV.wynni].includes(env) || Manifest.isLibrary(manifest)) {
416
416
  if (!preload_1.default.valid(manifest.version)) {
417
417
  throw new Error('"version" has to be a semantic version string!"');
418
418
  }
@@ -163,10 +163,22 @@ var APM;
163
163
  if (!publisher) {
164
164
  return null;
165
165
  }
166
- return {
167
- id: applicationId,
168
- ...(await registryAPI_1.Registry.getExistingApplication(token, publisher, applicationId, env))
169
- };
166
+ try {
167
+ return {
168
+ id: applicationId,
169
+ ...(await registryAPI_1.Registry.getExistingApplication(token, publisher, applicationId, env))
170
+ };
171
+ }
172
+ catch (e) {
173
+ if (e?.message === 'Could not find given application') {
174
+ // create the app with the given id!
175
+ applicationId = await registerNew(cwd, fs, token, manifest, env);
176
+ return {
177
+ id: applicationId,
178
+ ...(await registryAPI_1.Registry.getExistingApplication(token, publisher, applicationId, env))
179
+ };
180
+ }
181
+ }
170
182
  }
171
183
  return null;
172
184
  }
@@ -182,8 +194,9 @@ var APM;
182
194
  async function registerNew(cwd, fs, token, manifest, env) {
183
195
  // only myDatanet -> ONE support not needed.
184
196
  const backendTarget = 'myDatanet';
185
- const { publisher, name, description } = manifest;
197
+ const { publisher, name, description, registry } = manifest;
186
198
  const newApplication = {
199
+ id: registry?.id,
187
200
  // @ts-ignore
188
201
  type: manifest.type || manifest_1.Manifest.ProjectTypes.app,
189
202
  name: name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microtronics/studio-cli",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Microtronics Studio CLI Tool",
5
5
  "main": "./out/api.js",
6
6
  "typings": "./dist/studio-cli.d.ts",