Merge pull request #25198 from backstage/camilaibs/nbs10-rename-url-reader-types
[NBS1.0] Standardize url reader types naming
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
|
||||
Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports.
|
||||
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderSearchResponseFile`
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile`
|
||||
|
||||
@@ -226,15 +226,15 @@ Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=1.28.0-next.3](h
|
||||
|
||||
- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports.
|
||||
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderSearchResponseFile`
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile`
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-auth-node@0.4.14-next.3
|
||||
|
||||
@@ -67,13 +67,13 @@ import { Server } from 'http';
|
||||
import { ServiceRef } from '@backstage/backend-plugin-api';
|
||||
import { TokenManagerService as TokenManager } from '@backstage/backend-plugin-api';
|
||||
import { TransportStreamOptions } from 'winston-transport';
|
||||
import { UrlReaderReadTreeOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadUrlOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderSearchOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderSearchResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadTreeOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadUrlOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceSearchOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceSearchResponse } from '@backstage/backend-plugin-api';
|
||||
import { UserInfoService } from '@backstage/backend-plugin-api';
|
||||
import { V1PodTemplateSpec } from '@kubernetes/client-node';
|
||||
import * as winston from 'winston';
|
||||
|
||||
@@ -170,47 +170,47 @@ export type UrlReaderPredicateTuple = _UrlReaderPredicateTuple;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeOptions` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeOptions` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadTreeOptions = _ReadTreeOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponse` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponse` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadTreeResponse = _ReadTreeResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponseFile` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponseFile` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadTreeResponseFile = _ReadTreeResponseFile;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponseDirOptions` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponseDirOptions` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadTreeResponseDirOptions = _ReadTreeResponseDirOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadUrlOptions` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadUrlOptions` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadUrlOptions = _ReadUrlOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadUrlResponse` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceReadUrlResponse` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type ReadUrlResponse = _ReadUrlResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchOptions` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchOptions` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type SearchOptions = _SearchOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchResponse` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchResponse` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type SearchResponse = _SearchResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchResponseFile` from `@backstage/backend-plugin-api` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchResponseFile` from `@backstage/backend-plugin-api` instead
|
||||
*/
|
||||
export type SearchResponseFile = _SearchResponseFile;
|
||||
/**
|
||||
|
||||
@@ -22,13 +22,13 @@ import { HarnessIntegration } from '@backstage/integration';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { Readable } from 'stream';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadTreeOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadUrlOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderSearchOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderSearchResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadTreeOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadUrlOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceSearchOptions } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceSearchResponse } from '@backstage/backend-plugin-api';
|
||||
|
||||
// @public
|
||||
export class AwsS3UrlReader implements UrlReaderService {
|
||||
@@ -46,15 +46,15 @@ export class AwsS3UrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(): Promise<UrlReaderSearchResponse>;
|
||||
search(): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -75,18 +75,18 @@ export class AzureUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -106,18 +106,18 @@ export class BitbucketCloudUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -137,18 +137,18 @@ export class BitbucketServerUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -169,18 +169,18 @@ export class BitbucketUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -191,14 +191,14 @@ export class FetchUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
read(url: string): Promise<Buffer>;
|
||||
// (undocumented)
|
||||
readTree(): Promise<UrlReaderReadTreeResponse>;
|
||||
readTree(): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(): Promise<UrlReaderSearchResponse>;
|
||||
search(): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -225,15 +225,15 @@ export class GerritUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(): Promise<UrlReaderSearchResponse>;
|
||||
search(): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -253,15 +253,15 @@ export class GiteaUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(): Promise<UrlReaderSearchResponse>;
|
||||
search(): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -282,18 +282,18 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -313,18 +313,18 @@ export class GitlabUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -344,15 +344,15 @@ export class HarnessUrlReader implements UrlReaderService {
|
||||
// (undocumented)
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
// (undocumented)
|
||||
search(): Promise<UrlReaderSearchResponse>;
|
||||
search(): Promise<UrlReaderServiceSearchResponse>;
|
||||
// (undocumented)
|
||||
toString(): string;
|
||||
}
|
||||
@@ -369,17 +369,17 @@ export interface ReadTreeResponseFactory {
|
||||
// (undocumented)
|
||||
fromReadableArray(
|
||||
options: FromReadableArrayOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
fromTarArchive(
|
||||
options: ReadTreeResponseFactoryOptions & {
|
||||
stripFirstDirectory?: boolean;
|
||||
},
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
// (undocumented)
|
||||
fromZipArchive(
|
||||
options: ReadTreeResponseFactoryOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -400,11 +400,11 @@ export class ReadUrlResponseFactory {
|
||||
static fromNodeJSReadable(
|
||||
oldStyleStream: NodeJS.ReadableStream,
|
||||
options?: ReadUrlResponseFactoryFromStreamOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
static fromReadable(
|
||||
stream: Readable,
|
||||
options?: ReadUrlResponseFactoryFromStreamOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
import { ReaderFactory, ReadTreeResponseFactory } from './types';
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
AwsCredentialsManager,
|
||||
@@ -221,8 +221,8 @@ export class AwsCodeCommitUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
// etag and lastModifiedAfter are not supported by the CodeCommit API
|
||||
try {
|
||||
const { path, repositoryName, region, commitSpecifier } = parseUrl(
|
||||
@@ -325,8 +325,8 @@ export class AwsCodeCommitUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
// url: https://eu-west-1.console.aws.amazon.com/codesuite/codecommit/repositories/test-stijn-delete-techdocs/browse?region=eu-west-1
|
||||
try {
|
||||
const { path, repositoryName, region, commitSpecifier } = parseUrl(url);
|
||||
@@ -379,7 +379,7 @@ export class AwsCodeCommitUrlReader implements UrlReaderService {
|
||||
}
|
||||
}
|
||||
|
||||
async search(): Promise<UrlReaderSearchResponse> {
|
||||
async search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('AwsCodeCommitReader does not implement search');
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { ReaderFactory, ReadTreeResponseFactory } from './types';
|
||||
import {
|
||||
@@ -252,8 +252,8 @@ export class AwsS3UrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const { etag, lastModifiedAfter } = options ?? {};
|
||||
|
||||
try {
|
||||
@@ -299,8 +299,8 @@ export class AwsS3UrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
try {
|
||||
const { path, bucket, region } = parseUrl(url, this.integration.config);
|
||||
const s3Client = await this.buildS3Client(
|
||||
@@ -356,7 +356,7 @@ export class AwsS3UrlReader implements UrlReaderService {
|
||||
}
|
||||
}
|
||||
|
||||
async search(): Promise<UrlReaderSearchResponse> {
|
||||
async search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('AwsS3Reader does not implement search');
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
getAzureCommitsUrl,
|
||||
@@ -74,8 +74,8 @@ export class AzureUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
// TODO: etag is not implemented yet.
|
||||
const { signal } = options ?? {};
|
||||
|
||||
@@ -113,8 +113,8 @@ export class AzureUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const { etag, filter, signal } = options ?? {};
|
||||
|
||||
// TODO: Support filepath based reading tree feature like other providers
|
||||
@@ -181,8 +181,8 @@ export class AzureUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const treeUrl = new URL(url);
|
||||
|
||||
const path = treeUrl.searchParams.get('path');
|
||||
|
||||
+12
-12
@@ -16,12 +16,12 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import {
|
||||
@@ -78,8 +78,8 @@ export class BitbucketCloudUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const { etag, lastModifiedAfter, signal } = options ?? {};
|
||||
const bitbucketUrl = getBitbucketCloudFileFetchUrl(
|
||||
url,
|
||||
@@ -133,8 +133,8 @@ export class BitbucketCloudUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
|
||||
const lastCommitShortHash = await this.getLastCommitShortHash(url);
|
||||
@@ -168,8 +168,8 @@ export class BitbucketCloudUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
const matcher = new Minimatch(filepath);
|
||||
|
||||
|
||||
+12
-12
@@ -16,12 +16,12 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import {
|
||||
@@ -69,8 +69,8 @@ export class BitbucketServerUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const { etag, lastModifiedAfter, signal } = options ?? {};
|
||||
const bitbucketUrl = getBitbucketServerFileFetchUrl(
|
||||
url,
|
||||
@@ -124,8 +124,8 @@ export class BitbucketServerUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
|
||||
const lastCommitShortHash = await this.getLastCommitShortHash(url);
|
||||
@@ -159,8 +159,8 @@ export class BitbucketServerUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
const matcher = new Minimatch(filepath);
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import {
|
||||
@@ -94,8 +94,8 @@ export class BitbucketUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const { etag, lastModifiedAfter, signal } = options ?? {};
|
||||
const bitbucketUrl = getBitbucketFileFetchUrl(url, this.integration.config);
|
||||
const requestOptions = getBitbucketRequestOptions(this.integration.config);
|
||||
@@ -144,8 +144,8 @@ export class BitbucketUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
|
||||
const lastCommitShortHash = await this.getLastCommitShortHash(url);
|
||||
@@ -179,8 +179,8 @@ export class BitbucketUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
const matcher = new Minimatch(filepath);
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import fetch, { Response } from 'node-fetch';
|
||||
@@ -121,8 +121,8 @@ export class FetchUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
let response: Response;
|
||||
try {
|
||||
response = await fetch(url, {
|
||||
@@ -165,11 +165,11 @@ export class FetchUrlReader implements UrlReaderService {
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
async readTree(): Promise<UrlReaderReadTreeResponse> {
|
||||
async readTree(): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
throw new Error('FetchUrlReader does not implement readTree');
|
||||
}
|
||||
|
||||
async search(): Promise<UrlReaderSearchResponse> {
|
||||
async search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('FetchUrlReader does not implement search');
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { Base64Decode } from 'base64-stream';
|
||||
import fetch, { Response } from 'node-fetch';
|
||||
@@ -88,8 +88,8 @@ export class GerritUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const apiUrl = getGerritFileContentsApiUrl(this.integration.config, url);
|
||||
let response: Response;
|
||||
try {
|
||||
@@ -133,8 +133,8 @@ export class GerritUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const apiUrl = getGerritBranchApiUrl(this.integration.config, url);
|
||||
let response: Response;
|
||||
try {
|
||||
@@ -165,7 +165,7 @@ export class GerritUrlReader implements UrlReaderService {
|
||||
return this.readTreeFromGitiles(url, branchInfo.revision, options);
|
||||
}
|
||||
|
||||
async search(): Promise<UrlReaderSearchResponse> {
|
||||
async search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('GerritReader does not implement search');
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ export class GerritUrlReader implements UrlReaderService {
|
||||
private async readTreeFromGitiles(
|
||||
url: string,
|
||||
revision: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
) {
|
||||
const { branch, filePath, project } = parseGerritGitilesUrl(
|
||||
this.integration.config,
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
getGiteaFileContentsUrl,
|
||||
@@ -74,8 +74,8 @@ export class GiteaUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
let response: Response;
|
||||
const blobUrl = getGiteaFileContentsUrl(this.integration.config, url);
|
||||
|
||||
@@ -126,8 +126,8 @@ export class GiteaUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const lastCommitHash = await this.getLastCommitHash(url);
|
||||
if (options?.etag && options.etag === lastCommitHash) {
|
||||
throw new NotModifiedError();
|
||||
@@ -156,7 +156,7 @@ export class GiteaUrlReader implements UrlReaderService {
|
||||
});
|
||||
}
|
||||
|
||||
search(): Promise<UrlReaderSearchResponse> {
|
||||
search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('GiteaUrlReader search not implemented.');
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderSearchResponseFile,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
UrlReaderServiceSearchResponseFile,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
getGithubFileFetchUrl,
|
||||
@@ -112,8 +112,8 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const credentials = await this.getCredentials(url, options);
|
||||
|
||||
const ghUrl = getGithubFileFetchUrl(
|
||||
@@ -148,8 +148,8 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const repoDetails = await this.getRepoDetails(url);
|
||||
const commitSha = repoDetails.commitSha;
|
||||
|
||||
@@ -177,8 +177,8 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const repoDetails = await this.getRepoDetails(url);
|
||||
const commitSha = repoDetails.commitSha;
|
||||
|
||||
@@ -211,8 +211,8 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
sha: string,
|
||||
subpath: string,
|
||||
init: RequestInit,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
// archive_url looks like "https://api.github.com/repos/owner/repo/{archive_format}{/ref}"
|
||||
const archive = await this.fetchResponse(
|
||||
archiveUrl
|
||||
@@ -238,7 +238,7 @@ export class GithubUrlReader implements UrlReaderService {
|
||||
sha: string,
|
||||
query: string,
|
||||
init: RequestInit,
|
||||
): Promise<UrlReaderSearchResponseFile[]> {
|
||||
): Promise<UrlReaderServiceSearchResponseFile[]> {
|
||||
function pathToUrl(path: string): string {
|
||||
// TODO(freben): Use the integration package facility for this instead
|
||||
// pathname starts as /backstage/backstage/blob/master/<path>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
getGitLabFileFetchUrl,
|
||||
@@ -69,8 +69,8 @@ export class GitlabUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const { etag, lastModifiedAfter, signal } = options ?? {};
|
||||
const builtUrl = await this.getGitlabFetchUrl(url);
|
||||
|
||||
@@ -118,8 +118,8 @@ export class GitlabUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const { etag, signal } = options ?? {};
|
||||
const { ref, full_name, filepath } = parseGitUrl(url);
|
||||
|
||||
@@ -237,8 +237,8 @@ export class GitlabUrlReader implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const { filepath } = parseGitUrl(url);
|
||||
const staticPart = this.getStaticPart(filepath);
|
||||
const matcher = new Minimatch(filepath);
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
import * as GoogleCloud from '@google-cloud/storage';
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { ReaderFactory } from './types';
|
||||
import getRawBody from 'raw-body';
|
||||
@@ -106,18 +106,18 @@ export class GoogleGcsUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
_options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
_options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
// TODO etag is not implemented yet.
|
||||
const stream = this.readStreamFromUrl(url);
|
||||
return ReadUrlResponseFactory.fromReadable(stream);
|
||||
}
|
||||
|
||||
async readTree(): Promise<UrlReaderReadTreeResponse> {
|
||||
async readTree(): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
throw new Error('GcsUrlReader does not implement readTree');
|
||||
}
|
||||
|
||||
async search(url: string): Promise<UrlReaderSearchResponse> {
|
||||
async search(url: string): Promise<UrlReaderServiceSearchResponse> {
|
||||
const { bucket, key: pattern } = parseURL(url);
|
||||
|
||||
if (!pattern.endsWith('*') || pattern.indexOf('*') !== pattern.length - 1) {
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
getHarnessRequestOptions,
|
||||
@@ -75,8 +75,8 @@ export class HarnessUrlReader implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
let response: Response;
|
||||
const blobUrl = getHarnessFileContentsUrl(this.integration.config, url);
|
||||
|
||||
@@ -123,8 +123,8 @@ export class HarnessUrlReader implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const lastCommitHash = await this.getLastCommitHash(url);
|
||||
|
||||
if (options?.etag && options.etag === lastCommitHash) {
|
||||
@@ -154,7 +154,7 @@ export class HarnessUrlReader implements UrlReaderService {
|
||||
});
|
||||
}
|
||||
|
||||
search(): Promise<UrlReaderSearchResponse> {
|
||||
search(): Promise<UrlReaderServiceSearchResponse> {
|
||||
throw new Error('HarnessUrlReader search not implemented.');
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { ConflictError } from '@backstage/errors';
|
||||
import { UrlReaderReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import getRawBody from 'raw-body';
|
||||
import { Readable } from 'stream';
|
||||
import { ReadUrlResponseFactoryFromStreamOptions } from './types';
|
||||
@@ -33,7 +33,7 @@ export class ReadUrlResponseFactory {
|
||||
static async fromReadable(
|
||||
stream: Readable,
|
||||
options?: ReadUrlResponseFactoryFromStreamOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
// Reference to eventual buffer enables callers to call buffer() multiple
|
||||
// times without consequence.
|
||||
let buffer: Promise<Buffer>;
|
||||
@@ -69,7 +69,7 @@ export class ReadUrlResponseFactory {
|
||||
static async fromNodeJSReadable(
|
||||
oldStyleStream: NodeJS.ReadableStream,
|
||||
options?: ReadUrlResponseFactoryFromStreamOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const readable = Readable.from(oldStyleStream);
|
||||
return ReadUrlResponseFactory.fromReadable(readable, options);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
UrlReaderService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { NotAllowedError } from '@backstage/errors';
|
||||
@@ -47,8 +47,8 @@ export class UrlReaderPredicateMux implements UrlReaderService {
|
||||
|
||||
async readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse> {
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse> {
|
||||
const parsed = new URL(url);
|
||||
|
||||
for (const { predicate, reader } of this.readers) {
|
||||
@@ -62,8 +62,8 @@ export class UrlReaderPredicateMux implements UrlReaderService {
|
||||
|
||||
async readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
const parsed = new URL(url);
|
||||
|
||||
for (const { predicate, reader } of this.readers) {
|
||||
@@ -77,8 +77,8 @@ export class UrlReaderPredicateMux implements UrlReaderService {
|
||||
|
||||
async search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse> {
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse> {
|
||||
const parsed = new URL(url);
|
||||
|
||||
for (const { predicate, reader } of this.readers) {
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ import {
|
||||
import { TarArchiveResponse } from './TarArchiveResponse';
|
||||
import { ZipArchiveResponse } from './ZipArchiveResponse';
|
||||
import { ReadableArrayResponse } from './ReadableArrayResponse';
|
||||
import { UrlReaderReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
import { UrlReaderServiceReadTreeResponse } from '@backstage/backend-plugin-api';
|
||||
|
||||
export class DefaultReadTreeResponseFactory implements ReadTreeResponseFactory {
|
||||
static create(options: { config: Config }): DefaultReadTreeResponseFactory {
|
||||
@@ -40,7 +40,7 @@ export class DefaultReadTreeResponseFactory implements ReadTreeResponseFactory {
|
||||
options: ReadTreeResponseFactoryOptions & {
|
||||
stripFirstDirectory?: boolean;
|
||||
},
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
return new TarArchiveResponse(
|
||||
options.stream,
|
||||
options.subpath ?? '',
|
||||
@@ -53,7 +53,7 @@ export class DefaultReadTreeResponseFactory implements ReadTreeResponseFactory {
|
||||
|
||||
async fromZipArchive(
|
||||
options: ReadTreeResponseFactoryOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
return new ZipArchiveResponse(
|
||||
options.stream,
|
||||
options.subpath ?? '',
|
||||
@@ -65,7 +65,7 @@ export class DefaultReadTreeResponseFactory implements ReadTreeResponseFactory {
|
||||
|
||||
async fromReadableArray(
|
||||
options: FromReadableArrayOptions,
|
||||
): Promise<UrlReaderReadTreeResponse> {
|
||||
): Promise<UrlReaderServiceReadTreeResponse> {
|
||||
return new ReadableArrayResponse(options, this.workDir, '');
|
||||
}
|
||||
}
|
||||
|
||||
+9
-7
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadTreeResponseDirOptions,
|
||||
UrlReaderReadTreeResponseFile,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadTreeResponseDirOptions,
|
||||
UrlReaderServiceReadTreeResponseFile,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import concatStream from 'concat-stream';
|
||||
import platformPath, { dirname } from 'path';
|
||||
@@ -33,7 +33,7 @@ const pipeline = promisify(pipelineCb);
|
||||
/**
|
||||
* Wraps a array of Readable objects into a tree response reader.
|
||||
*/
|
||||
export class ReadableArrayResponse implements UrlReaderReadTreeResponse {
|
||||
export class ReadableArrayResponse implements UrlReaderServiceReadTreeResponse {
|
||||
private read = false;
|
||||
|
||||
constructor(
|
||||
@@ -52,10 +52,10 @@ export class ReadableArrayResponse implements UrlReaderReadTreeResponse {
|
||||
this.read = true;
|
||||
}
|
||||
|
||||
async files(): Promise<UrlReaderReadTreeResponseFile[]> {
|
||||
async files(): Promise<UrlReaderServiceReadTreeResponseFile[]> {
|
||||
this.onlyOnce();
|
||||
|
||||
const files = Array<UrlReaderReadTreeResponseFile>();
|
||||
const files = Array<UrlReaderServiceReadTreeResponseFile>();
|
||||
|
||||
for (let i = 0; i < this.stream.length; i++) {
|
||||
if (!this.stream[i].path.endsWith('/')) {
|
||||
@@ -86,7 +86,9 @@ export class ReadableArrayResponse implements UrlReaderReadTreeResponse {
|
||||
}
|
||||
}
|
||||
|
||||
async dir(options?: UrlReaderReadTreeResponseDirOptions): Promise<string> {
|
||||
async dir(
|
||||
options?: UrlReaderServiceReadTreeResponseDirOptions,
|
||||
): Promise<string> {
|
||||
this.onlyOnce();
|
||||
|
||||
const dir =
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadTreeResponseDirOptions,
|
||||
UrlReaderReadTreeResponseFile,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadTreeResponseDirOptions,
|
||||
UrlReaderServiceReadTreeResponseFile,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import concatStream from 'concat-stream';
|
||||
import fs from 'fs-extra';
|
||||
@@ -35,7 +35,7 @@ const pipeline = promisify(pipelineCb);
|
||||
/**
|
||||
* Wraps a tar archive stream into a tree response reader.
|
||||
*/
|
||||
export class TarArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
export class TarArchiveResponse implements UrlReaderServiceReadTreeResponse {
|
||||
private read = false;
|
||||
|
||||
constructor(
|
||||
@@ -68,10 +68,10 @@ export class TarArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
this.read = true;
|
||||
}
|
||||
|
||||
async files(): Promise<UrlReaderReadTreeResponseFile[]> {
|
||||
async files(): Promise<UrlReaderServiceReadTreeResponseFile[]> {
|
||||
this.onlyOnce();
|
||||
|
||||
const files = Array<UrlReaderReadTreeResponseFile>();
|
||||
const files = Array<UrlReaderServiceReadTreeResponseFile>();
|
||||
const parser = new TarParseStream();
|
||||
|
||||
parser.on('entry', (entry: ReadEntry & Readable) => {
|
||||
@@ -142,7 +142,9 @@ export class TarArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
}
|
||||
}
|
||||
|
||||
async dir(options?: UrlReaderReadTreeResponseDirOptions): Promise<string> {
|
||||
async dir(
|
||||
options?: UrlReaderServiceReadTreeResponseDirOptions,
|
||||
): Promise<string> {
|
||||
this.onlyOnce();
|
||||
|
||||
const dir =
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadTreeResponseDirOptions,
|
||||
UrlReaderReadTreeResponseFile,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadTreeResponseDirOptions,
|
||||
UrlReaderServiceReadTreeResponseFile,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import archiver from 'archiver';
|
||||
import yauzl, { Entry } from 'yauzl';
|
||||
@@ -30,7 +30,7 @@ import { resolveSafeChildPath } from '@backstage/backend-plugin-api';
|
||||
/**
|
||||
* Wraps a zip archive stream into a tree response reader.
|
||||
*/
|
||||
export class ZipArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
export class ZipArchiveResponse implements UrlReaderServiceReadTreeResponse {
|
||||
private read = false;
|
||||
|
||||
constructor(
|
||||
@@ -141,9 +141,9 @@ export class ZipArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
});
|
||||
}
|
||||
|
||||
async files(): Promise<UrlReaderReadTreeResponseFile[]> {
|
||||
async files(): Promise<UrlReaderServiceReadTreeResponseFile[]> {
|
||||
this.onlyOnce();
|
||||
const files = Array<UrlReaderReadTreeResponseFile>();
|
||||
const files = Array<UrlReaderServiceReadTreeResponseFile>();
|
||||
const temporary = await this.streamToTemporaryFile(this.stream);
|
||||
|
||||
await this.forEveryZipEntry(temporary.fileName, async (entry, content) => {
|
||||
@@ -184,7 +184,9 @@ export class ZipArchiveResponse implements UrlReaderReadTreeResponse {
|
||||
return archive;
|
||||
}
|
||||
|
||||
async dir(options?: UrlReaderReadTreeResponseDirOptions): Promise<string> {
|
||||
async dir(
|
||||
options?: UrlReaderServiceReadTreeResponseDirOptions,
|
||||
): Promise<string> {
|
||||
this.onlyOnce();
|
||||
const dir =
|
||||
options?.targetDir ??
|
||||
|
||||
@@ -18,7 +18,7 @@ import { Readable } from 'stream';
|
||||
import { Config } from '@backstage/config';
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
LoggerService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
@@ -110,11 +110,11 @@ export interface ReadTreeResponseFactory {
|
||||
*/
|
||||
stripFirstDirectory?: boolean;
|
||||
},
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
fromZipArchive(
|
||||
options: ReadTreeResponseFactoryOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
fromReadableArray(
|
||||
options: FromReadableArrayOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
- 9bdc3e8: In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken.
|
||||
- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports.
|
||||
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderSearchResponseFile`
|
||||
- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions`
|
||||
- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse`
|
||||
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions`
|
||||
- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile`
|
||||
- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse`
|
||||
- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions`
|
||||
- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions`
|
||||
- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse`
|
||||
- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile`
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-auth-node@0.4.14-next.3
|
||||
|
||||
@@ -467,22 +467,23 @@ export function readSchedulerServiceTaskScheduleDefinitionFromConfig(
|
||||
): SchedulerServiceTaskScheduleDefinition;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadTreeOptions = UrlReaderReadTreeOptions;
|
||||
export type ReadTreeOptions = UrlReaderServiceReadTreeOptions;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadTreeResponse = UrlReaderReadTreeResponse;
|
||||
export type ReadTreeResponse = UrlReaderServiceReadTreeResponse;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadTreeResponseDirOptions = UrlReaderReadTreeResponseDirOptions;
|
||||
export type ReadTreeResponseDirOptions =
|
||||
UrlReaderServiceReadTreeResponseDirOptions;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadTreeResponseFile = UrlReaderReadTreeResponseFile;
|
||||
export type ReadTreeResponseFile = UrlReaderServiceReadTreeResponseFile;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadUrlOptions = UrlReaderReadUrlOptions;
|
||||
export type ReadUrlOptions = UrlReaderServiceReadUrlOptions;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ReadUrlResponse = UrlReaderReadUrlResponse;
|
||||
export type ReadUrlResponse = UrlReaderServiceReadUrlResponse;
|
||||
|
||||
// @public
|
||||
export function resolvePackagePath(name: string, ...paths: string[]): string;
|
||||
@@ -587,13 +588,13 @@ export interface SchedulerServiceTaskScheduleDefinitionConfig {
|
||||
}
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type SearchOptions = UrlReaderSearchOptions;
|
||||
export type SearchOptions = UrlReaderServiceSearchOptions;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type SearchResponse = UrlReaderSearchResponse;
|
||||
export type SearchResponse = UrlReaderServiceSearchResponse;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type SearchResponseFile = UrlReaderSearchResponseFile;
|
||||
export type SearchResponseFile = UrlReaderServiceSearchResponseFile;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ServiceFactory<
|
||||
@@ -639,7 +640,23 @@ export interface TokenManagerService {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadTreeOptions = {
|
||||
export interface UrlReaderService {
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UrlReaderServiceReadTreeOptions = {
|
||||
filter?(
|
||||
path: string,
|
||||
info?: {
|
||||
@@ -652,27 +669,27 @@ export type UrlReaderReadTreeOptions = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadTreeResponse = {
|
||||
files(): Promise<UrlReaderReadTreeResponseFile[]>;
|
||||
export type UrlReaderServiceReadTreeResponse = {
|
||||
files(): Promise<UrlReaderServiceReadTreeResponseFile[]>;
|
||||
archive(): Promise<NodeJS.ReadableStream>;
|
||||
dir(options?: UrlReaderReadTreeResponseDirOptions): Promise<string>;
|
||||
dir(options?: UrlReaderServiceReadTreeResponseDirOptions): Promise<string>;
|
||||
etag: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadTreeResponseDirOptions = {
|
||||
export type UrlReaderServiceReadTreeResponseDirOptions = {
|
||||
targetDir?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadTreeResponseFile = {
|
||||
export type UrlReaderServiceReadTreeResponseFile = {
|
||||
path: string;
|
||||
content(): Promise<Buffer>;
|
||||
lastModifiedAt?: Date;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadUrlOptions = {
|
||||
export type UrlReaderServiceReadUrlOptions = {
|
||||
etag?: string;
|
||||
lastModifiedAfter?: Date;
|
||||
signal?: AbortSignal;
|
||||
@@ -680,7 +697,7 @@ export type UrlReaderReadUrlOptions = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderReadUrlResponse = {
|
||||
export type UrlReaderServiceReadUrlResponse = {
|
||||
buffer(): Promise<Buffer>;
|
||||
stream?(): Readable;
|
||||
etag?: string;
|
||||
@@ -688,41 +705,25 @@ export type UrlReaderReadUrlResponse = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderSearchOptions = {
|
||||
export type UrlReaderServiceSearchOptions = {
|
||||
etag?: string;
|
||||
signal?: AbortSignal;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderSearchResponse = {
|
||||
files: UrlReaderSearchResponseFile[];
|
||||
export type UrlReaderServiceSearchResponse = {
|
||||
files: UrlReaderServiceSearchResponseFile[];
|
||||
etag: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UrlReaderSearchResponseFile = {
|
||||
export type UrlReaderServiceSearchResponseFile = {
|
||||
url: string;
|
||||
content(): Promise<Buffer>;
|
||||
lastModifiedAt?: Date;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UrlReaderService {
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UserInfoService {
|
||||
getUserInfo(credentials: BackstageCredentials): Promise<BackstageUserInfo>;
|
||||
|
||||
@@ -29,24 +29,24 @@ export interface UrlReaderService {
|
||||
*/
|
||||
readUrl(
|
||||
url: string,
|
||||
options?: UrlReaderReadUrlOptions,
|
||||
): Promise<UrlReaderReadUrlResponse>;
|
||||
options?: UrlReaderServiceReadUrlOptions,
|
||||
): Promise<UrlReaderServiceReadUrlResponse>;
|
||||
|
||||
/**
|
||||
* Reads a full or partial file tree.
|
||||
*/
|
||||
readTree(
|
||||
url: string,
|
||||
options?: UrlReaderReadTreeOptions,
|
||||
): Promise<UrlReaderReadTreeResponse>;
|
||||
options?: UrlReaderServiceReadTreeOptions,
|
||||
): Promise<UrlReaderServiceReadTreeResponse>;
|
||||
|
||||
/**
|
||||
* Searches for a file in a tree using a glob pattern.
|
||||
*/
|
||||
search(
|
||||
url: string,
|
||||
options?: UrlReaderSearchOptions,
|
||||
): Promise<UrlReaderSearchResponse>;
|
||||
options?: UrlReaderServiceSearchOptions,
|
||||
): Promise<UrlReaderServiceSearchResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,7 @@ export interface UrlReaderService {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadUrlOptions = {
|
||||
export type UrlReaderServiceReadUrlOptions = {
|
||||
/**
|
||||
* An ETag which can be provided to check whether a
|
||||
* {@link UrlReaderService.readUrl} response has changed from a previous execution.
|
||||
@@ -122,7 +122,7 @@ export type UrlReaderReadUrlOptions = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadUrlResponse = {
|
||||
export type UrlReaderServiceReadUrlResponse = {
|
||||
/**
|
||||
* Returns the data that was read from the remote URL.
|
||||
*/
|
||||
@@ -157,7 +157,7 @@ export type UrlReaderReadUrlResponse = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadTreeOptions = {
|
||||
export type UrlReaderServiceReadTreeOptions = {
|
||||
/**
|
||||
* A filter that can be used to select which files should be included.
|
||||
*
|
||||
@@ -217,11 +217,11 @@ export type UrlReaderReadTreeOptions = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Options that control {@link UrlReaderReadTreeResponse.dir} execution.
|
||||
* Options that control {@link UrlReaderServiceReadTreeResponse.dir} execution.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadTreeResponseDirOptions = {
|
||||
export type UrlReaderServiceReadTreeResponseDirOptions = {
|
||||
/**
|
||||
* The directory to write files to.
|
||||
*
|
||||
@@ -237,12 +237,12 @@ export type UrlReaderReadTreeResponseDirOptions = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadTreeResponse = {
|
||||
export type UrlReaderServiceReadTreeResponse = {
|
||||
/**
|
||||
* Returns an array of all the files inside the tree, and corresponding
|
||||
* functions to read their content.
|
||||
*/
|
||||
files(): Promise<UrlReaderReadTreeResponseFile[]>;
|
||||
files(): Promise<UrlReaderServiceReadTreeResponseFile[]>;
|
||||
|
||||
/**
|
||||
* Returns the tree contents as a binary archive, using a stream.
|
||||
@@ -255,7 +255,7 @@ export type UrlReaderReadTreeResponse = {
|
||||
*
|
||||
* **NOTE**: It is the responsibility of the caller to remove the directory after use.
|
||||
*/
|
||||
dir(options?: UrlReaderReadTreeResponseDirOptions): Promise<string>;
|
||||
dir(options?: UrlReaderServiceReadTreeResponseDirOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* Etag returned by content provider.
|
||||
@@ -272,7 +272,7 @@ export type UrlReaderReadTreeResponse = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderReadTreeResponseFile = {
|
||||
export type UrlReaderServiceReadTreeResponseFile = {
|
||||
/**
|
||||
* The filepath of the data.
|
||||
*/
|
||||
@@ -294,7 +294,7 @@ export type UrlReaderReadTreeResponseFile = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderSearchOptions = {
|
||||
export type UrlReaderServiceSearchOptions = {
|
||||
/**
|
||||
* An etag can be provided to check whether the search response has changed from a previous execution.
|
||||
*
|
||||
@@ -335,11 +335,11 @@ export type UrlReaderSearchOptions = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderSearchResponse = {
|
||||
export type UrlReaderServiceSearchResponse = {
|
||||
/**
|
||||
* The files that matched the search query.
|
||||
*/
|
||||
files: UrlReaderSearchResponseFile[];
|
||||
files: UrlReaderServiceSearchResponseFile[];
|
||||
|
||||
/**
|
||||
* A unique identifier of the current remote tree, usually the commit SHA or etag from the target.
|
||||
@@ -352,7 +352,7 @@ export type UrlReaderSearchResponse = {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UrlReaderSearchResponseFile = {
|
||||
export type UrlReaderServiceSearchResponseFile = {
|
||||
/**
|
||||
* The full URL to the file.
|
||||
*/
|
||||
@@ -371,46 +371,47 @@ export type UrlReaderSearchResponseFile = {
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeOptions` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeOptions` instead
|
||||
*/
|
||||
export type ReadTreeOptions = UrlReaderReadTreeOptions;
|
||||
export type ReadTreeOptions = UrlReaderServiceReadTreeOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponse` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponse` instead
|
||||
*/
|
||||
export type ReadTreeResponse = UrlReaderReadTreeResponse;
|
||||
export type ReadTreeResponse = UrlReaderServiceReadTreeResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponseDirOptions` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponseDirOptions` instead
|
||||
*/
|
||||
export type ReadTreeResponseDirOptions = UrlReaderReadTreeResponseDirOptions;
|
||||
export type ReadTreeResponseDirOptions =
|
||||
UrlReaderServiceReadTreeResponseDirOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadTreeResponseFile` instead
|
||||
* @deprecated Use `UrlReaderServiceReadTreeResponseFile` instead
|
||||
*/
|
||||
export type ReadTreeResponseFile = UrlReaderReadTreeResponseFile;
|
||||
export type ReadTreeResponseFile = UrlReaderServiceReadTreeResponseFile;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadUrlResponse` instead
|
||||
* @deprecated Use `UrlReaderServiceReadUrlResponse` instead
|
||||
*/
|
||||
export type ReadUrlResponse = UrlReaderReadUrlResponse;
|
||||
export type ReadUrlResponse = UrlReaderServiceReadUrlResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderReadUrlOptions` instead
|
||||
* @deprecated Use `UrlReaderServiceReadUrlOptions` instead
|
||||
*/
|
||||
export type ReadUrlOptions = UrlReaderReadUrlOptions;
|
||||
export type ReadUrlOptions = UrlReaderServiceReadUrlOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchOptions` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchOptions` instead
|
||||
*/
|
||||
export type SearchOptions = UrlReaderSearchOptions;
|
||||
export type SearchOptions = UrlReaderServiceSearchOptions;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchResponse` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchResponse` instead
|
||||
*/
|
||||
export type SearchResponse = UrlReaderSearchResponse;
|
||||
export type SearchResponse = UrlReaderServiceSearchResponse;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `UrlReaderSearchResponseFile` instead
|
||||
* @deprecated Use `UrlReaderServiceSearchResponseFile` instead
|
||||
*/
|
||||
export type SearchResponseFile = UrlReaderSearchResponseFile;
|
||||
export type SearchResponseFile = UrlReaderServiceSearchResponseFile;
|
||||
|
||||
@@ -74,15 +74,15 @@ export type {
|
||||
SearchOptions,
|
||||
SearchResponse,
|
||||
SearchResponseFile,
|
||||
UrlReaderReadTreeOptions,
|
||||
UrlReaderReadTreeResponse,
|
||||
UrlReaderReadTreeResponseDirOptions,
|
||||
UrlReaderReadTreeResponseFile,
|
||||
UrlReaderReadUrlResponse,
|
||||
UrlReaderReadUrlOptions,
|
||||
UrlReaderSearchOptions,
|
||||
UrlReaderSearchResponse,
|
||||
UrlReaderSearchResponseFile,
|
||||
UrlReaderServiceReadTreeOptions,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
UrlReaderServiceReadTreeResponseDirOptions,
|
||||
UrlReaderServiceReadTreeResponseFile,
|
||||
UrlReaderServiceReadUrlResponse,
|
||||
UrlReaderServiceReadUrlOptions,
|
||||
UrlReaderServiceSearchOptions,
|
||||
UrlReaderServiceSearchResponse,
|
||||
UrlReaderServiceSearchResponseFile,
|
||||
UrlReaderService,
|
||||
} from './UrlReaderService';
|
||||
export type { BackstageUserInfo, UserInfoService } from './UserInfoService';
|
||||
|
||||
Reference in New Issue
Block a user