@quantum-hub/qhubctl 1.12.1 → 1.14.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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/services-build-logs.d.ts +6 -0
  3. package/dist/commands/services-build-logs.js +85 -0
  4. package/dist/lib/error.js +3 -2
  5. package/dist/program.js +2 -0
  6. package/dist/service/auth-service.d.ts +2 -2
  7. package/dist/service/quantum-hub-service.d.ts +1 -0
  8. package/dist/service/quantum-hub-service.js +14 -2
  9. package/dist/service/user-service.d.ts +3 -3
  10. package/dist/service/user-service.js +9 -9
  11. package/package.json +1 -1
  12. package/dist/client/users/apis/AuthenticationApi.d.ts +0 -31
  13. package/dist/client/users/apis/AuthenticationApi.js +0 -46
  14. package/dist/client/users/apis/ExpertsApi.d.ts +0 -44
  15. package/dist/client/users/apis/ExpertsApi.js +0 -75
  16. package/dist/client/users/apis/SearchApi.d.ts +0 -46
  17. package/dist/client/users/apis/SearchApi.js +0 -97
  18. package/dist/client/users/apis/UserSettingsApi.d.ts +0 -139
  19. package/dist/client/users/apis/UserSettingsApi.js +0 -380
  20. package/dist/client/users/apis/UserSettingsPersonalAccessTokensApi.d.ts +0 -64
  21. package/dist/client/users/apis/UserSettingsPersonalAccessTokensApi.js +0 -147
  22. package/dist/client/users/apis/UsersApi.d.ts +0 -70
  23. package/dist/client/users/apis/UsersApi.js +0 -133
  24. package/dist/client/users/apis/index.d.ts +0 -6
  25. package/dist/client/users/apis/index.js +0 -8
  26. package/dist/client/users/index.d.ts +0 -3
  27. package/dist/client/users/index.js +0 -5
  28. package/dist/client/users/models/AccessTokenCreateRequest.d.ts +0 -51
  29. package/dist/client/users/models/AccessTokenCreateRequest.js +0 -53
  30. package/dist/client/users/models/AccessTokenDto.d.ts +0 -75
  31. package/dist/client/users/models/AccessTokenDto.js +0 -61
  32. package/dist/client/users/models/AccessTokensResponse.d.ts +0 -38
  33. package/dist/client/users/models/AccessTokensResponse.js +0 -41
  34. package/dist/client/users/models/DefaultAccessTokenResponse.d.ts +0 -31
  35. package/dist/client/users/models/DefaultAccessTokenResponse.js +0 -38
  36. package/dist/client/users/models/Language.d.ts +0 -31
  37. package/dist/client/users/models/Language.js +0 -38
  38. package/dist/client/users/models/PageUserDto.d.ts +0 -94
  39. package/dist/client/users/models/PageUserDto.js +0 -61
  40. package/dist/client/users/models/Pageable.d.ts +0 -43
  41. package/dist/client/users/models/Pageable.js +0 -42
  42. package/dist/client/users/models/PageableObject.d.ts +0 -62
  43. package/dist/client/users/models/PageableObject.js +0 -49
  44. package/dist/client/users/models/PersonalAccessTokenPrincipal.d.ts +0 -38
  45. package/dist/client/users/models/PersonalAccessTokenPrincipal.js +0 -41
  46. package/dist/client/users/models/Skill.d.ts +0 -31
  47. package/dist/client/users/models/Skill.js +0 -38
  48. package/dist/client/users/models/SortObject.d.ts +0 -43
  49. package/dist/client/users/models/SortObject.js +0 -42
  50. package/dist/client/users/models/UpdateUserRequest.d.ts +0 -61
  51. package/dist/client/users/models/UpdateUserRequest.js +0 -48
  52. package/dist/client/users/models/UserDto.d.ts +0 -111
  53. package/dist/client/users/models/UserDto.js +0 -66
  54. package/dist/client/users/models/UserOverviewDto.d.ts +0 -67
  55. package/dist/client/users/models/UserOverviewDto.js +0 -50
  56. package/dist/client/users/models/index.d.ts +0 -14
  57. package/dist/client/users/models/index.js +0 -16
  58. package/dist/client/users/runtime.d.ts +0 -181
  59. package/dist/client/users/runtime.js +0 -325
