Skip to content

Commit

Permalink
Merge pull request #504 from dolittle/create-new-command
Browse files Browse the repository at this point in the history
Create new command
  • Loading branch information
N00bG1rl authored Feb 16, 2024
2 parents 5bf5d17 + 33fbb73 commit 73ba0d5
Show file tree
Hide file tree
Showing 57 changed files with 1,376 additions and 181 deletions.
5 changes: 5 additions & 0 deletions Source/SelfService/Web/apis/integrations/CacheKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export enum CACHE_KEYS {
ConnectionMappableTablesSearch_GET = 'connection_mappable_tables_search_get',
ConnectionMappableTablesTable_GET = 'connection_mappable_tables_table_get',

//ProgramMetadataApi
ConnectionProgramMetadata_GET = 'connection_program_metadata_get',
ConnectionProgramMetadataSearch_GET = 'connection_program_metadata_search_get',
ConnectionProgramMetadataProgram_GET = 'connection_program_metadata_program_get',

//ServiceAccountsApi
ConnectionServiceAccounts_GET = 'connection_service_accounts_get',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apis/MappableTablesApi.ts
apis/MessageMappingApi.ts
apis/MetadataAdminApi.ts
apis/ProgramMetadataApi.ts
apis/ProjectTemplateApi.ts
apis/ResourceDownloadsApi.ts
apis/ServiceAccountApi.ts
apis/TableMetadataApi.ts
Expand All @@ -32,6 +31,7 @@ models/ConnectionConfigurationResult.ts
models/ConnectionModel.ts
models/ConnectionModelArrayResult.ts
models/ConnectionModelResult.ts
models/ConnectionPrograms.ts
models/ConnectionStatus.ts
models/CredentialStatus.ts
models/DescribedJqDto.ts
Expand All @@ -52,6 +52,7 @@ models/ListTable.ts
models/M3BasicAuthConfigRequest.ts
models/M3BasicAuthConfiguration.ts
models/M3BasicAuthConfigurationResult.ts
models/M3EnvironmentDto.ts
models/M3EnvironmentListDto.ts
models/MappableTable.ts
models/MappableTableColumn.ts
Expand All @@ -67,9 +68,12 @@ models/MetadataPublisherConfigRequest.ts
models/ModelIndex.ts
models/NoSuchReadModelResult.ts
models/NotFoundResult.ts
models/Parameter.ts
models/ProblemDetails.ts
models/ProgramDetails.ts
models/ProgramHeader.ts
models/ProgramMetadataHeader.ts
models/ProgramTransaction.ts
models/ProgramTransactionHeader.ts
models/RelatedTable.ts
models/RemoteServiceStatus.ts
models/RestApiServiceStatus.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,111 @@

import * as runtime from '../runtime';
import type {
M3EnvironmentDto,
M3EnvironmentListDto,
ProblemDetails,
} from '../models/index';
import {
M3EnvironmentDtoFromJSON,
M3EnvironmentDtoToJSON,
M3EnvironmentListDtoFromJSON,
M3EnvironmentListDtoToJSON,
ProblemDetailsFromJSON,
ProblemDetailsToJSON,
} from '../models/index';

export interface MetadataEnvironmentsEnvironmentNameGetRequest {
environmentName: string;
}

export interface MetadataEnvironmentsEnvironmentNameReimportPostRequest {
environmentName: string;
}

/**
*
*/
export class BaseMetadataApi extends runtime.BaseAPI {

/**
*/
async metadataEnvironmentsEnvironmentNameGetRaw(requestParameters: MetadataEnvironmentsEnvironmentNameGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<M3EnvironmentDto>>> {
if (requestParameters.environmentName === null || requestParameters.environmentName === undefined) {
throw new runtime.RequiredError('environmentName','Required parameter requestParameters.environmentName was null or undefined when calling metadataEnvironmentsEnvironmentNameGet.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.apiKey) {
headerParameters["X-Organization-Id"] = this.configuration.apiKey("X-Organization-Id"); // X-Organization-Id authentication
}

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("Bearer", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/metadata/environments/{environmentName}`.replace(`{${"environmentName"}}`, encodeURIComponent(String(requestParameters.environmentName))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(M3EnvironmentDtoFromJSON));
}

/**
*/
async metadataEnvironmentsEnvironmentNameGet(requestParameters: MetadataEnvironmentsEnvironmentNameGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<M3EnvironmentDto>> {
const response = await this.metadataEnvironmentsEnvironmentNameGetRaw(requestParameters, initOverrides);
return await response.value();
}

/**
*/
async metadataEnvironmentsEnvironmentNameReimportPostRaw(requestParameters: MetadataEnvironmentsEnvironmentNameReimportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.environmentName === null || requestParameters.environmentName === undefined) {
throw new runtime.RequiredError('environmentName','Required parameter requestParameters.environmentName was null or undefined when calling metadataEnvironmentsEnvironmentNameReimportPost.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.apiKey) {
headerParameters["X-Organization-Id"] = this.configuration.apiKey("X-Organization-Id"); // X-Organization-Id authentication
}

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("Bearer", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/metadata/environments/{environmentName}/reimport`.replace(`{${"environmentName"}}`, encodeURIComponent(String(requestParameters.environmentName))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.VoidApiResponse(response);
}

/**
*/
async metadataEnvironmentsEnvironmentNameReimportPost(requestParameters: MetadataEnvironmentsEnvironmentNameReimportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.metadataEnvironmentsEnvironmentNameReimportPostRaw(requestParameters, initOverrides);
}

/**
*/
async metadataEnvironmentsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<M3EnvironmentListDto>>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,99 @@

import * as runtime from '../runtime';
import type {
ConnectionPrograms,
ProblemDetails,
ProgramDetails,
ProgramHeader,
ProgramMetadataHeader,
ProgramTransaction,
} from '../models/index';
import {
ConnectionProgramsFromJSON,
ConnectionProgramsToJSON,
ProblemDetailsFromJSON,
ProblemDetailsToJSON,
ProgramDetailsFromJSON,
ProgramDetailsToJSON,
ProgramHeaderFromJSON,
ProgramHeaderToJSON,
ProgramMetadataHeaderFromJSON,
ProgramMetadataHeaderToJSON,
ProgramTransactionFromJSON,
ProgramTransactionToJSON,
} from '../models/index';

export interface ConnectionsIdMetadataEnvironmentsEnvironmentProgramsGetRequest {
export interface ConnectionsIdMetadataProgramsGetRequest {
id: string;
environment: string;
}

export interface ConnectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGetRequest {
export interface ConnectionsIdMetadataProgramsProgramProgramGetRequest {
id: string;
environment: string;
program: string;
}

export interface ConnectionsIdMetadataProgramsProgramProgramTransactionsTransactionGetRequest {
id: string;
program: string;
transaction: string;
}

export interface ConnectionsIdMetadataProgramsSearchGetRequest {
id: string;
query?: string;
}

/**
*
*/
export class ProgramMetadataApi extends runtime.BaseAPI {

/**
*/
async connectionsIdMetadataEnvironmentsEnvironmentProgramsGetRaw(requestParameters: ConnectionsIdMetadataEnvironmentsEnvironmentProgramsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProgramHeader>>> {
async connectionsIdMetadataProgramsGetRaw(requestParameters: ConnectionsIdMetadataProgramsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProgramMetadataHeader>>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataProgramsGet.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.apiKey) {
headerParameters["X-Organization-Id"] = this.configuration.apiKey("X-Organization-Id"); // X-Organization-Id authentication
}

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("Bearer", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/connections/{id}/metadata/programs`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ProgramMetadataHeaderFromJSON));
}

/**
*/
async connectionsIdMetadataProgramsGet(requestParameters: ConnectionsIdMetadataProgramsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProgramMetadataHeader>> {
const response = await this.connectionsIdMetadataProgramsGetRaw(requestParameters, initOverrides);
return await response.value();
}

/**
*/
async connectionsIdMetadataProgramsProgramProgramGetRaw(requestParameters: ConnectionsIdMetadataProgramsProgramProgramGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProgramDetails>>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataEnvironmentsEnvironmentProgramsGet.');
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataProgramsProgramProgramGet.');
}

if (requestParameters.environment === null || requestParameters.environment === undefined) {
throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling connectionsIdMetadataEnvironmentsEnvironmentProgramsGet.');
if (requestParameters.program === null || requestParameters.program === undefined) {
throw new runtime.RequiredError('program','Required parameter requestParameters.program was null or undefined when calling connectionsIdMetadataProgramsProgramProgramGet.');
}

const queryParameters: any = {};
Expand All @@ -69,35 +127,35 @@ export class ProgramMetadataApi extends runtime.BaseAPI {
}
}
const response = await this.request({
path: `/connections/{id}/metadata/environments/{environment}/programs`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
path: `/connections/{id}/metadata/programs/program/{program}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"program"}}`, encodeURIComponent(String(requestParameters.program))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ProgramHeaderFromJSON));
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ProgramDetailsFromJSON));
}

/**
*/
async connectionsIdMetadataEnvironmentsEnvironmentProgramsGet(requestParameters: ConnectionsIdMetadataEnvironmentsEnvironmentProgramsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProgramHeader>> {
const response = await this.connectionsIdMetadataEnvironmentsEnvironmentProgramsGetRaw(requestParameters, initOverrides);
async connectionsIdMetadataProgramsProgramProgramGet(requestParameters: ConnectionsIdMetadataProgramsProgramProgramGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProgramDetails>> {
const response = await this.connectionsIdMetadataProgramsProgramProgramGetRaw(requestParameters, initOverrides);
return await response.value();
}

/**
*/
async connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGetRaw(requestParameters: ConnectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProgramDetails>>> {
async connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGetRaw(requestParameters: ConnectionsIdMetadataProgramsProgramProgramTransactionsTransactionGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProgramTransaction>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGet.');
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGet.');
}

if (requestParameters.environment === null || requestParameters.environment === undefined) {
throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGet.');
if (requestParameters.program === null || requestParameters.program === undefined) {
throw new runtime.RequiredError('program','Required parameter requestParameters.program was null or undefined when calling connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGet.');
}

if (requestParameters.program === null || requestParameters.program === undefined) {
throw new runtime.RequiredError('program','Required parameter requestParameters.program was null or undefined when calling connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGet.');
if (requestParameters.transaction === null || requestParameters.transaction === undefined) {
throw new runtime.RequiredError('transaction','Required parameter requestParameters.transaction was null or undefined when calling connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGet.');
}

const queryParameters: any = {};
Expand All @@ -117,19 +175,63 @@ export class ProgramMetadataApi extends runtime.BaseAPI {
}
}
const response = await this.request({
path: `/connections/{id}/metadata/environments/{environment}/programs/{program}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"program"}}`, encodeURIComponent(String(requestParameters.program))),
path: `/connections/{id}/metadata/programs/program/{program}/transactions/{transaction}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"program"}}`, encodeURIComponent(String(requestParameters.program))).replace(`{${"transaction"}}`, encodeURIComponent(String(requestParameters.transaction))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ProgramDetailsFromJSON));
return new runtime.JSONApiResponse(response, (jsonValue) => ProgramTransactionFromJSON(jsonValue));
}

/**
*/
async connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGet(requestParameters: ConnectionsIdMetadataProgramsProgramProgramTransactionsTransactionGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProgramTransaction> {
const response = await this.connectionsIdMetadataProgramsProgramProgramTransactionsTransactionGetRaw(requestParameters, initOverrides);
return await response.value();
}

/**
*/
async connectionsIdMetadataProgramsSearchGetRaw(requestParameters: ConnectionsIdMetadataProgramsSearchGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConnectionPrograms>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling connectionsIdMetadataProgramsSearchGet.');
}

const queryParameters: any = {};

if (requestParameters.query !== undefined) {
queryParameters['query'] = requestParameters.query;
}

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.apiKey) {
headerParameters["X-Organization-Id"] = this.configuration.apiKey("X-Organization-Id"); // X-Organization-Id authentication
}

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("Bearer", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/connections/{id}/metadata/programs/search`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionProgramsFromJSON(jsonValue));
}

/**
*/
async connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGet(requestParameters: ConnectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProgramDetails>> {
const response = await this.connectionsIdMetadataEnvironmentsEnvironmentProgramsProgramGetRaw(requestParameters, initOverrides);
async connectionsIdMetadataProgramsSearchGet(requestParameters: ConnectionsIdMetadataProgramsSearchGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConnectionPrograms> {
const response = await this.connectionsIdMetadataProgramsSearchGetRaw(requestParameters, initOverrides);
return await response.value();
}

Expand Down
Loading

0 comments on commit 73ba0d5

Please sign in to comment.