@super_studio/ecforce-ai-agent-server 1.1.1 → 1.2.0-canary.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.
@@ -2,6 +2,21 @@ const require_constants = require('../lib/constants.cjs');
2
2
  const require_index = require('./__generated__/index.cjs');
3
3
 
4
4
  //#region src/sdk/index.ts
5
+ /**
6
+ * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。
7
+ * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、
8
+ * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。
9
+ *
10
+ * @example
11
+ * 環境変数の既定値を使う場合
12
+ * ```ts
13
+ * import { createClient } from "@super_studio/ecforce-ai-agent-server";
14
+ *
15
+ * const client = createClient();
16
+ *
17
+ * const agents = await client.agents.agentsList();
18
+ * ```
19
+ */
5
20
  function createClient(params) {
6
21
  var _ref, _params$baseUrl, _params$apiKey;
7
22
  const baseUrl = `${(_ref = (_params$baseUrl = params === null || params === void 0 ? void 0 : params.baseUrl) !== null && _params$baseUrl !== void 0 ? _params$baseUrl : process.env.AI_AGENT_API_ENDPOINT) !== null && _ref !== void 0 ? _ref : require_constants.API_ENDPOINT}/api`;
@@ -16,6 +16,21 @@ type CreateClientParams = {
16
16
  baseUrl?: string;
17
17
  };
18
18
  type AgentApi = Api<unknown>;
19
+ /**
20
+ * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。
21
+ * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、
22
+ * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。
23
+ *
24
+ * @example
25
+ * 環境変数の既定値を使う場合
26
+ * ```ts
27
+ * import { createClient } from "@super_studio/ecforce-ai-agent-server";
28
+ *
29
+ * const client = createClient();
30
+ *
31
+ * const agents = await client.agents.agentsList();
32
+ * ```
33
+ */
19
34
  declare function createClient(params?: CreateClientParams): AgentApi;
20
35
  //#endregion
21
36
  export { CreateClientParams, createClient };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":[],"mappings":";;;KAKY,kBAAA;EAAA;AAaV;AAIF;;;;;;;;;;;KAFK,QAAA,GAAW;iBAEA,YAAA,UAAsB,qBAAqB"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":[],"mappings":";;;KAKY,kBAAA;EAAA;AAaV;AAmBF;;;;;;;;;;;KAjBK,QAAA,GAAW;;;;;;;;;;;;;;;;iBAiBA,YAAA,UAAsB,qBAAqB"}
@@ -16,6 +16,21 @@ type CreateClientParams = {
16
16
  baseUrl?: string;
17
17
  };
18
18
  type AgentApi = Api<unknown>;
19
+ /**
20
+ * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。
21
+ * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、
22
+ * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。
23
+ *
24
+ * @example
25
+ * 環境変数の既定値を使う場合
26
+ * ```ts
27
+ * import { createClient } from "@super_studio/ecforce-ai-agent-server";
28
+ *
29
+ * const client = createClient();
30
+ *
31
+ * const agents = await client.agents.agentsList();
32
+ * ```
33
+ */
19
34
  declare function createClient(params?: CreateClientParams): AgentApi;
20
35
  //#endregion
21
36
  export { CreateClientParams, createClient };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":[],"mappings":";;;KAKY,kBAAA;EAAA;AAaV;AAIF;;;;;;;;;;;KAFK,QAAA,GAAW;iBAEA,YAAA,UAAsB,qBAAqB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":[],"mappings":";;;KAKY,kBAAA;EAAA;AAaV;AAmBF;;;;;;;;;;;KAjBK,QAAA,GAAW;;;;;;;;;;;;;;;;iBAiBA,YAAA,UAAsB,qBAAqB"}
@@ -2,6 +2,21 @@ import { API_ENDPOINT } from "../lib/constants.mjs";
2
2
  import { Api, ContentType, HttpClient } from "./__generated__/index.mjs";
3
3
 
4
4
  //#region src/sdk/index.ts