package/README.md CHANGED
@@ -80,7 +80,7 @@ npm link
80
80
  ### Run against staging
81
81
 
82
82
  ```bash
83
- node dist/main.js login --base-path https://api.hub.34.90.225.20.nip.io -t <personal access token>
83
+ node dist/main.js login --base-path https://api.hub.34.6.228.233.nip.io -t <personal access token>
84
84
  ```
85
85
 
86
86
  ### Debug output
@@ -0,0 +1,6 @@
1
+ import { HubPlatform } from '@quantum-hub/qhub-api/platform';
2
+ import { Command } from 'commander';
3
+ export declare function formatLogEntry(entry: HubPlatform.LogEntry, opts: {
4
+ isTTY: boolean;
5
+ }): string;
6
+ export declare const servicesBuildLogsCommand: Command;
@@ -0,0 +1,85 @@
1
+ import { input } from '@inquirer/prompts';
2
+ import { Command } from 'commander';
3
+ import { error, spinner, stdout } from '../lib/output.js';
4
+ import { requireAuth } from '../model/command.js';
5
+ import QuantumHubService from '../service/quantum-hub-service.js';
6
+ import { readServiceConfig } from '../service/service-config-service.js';
7
+ const SEVERITY_COLUMN_WIDTH = 7;
8
+ const COLUMN_GAP = ' ';
9
+ const ANSI_RESET = '\x1b[0m';
10
+ const ANSI_BY_SEVERITY = {
11
+ DEBUG: '\x1b[2m',
12
+ WARNING: '\x1b[33m',
13
+ ERROR: '\x1b[31m',
14
+ };
15
+ export function formatLogEntry(entry, opts) {
16
+ const timestamp = entry.timestamp ?? '-';
17
+ const severity = entry.severity ?? 'INFO';
18
+ const message = entry.message ?? '';
19
+ const paddedSeverity = severity.padEnd(SEVERITY_COLUMN_WIDTH, ' ');
20
+ const ansi = opts.isTTY ? ANSI_BY_SEVERITY[severity] : undefined;
21
+ const severityCell = ansi ? `${ansi}${paddedSeverity}${ANSI_RESET}` : paddedSeverity;
22
+ return `${timestamp}${COLUMN_GAP}${severityCell}${COLUMN_GAP}${message}`;
23
+ }
24
+ const EXAMPLES = `
25
+ Examples:
26
+ $ qhubctl services build-logs
27
+ $ qhubctl services build-logs --id <serviceId>
28
+ $ qhubctl services build-logs --id <serviceId> --json`;
29
+ export const servicesBuildLogsCommand = new Command('build-logs')
30
+ .description('Show the build logs of a service.')
31
+ .option('--id <value>', 'The ID of the service (reads from qhub.json if omitted)')
32
+ .option('--json', 'Output in JSON format', false)
33
+ .addHelpText('after', EXAMPLES)
34
+ .action(async (opts) => {
35
+ const userConfig = await requireAuth({ printContext: !opts.json });
36
+ const quantumHubService = new QuantumHubService(userConfig);
37
+ let serviceId = opts.id;
38
+ if (!serviceId) {
39
+ try {
40
+ const serviceConfig = readServiceConfig(process.cwd());
41
+ serviceId = serviceConfig.serviceId;
42
+ }
43
+ catch {
44
+ serviceId = undefined;
45
+ }
46
+ }
47
+ if (!serviceId) {
48
+ try {
49
+ serviceId = await input({ message: 'Enter the service ID:' });
50
+ }
51
+ catch {
52
+ // user cancelled (Ctrl+C)
53
+ process.exit(0);
54
+ }
55
+ }
56
+ if (!serviceId?.trim()) {
57
+ error('No service ID provided.');
58
+ }
59
+ const spin = spinner('Loading build logs');
60
+ let logs;
61
+ try {
62
+ logs = await quantumHubService.getBuildLogs(serviceId);
63
+ }
64
+ catch (err) {
65
+ spin.fail('Failed to load build logs');
66
+ error(err instanceof Error ? err.message : String(err));
67
+ }
68
+ spin.succeed('Build logs loaded');
69
+ if (opts.json) {
70
+ stdout(JSON.stringify(logs, null, 2));
71
+ return;
72
+ }
73
+ if (logs.length === 0) {
74
+ stdout();
75
+ stdout('No build logs available.');
76
+ stdout();
77
+ return;
78
+ }
79
+ const isTTY = Boolean(process.stdout.isTTY);
80
+ stdout();
81
+ for (const entry of logs) {
82
+ stdout(formatLogEntry(entry, { isTTY }));
83
+ }
84
+ stdout();
85
+ });
package/dist/lib/error.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { HubPlatformError, HubPlatformTimeoutError } from '@quantum-hub/qhub-api/platform';
2
+ import { HubUserError, HubUserTimeoutError } from '@quantum-hub/qhub-api/user';
2
3
  import { debugEnabled } from './debug.js';
