@breign/client 1.0.55 → 1.0.57

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.
@@ -10,7 +10,10 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AgentToolUio, RevealTokenRequestUio, RevealTokenResponseUio, STTResponseUio, SetTokenRequestUio, TTSRequestUio, TTSResponseUio, ToolCreateRequestUio, ToolSecureUio } from '../models/index';
13
+ import type { AgentToolUio, ConnectOAuth2Tool200ResponseUio, RevealTokenRequestUio, RevealTokenResponseUio, STTResponseUio, SetTokenRequestUio, TTSRequestUio, TTSResponseUio, ToolCreateRequestUio, ToolSecureUio } from '../models/index';
14
+ export interface ConnectOAuth2ToolRequest {
15
+ toolId: string;
16
+ }
14
17
  export interface ConvertSpeechToTextRequest {
15
18
  body: Blob;
16
19
  language?: string;
@@ -38,10 +41,21 @@ export interface SetToolTokenRequest {
38
41
  toolId: string;
39
42
  setTokenRequestUio: SetTokenRequestUio;
40
43
  }
44
+ export interface SetupToolRequest {
45
+ toolId: string;
46
+ }
41
47
  /**
42
48
  *
43
49
  */
44
50
  export declare class ToolsApi extends runtime.BaseAPI {
51
+ /**
52
+ * Connect a tool via OAuth2
53
+ */
54
+ connectOAuth2ToolRaw(requestParameters: ConnectOAuth2ToolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConnectOAuth2Tool200ResponseUio>>;
55
+ /**
56
+ * Connect a tool via OAuth2
57
+ */
58
+ connectOAuth2Tool(toolId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConnectOAuth2Tool200ResponseUio>;
45
59
  /**
46
60
  * Transcribes audio files to text using OpenAI\'s Whisper model
47
61
  * Convert speech to text
@@ -106,4 +120,12 @@ export declare class ToolsApi extends runtime.BaseAPI {
106
120
  * Set or update the tool secret token
107
121
  */
108
122
  setToolToken(toolId: string, setTokenRequestUio: SetTokenRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
123
+ /**
124
+ * Complete the setup of a tool (oauth2 configuration)
125
+ */
126
+ setupToolRaw(requestParameters: SetupToolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
127
+ /**
128
+ * Complete the setup of a tool (oauth2 configuration)
129
+ */
130
+ setupTool(toolId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
109
131
  }
@@ -53,6 +53,33 @@ const index_1 = require("../models/index");
53
53
  *
54
54
  */
55
55
  class ToolsApi extends runtime.BaseAPI {
56
+ /**
57
+ * Connect a tool via OAuth2
58
+ */
59
+ async connectOAuth2ToolRaw(requestParameters, initOverrides) {
60
+ if (requestParameters['toolId'] == null) {
61
+ throw new runtime.RequiredError('toolId', 'Required parameter "toolId" was null or undefined when calling connectOAuth2Tool().');
62
+ }
63
+ const queryParameters = {};
64
+ const headerParameters = {};
65
+ if (this.configuration && this.configuration.apiKey) {
66
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
67
+ }
68
+ const response = await this.request({
69
+ path: `/tools/{toolId}/oauth/connect`.replace(`{${"toolId"}}`, encodeURIComponent(String(requestParameters['toolId']))),
70
+ method: 'POST',
71
+ headers: headerParameters,
72
+ query: queryParameters,
73
+ }, initOverrides);
74
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConnectOAuth2Tool200ResponseUioFromJSON)(jsonValue));
75
+ }
76
+ /**
77
+ * Connect a tool via OAuth2
78
+ */
79
+ async connectOAuth2Tool(toolId, initOverrides) {
80
+ const response = await this.connectOAuth2ToolRaw({ toolId: toolId }, initOverrides);
81
+ return await response.value();
82
+ }
56
83
  /**
57
84
  * Transcribes audio files to text using OpenAI\'s Whisper model
58
85
  * Convert speech to text
@@ -276,5 +303,31 @@ class ToolsApi extends runtime.BaseAPI {
276
303
  async setToolToken(toolId, setTokenRequestUio, initOverrides) {
277
304
  await this.setToolTokenRaw({ toolId: toolId, setTokenRequestUio: setTokenRequestUio }, initOverrides);
278
305
  }
306
+ /**
307
+ * Complete the setup of a tool (oauth2 configuration)
308
+ */
309
+ async setupToolRaw(requestParameters, initOverrides) {
310
+ if (requestParameters['toolId'] == null) {
311
+ throw new runtime.RequiredError('toolId', 'Required parameter "toolId" was null or undefined when calling setupTool().');
312
+ }
313
+ const queryParameters = {};
314
+ const headerParameters = {};
315
+ if (this.configuration && this.configuration.apiKey) {
316
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
317
+ }
318
+ const response = await this.request({
319
+ path: `/tools/{toolId}/setup`.replace(`{${"toolId"}}`, encodeURIComponent(String(requestParameters['toolId']))),
320
+ method: 'POST',
321
+ headers: headerParameters,
322
+ query: queryParameters,
323
+ }, initOverrides);
324
+ return new runtime.VoidApiResponse(response);
325
+ }
326
+ /**
327
+ * Complete the setup of a tool (oauth2 configuration)
328
+ */
329
+ async setupTool(toolId, initOverrides) {
330
+ await this.setupToolRaw({ toolId: toolId }, initOverrides);
331
+ }
279
332
  }
280
333
  exports.ToolsApi = ToolsApi;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ConnectOAuth2Tool200ResponseUio
16
+ */
17
+ export interface ConnectOAuth2Tool200ResponseUio {
18
+ /**
19
+ * URL to redirect the user for OAuth2 authorization
20
+ * @type {string}
21
+ * @memberof ConnectOAuth2Tool200ResponseUio
22
+ */
23
+ authorizationUrl: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ConnectOAuth2Tool200ResponseUio interface.
27
+ */
28
+ export declare function instanceOfConnectOAuth2Tool200ResponseUio(value: object): value is ConnectOAuth2Tool200ResponseUio;
29
+ export declare function ConnectOAuth2Tool200ResponseUioFromJSON(json: any): ConnectOAuth2Tool200ResponseUio;
30
+ export declare function ConnectOAuth2Tool200ResponseUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectOAuth2Tool200ResponseUio;
31
+ export declare function ConnectOAuth2Tool200ResponseUioToJSON(json: any): ConnectOAuth2Tool200ResponseUio;
32
+ export declare function ConnectOAuth2Tool200ResponseUioToJSONTyped(value?: ConnectOAuth2Tool200ResponseUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfConnectOAuth2Tool200ResponseUio = instanceOfConnectOAuth2Tool200ResponseUio;
17
+ exports.ConnectOAuth2Tool200ResponseUioFromJSON = ConnectOAuth2Tool200ResponseUioFromJSON;
18
+ exports.ConnectOAuth2Tool200ResponseUioFromJSONTyped = ConnectOAuth2Tool200ResponseUioFromJSONTyped;
19
+ exports.ConnectOAuth2Tool200ResponseUioToJSON = ConnectOAuth2Tool200ResponseUioToJSON;
20
+ exports.ConnectOAuth2Tool200ResponseUioToJSONTyped = ConnectOAuth2Tool200ResponseUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ConnectOAuth2Tool200ResponseUio interface.
23
+ */
24
+ function instanceOfConnectOAuth2Tool200ResponseUio(value) {
25
+ if (!('authorizationUrl' in value) || value['authorizationUrl'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function ConnectOAuth2Tool200ResponseUioFromJSON(json) {
30
+ return ConnectOAuth2Tool200ResponseUioFromJSONTyped(json, false);
31
+ }
32
+ function ConnectOAuth2Tool200ResponseUioFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'authorizationUrl': json['authorizationUrl'],
38
+ };
39
+ }
40
+ function ConnectOAuth2Tool200ResponseUioToJSON(json) {
41
+ return ConnectOAuth2Tool200ResponseUioToJSONTyped(json, false);
42
+ }
43
+ function ConnectOAuth2Tool200ResponseUioToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'authorizationUrl': value['authorizationUrl'],
49
+ };
50
+ }
@@ -76,6 +76,7 @@ export * from './ChunkCreateRequestUio';
76
76
  export * from './ChunkCreateResponseUio';
77
77
  export * from './ChunkUio';
78
78
  export * from './ConfigurationDefaultFillerPhrasesUio';
79
+ export * from './ConnectOAuth2Tool200ResponseUio';
79
80
  export * from './ContentsToolsUio';
80
81
  export * from './ContextUio';
81
82
  export * from './ConversationFlowNodeEntrypointsUio';
@@ -94,6 +94,7 @@ __exportStar(require("./ChunkCreateRequestUio"), exports);
94
94
  __exportStar(require("./ChunkCreateResponseUio"), exports);
95
95
  __exportStar(require("./ChunkUio"), exports);
96
96
  __exportStar(require("./ConfigurationDefaultFillerPhrasesUio"), exports);
97
+ __exportStar(require("./ConnectOAuth2Tool200ResponseUio"), exports);
97
98
  __exportStar(require("./ContentsToolsUio"), exports);
98
99
  __exportStar(require("./ContextUio"), exports);
99
100
  __exportStar(require("./ConversationFlowNodeEntrypointsUio"), exports);
package/dist/openapi.json CHANGED
@@ -5561,6 +5561,85 @@
5561
5561
  "tags" : [ "tools" ]
5562
5562
  }
5563
5563
  },
5564
+ "/tools/{toolId}/setup" : {
5565
+ "post" : {
5566
+ "operationId" : "setupTool",
5567
+ "parameters" : [ {
5568
+ "description" : "Tool identifier",
5569
+ "in" : "path",
5570
+ "name" : "toolId",
5571
+ "required" : true,
5572
+ "schema" : {
5573
+ "type" : "string"
5574
+ }
5575
+ } ],
5576
+ "responses" : {
5577
+ "204" : {
5578
+ "description" : "Tool setup completed"
5579
+ },
5580
+ "400" : {
5581
+ "description" : "Tool setup not required or failed."
5582
+ },
5583
+ "401" : {
5584
+ "description" : "Unauthorized"
5585
+ },
5586
+ "403" : {
5587
+ "description" : "Forbidden"
5588
+ },
5589
+ "404" : {
5590
+ "description" : "Tool not found"
5591
+ },
5592
+ "500" : {
5593
+ "description" : "Internal server error"
5594
+ }
5595
+ },
5596
+ "summary" : "Complete the setup of a tool (oauth2 configuration)",
5597
+ "tags" : [ "tools" ]
5598
+ }
5599
+ },
5600
+ "/tools/{toolId}/oauth/connect" : {
5601
+ "post" : {
5602
+ "operationId" : "connectOAuth2Tool",
5603
+ "parameters" : [ {
5604
+ "description" : "Tool identifier",
5605
+ "in" : "path",
5606
+ "name" : "toolId",
5607
+ "required" : true,
5608
+ "schema" : {
5609
+ "type" : "string"
5610
+ }
5611
+ } ],
5612
+ "responses" : {
5613
+ "200" : {
5614
+ "content" : {
5615
+ "application/json" : {
5616
+ "schema" : {
5617
+ "$ref" : "#/components/schemas/connectOAuth2Tool_200_response"
5618
+ }
5619
+ }
5620
+ },
5621
+ "description" : "Tool connection initialized"
5622
+ },
5623
+ "400" : {
5624
+ "description" : "Tool connection failed"
5625
+ },
5626
+ "401" : {
5627
+ "description" : "Unauthorized"
5628
+ },
5629
+ "403" : {
5630
+ "description" : "Forbidden"
5631
+ },
5632
+ "404" : {
5633
+ "description" : "Tool not found"
5634
+ },
5635
+ "500" : {
5636
+ "description" : "Internal server error"
5637
+ }
5638
+ },
5639
+ "summary" : "Connect a tool via OAuth2",
5640
+ "tags" : [ "tools" ]
5641
+ }
5642
+ },
5564
5643
  "/tools/{toolId}/token" : {
5565
5644
  "put" : {
5566
5645
  "operationId" : "setToolToken",
@@ -9505,6 +9584,18 @@
9505
9584
  "required" : [ "image" ],
9506
9585
  "type" : "object"
9507
9586
  },
9587
+ "connectOAuth2Tool_200_response" : {
9588
+ "additionalProperties" : false,
9589
+ "properties" : {
9590
+ "authorizationUrl" : {
9591
+ "description" : "URL to redirect the user for OAuth2 authorization",
9592
+ "format" : "uri",
9593
+ "type" : "string"
9594
+ }
9595
+ },
9596
+ "required" : [ "authorizationUrl" ],
9597
+ "type" : "object"
9598
+ },
9508
9599
  "KnowledgeBase_files_inner" : {
9509
9600
  "properties" : {
9510
9601
  "id" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",