@nosana/api 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jobs/index.js +8 -8
- package/dist/jobs/index.js.map +1 -1
- package/dist/jobs/types.d.ts +12 -10
- package/package.json +1 -1
package/dist/jobs/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { errorFormatter } from '../utils/errorFormatter.js';
|
|
|
2
2
|
export * from './types.js';
|
|
3
3
|
export function createNosanaJobsApi(client) {
|
|
4
4
|
return {
|
|
5
|
-
async get(
|
|
5
|
+
async get(address) {
|
|
6
6
|
const { data, error } = await client.GET('/api/jobs/{address}', {
|
|
7
7
|
params: {
|
|
8
8
|
path: {
|
|
9
|
-
address
|
|
9
|
+
address
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
});
|
|
@@ -15,20 +15,20 @@ export function createNosanaJobsApi(client) {
|
|
|
15
15
|
}
|
|
16
16
|
return data;
|
|
17
17
|
},
|
|
18
|
-
async
|
|
18
|
+
async list(request) {
|
|
19
19
|
const { data, error } = await client.POST('/api/jobs/list', {
|
|
20
20
|
body: request,
|
|
21
21
|
});
|
|
22
22
|
if (!data || error) {
|
|
23
|
-
throw errorFormatter('Failed to
|
|
23
|
+
throw errorFormatter('Failed to list job', error);
|
|
24
24
|
}
|
|
25
25
|
return data;
|
|
26
26
|
},
|
|
27
|
-
async extend(
|
|
27
|
+
async extend({ address, ...request }) {
|
|
28
28
|
const { data, error } = await client.POST('/api/jobs/{address}/extend', {
|
|
29
29
|
params: {
|
|
30
30
|
path: {
|
|
31
|
-
address
|
|
31
|
+
address
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
body: request,
|
|
@@ -38,11 +38,11 @@ export function createNosanaJobsApi(client) {
|
|
|
38
38
|
}
|
|
39
39
|
return data;
|
|
40
40
|
},
|
|
41
|
-
async stop(
|
|
41
|
+
async stop(address) {
|
|
42
42
|
const { data, error } = await client.POST('/api/jobs/{address}/stop', {
|
|
43
43
|
params: {
|
|
44
44
|
path: {
|
|
45
|
-
address
|
|
45
|
+
address
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
});
|
package/dist/jobs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAe5D,cAAc,YAAY,CAAC;AAE3B,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,OAAO;QACL,KAAK,CAAC,GAAG,CAAC,OAAwC;YAChD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE;gBAC9D,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,OAAO;qBACR;iBACF;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACnB,MAAM,cAAc,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;YACnD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,OAAgC;YACzC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1D,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACnB,MAAM,cAAc,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,EAA6B;YAC7D,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;gBACtE,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,OAAO;qBACR;iBACF;gBACD,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACnB,MAAM,cAAc,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,OAAgC;YACzC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE;gBACpE,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,OAAO;qBACR;iBACF;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACnB,MAAM,cAAc,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/jobs/types.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { operations } from "../client/schema.js";
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
2
|
+
export type NosanaApiGetJobByAddressRequest = operations['getApiJobsByAddress']['parameters']['path']['address'];
|
|
3
|
+
export type NosanaApiListJobRequest = operations['postApiJobsList']['requestBody']['content']['application/json'];
|
|
4
|
+
export type NosanaApiExtendJobRequest = operations['postApiJobsByAddressExtend']['requestBody']['content']['application/json'] & operations['postApiJobsByAddressExtend']['parameters']['path'];
|
|
5
|
+
export type NosanaApiStopJobRequest = operations['postApiJobsByAddressStop']['parameters']['path']['address'];
|
|
6
|
+
export type NosanaApiListJobResponse = operations['postApiJobsList']['responses'][200]['content']['application/json'];
|
|
7
|
+
export type NosanaApiExtendJobResponse = operations['postApiJobsByAddressExtend']['responses'][200]['content']['application/json'];
|
|
8
|
+
export type NosanaApiStopJobResponse = operations['postApiJobsByAddressStop']['responses'][200]['content']['application/json'];
|
|
9
|
+
export type NosanaApiGetJobByAddressResponse = operations['getApiJobsByAddress']['responses'][200]['content']['application/json'];
|
|
8
10
|
export interface NosanaJobsApi {
|
|
9
|
-
get: (
|
|
10
|
-
|
|
11
|
-
extend: (
|
|
12
|
-
stop: (
|
|
11
|
+
get: (request: NosanaApiGetJobByAddressRequest) => Promise<NosanaApiGetJobByAddressResponse>;
|
|
12
|
+
list: (request: NosanaApiListJobRequest) => Promise<NosanaApiListJobResponse>;
|
|
13
|
+
extend: (request: NosanaApiExtendJobRequest) => Promise<NosanaApiExtendJobResponse>;
|
|
14
|
+
stop: (request: NosanaApiStopJobRequest) => Promise<NosanaApiStopJobResponse>;
|
|
13
15
|
}
|