3
4
  export const handleError = async (error) => {
4
- if (error instanceof HubPlatformError) {
5
+ if (error instanceof HubPlatformError || error instanceof HubUserError) {
5
6
  const httpStatus = error.statusCode;
6
7
  // message is either in body.errorMessage, body.error or body.detail
7
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -18,7 +19,7 @@ export const handleError = async (error) => {
18
19
  }
19
20
  return errorMessage ? `${errorMessage} (${httpStatus})` : `${httpStatus}`;
20
21
  }
21
- if (error instanceof HubPlatformTimeoutError) {
22
+ if (error instanceof HubPlatformTimeoutError || error instanceof HubUserTimeoutError) {
22
23
  return `Internal error occurred, please try again later (${error.message})`;
23
24
  }
24
25
  if (debugEnabled()) {
package/dist/program.js CHANGED
@@ -11,6 +11,7 @@ import { logoutCommand } from './commands/logout.js';
11
11
  import { openapiCommand } from './commands/openapi.js';
12
12
  import { runCommand } from './commands/run.js';
13
13
  import { serveCommand } from './commands/serve.js';
14
+ import { servicesBuildLogsCommand } from './commands/services-build-logs.js';
14
15
  import { servicesBuildStatusCommand } from './commands/services-build-status.js';
15
16
  import { servicesListCommand } from './commands/services-list.js';
16
17
  import { setContextCommand } from './commands/set-context.js';
@@ -37,6 +38,7 @@ program.addCommand(serveCommand);
37
38
  const servicesCommand = new Command('services').description('Manage services');
38
39
  servicesCommand.addCommand(servicesListCommand);
39
40
  servicesCommand.addCommand(servicesBuildStatusCommand);
41
+ servicesCommand.addCommand(servicesBuildLogsCommand);
40
42
  program.addCommand(servicesCommand);
41
43
  program.addCommand(setContextCommand);
42
44
  program.addCommand(upCommand);
@@ -1,9 +1,9 @@
1
- import { UserDto } from '../client/users/index.js';
1
+ import { HubUser } from '@quantum-hub/qhub-api/user';
2
2
  import UserConfig from '../model/user-config.js';
3
3
  import UserService from './user-service.js';
4
4
  export default class AuthService {
5
5
  userConfig: UserConfig;
6
6
  userService: UserService;
7
7
  constructor(userConfig: UserConfig);
8
- authenticate(apiKey: string): Promise<UserDto>;
8
+ authenticate(apiKey: string): Promise<HubUser.UserDto>;
9
9
  }
@@ -8,6 +8,7 @@ export default class QuantumHubService extends CommandService {
8
8
  getAccounts(): Promise<HubPlatform.AccountDto[]>;
9
9
  createService(serviceConfig: ManagedServiceConfig, sourceCode: Blob, apiDefinition?: Blob): Promise<HubPlatform.ServiceDto>;
10
10
  getBuildJob(id: string): Promise<HubPlatform.BuildJobDto>;
11
+ getBuildLogs(id: string): Promise<HubPlatform.LogEntry[]>;
11
12
  getJobById(id: string): Promise<HubPlatform.ServiceJobDto>;
12
13
  getService(id: string): Promise<HubPlatform.ServiceDto>;
13
14
  getServices(): Promise<HubPlatform.ServiceOverviewDto[]>;
@@ -1,4 +1,4 @@
1
- import { HubPlatformClient } from "@quantum-hub/qhub-api/platform";
1
+ import { HubPlatform, HubPlatformClient } from "@quantum-hub/qhub-api/platform";
2
2
  import { handleError } from '../lib/error.js';
3
3
  import { defaultBasePath } from '../model/user-config.js';
4
4
  import { CommandService } from './command-service.js';
@@ -19,7 +19,7 @@ export default class QuantumHubService extends CommandService {
19
19
  }
20
20
  async getAccounts() {
21
21
  try {
22
- return await this.apiClient.users.getAccounts();
22
+ return await this.apiClient.users.getMyAccounts();
23
23
  }
24
24
  catch (error) {
25
25
  const errorMessage = await handleError(error);
@@ -69,6 +69,18 @@ export default class QuantumHubService extends CommandService {
69
69
  throw new Error(errorMessage);
70
70
  }
71
71
  }
72
+ async getBuildLogs(id) {
73
+ try {
74
+ return await this.apiClient.managedServices.getManagedServiceBuildLogs(id);
75
+ }
76
+ catch (error) {
77
+ if (error instanceof HubPlatform.NotFoundError) {
78
+ return [];
79
+ }
80
+ const errorMessage = await handleError(error);
81
+ throw new Error(errorMessage);
82
+ }
83
+ }
72
84
  async getJobById(id) {
73
85
  try {
74
86
  return await this.apiClient.serviceJobs.getServiceJob(id);
@@ -1,9 +1,9 @@
1
- import { UserDto, UserSettingsApi } from '../client/users/index.js';
1
+ import { HubUser, HubUserClient } from '@quantum-hub/qhub-api/user';
2
2
  import UserConfig from '../model/user-config.js';
3
3
  export default class UserService {
4
4
  basePath: string;
5
5
  defaultHeaders: Record<string, string>;
6
- userSettingsApi: UserSettingsApi;
6
+ apiClient: HubUserClient;
7
7
  constructor(userConfig: UserConfig);
8
- getCurrentUser(apiKey: string): Promise<UserDto>;
8
+ getCurrentUser(apiKey: string): Promise<HubUser.UserDto>;
9
9
  }
@@ -1,28 +1,28 @@
1
- import { Configuration, UserSettingsApi } from '../client/users/index.js';
1
+ import { HubUserClient } from '@quantum-hub/qhub-api/user';
2
2
  import { handleError } from '../lib/error.js';
3
3
  import { defaultBasePath } from '../model/user-config.js';
4
4
  export default class UserService {
5
5
  basePath;
6
6
  defaultHeaders;
7
- userSettingsApi;
7
+ apiClient;
8
8
  constructor(userConfig) {
9
9
  this.basePath = (userConfig.endpoint?.basePath || defaultBasePath) + '/user-service';
10
10
  this.defaultHeaders = userConfig.endpoint?.defaultHeaders || {};
11
11
  const apiKey = userConfig.auth?.value;
12
- this.userSettingsApi = new UserSettingsApi(new Configuration({
12
+ this.apiClient = new HubUserClient({
13
13
  apiKey,
14
- basePath: this.basePath,
14
+ baseUrl: this.basePath,
15
15
  headers: this.defaultHeaders,
16
- }));
16
+ });
17
17
  }
18
18
  async getCurrentUser(apiKey) {
19
- const userSettingsApi = new UserSettingsApi(new Configuration({
19
+ const apiClient = new HubUserClient({
20
20
  apiKey,
21
- basePath: this.basePath,
21
+ baseUrl: this.basePath,
22
22
  headers: this.defaultHeaders,
23
- }));
23
+ });
24
24
  try {
25
- return await userSettingsApi.getUser();
25
+ return await apiClient.userSettings.getCurrentUser();
26
26
  }
27
27
  catch (error) {
28
28
  const errorMessage = await handleError(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantum-hub/qhubctl",
3
- "version": "1.12.1",
3
+ "version": "1.14.0",
4
4
  "description": "Kipu Quantum Hub CLI",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [
@@ -1,31 +0,0 @@
1
- /**
2
- * Quantum Platform User Service API
3
- * Part of the OpenAPI specification for the Quantum Platform.
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: support-hub@kipu-quantum.com
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import * as runtime from '../runtime.js';
13
- import type { PersonalAccessTokenPrincipal } from '../models/index.js';
14
- export interface AuthorizeUserRequest {
15
- xAuthToken?: string;
16
- }
17
- /**
18
- *
19
- */
20
- export declare class AuthenticationApi extends runtime.BaseAPI {
21
- /**
22
- * Checks the given personal access token and returns the user details.
23
- * Checks the given personal access token and returns the user details.
24
- */
25
- authorizeUserRaw(requestParameters: AuthorizeUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PersonalAccessTokenPrincipal>>;
26
- /**
27
- * Checks the given personal access token and returns the user details.
28
- * Checks the given personal access token and returns the user details.
29
- */
30
- authorizeUser(requestParameters?: AuthorizeUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PersonalAccessTokenPrincipal>;
31
- }
@@ -1,46 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Quantum Platform User Service API
5
- * Part of the OpenAPI specification for the Quantum Platform.
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: support-hub@kipu-quantum.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import * as runtime from '../runtime.js';
15
- import { PersonalAccessTokenPrincipalFromJSON, } from '../models/index.js';
16
- /**
17
- *
18
- */
19
- export class AuthenticationApi extends runtime.BaseAPI {
20
- /**
21
- * Checks the given personal access token and returns the user details.
22
- * Checks the given personal access token and returns the user details.
23
- */
24
- async authorizeUserRaw(requestParameters, initOverrides) {
25
- const queryParameters = {};
26
- const headerParameters = {};
27
- if (requestParameters['xAuthToken'] != null) {
28
- headerParameters['X-Auth-Token'] = String(requestParameters['xAuthToken']);
29
- }
30
- const response = await this.request({
31
- path: `/authorize`,
32
- method: 'POST',
33
- headers: headerParameters,
34
- query: queryParameters,
35
- }, initOverrides);
36
- return new runtime.JSONApiResponse(response, (jsonValue) => PersonalAccessTokenPrincipalFromJSON(jsonValue));
37
- }
38
- /**
39
- * Checks the given personal access token and returns the user details.
40
- * Checks the given personal access token and returns the user details.
41
- */
42
- async authorizeUser(requestParameters = {}, initOverrides) {
43
- const response = await this.authorizeUserRaw(requestParameters, initOverrides);
44
- return await response.value();
45
- }
46
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Quantum Platform User Service API
3
- * Part of the OpenAPI specification for the Quantum Platform.
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: support-hub@kipu-quantum.com
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import * as runtime from '../runtime.js';
13
- import type { PageUserDto, Pageable, UserDto } from '../models/index.js';
14
- export interface FindExpertByIdRequest {
15
- id: string;
16
- }
17
- export interface GetExpertsRequest {
18
- pageable: Pageable;
19
- }
20
- /**
21
- *
22
- */
23
- export declare class ExpertsApi extends runtime.BaseAPI {
24
- /**
25
- * Returns the expert details with the given id.
26
- * Returns the expert details with the given id.
27
- */
28
- findExpertByIdRaw(requestParameters: FindExpertByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserDto>>;
29
- /**
30
- * Returns the expert details with the given id.
31
- * Returns the expert details with the given id.
32
- */
33
- findExpertById(requestParameters: FindExpertByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserDto>;
34
- /**
35
- * Lists all experts.
36
- * Lists all experts.
37
- */
38
- getExpertsRaw(requestParameters: GetExpertsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PageUserDto>>;
39
- /**
40
- * Lists all experts.
41
- * Lists all experts.
42
- */
43
- getExperts(requestParameters: GetExpertsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PageUserDto>;
44
- }
@@ -1,75 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Quantum Platform User Service API
5
- * Part of the OpenAPI specification for the Quantum Platform.
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: support-hub@kipu-quantum.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import * as runtime from '../runtime.js';
15
- import { PageUserDtoFromJSON, UserDtoFromJSON, } from '../models/index.js';
16
- /**
17
- *
18
- */
19
- export class ExpertsApi extends runtime.BaseAPI {
20
- /**
21
- * Returns the expert details with the given id.
22
- * Returns the expert details with the given id.
23
- */
24
- async findExpertByIdRaw(requestParameters, initOverrides) {
25
- if (requestParameters['id'] == null) {
26
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling findExpertById().');
27
- }
28
- const queryParameters = {};
29
- const headerParameters = {};
30
- const response = await this.request({
31
- path: `/experts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
32
- method: 'GET',
33
- headers: headerParameters,
34
- query: queryParameters,
35
- }, initOverrides);
36
- return new runtime.JSONApiResponse(response, (jsonValue) => UserDtoFromJSON(jsonValue));
37
- }
38
- /**
39
- * Returns the expert details with the given id.
40
- * Returns the expert details with the given id.
41
- */
42
- async findExpertById(requestParameters, initOverrides) {
43
- const response = await this.findExpertByIdRaw(requestParameters, initOverrides);
44
- return await response.value();
45
- }
46
- /**
47
- * Lists all experts.
48
- * Lists all experts.
49
- */
50
- async getExpertsRaw(requestParameters, initOverrides) {
51
- if (requestParameters['pageable'] == null) {
52
- throw new runtime.RequiredError('pageable', 'Required parameter "pageable" was null or undefined when calling getExperts().');
53
- }
54
- const queryParameters = {};
55
- if (requestParameters['pageable'] != null) {
56
- queryParameters['pageable'] = requestParameters['pageable'];
57
- }
58
- const headerParameters = {};
59
- const response = await this.request({
60
- path: `/experts`,
61
- method: 'GET',
62
- headers: headerParameters,
63
- query: queryParameters,
64
- }, initOverrides);
65
- return new runtime.JSONApiResponse(response, (jsonValue) => PageUserDtoFromJSON(jsonValue));
66
- }
67
- /**
68
- * Lists all experts.
69
- * Lists all experts.
70
- */
71
- async getExperts(requestParameters, initOverrides) {
72
- const response = await this.getExpertsRaw(requestParameters, initOverrides);
73
- return await response.value();
74
- }
75
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * Quantum Platform User Service API
3
- * Part of the OpenAPI specification for the Quantum Platform.
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- * Contact: support-hub@kipu-quantum.com
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import * as runtime from '../runtime.js';
13
- import type { PageUserDto, UserDto } from '../models/index.js';
14
- export interface FindByLastname11Request {
15
- lastname: string;
16
- firstname: string;
17
- email: string;
18
- }
19
- export interface SearchExpertsRequest {
20
- q: string;
21
- }
22
- /**
23
- *
24
- */
25
- export declare class SearchApi extends runtime.BaseAPI {
26
- /**
27
- * Search for users based on the given query parameter.
28
- * Search for users based on the given query parameter.
29
- */
30
- findByLastname11Raw(requestParameters: FindByLastname11Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UserDto>>>;
31
- /**
32
- * Search for users based on the given query parameter.
33
- * Search for users based on the given query parameter.
34
- */
35
- findByLastname11(requestParameters: FindByLastname11Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UserDto>>;
36
- /**
37
- * Search for experts based on the given query parameter.
38
- * Search for experts based on the given query parameter.
39
- */
40
- searchExpertsRaw(requestParameters: SearchExpertsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PageUserDto>>;
41
- /**
42
- * Search for experts based on the given query parameter.
43
- * Search for experts based on the given query parameter.
44
- */
45
- searchExperts(requestParameters: SearchExpertsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PageUserDto>;
46
- }
@@ -1,97 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Quantum Platform User Service API
5
- * Part of the OpenAPI specification for the Quantum Platform.
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: support-hub@kipu-quantum.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import * as runtime from '../runtime.js';
15
- import { PageUserDtoFromJSON, UserDtoFromJSON, } from '../models/index.js';
16
- /**
17
- *
18
- */
19
- export class SearchApi extends runtime.BaseAPI {
20
- /**
21
- * Search for users based on the given query parameter.
22
- * Search for users based on the given query parameter.
23
- */
24
- async findByLastname11Raw(requestParameters, initOverrides) {
25
- if (requestParameters['lastname'] == null) {
26
- throw new runtime.RequiredError('lastname', 'Required parameter "lastname" was null or undefined when calling findByLastname11().');
27
- }
28
- if (requestParameters['firstname'] == null) {
29
- throw new runtime.RequiredError('firstname', 'Required parameter "firstname" was null or undefined when calling findByLastname11().');
30
- }
31
- if (requestParameters['email'] == null) {
32
- throw new runtime.RequiredError('email', 'Required parameter "email" was null or undefined when calling findByLastname11().');
33
- }
34
- const queryParameters = {};
35
- if (requestParameters['lastname'] != null) {
36
- queryParameters['lastname'] = requestParameters['lastname'];
37
- }
38
- if (requestParameters['firstname'] != null) {
39
- queryParameters['firstname'] = requestParameters['firstname'];
40
- }
41
- if (requestParameters['email'] != null) {
42
- queryParameters['email'] = requestParameters['email'];
43
- }
44
- const headerParameters = {};
45
- if (this.configuration && this.configuration.apiKey) {
46
- headerParameters["X-Auth-Token"] = await this.configuration.apiKey("X-Auth-Token"); // apiKey authentication
47
- }
48
- if (this.configuration && this.configuration.accessToken) {
49
- // oauth required
50
- headerParameters["Authorization"] = await this.configuration.accessToken("oauth2", []);
51
- }
52
- const response = await this.request({
53
- path: `/search`,
54
- method: 'GET',
55
- headers: headerParameters,
56
- query: queryParameters,
57
- }, initOverrides);
58
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserDtoFromJSON));
59
- }
60
- /**
61
- * Search for users based on the given query parameter.
62
- * Search for users based on the given query parameter.
63
- */
64
- async findByLastname11(requestParameters, initOverrides) {
65
- const response = await this.findByLastname11Raw(requestParameters, initOverrides);
66
- return await response.value();
67
- }
68
- /**
69
- * Search for experts based on the given query parameter.
70
- * Search for experts based on the given query parameter.
71
- */
72
- async searchExpertsRaw(requestParameters, initOverrides) {
73
- if (requestParameters['q'] == null) {
74
- throw new runtime.RequiredError('q', 'Required parameter "q" was null or undefined when calling searchExperts().');
75
- }
76
- const queryParameters = {};
77
- if (requestParameters['q'] != null) {
78
- queryParameters['q'] = requestParameters['q'];
79
- }
80
- const headerParameters = {};
81
- const response = await this.request({
82
- path: `/search/experts`,
83
- method: 'GET',
84
- headers: headerParameters,
85
- query: queryParameters,
86
- }, initOverrides);
87
- return new runtime.JSONApiResponse(response, (jsonValue) => PageUserDtoFromJSON(jsonValue));
88
- }
89
- /**
90
- * Search for experts based on the given query parameter.
91
- * Search for experts based on the given query parameter.
92
- */
93
- async searchExperts(requestParameters, initOverrides) {
94
- const response = await this.searchExpertsRaw(requestParameters, initOverrides);
95
- return await response.value();
96
- }
97
- }