Skip to content

Commit 7dde205

Browse files
committed
add missing package
1 parent 058fed8 commit 7dde205

File tree

6 files changed

+1825
-1731
lines changed

6 files changed

+1825
-1731
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ typings/
6868
.yarn/build-state.yml
6969

7070
dist
71+
types
7172
docs
7273

7374
# misc

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
},
1919
"homepage": "https://github.com/modzy/sdk-javascript#readme",
2020
"types": "types/index.d.ts",
21+
"files": [
22+
"dist",
23+
"types"
24+
],
2125
"browser": {
2226
"dist/FileJobClient.js": "./dist/FileJobClientBrowser.js",
2327
"dist/base64Util.js": "./dist/base64UtilBrowser.js",
@@ -50,6 +54,7 @@
5054
},
5155
"dependencies": {
5256
"axios": "^0.24.0",
57+
"form-data": "^4.0.0",
5358
"string-similarity": "^4.0.4"
5459
}
5560
}

types/JobClient.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Logger } from "./Logger";
2-
import { ClassInitiator, GetJobHistoryParams, JobHistoryResponseItem, SubmitJobParams, SubmitJobTextParams, SubmitJobResponse, GetOutputContentsParams, SubmitJobJDBCParams, SubmitJobAwsS3Params, SubmitJobEmbeddedParams, EnginesResponse, GetJobResponse } from "./types";
2+
import { ClassInitiator, GetJobHistoryParams, JobHistoryResponseItem, SubmitJobParams, SubmitJobTextParams, SubmitJobResponse, GetOutputContentsParams, SubmitJobJDBCParams, SubmitJobAwsS3Params, SubmitJobEmbeddedParams, EnginesResponse, GetJobResponse, GetResultResponse } from "./types";
33
export declare class JobClient {
44
logger: Logger;
55
readonly baseUrl: string;
@@ -21,8 +21,8 @@ export declare class JobClient {
2121
* Call the Modzy API Service that return a job instance by it's identifier
2222
*/
2323
getJob(jobId: string): Promise<GetJobResponse>;
24-
getResult(jobId: string): Promise<any>;
25-
getOutputContents({ jobId, inputKey, outputName, responseType, }: GetOutputContentsParams): Promise<any>;
24+
getResult(jobId: string): Promise<GetResultResponse>;
25+
getOutputContents({ jobId, inputKey, outputName, responseType, }: GetOutputContentsParams): Promise<unknown>;
2626
/**
2727
* Utility method that waits until the job finishes.
2828
*

types/ModzyClient.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export declare class ModzyClient {
2828
getJobClient(): JobClient;
2929
getJob(jobId: string): Promise<import("./types").GetJobResponse>;
3030
cancelJob(jobId: string): Promise<any>;
31-
getResult(jobId: string): Promise<any>;
32-
getOutputContents(params: GetOutputContentsParams): Promise<any>;
31+
getResult(jobId: string): Promise<import("./types").GetResultResponse>;
32+
getOutputContents(params: GetOutputContentsParams): Promise<unknown>;
3333
blockUntilJobComplete(jobId: string, options?: {
3434
timeout?: number;
3535
}): Promise<import("./types").GetJobResponse>;

types/types.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,44 @@ export interface GetJobResponse {
344344
identifier: string;
345345
};
346346
}
347+
export interface GetResultResponse {
348+
jobIdentifier: string;
349+
accountIdentifier: string;
350+
team: {
351+
identifier: string;
352+
};
353+
total: number;
354+
completed: number;
355+
failed: number;
356+
finished: boolean;
357+
submittedByKey: string;
358+
explained: boolean;
359+
submittedAt: string;
360+
initialQueueTime: number;
361+
totalQueueTime: number;
362+
averageModelLatency: number;
363+
totalModelLatency: number;
364+
elapsedTime: number;
365+
startingResultSummarizing: string;
366+
resultSummarizing: number;
367+
inputSize: number;
368+
results: {
369+
job: {
370+
status: string;
371+
engine: string;
372+
inputFetching: number;
373+
outputUploading?: any;
374+
modelLatency: number;
375+
queueTime: number;
376+
startTime: string;
377+
updateTime: string;
378+
endTime: string;
379+
[key: string]: any;
380+
voting: {
381+
up: 0;
382+
down: 0;
383+
};
384+
};
385+
};
386+
}
347387
export {};

0 commit comments

Comments
 (0)