@super_studio/ecforce-ai-agent-server 0.2.0-canary.4 → 0.2.0-canary.5
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/index.js +567 -42
- package/dist/index.mjs +567 -42
- package/dist/sdk/__generated__/index.d.ts +1053 -54
- package/dist/sdk/__generated__/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/sdk/__generated__/index.ts +2194 -532
- package/src/sdk/generate.ts +21 -1
- package/src/.tmp/test-script.ts +0 -18
package/src/sdk/generate.ts
CHANGED
|
@@ -8,7 +8,7 @@ const SCRIPT_DIR = path.dirname(new URL(import.meta.url).pathname);
|
|
|
8
8
|
/**
|
|
9
9
|
* こちらのスクリプトは以下のコマンドで実行してください
|
|
10
10
|
*
|
|
11
|
-
* `pnpm --filter
|
|
11
|
+
* `pnpm --filter @super_studio/ecforce-ai-agent-server generate`
|
|
12
12
|
*/
|
|
13
13
|
void (async () => {
|
|
14
14
|
await updateApiSchema();
|
|
@@ -20,6 +20,26 @@ void (async () => {
|
|
|
20
20
|
moduleNameIndex: 1,
|
|
21
21
|
unwrapResponseData: true,
|
|
22
22
|
hooks: {
|
|
23
|
+
onCreateRoute(routeData) {
|
|
24
|
+
// internalルートの場合、次のパス部分と結合してモジュール名を設定
|
|
25
|
+
// 例: /v1/internal/account/{projectId} -> internalAccount
|
|
26
|
+
// 例: /v1/internal/chat/create-session -> internalChat
|
|
27
|
+
const route = routeData.raw.route;
|
|
28
|
+
const routeParts = route.split("/").filter(Boolean);
|
|
29
|
+
const internalIndex = routeParts.indexOf("internal");
|
|
30
|
+
if (internalIndex >= 0) {
|
|
31
|
+
const subRouter = routeParts[internalIndex + 1];
|
|
32
|
+
if (subRouter) {
|
|
33
|
+
// ケバブケースをキャメルケースに変換
|
|
34
|
+
const camelCase = subRouter
|
|
35
|
+
.split("-")
|
|
36
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
37
|
+
.join("");
|
|
38
|
+
routeData.namespace = `internal${camelCase}`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return routeData;
|
|
42
|
+
},
|
|
23
43
|
onFormatRouteName(routeInfo) {
|
|
24
44
|
const { method, route, summary } = routeInfo;
|
|
25
45
|
|
package/src/.tmp/test-script.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createClient } from "../sdk";
|
|
2
|
-
|
|
3
|
-
const client = createClient({
|
|
4
|
-
apiKey: "01K4VQR6CS0P88X3ACMCCBFMFT#BT2ilawlgBJkYuAC9iAc5bwzamV32lb4",
|
|
5
|
-
baseUrl: "http://localhost:4043/api",
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
void (async () => {
|
|
9
|
-
const res = await client.chat.startSession({
|
|
10
|
-
agentId: "01K47P4GY6BAAZW9QJQ4X21CZK",
|
|
11
|
-
externalUserId: "test",
|
|
12
|
-
metadata: {
|
|
13
|
-
test: "test",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
console.log(res);
|
|
18
|
-
})();
|