@hautechai/sdk 0.1.4 → 0.2.0
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/.github/workflows/main.yml +31 -31
- package/.github/workflows/test.yml +30 -30
- package/.prettierignore +1 -0
- package/dist/autogenerated/api.d.ts +981 -23
- package/dist/autogenerated/api.js +1110 -161
- package/dist/sdk/api.d.ts +2 -0
- package/dist/sdk/api.js +10 -10
- package/dist/sdk/exceptions/index.d.ts +3 -0
- package/dist/sdk/exceptions/index.js +6 -0
- package/dist/sdk/index.d.ts +763 -142
- package/dist/sdk/index.js +18 -1
- package/dist/sdk/listeners/index.d.ts +25 -0
- package/dist/sdk/listeners/index.js +81 -0
- package/dist/sdk/operations/index.d.ts +3 -2
- package/dist/sdk/operations/index.js +18 -14
- package/dist/sdk/pipelines/index.d.ts +760 -140
- package/dist/sdk/pipelines/index.js +59 -2
- package/dist/sdk/pipelines/pipelines.d.ts +0 -0
- package/dist/sdk/pipelines/pipelines.js +1 -0
- package/dist/token/index.js +32 -21
- package/dist/types.d.ts +1 -0
- package/openapitools.json +5 -5
- package/package.json +5 -3
|
@@ -4,7 +4,9 @@ import { useAutogeneratedAPI } from '../api';
|
|
|
4
4
|
const pipelines = (options) => {
|
|
5
5
|
const api = useAutogeneratedAPI({ API: PipelinesApi, options });
|
|
6
6
|
const callAPI = useAutogeneratedAPI({ API: CallApi, options });
|
|
7
|
-
const callMethod = (method) =>
|
|
7
|
+
const callMethod = (method) =>
|
|
8
|
+
// Type intersection is used as a type check assistance to prevent accidental passing of raw TaskOutput.
|
|
9
|
+
(params) => callAPI.call({
|
|
8
10
|
run: (methods) => method(methods)(params),
|
|
9
11
|
});
|
|
10
12
|
const createPipeline = () => new Pipeline({
|
|
@@ -50,6 +52,61 @@ const pipelines = (options) => {
|
|
|
50
52
|
get: callMethod((methods) => methods.callControllerCallOperationsGetV1),
|
|
51
53
|
list: callMethod((methods) => methods.callControllerCallOperationsListV1),
|
|
52
54
|
updateMetadata: callMethod((methods) => methods.callControllerCallOperationsMetadataUpdateV1),
|
|
55
|
+
run: {
|
|
56
|
+
haute: {
|
|
57
|
+
linda: {
|
|
58
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunHauteLindaV1V1)
|
|
59
|
+
},
|
|
60
|
+
naomi: {
|
|
61
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunHauteNaomiV1V1)
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
inpaint: {
|
|
65
|
+
kate: {
|
|
66
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunInpaintKateV1V1),
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
gpt: {
|
|
70
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunGptV1V1)
|
|
71
|
+
},
|
|
72
|
+
imagine: {
|
|
73
|
+
kate: {
|
|
74
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunImagineKateV1V1)
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
upscale: {
|
|
78
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunUpscaleV1V1),
|
|
79
|
+
},
|
|
80
|
+
objectDetection: {
|
|
81
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunObjectDetectionV1V1),
|
|
82
|
+
},
|
|
83
|
+
segmentAnything: {
|
|
84
|
+
embeddings: {
|
|
85
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunSegmentAnythingEmbeddingsV1V1),
|
|
86
|
+
},
|
|
87
|
+
mask: {
|
|
88
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunSegmentAnythingMaskV1V1),
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
poseEstimation: {
|
|
92
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunPoseEstimationV1V1),
|
|
93
|
+
},
|
|
94
|
+
cut: {
|
|
95
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunCutV1V1),
|
|
96
|
+
},
|
|
97
|
+
composite: {
|
|
98
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunCompositeV1V1),
|
|
99
|
+
},
|
|
100
|
+
vton: {
|
|
101
|
+
gisele: {
|
|
102
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunVtonGiseleV1V1),
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
negateImage: {
|
|
106
|
+
v1: callMethod((methods) => methods.callControllerCallOperationsRunNegateImageV1V1),
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
wait: callMethod((methods) => methods.callControllerCallOperationsWaitV1),
|
|
53
110
|
},
|
|
54
111
|
poses: {
|
|
55
112
|
get: callMethod((methods) => methods.callControllerCallPosesGetV1),
|
|
@@ -90,7 +147,7 @@ const pipelines = (options) => {
|
|
|
90
147
|
if (pipeline.status === 'completed')
|
|
91
148
|
return resolve(pipeline);
|
|
92
149
|
if (pipeline.status === 'failed')
|
|
93
|
-
return
|
|
150
|
+
return resolve(pipeline);
|
|
94
151
|
timeoutId = setTimeout(poll, delay);
|
|
95
152
|
};
|
|
96
153
|
timeoutId = setTimeout(poll, initialDelay);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/token/index.js
CHANGED
|
@@ -31,24 +31,35 @@ const serializePermissions = (permissions) => {
|
|
|
31
31
|
traverse(permissions);
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
|
-
export const createTokenSigner = (options) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
34
|
+
export const createTokenSigner = (options) => {
|
|
35
|
+
if (!options.appId || options.appId.length === 0) {
|
|
36
|
+
throw new Error('appId is required');
|
|
37
|
+
}
|
|
38
|
+
if (!options.appKeyId || options.appKeyId.length === 0) {
|
|
39
|
+
throw new Error('appKeyId is required');
|
|
40
|
+
}
|
|
41
|
+
if (!options.appKeySecret || options.appKeySecret.length === 0) {
|
|
42
|
+
throw new Error('appKeySecret is required');
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
createAccountToken: async (props) => createToken({
|
|
46
|
+
appKeyId: options.appKeyId,
|
|
47
|
+
appKeySecret: options.appKeySecret,
|
|
48
|
+
expiresInSeconds: props.expiresInSeconds,
|
|
49
|
+
payload: {
|
|
50
|
+
iss: options.appId,
|
|
51
|
+
permissions: serializePermissions(props.permissions ?? {}),
|
|
52
|
+
sub: props.accountId,
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
createRootToken: async (props) => createToken({
|
|
56
|
+
appKeyId: options.appKeyId,
|
|
57
|
+
appKeySecret: options.appKeySecret,
|
|
58
|
+
expiresInSeconds: props.expiresInSeconds ?? 3600,
|
|
59
|
+
payload: {
|
|
60
|
+
iss: options.appId,
|
|
61
|
+
permissions: ['*'],
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
};
|
package/dist/types.d.ts
CHANGED
package/openapitools.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
|
3
|
+
"spaces": 2,
|
|
4
|
+
"generator-cli": {
|
|
5
|
+
"version": "7.10.0"
|
|
6
|
+
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hautechai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"description": "Hautech SDK",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@hautechai/pipelines": "0.
|
|
13
|
+
"@hautechai/pipelines": "0.3.2",
|
|
14
14
|
"axios": "1.6.1",
|
|
15
|
-
"jose": "5.9.6"
|
|
15
|
+
"jose": "5.9.6",
|
|
16
|
+
"ws": "^8.18.0"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@jest/globals": "^29.7.0",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"@types/jest": "29.5.12",
|
|
21
22
|
"@types/jsonwebtoken": "9.0.7",
|
|
22
23
|
"@types/node": "22.5.2",
|
|
24
|
+
"@types/ws": "^8.5.14",
|
|
23
25
|
"dotenv": "16.4.7",
|
|
24
26
|
"jest": "29.7.0",
|
|
25
27
|
"jest-environment-jsdom": "29.7.0",
|