types.ts•2.29 kB
export type Workspace = {
id: string;
name: string;
type: string;
};
export type CollectionSummary = {
id: string;
uid: string;
name: string;
owner: string;
};
// Input for creating a collection. The payload must conform to the
// Postman Collection v2 format. The API expects the top-level key to be
// `collection`.
export interface CreateCollectionInput {
/**
* The collection object following the Postman Collection v2 schema. At a
* minimum this should include an `info` object with a `name` field and an
* `item` array of requests or folders.
*/
collection: Record<string, unknown>;
/**
* Optional: ID of the workspace to create the collection in. If omitted the
* collection will be created in your default personal workspace.
*/
workspaceId?: string;
}
// Input for updating an existing collection.
export interface UpdateCollectionInput {
collectionUid: string;
collection: Record<string, unknown>;
}
// Input for reading a request inside a collection.
export interface GetRequestInput {
collectionId: string;
requestId: string;
}
// Input for creating a request inside a collection. The body must include
// a `request` object that follows the Postman Collection v2 specification.
export interface CreateRequestInput {
collectionId: string;
request: Record<string, unknown>;
}
// Input for updating a request inside a collection.
export interface UpdateRequestInput {
collectionId: string;
requestId: string;
request: Record<string, unknown>;
}
// Input for reading a response associated with a collection request.
export interface GetResponseInput {
collectionId: string;
responseId: string;
}
// Input for creating a response (example) for an existing request. You must
// specify the parent request ID in the query string; the API uses this to
// attach the response to the correct request.
export interface CreateResponseInput {
collectionId: string;
requestId: string;
response: Record<string, unknown>;
}
// Input for updating an existing response.
export interface UpdateResponseInput {
collectionId: string;
responseId: string;
response: Record<string, unknown>;
}
// Input for running a monitor. Accepts the monitor UID.
export interface RunMonitorInput {
monitorUid: string;
}