@apideck/portman
Version:
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
45 lines (44 loc) • 1.46 kB
TypeScript
import * as Either from 'fp-ts/lib/Either';
import { CollectionDefinition } from 'postman-collection';
export type PostmanApiWorkspaceResult = {
id: string;
name: string;
type: string;
};
export type PostmanApiWorkspaceDetailResult = {
id: string;
name: string;
type: string;
description: string;
createdAt: string;
updatedAt: string;
collections: [
{
id: string;
uid: string;
name: string;
}
];
};
export type PostmanApiCollectionResult = {
id: string;
uid: string;
name: string;
owner: string;
isPublic: boolean;
createdAt: string;
updatedAt: string;
};
export declare class PostmanApiService {
private baseUrl;
private apiKey;
constructor();
getWorkspaces(): Promise<Either.Either<string, PostmanApiWorkspaceResult[]>>;
getWorkspace(id: string): Promise<Either.Either<string, PostmanApiWorkspaceDetailResult>>;
getCollections(): Promise<Either.Either<string, PostmanApiCollectionResult[]>>;
getCollection(collectionId: string): Promise<Either.Either<string, CollectionDefinition>>;
createCollection(collection: CollectionDefinition, workspaceId?: string): Promise<string>;
updateCollection(collection: CollectionDefinition, postmanUid: string, workspaceId?: string): Promise<string>;
deleteCollection(postmanUid: string): Promise<string>;
isGuid(value: string | undefined): boolean;
}