@quantum-hub/qhubctl 1.1.2 → 1.1.3

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 (210) hide show
  1. package/bin/dev.js +3 -1
  2. package/bin/run.js +1 -1
  3. package/dist/client/kqh/apis/ServicePlatformApplicationsApi.d.ts +2 -2
  4. package/dist/client/kqh/apis/ServicePlatformApplicationsApi.js +9 -46
  5. package/dist/client/kqh/apis/ServicePlatformDashboardApi.d.ts +2 -2
  6. package/dist/client/kqh/apis/ServicePlatformDashboardApi.js +5 -42
  7. package/dist/client/kqh/apis/ServicePlatformDataPoolsApi.d.ts +2 -2
  8. package/dist/client/kqh/apis/ServicePlatformDataPoolsApi.js +11 -48
  9. package/dist/client/kqh/apis/ServicePlatformJobsApi.d.ts +2 -2
  10. package/dist/client/kqh/apis/ServicePlatformJobsApi.js +9 -46
  11. package/dist/client/kqh/apis/ServicePlatformMarketplaceApi.d.ts +2 -2
  12. package/dist/client/kqh/apis/ServicePlatformMarketplaceApi.js +5 -42
  13. package/dist/client/kqh/apis/ServicePlatformMeteringAPIApi.d.ts +2 -2
  14. package/dist/client/kqh/apis/ServicePlatformMeteringAPIApi.js +5 -42
  15. package/dist/client/kqh/apis/ServicePlatformServicesApi.d.ts +2 -2
  16. package/dist/client/kqh/apis/ServicePlatformServicesApi.js +34 -71
  17. package/dist/client/kqh/apis/ServicePlatformSubscriptionsApi.d.ts +2 -2
  18. package/dist/client/kqh/apis/ServicePlatformSubscriptionsApi.js +7 -44
  19. package/dist/client/kqh/apis/TaxonomiesApi.d.ts +2 -2
  20. package/dist/client/kqh/apis/TaxonomiesApi.js +12 -49
  21. package/dist/client/kqh/apis/index.d.ts +9 -9
  22. package/dist/client/kqh/apis/index.js +9 -25
  23. package/dist/client/kqh/index.d.ts +3 -3
  24. package/dist/client/kqh/index.js +3 -19
  25. package/dist/client/kqh/models/AccessTokenDto.js +5 -12
  26. package/dist/client/kqh/models/AmountMajorDto.js +4 -10
  27. package/dist/client/kqh/models/ApiDto.d.ts +2 -2
  28. package/dist/client/kqh/models/ApiDto.js +13 -20
  29. package/dist/client/kqh/models/ApiOverviewDto.d.ts +1 -1
  30. package/dist/client/kqh/models/ApiOverviewDto.js +10 -17
  31. package/dist/client/kqh/models/ApplicationDto.js +5 -12
  32. package/dist/client/kqh/models/BuildJobDto.d.ts +1 -1
  33. package/dist/client/kqh/models/BuildJobDto.js +9 -16
  34. package/dist/client/kqh/models/CpuConfiguration.d.ts +1 -1
  35. package/dist/client/kqh/models/CpuConfiguration.js +7 -13
  36. package/dist/client/kqh/models/CreateApplicationRequest.js +4 -10
  37. package/dist/client/kqh/models/CreateDataPoolRequest.js +4 -10
  38. package/dist/client/kqh/models/CreateExternalServicePricingPlanRequest.d.ts +1 -1
  39. package/dist/client/kqh/models/CreateExternalServicePricingPlanRequest.js +8 -15
  40. package/dist/client/kqh/models/CreateJobRequest.d.ts +1 -1
  41. package/dist/client/kqh/models/CreateJobRequest.js +9 -15
  42. package/dist/client/kqh/models/CreateManagedServicePricingPlanRequest.js +6 -13
  43. package/dist/client/kqh/models/CreateProductRequest.js +4 -10
  44. package/dist/client/kqh/models/CreateSubscriptionRequest.js +4 -10
  45. package/dist/client/kqh/models/CreateWorkflowServiceRequest.js +4 -10
  46. package/dist/client/kqh/models/DataPoolDto.d.ts +3 -3
  47. package/dist/client/kqh/models/DataPoolDto.js +21 -28
  48. package/dist/client/kqh/models/DataPoolRef.js +4 -10
  49. package/dist/client/kqh/models/DataSourceDescriptorDto.d.ts +1 -1
  50. package/dist/client/kqh/models/DataSourceDescriptorDto.js +8 -15
  51. package/dist/client/kqh/models/FileDto.js +4 -10
  52. package/dist/client/kqh/models/FileSource.d.ts +1 -1
  53. package/dist/client/kqh/models/FileSource.js +4 -10
  54. package/dist/client/kqh/models/GpuConfiguration.d.ts +1 -1
  55. package/dist/client/kqh/models/GpuConfiguration.js +8 -15
  56. package/dist/client/kqh/models/JobDto.d.ts +2 -2
  57. package/dist/client/kqh/models/JobDto.js +13 -20
  58. package/dist/client/kqh/models/JobOverviewDto.d.ts +1 -1
  59. package/dist/client/kqh/models/JobOverviewDto.js +8 -15
  60. package/dist/client/kqh/models/MemoryConfiguration.d.ts +1 -1
  61. package/dist/client/kqh/models/MemoryConfiguration.js +7 -13
  62. package/dist/client/kqh/models/MeteringRequest.js +4 -10
  63. package/dist/client/kqh/models/MeteringResponse.js +4 -10
  64. package/dist/client/kqh/models/MonthAmountDto.d.ts +2 -2
  65. package/dist/client/kqh/models/MonthAmountDto.js +10 -16
  66. package/dist/client/kqh/models/OwnerDto.js +4 -10
  67. package/dist/client/kqh/models/PageDataPoolDto.d.ts +3 -3
  68. package/dist/client/kqh/models/PageDataPoolDto.js +13 -19
  69. package/dist/client/kqh/models/PageableObject.d.ts +1 -1
  70. package/dist/client/kqh/models/PageableObject.js +7 -13
  71. package/dist/client/kqh/models/PricingPlanDto.d.ts +1 -1
  72. package/dist/client/kqh/models/PricingPlanDto.js +8 -15
  73. package/dist/client/kqh/models/ProductAmountDto.d.ts +1 -1
  74. package/dist/client/kqh/models/ProductAmountDto.js +7 -13
  75. package/dist/client/kqh/models/ProductDto.js +5 -12
  76. package/dist/client/kqh/models/ProductGroupDto.d.ts +2 -2
  77. package/dist/client/kqh/models/ProductGroupDto.js +10 -16
  78. package/dist/client/kqh/models/ProductUsageDto.js +4 -10
  79. package/dist/client/kqh/models/RegistrySource.d.ts +1 -1
  80. package/dist/client/kqh/models/RegistrySource.js +7 -13
  81. package/dist/client/kqh/models/RepositorySource.d.ts +1 -1
  82. package/dist/client/kqh/models/RepositorySource.js +7 -13
  83. package/dist/client/kqh/models/ResourceConfiguration.js +10 -16
  84. package/dist/client/kqh/models/ReviewDto.js +5 -12
  85. package/dist/client/kqh/models/RuntimeConfiguration.js +5 -12
  86. package/dist/client/kqh/models/ServiceDefinitionCommand.js +5 -12
  87. package/dist/client/kqh/models/ServiceDefinitionDto.d.ts +5 -5
  88. package/dist/client/kqh/models/ServiceDefinitionDto.js +21 -28
  89. package/dist/client/kqh/models/ServiceDefinitionDtoSource.d.ts +3 -3
  90. package/dist/client/kqh/models/ServiceDefinitionDtoSource.js +18 -23
  91. package/dist/client/kqh/models/ServiceDefinitionOverviewDto.js +6 -13
  92. package/dist/client/kqh/models/ServiceDto.d.ts +1 -1
  93. package/dist/client/kqh/models/ServiceDto.js +8 -15
  94. package/dist/client/kqh/models/ServiceExecutionConsumerDto.js +5 -12
  95. package/dist/client/kqh/models/ServiceExecutionDto.js +4 -10
  96. package/dist/client/kqh/models/ServiceOverviewDto.js +8 -15
  97. package/dist/client/kqh/models/ServiceSource.js +10 -16
  98. package/dist/client/kqh/models/SortObject.js +4 -10
  99. package/dist/client/kqh/models/SubscriptionDto.d.ts +3 -3
  100. package/dist/client/kqh/models/SubscriptionDto.js +13 -19
  101. package/dist/client/kqh/models/TaxonomyElement.js +4 -10
  102. package/dist/client/kqh/models/UpdateDataPoolRequest.js +4 -10
  103. package/dist/client/kqh/models/UpdateResourceConfigurationRequest.d.ts +3 -3
  104. package/dist/client/kqh/models/UpdateResourceConfigurationRequest.js +18 -23
  105. package/dist/client/kqh/models/UpdateVersionRequest.d.ts +1 -1
  106. package/dist/client/kqh/models/UpdateVersionRequest.js +7 -13
  107. package/dist/client/kqh/models/UpdateWorkflowServiceRequest.js +4 -10
  108. package/dist/client/kqh/models/ValidationResult.js +5 -12
  109. package/dist/client/kqh/models/index.d.ts +57 -57
  110. package/dist/client/kqh/models/index.js +57 -73
  111. package/dist/client/kqh/runtime.js +17 -32
  112. package/dist/client/users/apis/AuthenticationApi.d.ts +2 -2
  113. package/dist/client/users/apis/AuthenticationApi.js +4 -41
  114. package/dist/client/users/apis/ExpertsApi.d.ts +2 -2
  115. package/dist/client/users/apis/ExpertsApi.js +5 -42
  116. package/dist/client/users/apis/SearchApi.d.ts +2 -2
  117. package/dist/client/users/apis/SearchApi.js +5 -42
  118. package/dist/client/users/apis/UserSettingsApi.d.ts +2 -2
  119. package/dist/client/users/apis/UserSettingsApi.js +11 -48
  120. package/dist/client/users/apis/UserSettingsPersonalAccessTokensApi.d.ts +2 -2
  121. package/dist/client/users/apis/UserSettingsPersonalAccessTokensApi.js +7 -44
  122. package/dist/client/users/apis/UsersApi.d.ts +2 -2
  123. package/dist/client/users/apis/UsersApi.js +4 -41
  124. package/dist/client/users/apis/index.d.ts +6 -6
  125. package/dist/client/users/apis/index.js +6 -22
  126. package/dist/client/users/index.d.ts +3 -3
  127. package/dist/client/users/index.js +3 -19
  128. package/dist/client/users/models/AccessTokenCreateRequest.js +5 -12
  129. package/dist/client/users/models/AccessTokenDto.js +5 -12
  130. package/dist/client/users/models/AccessTokensResponse.d.ts +1 -1
  131. package/dist/client/users/models/AccessTokensResponse.js +7 -13
  132. package/dist/client/users/models/DefaultAccessTokenResponse.js +4 -10
  133. package/dist/client/users/models/Language.js +4 -10
  134. package/dist/client/users/models/PageUserDto.d.ts +3 -3
  135. package/dist/client/users/models/PageUserDto.js +13 -19
  136. package/dist/client/users/models/Pageable.js +4 -10
  137. package/dist/client/users/models/PageableObject.d.ts +1 -1
  138. package/dist/client/users/models/PageableObject.js +7 -13
  139. package/dist/client/users/models/PersonalAccessTokenPrincipal.d.ts +1 -1
  140. package/dist/client/users/models/PersonalAccessTokenPrincipal.js +7 -13
  141. package/dist/client/users/models/Skill.js +4 -10
  142. package/dist/client/users/models/SortObject.js +4 -10
  143. package/dist/client/users/models/UpdateUserRequest.js +4 -10
  144. package/dist/client/users/models/UserDto.d.ts +2 -2
  145. package/dist/client/users/models/UserDto.js +10 -16
  146. package/dist/client/users/models/UserOverviewDto.js +4 -10
  147. package/dist/client/users/models/index.d.ts +14 -14
  148. package/dist/client/users/models/index.js +14 -30
  149. package/dist/client/users/runtime.js +17 -32
  150. package/dist/commands/compress/index.d.ts +1 -1
  151. package/dist/commands/compress/index.js +13 -19
  152. package/dist/commands/datapool/upload.d.ts +4 -4
  153. package/dist/commands/datapool/upload.js +24 -30
  154. package/dist/commands/get-context/index.d.ts +1 -1
  155. package/dist/commands/get-context/index.js +2 -5
  156. package/dist/commands/init/index.d.ts +3 -3
  157. package/dist/commands/init/index.js +30 -36
  158. package/dist/commands/list-contexts/index.d.ts +2 -2
  159. package/dist/commands/list-contexts/index.js +11 -17
  160. package/dist/commands/login/index.d.ts +3 -3
  161. package/dist/commands/login/index.js +16 -22
  162. package/dist/commands/logout/index.d.ts +1 -1
  163. package/dist/commands/logout/index.js +7 -10
  164. package/dist/commands/openapi/index.d.ts +7 -7
  165. package/dist/commands/openapi/index.js +81 -87
  166. package/dist/commands/run/index.d.ts +6 -6
  167. package/dist/commands/run/index.js +43 -48
  168. package/dist/commands/serve/index.d.ts +3 -3
  169. package/dist/commands/serve/index.js +31 -37
  170. package/dist/commands/services/index.d.ts +5 -5
  171. package/dist/commands/services/index.js +17 -23
  172. package/dist/commands/set-context/index.d.ts +4 -4
  173. package/dist/commands/set-context/index.js +13 -19
  174. package/dist/commands/up/index.d.ts +5 -5
  175. package/dist/commands/up/index.js +51 -57
  176. package/dist/index.js +1 -4
  177. package/dist/lib/command.js +5 -10
  178. package/dist/lib/debug.js +1 -5
  179. package/dist/lib/entrypoint-resolver.js +3 -7
  180. package/dist/lib/error.js +8 -12
  181. package/dist/lib/fetch.js +4 -10
  182. package/dist/lib/init-user-input.d.ts +1 -1
  183. package/dist/lib/init-user-input.js +16 -20
  184. package/dist/lib/random-name.js +1 -5
  185. package/dist/lib/random-string.js +1 -5
  186. package/dist/lib/repository.js +9 -17
  187. package/dist/lib/stream-to-blob.d.ts +1 -1
  188. package/dist/lib/stream-to-blob.js +1 -5
  189. package/dist/lib/up/get-description.js +9 -15
  190. package/dist/lib/up/ignore.js +9 -15
  191. package/dist/lib/up/zip.js +18 -24
  192. package/dist/model/account.js +1 -2
  193. package/dist/model/command.d.ts +2 -2
  194. package/dist/model/command.js +11 -19
  195. package/dist/model/managed-service-config.js +4 -7
  196. package/dist/model/user-config.js +3 -6
  197. package/dist/service/auth-service.d.ts +3 -3
  198. package/dist/service/auth-service.js +8 -14
  199. package/dist/service/command-service.d.ts +2 -2
  200. package/dist/service/command-service.js +1 -5
  201. package/dist/service/quantum-hub-service.d.ts +10 -10
  202. package/dist/service/quantum-hub-service.js +21 -24
  203. package/dist/service/service-config-service.d.ts +1 -1
  204. package/dist/service/service-config-service.js +14 -21
  205. package/dist/service/user-config-service.d.ts +1 -1
  206. package/dist/service/user-config-service.js +14 -21
  207. package/dist/service/user-service.d.ts +2 -2
  208. package/dist/service/user-service.js +8 -11
  209. package/oclif.manifest.json +119 -119
  210. package/package.json +4 -2
