New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

replicate-api

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replicate-api - npm Package Compare versions

Comparing version
0.4.4
to
0.4.5
+1
-1
dist/cancelPrediction.d.ts
import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
export declare type CancelPredictionOptions = {
export type CancelPredictionOptions = {
/** The id of a prediction */

@@ -4,0 +4,0 @@ id: string;

import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
import { ModelNameOptions } from "./predict";
export declare type ResolveModelOptions = ModelNameOptions & ReplicateRequestOptions;
export declare type ModelVersionResponse = {
export type ResolveModelOptions = ModelNameOptions & ReplicateRequestOptions;
export type ModelVersionResponse = {
id: string;

@@ -6,0 +6,0 @@ created_at: string;

import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
export declare type GetPredictionOptions = {
export type GetPredictionOptions = {
/** The ID of a prediction */

@@ -4,0 +4,0 @@ id: string;

import { ReplicateRequestOptions } from "./makeApiRequest";
export declare type PredictionStatus = "starting" | "processing" | "succeeded" | "failed" | "canceled";
export declare type PredictionResponse = {
export type PredictionStatus = "starting" | "processing" | "succeeded" | "failed" | "canceled";
export type PredictionResponse = {
id: string;

@@ -27,3 +27,3 @@ version: string;

*/
export declare type PredictionState = {
export type PredictionState = {
/** The id of this prediction */

@@ -30,0 +30,0 @@ id: string;

import { PredictionResponse, PredictionState } from "./convertPrediction";
import { ReplicateRequestOptions } from "./makeApiRequest";
/** List does not return full predictions. This is the type for those response elements */
export declare type ShallowPredictionResponse = Pick<PredictionResponse, "id" | "version" | "created_at" | "started_at" | "completed_at" | "status">;
export type ShallowPredictionResponse = Pick<PredictionResponse, "id" | "version" | "created_at" | "started_at" | "completed_at" | "status">;
/** Status of a prediction without the actual results

@@ -9,3 +9,3 @@ *

*/
export declare type ShallowPredictionState = Pick<PredictionState, "id" | "version" | "createdAt" | "startedAt" | "completedAt" | "status" | "get" | "cancel" | "poll">;
export type ShallowPredictionState = Pick<PredictionState, "id" | "version" | "createdAt" | "startedAt" | "completedAt" | "status" | "get" | "cancel" | "poll">;
/** Convert prediction list entries from replicate to a more idiomatic TypeScript object.

@@ -12,0 +12,0 @@ *

/** Interface of a fetch function. Compatible with the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) */
export declare type FetchFunction = (url: string, config: Record<string, any>) => Promise<{
export type FetchFunction = (url: string, config: Record<string, any>) => Promise<{
json: () => Promise<any>;

@@ -8,3 +8,3 @@ ok: boolean;

/** Basic options for every request */
export declare type ReplicateRequestOptions = {
export type ReplicateRequestOptions = {
/** Use a custom fetch function. Defaults to the native fetch or `node-fetch` */

@@ -11,0 +11,0 @@ fetch?: FetchFunction;

import { ShallowPredictionState } from "./helpers/convertShallowPrediction";
import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
export declare type PagedRequestOptions = {
export type PagedRequestOptions = {
/** Set to true to get all results */

@@ -9,4 +9,4 @@ all?: boolean;

};
export declare type ListPredictionsOptions = PagedRequestOptions & ReplicateRequestOptions;
export declare type ListOfPredictions = {
export type ListPredictionsOptions = PagedRequestOptions & ReplicateRequestOptions;
export type ListOfPredictions = {
/** Up to 100 predictions */

@@ -13,0 +13,0 @@ predictions: ShallowPredictionState[];

@@ -5,4 +5,4 @@ import { ReplicateRequestOptions } from "./helpers/makeApiRequest";

/** Options for `listVersions` */
export declare type ListVersionsOptions = PagedRequestOptions & ModelNameOptions & ReplicateRequestOptions;
export declare type ModelVersion = {
export type ListVersionsOptions = PagedRequestOptions & ModelNameOptions & ReplicateRequestOptions;
export type ModelVersion = {
id: string;

@@ -13,3 +13,3 @@ createdAt: Date;

};
export declare type ListOfVersions = {
export type ListOfVersions = {
/** The id of the latest version */

@@ -16,0 +16,0 @@ version: string | undefined;

import { PredictionState } from "./helpers/convertPrediction";
import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
export declare type PollPredictionOptions = {
export type PollPredictionOptions = {
/** The id of a prediction */

@@ -5,0 +5,0 @@ id: string;

import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
/** Option for the model name; e.g. `stability-ai/stable-diffusion` */
export declare type ModelNameOptions = {
export type ModelNameOptions = {
/** The name of the model; e.g. `stability-ai/stable-diffusion` */

@@ -8,3 +8,3 @@ model: string;

/** Option for the model version */
export declare type ModelVersionOptions = {
export type ModelVersionOptions = {
/** The ID of the model version that you want to run. */

@@ -22,5 +22,5 @@ version: string;

*/
export declare type WebhookEventType = "start" | "output" | "logs" | "completed";
export type WebhookEventType = "start" | "output" | "logs" | "completed";
/** Options for creating a new prediction */
export declare type PredictOptions = {
export type PredictOptions = {
/** The model's input as a JSON object. This differs for each model */

@@ -27,0 +27,0 @@ input: Record<string, unknown>;

import { ReplicateRequestOptions } from "./helpers/makeApiRequest";
export declare type ProcessWebhookOptions = {
export type ProcessWebhookOptions = {
/** The webhook body as an object */

@@ -4,0 +4,0 @@ body: unknown;

{
"name": "replicate-api",
"version": "0.4.4",
"version": "0.4.5",
"description": "A typed client library for the replicate.com API",

@@ -29,3 +29,2 @@ "author": {

"lint-staged": "^13.0.3",
"pinst": "^3.0.0",
"prettier": "^2.7.1",

@@ -41,7 +40,6 @@ "prettier-plugin-organize-imports": "^3.1.1",

"build": "rm -rf dist && tsc -p tsconfig.build.json && resolve-tspaths -p tsconfig.build.json",
"prepack": "rm -rf dist && tsc -p tsconfig.build.json && resolve-tspaths -p tsconfig.build.json && pinst --disable",
"prepack": "rm -rf dist && tsc -p tsconfig.build.json && resolve-tspaths -p tsconfig.build.json",
"format": "prettier --write .",
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
"_postinstall": "husky install",
"postpack": "pinst --enable"
"prepare": "husky install"
},

@@ -48,0 +46,0 @@ "files": [