update all generated clients
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -34,8 +34,8 @@ import { EntityFacetsResponse } from '../models/EntityFacetsResponse.model';
|
||||
import { GetEntitiesByRefsRequest } from '../models/GetEntitiesByRefsRequest.model';
|
||||
import { GetLocations200ResponseInner } from '../models/GetLocations200ResponseInner.model';
|
||||
import { Location } from '../models/Location.model';
|
||||
import { ValidateEntityRequest } from '../models/ValidateEntityRequest.model';
|
||||
import { RefreshEntityRequest } from '../models/RefreshEntityRequest.model';
|
||||
import { ValidateEntityRequest } from '../models/ValidateEntityRequest.model';
|
||||
|
||||
/**
|
||||
* Wraps the Response type to convey a type on the json call.
|
||||
@@ -184,14 +184,14 @@ export type GetLocations = {};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
export type RefreshEntity = {
|
||||
body: RefreshEntityRequest;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type RefreshEntity = {
|
||||
body: RefreshEntityRequest;
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -598,31 +598,6 @@ export class DefaultApiClient {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a passed in entity has no errors in schema.
|
||||
* @param validateEntityRequest -
|
||||
*/
|
||||
public async validateEntity(
|
||||
// @ts-ignore
|
||||
request: ValidateEntity,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/validate-entity`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the entity related to entityRef.
|
||||
* @param refreshEntityRequest -
|
||||
@@ -647,4 +622,29 @@ export class DefaultApiClient {
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a passed in entity has no errors in schema.
|
||||
* @param validateEntityRequest -
|
||||
*/
|
||||
public async validateEntity(
|
||||
// @ts-ignore
|
||||
request: ValidateEntity,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/validate-entity`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,653 +0,0 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { DiscoveryApi } from '../types/discovery';
|
||||
import { FetchApi } from '../types/fetch';
|
||||
import crossFetch from 'cross-fetch';
|
||||
import { pluginId } from '../pluginId';
|
||||
import * as parser from 'uri-template';
|
||||
|
||||
import { AnalyzeLocationRequest } from '../models/AnalyzeLocationRequest.model';
|
||||
import { AnalyzeLocationResponse } from '../models/AnalyzeLocationResponse.model';
|
||||
import { CreateLocation201Response } from '../models/CreateLocation201Response.model';
|
||||
import { CreateLocationRequest } from '../models/CreateLocationRequest.model';
|
||||
import { EntitiesBatchResponse } from '../models/EntitiesBatchResponse.model';
|
||||
import { EntitiesQueryResponse } from '../models/EntitiesQueryResponse.model';
|
||||
import { Entity } from '../models/Entity.model';
|
||||
import { EntityAncestryResponse } from '../models/EntityAncestryResponse.model';
|
||||
import { EntityFacetsResponse } from '../models/EntityFacetsResponse.model';
|
||||
import { GetEntitiesByRefsRequest } from '../models/GetEntitiesByRefsRequest.model';
|
||||
import { GetLocations200ResponseInner } from '../models/GetLocations200ResponseInner.model';
|
||||
import { Location } from '../models/Location.model';
|
||||
import { RefreshEntityRequest } from '../models/RefreshEntityRequest.model';
|
||||
import { ValidateEntityRequest } from '../models/ValidateEntityRequest.model';
|
||||
|
||||
/**
|
||||
* Wraps the Response type to convey a type on the json call.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TypedResponse<T> = Omit<Response, 'json'> & {
|
||||
json: () => Promise<T>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options you can pass into a request for additional information.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface RequestOptions {
|
||||
token?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type AnalyzeLocation = {
|
||||
body: AnalyzeLocationRequest;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type CreateLocation = {
|
||||
body: CreateLocationRequest;
|
||||
query: {
|
||||
dryRun?: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type DeleteEntityByUid = {
|
||||
path: {
|
||||
uid: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type DeleteLocation = {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntities = {
|
||||
query: {
|
||||
fields?: Array<string>;
|
||||
limit?: number;
|
||||
filter?: Array<string>;
|
||||
offset?: number;
|
||||
after?: string;
|
||||
order?: Array<string>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntitiesByQuery = {
|
||||
query: {
|
||||
fields?: Array<string>;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
orderField?: Array<string>;
|
||||
cursor?: string;
|
||||
filter?: Array<string>;
|
||||
fullTextFilterTerm?: string;
|
||||
fullTextFilterFields?: Array<string>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntitiesByRefs = {
|
||||
body: GetEntitiesByRefsRequest;
|
||||
query: {
|
||||
filter?: Array<string>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityAncestryByName = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityByName = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityByUid = {
|
||||
path: {
|
||||
uid: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityFacets = {
|
||||
query: {
|
||||
facet: Array<string>;
|
||||
filter?: Array<string>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocation = {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocationByEntity = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocations = {};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type RefreshEntity = {
|
||||
body: RefreshEntityRequest;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
};
|
||||
|
||||
/**
|
||||
* no description
|
||||
* @public
|
||||
*/
|
||||
export class DefaultApiClient {
|
||||
private readonly discoveryApi: DiscoveryApi;
|
||||
private readonly fetchApi: FetchApi;
|
||||
|
||||
constructor(options: {
|
||||
discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };
|
||||
fetchApi?: { fetch: typeof fetch };
|
||||
}) {
|
||||
this.discoveryApi = options.discoveryApi;
|
||||
this.fetchApi = options.fetchApi || { fetch: crossFetch };
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a given location.
|
||||
* @param analyzeLocationRequest -
|
||||
*/
|
||||
public async analyzeLocation(
|
||||
// @ts-ignore
|
||||
request: AnalyzeLocation,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<AnalyzeLocationResponse>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/analyze-location`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a location for a given target.
|
||||
* @param createLocationRequest -
|
||||
* @param dryRun -
|
||||
*/
|
||||
public async createLocation(
|
||||
// @ts-ignore
|
||||
request: CreateLocation,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<CreateLocation201Response>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/locations{?dryRun}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
...request.query,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a single entity by UID.
|
||||
* @param uid -
|
||||
*/
|
||||
public async deleteEntityByUid(
|
||||
// @ts-ignore
|
||||
request: DeleteEntityByUid,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-uid/{uid}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
uid: request.path.uid,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a location by id.
|
||||
* @param id -
|
||||
*/
|
||||
public async deleteLocation(
|
||||
// @ts-ignore
|
||||
request: DeleteLocation,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/locations/{id}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
id: request.path.id,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all entities matching a given filter.
|
||||
* @param fields - Restrict to just these fields in the response.
|
||||
* @param limit - Number of records to return in the response.
|
||||
* @param filter - Filter for just the entities defined by this filter.
|
||||
* @param offset - Number of records to skip in the query page.
|
||||
* @param after - Pointer to the previous page of results.
|
||||
* @param order -
|
||||
*/
|
||||
public async getEntities(
|
||||
// @ts-ignore
|
||||
request: GetEntities,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Array<Entity>>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities{?fields,limit,filter*,offset,after,order*}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
...request.query,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for entities by a given query.
|
||||
* @param fields - Restrict to just these fields in the response.
|
||||
* @param limit - Number of records to return in the response.
|
||||
* @param offset - Number of records to skip in the query page.
|
||||
* @param orderField - The fields to sort returned results by.
|
||||
* @param cursor - Cursor to a set page of results.
|
||||
* @param filter - Filter for just the entities defined by this filter.
|
||||
* @param fullTextFilterTerm - Text search term.
|
||||
* @param fullTextFilterFields - A comma separated list of fields to sort returned results by.
|
||||
*/
|
||||
public async getEntitiesByQuery(
|
||||
// @ts-ignore
|
||||
request: GetEntitiesByQuery,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<EntitiesQueryResponse>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-query{?fields,limit,offset,orderField*,cursor,filter*,fullTextFilterTerm,fullTextFilterFields}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
...request.query,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a batch set of entities given an array of entityRefs.
|
||||
* @param filter - Filter for just the entities defined by this filter.
|
||||
* @param getEntitiesByRefsRequest -
|
||||
*/
|
||||
public async getEntitiesByRefs(
|
||||
// @ts-ignore
|
||||
request: GetEntitiesByRefs,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<EntitiesBatchResponse>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-refs{?filter*}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
...request.query,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an entity's ancestry by entity ref.
|
||||
* @param kind -
|
||||
* @param namespace -
|
||||
* @param name -
|
||||
*/
|
||||
public async getEntityAncestryByName(
|
||||
// @ts-ignore
|
||||
request: GetEntityAncestryByName,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<EntityAncestryResponse>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-name/{kind}/{namespace}/{name}/ancestry`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
kind: request.path.kind,
|
||||
namespace: request.path.namespace,
|
||||
name: request.path.name,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an entity by an entity ref.
|
||||
* @param kind -
|
||||
* @param namespace -
|
||||
* @param name -
|
||||
*/
|
||||
public async getEntityByName(
|
||||
// @ts-ignore
|
||||
request: GetEntityByName,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Entity>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-name/{kind}/{namespace}/{name}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
kind: request.path.kind,
|
||||
namespace: request.path.namespace,
|
||||
name: request.path.name,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single entity by the UID.
|
||||
* @param uid -
|
||||
*/
|
||||
public async getEntityByUid(
|
||||
// @ts-ignore
|
||||
request: GetEntityByUid,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Entity>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entities/by-uid/{uid}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
uid: request.path.uid,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all entity facets that match the given filters.
|
||||
* @param facet -
|
||||
* @param filter - Filter for just the entities defined by this filter.
|
||||
*/
|
||||
public async getEntityFacets(
|
||||
// @ts-ignore
|
||||
request: GetEntityFacets,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<EntityFacetsResponse>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/entity-facets{?facet*,filter*}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
...request.query,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a location by id.
|
||||
* @param id -
|
||||
*/
|
||||
public async getLocation(
|
||||
// @ts-ignore
|
||||
request: GetLocation,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Location>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/locations/{id}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
id: request.path.id,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a location for entity.
|
||||
* @param kind -
|
||||
* @param namespace -
|
||||
* @param name -
|
||||
*/
|
||||
public async getLocationByEntity(
|
||||
// @ts-ignore
|
||||
request: GetLocationByEntity,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Location>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/locations/by-entity/{kind}/{namespace}/{name}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
kind: request.path.kind,
|
||||
namespace: request.path.namespace,
|
||||
name: request.path.name,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all locations
|
||||
*/
|
||||
public async getLocations(
|
||||
// @ts-ignore
|
||||
request: GetLocations,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<Array<GetLocations200ResponseInner>>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/locations`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the entity related to entityRef.
|
||||
* @param refreshEntityRequest -
|
||||
*/
|
||||
public async refreshEntity(
|
||||
// @ts-ignore
|
||||
request: RefreshEntity,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/refresh`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a passed in entity has no errors in schema.
|
||||
* @param validateEntityRequest -
|
||||
*/
|
||||
public async validateEntity(
|
||||
// @ts-ignore
|
||||
request: ValidateEntity,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/validate-entity`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './DefaultApi.client';
|
||||
export * from './Api.client';
|
||||
|
||||
@@ -31,6 +31,7 @@ import { EntityFacetsResponse } from '../models/EntityFacetsResponse.model';
|
||||
import { GetEntitiesByRefsRequest } from '../models/GetEntitiesByRefsRequest.model';
|
||||
import { GetLocations200ResponseInner } from '../models/GetLocations200ResponseInner.model';
|
||||
import { Location } from '../models/Location.model';
|
||||
import { RefreshEntityRequest } from '../models/RefreshEntityRequest.model';
|
||||
import { ValidateEntity400Response } from '../models/ValidateEntity400Response.model';
|
||||
import { ValidateEntityRequest } from '../models/ValidateEntityRequest.model';
|
||||
|
||||
@@ -176,15 +177,6 @@ export type GetLocationByEntity = {
|
||||
export type GetLocations = {
|
||||
response: Array<GetLocations200ResponseInner> | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
response: void | ValidateEntity400Response;
|
||||
};
|
||||
import { RefreshEntityRequest } from '../models/RefreshEntityRequest.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@@ -192,6 +184,13 @@ export type RefreshEntity = {
|
||||
body: RefreshEntityRequest;
|
||||
response: void | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
response: void | ValidateEntity400Response;
|
||||
};
|
||||
|
||||
export type EndpointMap = {
|
||||
'#post|/analyze-location': AnalyzeLocation;
|
||||
@@ -222,7 +221,7 @@ export type EndpointMap = {
|
||||
|
||||
'#get|/locations': GetLocations;
|
||||
|
||||
'#post|/validate-entity': ValidateEntity;
|
||||
|
||||
'#post|/refresh': RefreshEntity;
|
||||
|
||||
'#post|/validate-entity': ValidateEntity;
|
||||
};
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { AnalyzeLocationRequest } from '../models/AnalyzeLocationRequest.model';
|
||||
import { AnalyzeLocationResponse } from '../models/AnalyzeLocationResponse.model';
|
||||
import { CreateLocation201Response } from '../models/CreateLocation201Response.model';
|
||||
import { CreateLocationRequest } from '../models/CreateLocationRequest.model';
|
||||
import { EntitiesBatchResponse } from '../models/EntitiesBatchResponse.model';
|
||||
import { EntitiesQueryResponse } from '../models/EntitiesQueryResponse.model';
|
||||
import { Entity } from '../models/Entity.model';
|
||||
import { EntityAncestryResponse } from '../models/EntityAncestryResponse.model';
|
||||
import { EntityFacetsResponse } from '../models/EntityFacetsResponse.model';
|
||||
import { GetEntitiesByRefsRequest } from '../models/GetEntitiesByRefsRequest.model';
|
||||
import { GetLocations200ResponseInner } from '../models/GetLocations200ResponseInner.model';
|
||||
import { Location } from '../models/Location.model';
|
||||
import { RefreshEntityRequest } from '../models/RefreshEntityRequest.model';
|
||||
import { ValidateEntity400Response } from '../models/ValidateEntity400Response.model';
|
||||
import { ValidateEntityRequest } from '../models/ValidateEntityRequest.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type AnalyzeLocation = {
|
||||
body: AnalyzeLocationRequest;
|
||||
response: AnalyzeLocationResponse | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type CreateLocation = {
|
||||
body: CreateLocationRequest;
|
||||
query: {
|
||||
dryRun?: string;
|
||||
};
|
||||
response: CreateLocation201Response | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type DeleteEntityByUid = {
|
||||
path: {
|
||||
uid: string;
|
||||
};
|
||||
response: void | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type DeleteLocation = {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
response: void | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntities = {
|
||||
query: {
|
||||
fields?: Array<string>;
|
||||
limit?: number;
|
||||
filter?: Array<string>;
|
||||
offset?: number;
|
||||
after?: string;
|
||||
order?: Array<string>;
|
||||
};
|
||||
response: Array<Entity> | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntitiesByQuery = {
|
||||
query: {
|
||||
fields?: Array<string>;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
orderField?: Array<string>;
|
||||
cursor?: string;
|
||||
filter?: Array<string>;
|
||||
fullTextFilterTerm?: string;
|
||||
fullTextFilterFields?: Array<string>;
|
||||
};
|
||||
response: EntitiesQueryResponse | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntitiesByRefs = {
|
||||
body: GetEntitiesByRefsRequest;
|
||||
query: {
|
||||
filter?: Array<string>;
|
||||
};
|
||||
response: EntitiesBatchResponse | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityAncestryByName = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
response: EntityAncestryResponse | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityByName = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
response: Entity | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityByUid = {
|
||||
path: {
|
||||
uid: string;
|
||||
};
|
||||
response: Entity | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetEntityFacets = {
|
||||
query: {
|
||||
facet: Array<string>;
|
||||
filter?: Array<string>;
|
||||
};
|
||||
response: EntityFacetsResponse | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocation = {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
response: Location | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocationByEntity = {
|
||||
path: {
|
||||
kind: string;
|
||||
namespace: string;
|
||||
name: string;
|
||||
};
|
||||
response: Location | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetLocations = {
|
||||
response: Array<GetLocations200ResponseInner> | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type RefreshEntity = {
|
||||
body: RefreshEntityRequest;
|
||||
response: void | Error | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ValidateEntity = {
|
||||
body: ValidateEntityRequest;
|
||||
response: void | ValidateEntity400Response;
|
||||
};
|
||||
|
||||
/**
|
||||
* no description
|
||||
*/
|
||||
|
||||
export type EndpointMap = {
|
||||
'#post|/analyze-location': AnalyzeLocation;
|
||||
|
||||
'#post|/locations': CreateLocation;
|
||||
|
||||
'#_delete|/entities/by-uid/{uid}': DeleteEntityByUid;
|
||||
|
||||
'#_delete|/locations/{id}': DeleteLocation;
|
||||
|
||||
'#get|/entities': GetEntities;
|
||||
|
||||
'#get|/entities/by-query': GetEntitiesByQuery;
|
||||
|
||||
'#post|/entities/by-refs': GetEntitiesByRefs;
|
||||
|
||||
'#get|/entities/by-name/{kind}/{namespace}/{name}/ancestry': GetEntityAncestryByName;
|
||||
|
||||
'#get|/entities/by-name/{kind}/{namespace}/{name}': GetEntityByName;
|
||||
|
||||
'#get|/entities/by-uid/{uid}': GetEntityByUid;
|
||||
|
||||
'#get|/entity-facets': GetEntityFacets;
|
||||
|
||||
'#get|/locations/{id}': GetLocation;
|
||||
|
||||
'#get|/locations/by-entity/{kind}/{namespace}/{name}': GetLocationByEntity;
|
||||
|
||||
'#get|/locations': GetLocations;
|
||||
|
||||
'#post|/refresh': RefreshEntity;
|
||||
|
||||
'#post|/validate-entity': ValidateEntity;
|
||||
};
|
||||
@@ -14,4 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './DefaultApi.server';
|
||||
//
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
export * from './Api.server';
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { GetSubscriptionEvents200Response } from '../models/GetSubscriptionEvents200Response.model';
|
||||
import { PostEventRequest } from '../models/PostEventRequest.model';
|
||||
import { PutSubscriptionRequest } from '../models/PutSubscriptionRequest.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetSubscriptionEvents = {
|
||||
path: {
|
||||
subscriptionId: string;
|
||||
};
|
||||
response: GetSubscriptionEvents200Response | void | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type PostEvent = {
|
||||
body: PostEventRequest;
|
||||
response: void | void | Error;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type PutSubscription = {
|
||||
path: {
|
||||
subscriptionId: string;
|
||||
};
|
||||
body: PutSubscriptionRequest;
|
||||
response: void | Error;
|
||||
};
|
||||
|
||||
export type EndpointMap = {
|
||||
'#get|/bus/v1/subscriptions/{subscriptionId}/events': GetSubscriptionEvents;
|
||||
|
||||
'#post|/bus/v1/events': PostEvent;
|
||||
|
||||
'#put|/bus/v1/subscriptions/{subscriptionId}': PutSubscription;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
export * from './Api.server';
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './apis';
|
||||
export * from './router';
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorError {
|
||||
name: string;
|
||||
message: string;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorRequest {
|
||||
method: string;
|
||||
url: string;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorResponse {
|
||||
statusCode: number;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Event {
|
||||
/**
|
||||
* The topic that the event is published on
|
||||
*/
|
||||
topic: string;
|
||||
/**
|
||||
* The event payload
|
||||
*/
|
||||
payload: any | null;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { Event } from '../models/Event.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface GetSubscriptionEvents200Response {
|
||||
events: Array<Event>;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { ErrorError } from '../models/ErrorError.model';
|
||||
import { ErrorRequest } from '../models/ErrorRequest.model';
|
||||
import { ErrorResponse } from '../models/ErrorResponse.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ModelError {
|
||||
error: ErrorError;
|
||||
request: ErrorRequest;
|
||||
response: ErrorResponse;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { Event } from '../models/Event.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface PostEventRequest {
|
||||
event: Event;
|
||||
/**
|
||||
* The IDs of subscriptions that have already received this event
|
||||
*/
|
||||
notifiedSubscribers?: Array<string>;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface PutSubscriptionRequest {
|
||||
/**
|
||||
* The topics to subscribe to
|
||||
*/
|
||||
topics: Array<string>;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from '../models/ErrorError.model';
|
||||
export * from '../models/ErrorRequest.model';
|
||||
export * from '../models/ErrorResponse.model';
|
||||
export * from '../models/Event.model';
|
||||
export * from '../models/GetSubscriptionEvents200Response.model';
|
||||
export * from '../models/ModelError.model';
|
||||
export * from '../models/PostEventRequest.model';
|
||||
export * from '../models/PutSubscriptionRequest.model';
|
||||
+10
-3
@@ -17,7 +17,8 @@
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { createValidatedOpenApiRouter } from '@backstage/backend-openapi-utils';
|
||||
import { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';
|
||||
import { EndpointMap } from './';
|
||||
|
||||
export const spec = {
|
||||
openapi: '3.0.3',
|
||||
@@ -287,5 +288,11 @@ export const spec = {
|
||||
},
|
||||
} as const;
|
||||
export const createOpenApiRouter = async (
|
||||
options?: Parameters<typeof createValidatedOpenApiRouter>['1'],
|
||||
) => createValidatedOpenApiRouter<typeof spec>(spec, options);
|
||||
options?: Parameters<
|
||||
typeof createValidatedOpenApiRouterFromGeneratedEndpointMap
|
||||
>['1'],
|
||||
) =>
|
||||
createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(
|
||||
spec,
|
||||
options,
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './generated';
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { DiscoveryApi } from '../types/discovery';
|
||||
import { FetchApi } from '../types/fetch';
|
||||
import crossFetch from 'cross-fetch';
|
||||
import { pluginId } from '../pluginId';
|
||||
import * as parser from 'uri-template';
|
||||
import { GetSubscriptionEvents200Response } from '../models/GetSubscriptionEvents200Response.model';
|
||||
import { PostEventRequest } from '../models/PostEventRequest.model';
|
||||
import { PutSubscriptionRequest } from '../models/PutSubscriptionRequest.model';
|
||||
|
||||
/**
|
||||
* Wraps the Response type to convey a type on the json call.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TypedResponse<T> = Omit<Response, 'json'> & {
|
||||
json: () => Promise<T>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options you can pass into a request for additional information.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface RequestOptions {
|
||||
token?: string;
|
||||
}
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type GetSubscriptionEvents = {
|
||||
path: {
|
||||
subscriptionId: string;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type PostEvent = {
|
||||
body: PostEventRequest;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type PutSubscription = {
|
||||
path: {
|
||||
subscriptionId: string;
|
||||
};
|
||||
body: PutSubscriptionRequest;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class DefaultApiClient {
|
||||
private readonly discoveryApi: DiscoveryApi;
|
||||
private readonly fetchApi: FetchApi;
|
||||
|
||||
constructor(options: {
|
||||
discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };
|
||||
fetchApi?: { fetch: typeof fetch };
|
||||
}) {
|
||||
this.discoveryApi = options.discoveryApi;
|
||||
this.fetchApi = options.fetchApi || { fetch: crossFetch };
|
||||
}
|
||||
|
||||
/**
|
||||
* Get new events for the provided subscription
|
||||
* @param subscriptionId -
|
||||
*/
|
||||
public async getSubscriptionEvents(
|
||||
// @ts-ignore
|
||||
request: GetSubscriptionEvents,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void | GetSubscriptionEvents200Response>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/bus/v1/subscriptions/{subscriptionId}/events`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
subscriptionId: request.path.subscriptionId,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a new event
|
||||
* @param postEventRequest -
|
||||
*/
|
||||
public async postEvent(
|
||||
// @ts-ignore
|
||||
request: PostEvent,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/bus/v1/events`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the subscription exists with the provided configuration
|
||||
* @param subscriptionId -
|
||||
* @param putSubscriptionRequest -
|
||||
*/
|
||||
public async putSubscription(
|
||||
// @ts-ignore
|
||||
request: PutSubscription,
|
||||
options?: RequestOptions,
|
||||
): Promise<TypedResponse<void>> {
|
||||
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
|
||||
|
||||
const uriTemplate = `/bus/v1/subscriptions/{subscriptionId}`;
|
||||
|
||||
const uri = parser.parse(uriTemplate).expand({
|
||||
subscriptionId: request.path.subscriptionId,
|
||||
});
|
||||
|
||||
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
|
||||
},
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(request.body),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './Api.client';
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './apis';
|
||||
export * from './models';
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorError {
|
||||
name: string;
|
||||
message: string;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorRequest {
|
||||
method: string;
|
||||
url: string;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ErrorResponse {
|
||||
statusCode: number;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Event {
|
||||
/**
|
||||
* The topic that the event is published on
|
||||
*/
|
||||
topic: string;
|
||||
/**
|
||||
* The event payload
|
||||
*/
|
||||
payload: any | null;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { Event } from '../models/Event.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface GetSubscriptionEvents200Response {
|
||||
events: Array<Event>;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { ErrorError } from '../models/ErrorError.model';
|
||||
import { ErrorRequest } from '../models/ErrorRequest.model';
|
||||
import { ErrorResponse } from '../models/ErrorResponse.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ModelError {
|
||||
error: ErrorError;
|
||||
request: ErrorRequest;
|
||||
response: ErrorResponse;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
import { Event } from '../models/Event.model';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface PostEventRequest {
|
||||
event: Event;
|
||||
/**
|
||||
* The IDs of subscriptions that have already received this event
|
||||
*/
|
||||
notifiedSubscribers?: Array<string>;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface PutSubscriptionRequest {
|
||||
/**
|
||||
* The topics to subscribe to
|
||||
*/
|
||||
topics: Array<string>;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from '../models/ErrorError.model';
|
||||
export * from '../models/ErrorRequest.model';
|
||||
export * from '../models/ErrorResponse.model';
|
||||
export * from '../models/Event.model';
|
||||
export * from '../models/GetSubscriptionEvents200Response.model';
|
||||
export * from '../models/ModelError.model';
|
||||
export * from '../models/PostEventRequest.model';
|
||||
export * from '../models/PutSubscriptionRequest.model';
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const pluginId = 'events';
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a copy of the DiscoveryApi, to avoid importing core-plugin-api.
|
||||
*/
|
||||
export type DiscoveryApi = {
|
||||
getBaseUrl(pluginId: string): Promise<string>;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a copy of FetchApi, to avoid importing core-plugin-api.
|
||||
*/
|
||||
export type FetchApi = {
|
||||
fetch: typeof fetch;
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './generated';
|
||||
@@ -175,4 +175,4 @@ paths:
|
||||
allowReserved: true
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
additionalProperties: {}
|
||||
|
||||
+3
-4
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
@@ -29,14 +31,11 @@ export type Query = {
|
||||
types?: Array<string>;
|
||||
pageCursor?: string;
|
||||
pageLimit?: number;
|
||||
unknown?: { [key: string]: any };
|
||||
};
|
||||
response: Query200Response | Error;
|
||||
};
|
||||
|
||||
/**
|
||||
* no description
|
||||
*/
|
||||
|
||||
export type EndpointMap = {
|
||||
'#get|/query': Query;
|
||||
};
|
||||
@@ -14,4 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './DefaultApi.server';
|
||||
//
|
||||
|
||||
// ******************************************************************
|
||||
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
|
||||
// ******************************************************************
|
||||
|
||||
export * from './Api.server';
|
||||
|
||||
@@ -253,7 +253,7 @@ export const spec = {
|
||||
allowReserved: true,
|
||||
schema: {
|
||||
type: 'object',
|
||||
additionalProperties: true,
|
||||
additionalProperties: {},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user