@@ -1,26 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const platform_1 = require("@quantum-hub/qhub-api/dist/api/platform");
4
- const kqh_1 = require("../client/kqh");
5
- const error_1 = require("../lib/error");
6
- const fetch_1 = require("../lib/fetch");
7
- const user_config_1 = require("../model/user-config");
8
- const command_service_1 = require("./command-service");
9
- class QuantumHubService extends command_service_1.CommandService {
1
+ import { HubPlatformClient } from "@quantum-hub/qhub-api/platform";
2
+ import { Configuration, ServicePlatformServicesApi, } from '../client/kqh/index.js';
3
+ import { handleError } from '../lib/error.js';
4
+ import { fetchOrThrow } from '../lib/fetch.js';
5
+ import { defaultBasePath } from '../model/user-config.js';
6
+ import { CommandService } from './command-service.js';
7
+ export default class QuantumHubService extends CommandService {
10
8
  serviceApi;
11
9
  apiClient;
12
10
  constructor(cmd, config, userConfig) {
13
11
  super(cmd, config, userConfig);
14
- const basePath = (userConfig.endpoint?.basePath || user_config_1.defaultBasePath) + '/qc-catalog';
12
+ const basePath = (userConfig.endpoint?.basePath || defaultBasePath) + '/qc-catalog';
15
13
  const defaultHeaders = userConfig.endpoint?.defaultHeaders || {};
16
14
  const apiKey = userConfig.auth?.value;
17
15
  const organizationId = this.userConfig.context?.isOrganization ? this.userConfig.context.id : undefined;
18
- this.serviceApi = new kqh_1.ServicePlatformServicesApi(new kqh_1.Configuration({
16
+ this.serviceApi = new ServicePlatformServicesApi(new Configuration({
19
17
  apiKey,
20
18
  basePath,
21
19
  headers: defaultHeaders,
22
20
  }));
23
- this.apiClient = new platform_1.HubPlatformClient({
21
+ this.apiClient = new HubPlatformClient({
24
22
  apiKey,
25
23
  baseUrl: basePath,
26
24
  organizationId
@@ -46,20 +44,20 @@ class QuantumHubService extends command_service_1.CommandService {
46
44
  });
47
45
  }
48
46
  catch (error) {
49
- const errorMessage = await (0, error_1.handleError)(error);
47
+ const errorMessage = await handleError(error);
50
48
  throw new Error(errorMessage);
51
49
  }
52
50
  }
53
51
  async getAccounts() {
54
- const basePath = (this.userConfig.endpoint?.basePath || user_config_1.defaultBasePath) + '/qc-catalog';
52
+ const basePath = (this.userConfig.endpoint?.basePath || defaultBasePath) + '/qc-catalog';
55
53
  try {
56
- const response = await (0, fetch_1.fetchOrThrow)(basePath + '/my/accounts', {
54
+ const response = await fetchOrThrow(basePath + '/my/accounts', {
57
55
  headers: { 'X-Auth-Token': this.userConfig.auth.value },
58
56
  });
59
57
  return (await response.json());
60
58
  }
61
59
  catch (error) {
62
- const errorMessage = await (0, error_1.handleError)(error);
60
+ const errorMessage = await handleError(error);
63
61
  throw new Error(errorMessage);
64
62
  }
65
63
  }
@@ -73,7 +71,7 @@ class QuantumHubService extends command_service_1.CommandService {
73
71
  });
74
72
  }
75
73
  catch (error) {
76
- const errorMessage = await (0, error_1.handleError)(error);
74
+ const errorMessage = await handleError(error);
77
75
  throw new Error(errorMessage);
78
76
  }
79
77
  }
@@ -82,7 +80,7 @@ class QuantumHubService extends command_service_1.CommandService {
82
80
  return await this.apiClient.serviceJobs.getServiceJob({ "id": id });
83
81
  }
84
82
  catch (error) {
85
- const errorMessage = await (0, error_1.handleError)(error);
83
+ const errorMessage = await handleError(error);
86
84
  throw new Error(errorMessage);
87
85
  }
88
86
  }
@@ -92,7 +90,7 @@ class QuantumHubService extends command_service_1.CommandService {
92
90
  return await this.serviceApi.getService({ id, xOrganizationId: organizationId });
93
91
  }
94
92
  catch (error) {
95
- const errorMessage = await (0, error_1.handleError)(error);
93
+ const errorMessage = await handleError(error);
96
94
  throw new Error(errorMessage);
97
95
  }
98
96
  }
@@ -102,7 +100,7 @@ class QuantumHubService extends command_service_1.CommandService {
102
100
  return await this.serviceApi.getServices({ xOrganizationId: organizationId });
103
101
  }
104
102
  catch (error) {
105
- const errorMessage = await (0, error_1.handleError)(error);
103
+ const errorMessage = await handleError(error);
106
104
  throw new Error(errorMessage);
107
105
  }
108
106
  }
@@ -111,7 +109,7 @@ class QuantumHubService extends command_service_1.CommandService {
111
109
  return await this.apiClient.serviceJobs.createServiceJob(request);
112
110
  }
113
111
  catch (error) {
114
- const errorMessage = await (0, error_1.handleError)(error);
112
+ const errorMessage = await handleError(error);
115
113
  throw new Error(errorMessage);
116
114
  }
117
115
  }
@@ -128,7 +126,7 @@ class QuantumHubService extends command_service_1.CommandService {
128
126
  });
129
127
  }
