@breign/client 1.0.56 → 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;
@@ -45,6 +48,14 @@ export interface SetupToolRequest {
45
48
  *
46
49
  */
47
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>;
48
59
  /**
49
60
  * Transcribes audio files to text using OpenAI\'s Whisper model
50
61
  * Convert speech to text
@@ -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
@@ -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
@@ -5597,6 +5597,49 @@
5597
5597
  "tags" : [ "tools" ]
5598
5598
  }
5599
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
+ },
5600
5643
  "/tools/{toolId}/token" : {
5601
5644
  "put" : {
5602
5645
  "operationId" : "setToolToken",
@@ -9541,6 +9584,18 @@
9541
9584
  "required" : [ "image" ],
9542
9585
  "type" : "object"
9543
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
+ },
9544
9599
  "KnowledgeBase_files_inner" : {
9545
9600
  "properties" : {
9546
9601
  "id" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",