@apideck/portman
Version:
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
47 lines (46 loc) • 2 kB
TypeScript
import { CollectionDefinition, ItemDefinition, ItemGroupDefinition, ResponseDefinition } from 'postman-collection';
import { PostmanApiCollectionResult, PostmanApiService, PostmanApiWorkspaceResult } from './';
import { PostmanRepo } from './PostmanRepo';
type PostmanCache = {
collections: PostmanApiCollectionResult[];
workspaces: PostmanApiWorkspaceResult[];
};
export declare class PostmanSyncService {
state: any;
portmanCollection: CollectionDefinition;
collectionName?: string;
postmanApi: PostmanApiService;
postmanUid?: string;
postmanWorkspaceName?: string;
postmanRepo: PostmanRepo;
cacheFile: string;
cache: PostmanCache;
postmanFastSync: boolean;
postmanRefreshCache: boolean;
syncPostmanCollectionIds: boolean;
constructor({ postmanApi, portmanCollection, postmanUid, postmanWorkspaceName, collectionName, cacheFile, postmanFastSync, postmanRefreshCache, syncPostmanCollectionIds }: {
portmanCollection: CollectionDefinition;
postmanApi?: PostmanApiService;
postmanUid?: string;
postmanWorkspaceName?: string;
collectionName?: string;
cacheFile?: string;
postmanFastSync?: boolean;
postmanRefreshCache?: boolean;
syncPostmanCollectionIds?: boolean;
});
sync(): Promise<string>;
validateState(): Promise<void>;
shouldCreate(): boolean;
shouldUpdate(): boolean;
lookupCollection(): PostmanApiCollectionResult | undefined;
existsInWorkspace(): boolean;
lookupWorkspaceId(): Promise<string | undefined>;
createCollection(): Promise<string>;
updateCollection(): Promise<string>;
deleteCollection(): Promise<string>;
synchronizeCollectionIds(): Promise<void>;
replaceCollectionId(postmanItem: ItemGroupDefinition | ItemDefinition, portmanItems: ItemGroupDefinition): void;
replaceResponsesId(postmanResponseItems: ResponseDefinition[], portmanResponseItems: ResponseDefinition[]): void;
}
export {};