130
128
  catch (error) {
131
- const errorMessage = await (0, error_1.handleError)(error);
129
+ const errorMessage = await handleError(error);
132
130
  throw new Error(errorMessage);
133
131
  }
134
132
  }
@@ -214,9 +212,8 @@ class QuantumHubService extends command_service_1.CommandService {
214
212
  return service;
215
213
  }
216
214
  catch (error) {
217
- const errorMessage = await (0, error_1.handleError)(error);
215
+ const errorMessage = await handleError(error);
218
216
  throw new Error(errorMessage);
219
217
  }
220
218
  }
221
219
  }
222
- exports.default = QuantumHubService;
@@ -1,3 +1,3 @@
1
- import ManagedServiceConfig from '../model/managed-service-config';
1
+ import ManagedServiceConfig from '../model/managed-service-config.js';
2
2
  export declare const readServiceConfig: (location: string) => ManagedServiceConfig;
3
3
  export declare const writeServiceConfig: (location: string, serviceConfig: ManagedServiceConfig) => ManagedServiceConfig;
@@ -1,26 +1,19 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writeServiceConfig = exports.readServiceConfig = void 0;
7
- const fs_extra_1 = require("fs-extra");
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- const node_path_1 = __importDefault(require("node:path"));
10
- const readServiceConfig = (location) => {
11
- const file = node_path_1.default.join(location, 'qhub.json');
12
- if (!node_fs_1.default.existsSync(file)) {
1
+ import fsExtra from 'fs-extra';
2
+ const { createFileSync, readJsonSync, writeJsonSync } = fsExtra;
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ export const readServiceConfig = (location) => {
6
+ const file = path.join(location, 'qhub.json');
7
+ if (!fs.existsSync(file)) {
13
8
  throw new Error('No qhub.json file found in current directory');
14
9
  }
15
- return (0, fs_extra_1.readJsonSync)(file, { encoding: 'utf8' });
10
+ return readJsonSync(file, { encoding: 'utf8' });
16
11
  };
17
- exports.readServiceConfig = readServiceConfig;
18
- const writeServiceConfig = (location, serviceConfig) => {
19
- const file = node_path_1.default.join(location, 'qhub.json');
20
- if (!node_fs_1.default.existsSync(file)) {
21
- (0, fs_extra_1.createFileSync)(file);
12
+ export const writeServiceConfig = (location, serviceConfig) => {
13
+ const file = path.join(location, 'qhub.json');
14
+ if (!fs.existsSync(file)) {
15
+ createFileSync(file);
22
16
  }
23
- (0, fs_extra_1.writeJsonSync)(file, serviceConfig, { encoding: 'utf8', spaces: 2 });
24
- return (0, exports.readServiceConfig)(location);
17
+ writeJsonSync(file, serviceConfig, { encoding: 'utf8', spaces: 2 });
18
+ return readServiceConfig(location);
25
19
  };
26
- exports.writeServiceConfig = writeServiceConfig;
@@ -1,3 +1,3 @@
1
- import UserConfig from '../model/user-config';
1
+ import UserConfig from '../model/user-config.js';
2
2
  export declare const readUserConfig: (location: string) => UserConfig;
3
3
  export declare const writeUserConfig: (location: string, userConfig: UserConfig) => UserConfig;
@@ -1,26 +1,19 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writeUserConfig = exports.readUserConfig = void 0;
7
- const fs_extra_1 = require("fs-extra");
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- const node_path_1 = __importDefault(require("node:path"));
10
- const readUserConfig = (location) => {
11
- const file = node_path_1.default.join(location, 'config.json');
12
- if (!node_fs_1.default.existsSync(file)) {
1
+ import fsExtra from 'fs-extra';
2
+ const { createFileSync, readJsonSync, writeJsonSync } = fsExtra;
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ export const readUserConfig = (location) => {
6
+ const file = path.join(location, 'config.json');
7
+ if (!fs.existsSync(file)) {
13
8
  return {};
14
9
  }
15
- return (0, fs_extra_1.readJsonSync)(file, { encoding: 'utf8' });
10
+ return readJsonSync(file, { encoding: 'utf8' });
16
11
  };
17
- exports.readUserConfig = readUserConfig;
18
- const writeUserConfig = (location, userConfig) => {
19
- const file = node_path_1.default.join(location, 'config.json');
20
- if (!node_fs_1.default.existsSync(file)) {
21
- (0, fs_extra_1.createFileSync)(file);
12
+ export const writeUserConfig = (location, userConfig) => {
13
+ const file = path.join(location, 'config.json');
14
+ if (!fs.existsSync(file)) {
15
+ createFileSync(file);
22
16
  }
23
- (0, fs_extra_1.writeJsonSync)(file, userConfig, { encoding: 'utf8', spaces: 2 });
24
- return (0, exports.readUserConfig)(location);
17
+ writeJsonSync(file, userConfig, { encoding: 'utf8', spaces: 2 });
18
+ return readUserConfig(location);
25
19
  };
26
- exports.writeUserConfig = writeUserConfig;
@@ -1,5 +1,5 @@
1
- import { UserDto, UserSettingsApi } from '../client/users';
2
- import UserConfig from '../model/user-config';
1
+ import { UserDto, UserSettingsApi } from '../client/users/index.js';
2
+ import UserConfig from '../model/user-config.js';
3
3
  export default class UserService {
4
4
  basePath: string;
5
5
  defaultHeaders: Record<string, string>;
@@ -1,24 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const users_1 = require("../client/users");
4
- const error_1 = require("../lib/error");
5
- const user_config_1 = require("../model/user-config");
6
- class UserService {
1
+ import { Configuration, UserSettingsApi } from '../client/users/index.js';
2
+ import { handleError } from '../lib/error.js';
3
+ import { defaultBasePath } from '../model/user-config.js';
4
+ export default class UserService {
7
5
  basePath;
8
6
  defaultHeaders;
9
7
  userSettingsApi;
10
8
  constructor(userConfig) {
11
- this.basePath = (userConfig.endpoint?.basePath || user_config_1.defaultBasePath) + '/user-service';
9
+ this.basePath = (userConfig.endpoint?.basePath || defaultBasePath) + '/user-service';
12
10
  this.defaultHeaders = userConfig.endpoint?.defaultHeaders || {};
13
11
  const apiKey = userConfig.auth?.value;
14
- this.userSettingsApi = new users_1.UserSettingsApi(new users_1.Configuration({
12
+ this.userSettingsApi = new UserSettingsApi(new Configuration({
15
13
  apiKey,
16
14
  basePath: this.basePath,
17
15
  headers: this.defaultHeaders,
18
16
  }));
19
17
  }
20
18
  async getCurrentUser(apiKey) {
21
- const userSettingsApi = new users_1.UserSettingsApi(new users_1.Configuration({
19
+ const userSettingsApi = new UserSettingsApi(new Configuration({
22
20
  apiKey,
23
21
  basePath: this.basePath,
24
22
  headers: this.defaultHeaders,
@@ -27,9 +25,8 @@ class UserService {
27
25
  return await userSettingsApi.getUser();
28
26
  }
29
27
  catch (error) {
30
- const errorMessage = await (0, error_1.handleError)(error);
28
+ const errorMessage = await handleError(error);
31
29
  throw new Error(errorMessage);
32
30
  }
33
31
  }
34
32
  }
35
- exports.default = UserService;
@@ -15,7 +15,7 @@
15
15
  "pluginName": "@quantum-hub/qhubctl",
16
16
  "pluginType": "core",
17
17
  "strict": true,
18
- "isESM": false,
18
+ "isESM": true,
19
19
  "relativePath": [
20
20
  "dist",
21
21
  "commands",
@@ -59,7 +59,7 @@
59
59
  "pluginName": "@quantum-hub/qhubctl",
60
60
  "pluginType": "core",
61
61
  "strict": true,
62
- "isESM": false,
62
+ "isESM": true,
63
63
  "relativePath": [
64
64
  "dist",
65
65
  "commands",
@@ -67,6 +67,29 @@
67
67
  "upload.js"
68
68
  ]
69
69
  },
70
+ "get-context": {
71
+ "aliases": [],
72
+ "args": {},
73
+ "description": "Get the current context, i.e., the personal or organization account you are currently working with.",
74
+ "examples": [
75
+ "$ qhubctl get-context"
76
+ ],
77
+ "flags": {},
78
+ "hasDynamicHelp": false,
79
+ "hiddenAliases": [],
80
+ "id": "get-context",
81
+ "pluginAlias": "@quantum-hub/qhubctl",
82
+ "pluginName": "@quantum-hub/qhubctl",
83
+ "pluginType": "core",
84
+ "strict": true,
85
+ "isESM": true,
86
+ "relativePath": [
87
+ "dist",
88
+ "commands",
89
+ "get-context",
90
+ "index.js"
91
+ ]
92
+ },
70
93
  "init": {
71
94
  "aliases": [],
72
95
  "args": {},
@@ -98,7 +121,7 @@
98
121
  "pluginName": "@quantum-hub/qhubctl",
99
122
  "pluginType": "core",
100
123
  "strict": true,
101
- "isESM": false,
124
+ "isESM": true,
102
125
  "relativePath": [
103
126
  "dist",
104
127
  "commands",
@@ -106,26 +129,26 @@
106
129
  "index.js"
107
130
  ]
108
131
  },
109
- "get-context": {
132
+ "list-contexts": {
110
133
  "aliases": [],
111
134
  "args": {},
112
- "description": "Get the current context, i.e., the personal or organization account you are currently working with.",
135
+ "description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
113
136
  "examples": [
114
- "$ qhubctl get-context"
137
+ "$ qhubctl list-contexts"
115
138
  ],
116
139
  "flags": {},
117
140
  "hasDynamicHelp": false,
118
141
  "hiddenAliases": [],
119
- "id": "get-context",
142
+ "id": "list-contexts",
120
143
  "pluginAlias": "@quantum-hub/qhubctl",
121
144
  "pluginName": "@quantum-hub/qhubctl",
122
145
  "pluginType": "core",
123
146
  "strict": true,
124
- "isESM": false,
147
+ "isESM": true,
125
148
  "relativePath": [
126
149
  "dist",
127
150
  "commands",
128
- "get-context",
151
+ "list-contexts",
129
152
  "index.js"
130
153
  ]
131
154
  },
@@ -163,7 +186,7 @@
163
186
  "pluginName": "@quantum-hub/qhubctl",
164
187
  "pluginType": "core",
165
188
  "strict": true,
166
- "isESM": false,
189
+ "isESM": true,
167
190
  "relativePath": [
168
191
  "dist",
169
192
  "commands",
@@ -186,7 +209,7 @@
186
209
  "pluginName": "@quantum-hub/qhubctl",
187
210
  "pluginType": "core",
188
211
  "strict": true,
189
- "isESM": false,
212
+ "isESM": true,
190
213
  "relativePath": [
191
214
  "dist",
192
215
  "commands",
@@ -194,108 +217,6 @@
194
217
  "index.js"
195
218
  ]
196
219
  },
197
- "list-contexts": {
198
- "aliases": [],
199
- "args": {},
200
- "description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
201
- "examples": [
202
- "$ qhubctl list-contexts"
203
- ],
204
- "flags": {},
205
- "hasDynamicHelp": false,
206
- "hiddenAliases": [],
207
- "id": "list-contexts",
208
- "pluginAlias": "@quantum-hub/qhubctl",
209
- "pluginName": "@quantum-hub/qhubctl",
210
- "pluginType": "core",
211
- "strict": true,
212
- "isESM": false,
213
- "relativePath": [
214
- "dist",
215
- "commands",
216
- "list-contexts",
217
- "index.js"
218
- ]
219
- },
220
- "openapi": {
221
- "aliases": [],
222
- "args": {},
223
- "description": "Generates the OpenAPI description for your project based on the parameter and return types of your run() method. The output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency \"qhub-commons\" must be installed in your activated Python environment to use this command.",
224
- "examples": [
225
- "$ qhubctl openapi",
226
- "$ qhubctl openapi --file=./openapi.yaml --format=yaml --force",
227
- "$ qhubctl openapi --entrypoint=src.program:run",
228
- "$ qhubctl openapi --package=src.program --method=run",
229
- "$ qhubctl openapi --package=src.program"
230
- ],
231
- "flags": {
232
- "force": {
233
- "char": "f",
234
- "description": "Overwrite the output file if it already exists",
235
- "name": "force",
236
- "required": false,
237
- "allowNo": false,
238
- "type": "boolean"
239
- },
240
- "file": {
241
- "description": "The file to write the OpenAPI description to",
242
- "name": "file",
243
- "required": false,
244
- "hasDynamicHelp": false,
245
- "multiple": false,
246
- "type": "option"
247
- },
248
- "format": {
249
- "description": "The format to generate the OpenAPI description [possible values: yaml]",
250
- "name": "format",
251
- "required": false,
252
- "hasDynamicHelp": false,
253
- "multiple": false,
254
- "options": [
255
- "yaml"
256
- ],
257
- "type": "option"
258
- },
259
- "entrypoint": {
260
- "description": "The entrypoint to your program in the format \"package.module:function\" (default: \"src.program:run\"). Overrides package and method flags.",
261
- "name": "entrypoint",
262
- "required": false,
263
- "hasDynamicHelp": false,
264
- "multiple": false,
265
- "type": "option"
266
- },
267
- "package": {
268
- "description": "The package/module path to your program (e.g., \"src.program\" or \"my_package.main\"). Only used if entrypoint is not provided.",
269
- "name": "package",
270
- "required": false,
271
- "hasDynamicHelp": false,
272
- "multiple": false,
273
- "type": "option"
274
- },
275
- "method": {
276
- "description": "The method/function name in your program (default: \"run\"). Only used if entrypoint is not provided.",
277
- "name": "method",
278
- "required": false,
279
- "hasDynamicHelp": false,
280
- "multiple": false,
281
- "type": "option"
282
- }
283
- },
284
- "hasDynamicHelp": false,
285
- "hiddenAliases": [],
286
- "id": "openapi",
287
- "pluginAlias": "@quantum-hub/qhubctl",
288
- "pluginName": "@quantum-hub/qhubctl",
289
- "pluginType": "core",
290
- "strict": true,
291
- "isESM": false,
292
- "relativePath": [
293
- "dist",
294
- "commands",
295
- "openapi",
296
- "index.js"
297
- ]
298
- },
299
220
  "run": {
300
221
  "aliases": [],
301
222
  "args": {
@@ -347,7 +268,7 @@
347
268
  "pluginName": "@quantum-hub/qhubctl",
348
269
  "pluginType": "core",
349
270
  "strict": true,
350
- "isESM": false,
271
+ "isESM": true,
351
272
  "relativePath": [
352
273
  "dist",
353
274
  "commands",
@@ -392,7 +313,7 @@
392
313
  "strict": true,
393
314
  "CONTAINER_NAME": "planqk-cli-serve",
394
315
  "IMAGE": "registry.gitlab.com/planqk-foss/planqk-cli-serve:latest",
395
- "isESM": false,
316
+ "isESM": true,
396
317
  "relativePath": [
397
318
  "dist",
398
319
  "commands",
@@ -440,7 +361,7 @@
440
361
  "pluginName": "@quantum-hub/qhubctl",
441
362
  "pluginType": "core",
442
363
  "strict": true,
443
- "isESM": false,
364
+ "isESM": true,
444
365
  "relativePath": [
445
366
  "dist",
446
367
  "commands",
@@ -468,7 +389,7 @@
468
389
  "pluginName": "@quantum-hub/qhubctl",
469
390
  "pluginType": "core",
470
391
  "strict": true,
471
- "isESM": false,
392
+ "isESM": true,
472
393
  "relativePath": [
473
394
  "dist",
474
395
  "commands",
@@ -476,6 +397,85 @@
476
397
  "index.js"
477
398
  ]
478
399
  },
400
+ "openapi": {
401
+ "aliases": [],
402
+ "args": {},
403
+ "description": "Generates the OpenAPI description for your project based on the parameter and return types of your run() method. The output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency \"qhub-commons\" must be installed in your activated Python environment to use this command.",
404
+ "examples": [
405
+ "$ qhubctl openapi",
406
+ "$ qhubctl openapi --file=./openapi.yaml --format=yaml --force",
407
+ "$ qhubctl openapi --entrypoint=src.program:run",
408
+ "$ qhubctl openapi --package=src.program --method=run",
409
+ "$ qhubctl openapi --package=src.program"
410
+ ],
411
+ "flags": {
412
+ "force": {
413
+ "char": "f",
414
+ "description": "Overwrite the output file if it already exists",
415
+ "name": "force",
416
+ "required": false,
417
+ "allowNo": false,
418
+ "type": "boolean"
419
+ },
420
+ "file": {
421
+ "description": "The file to write the OpenAPI description to",
422
+ "name": "file",
423
+ "required": false,
424
+ "hasDynamicHelp": false,
425
+ "multiple": false,
426
+ "type": "option"
427
+ },
428
+ "format": {
429
+ "description": "The format to generate the OpenAPI description [possible values: yaml]",
430
+ "name": "format",
431
+ "required": false,
432
+ "hasDynamicHelp": false,
433
+ "multiple": false,
434
+ "options": [
435
+ "yaml"
436
+ ],
437
+ "type": "option"
438
+ },
439
+ "entrypoint": {
440
+ "description": "The entrypoint to your program in the format \"package.module:function\" (default: \"src.program:run\"). Overrides package and method flags.",
441
+ "name": "entrypoint",
442
+ "required": false,
443
+ "hasDynamicHelp": false,
444
+ "multiple": false,
445
+ "type": "option"
446
+ },
447
+ "package": {
448
+ "description": "The package/module path to your program (e.g., \"src.program\" or \"my_package.main\"). Only used if entrypoint is not provided.",
449
+ "name": "package",
450
+ "required": false,
451
+ "hasDynamicHelp": false,
452
+ "multiple": false,
453
+ "type": "option"
454
+ },
455
+ "method": {
456
+ "description": "The method/function name in your program (default: \"run\"). Only used if entrypoint is not provided.",
457
+ "name": "method",
458
+ "required": false,
459
+ "hasDynamicHelp": false,
460
+ "multiple": false,
461
+ "type": "option"
462
+ }
463
+ },
464
+ "hasDynamicHelp": false,
465
+ "hiddenAliases": [],
466
+ "id": "openapi",
467
+ "pluginAlias": "@quantum-hub/qhubctl",
468
+ "pluginName": "@quantum-hub/qhubctl",
469
+ "pluginType": "core",
470
+ "strict": true,
471
+ "isESM": true,
472
+ "relativePath": [
473
+ "dist",
474
+ "commands",
475
+ "openapi",
476
+ "index.js"
477
+ ]
478
+ },
479
479
  "up": {
480
480
  "aliases": [],
481
481
  "args": {},
@@ -517,7 +517,7 @@
517
517
  "pluginName": "@quantum-hub/qhubctl",
518
518
  "pluginType": "core",
519
519
  "strict": true,
520
- "isESM": false,
520
+ "isESM": true,
521
521
  "relativePath": [
522
522
  "dist",
523
523
  "commands",
@@ -526,5 +526,5 @@
526
526
  ]
527
527
  }
528
528
  },
529
- "version": "1.1.2"
529
+ "version": "1.1.3"
530
530
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantum-hub/qhubctl",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Quantum Hub CLI",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [
@@ -10,6 +10,7 @@
10
10
  "Harzenetter, Lukas <lukas.harzenetter@kipu-quantum.com>"
11
11
  ],
12
12
  "license": "Apache-2.0",
13
+ "type": "module",
13
14
  "keywords": [
14
15
  "hub",
15
16
  "kipu",
@@ -32,7 +33,7 @@
32
33
  "@oclif/plugin-not-found": "^3.2.74",
33
34
  "@oclif/plugin-version": "^2.2.36",
34
35
  "@oclif/plugin-warn-if-update-available": "^3.1.55",
35
- "@quantum-hub/qhub-api": "^1",
36
+ "@quantum-hub/qhub-api": "^1.0.24",
36
37
  "adm-zip": "^0.5.16",
37
38
  "async-wait-until": "^2.0.31",
38
39
  "fs-extra": "^11.3.3",
@@ -61,6 +62,7 @@
61
62
  "oclif": "^4.22.81",
62
63
  "shx": "^0.4.0",
63
64
  "ts-node": "^10.9.2",
65
+ "tsx": "^4.21.0",
64
66
  "typescript": "^5.9.3",
65
67
  "typescript-eslint": "^8.56.1"
66
68
  },