5
+ /**
6
+ * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。
7
+ * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、
8
+ * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。
9
+ *
10
+ * @example
11
+ * 環境変数の既定値を使う場合
12
+ * ```ts
13
+ * import { createClient } from "@super_studio/ecforce-ai-agent-server";
14
+ *
15
+ * const client = createClient();
16
+ *
17
+ * const agents = await client.agents.agentsList();
18
+ * ```
19
+ */
5
20
  function createClient(params) {
6
21
  var _ref, _params$baseUrl, _params$apiKey;
7
22
  const baseUrl = `${(_ref = (_params$baseUrl = params === null || params === void 0 ? void 0 : params.baseUrl) !== null && _params$baseUrl !== void 0 ? _params$baseUrl : process.env.AI_AGENT_API_ENDPOINT) !== null && _ref !== void 0 ? _ref : API_ENDPOINT}/api`;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":["import { API_ENDPOINT } from \"@/lib/constants\";\nimport { Api } from \"./__generated__\";\n\nexport * from \"./__generated__\";\n\nexport type CreateClientParams = {\n /**\n * 管理画面から作られたAPIキー。\n * `AI_AGENT_API_KEY`の環境変数からも設定可能。\n */\n apiKey?: string;\n /**\n * エージェントのAPIエンドポイント。\n * `AI_AGENT_API_ENDPOINT`の環境変数からも設定可能。\n * デフォルトは本番のAPIエンドポイント。\n * 基本的には変更不要。\n */\n baseUrl?: string;\n};\n\ntype AgentApi = Api<unknown>;\n\nexport function createClient(params?: CreateClientParams): AgentApi {\n const baseUrl = `${params?.baseUrl ?? process.env.AI_AGENT_API_ENDPOINT ?? API_ENDPOINT}/api`;\n const apiKey = params?.apiKey ?? process.env.AI_AGENT_API_KEY;\n\n if (!apiKey) {\n throw new Error(\"APIキーが設定されていません。\");\n }\n if (!baseUrl) {\n throw new Error(\"APIエンドポイントが設定されていません。\");\n }\n\n return new Api({\n baseUrl,\n baseApiParams: {\n secure: true,\n },\n async securityWorker() {\n return {\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n };\n },\n });\n}\n"],"mappings":";;;;AAsBA,SAAgB,aAAa,QAAuC;;CAClE,MAAM,UAAU,8EAAG,OAAQ,oEAAW,QAAQ,IAAI,4DAAyB,aAAa;CACxF,MAAM,2EAAS,OAAQ,iEAAU,QAAQ,IAAI;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,mBAAmB;AAErC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB;AAG1C,QAAO,IAAI,IAAI;EACb;EACA,eAAe,EACb,QAAQ,MACT;EACD,MAAM,iBAAiB;AACrB,UAAO,EACL,SAAS,EACP,eAAe,UAAU,UAC1B,EACF;;EAEJ,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/sdk/index.ts"],"sourcesContent":["import { API_ENDPOINT } from \"@/lib/constants\";\nimport { Api } from \"./__generated__\";\n\nexport * from \"./__generated__\";\n\nexport type CreateClientParams = {\n /**\n * 管理画面から作られたAPIキー。\n * `AI_AGENT_API_KEY`の環境変数からも設定可能。\n */\n apiKey?: string;\n /**\n * エージェントのAPIエンドポイント。\n * `AI_AGENT_API_ENDPOINT`の環境変数からも設定可能。\n * デフォルトは本番のAPIエンドポイント。\n * 基本的には変更不要。\n */\n baseUrl?: string;\n};\n\ntype AgentApi = Api<unknown>;\n\n/**\n * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。\n * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、\n * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。\n *\n * @example\n * 環境変数の既定値を使う場合\n * ```ts\n * import { createClient } from \"@super_studio/ecforce-ai-agent-server\";\n *\n * const client = createClient();\n *\n * const agents = await client.agents.agentsList();\n * ```\n */\nexport function createClient(params?: CreateClientParams): AgentApi {\n const baseUrl = `${params?.baseUrl ?? process.env.AI_AGENT_API_ENDPOINT ?? API_ENDPOINT}/api`;\n const apiKey = params?.apiKey ?? process.env.AI_AGENT_API_KEY;\n\n if (!apiKey) {\n throw new Error(\"APIキーが設定されていません。\");\n }\n if (!baseUrl) {\n throw new Error(\"APIエンドポイントが設定されていません。\");\n }\n\n return new Api({\n baseUrl,\n baseApiParams: {\n secure: true,\n },\n async securityWorker() {\n return {\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n };\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,aAAa,QAAuC;;CAClE,MAAM,UAAU,8EAAG,OAAQ,oEAAW,QAAQ,IAAI,4DAAyB,aAAa;CACxF,MAAM,2EAAS,OAAQ,iEAAU,QAAQ,IAAI;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,mBAAmB;AAErC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB;AAG1C,QAAO,IAAI,IAAI;EACb;EACA,eAAe,EACb,QAAQ,MACT;EACD,MAAM,iBAAiB;AACrB,UAAO,EACL,SAAS,EACP,eAAe,UAAU,UAC1B,EACF;;EAEJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super_studio/ecforce-ai-agent-server",
3
- "version": "1.1.1",
3
+ "version": "1.2.0-canary.0",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.cts",
package/src/sdk/index.ts CHANGED
@@ -20,6 +20,21 @@ export type CreateClientParams = {
20
20
 
21
21
  type AgentApi = Api<unknown>;
22
22
 
23
+ /**
24
+ * ecforce AIエージェントのAPIを呼び出すサーバークライアントを生成します。
25
+ * `params` を省略した場合、`apiKey` は `AI_AGENT_API_KEY`、
26
+ * `baseUrl` は `AI_AGENT_API_ENDPOINT` または既定の本番APIエンドポイントを使います。
27
+ *
28
+ * @example
29
+ * 環境変数の既定値を使う場合
30
+ * ```ts
31
+ * import { createClient } from "@super_studio/ecforce-ai-agent-server";
32
+ *
33
+ * const client = createClient();
34
+ *
35
+ * const agents = await client.agents.agentsList();
36
+ * ```
37
+ */
23
38
  export function createClient(params?: CreateClientParams): AgentApi {
24
39
  const baseUrl = `${params?.baseUrl ?? process.env.AI_AGENT_API_ENDPOINT ?? API_ENDPOINT}/api`;
25
40
  const apiKey = params?.apiKey ?? process.env.AI_AGENT_API_KEY;