@fonoster/sdk 0.8.26 → 0.8.28

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.
@@ -45,9 +45,6 @@ import { FonosterClient } from "./client/types";
45
45
  * },
46
46
  * intelligence: {
47
47
  * productRef: "nlu.dialogflowcx",
48
- * credentials: {
49
- * apiKey: "your-api-key"
50
- * },
51
48
  * config: {
52
49
  * agentId: "your-agent-id"
53
50
  * }
@@ -81,7 +78,6 @@ declare class Applications {
81
78
  * @param {object} request.speechToText.config - The configuration object for the speech-to-text engine (e.g., { languageCode: "en-US" })
82
79
  * @param {Intelligence} request.intelligence - The intelligence configuration
83
80
  * @param {string} request.intelligence.productRef - The product reference of the intelligence engine (e.g., nlu.dialogflowcx)
84
- * @param {object} request.intelligence.credentials - The credentials object for the intelligence engine (e.g., { apiKey: "your-api-key" })
85
81
  * @param {object} request.intelligence.config - The configuration object for the intelligence engine (e.g., { agentId: "your-agent-id" })
86
82
  * @return {Promise<CreateAppResponse>} - The response object that contains the reference to the newly created application
87
83
  * @example
@@ -105,9 +101,6 @@ declare class Applications {
105
101
  * },
106
102
  * intelligence: {
107
103
  * productRef: "nlu.dialogflowcx",
108
- * credentials: {
109
- * apiKey: "your-api-key"
110
- * },
111
104
  * config: {
112
105
  * agentId: "your-agent-id"
113
106
  * }
@@ -151,7 +144,6 @@ declare class Applications {
151
144
  * @param {object} request.speechToText.config - The configuration object for the speech-to-text engine (e.g., { languageCode: "en-US" })
152
145
  * @param {Intelligence} request.intelligence - The intelligence configuration
153
146
  * @param {string} request.intelligence.productRef - The product reference of the intelligence engine (e.g., nlu.dialogflowcx)
154
- * @param {object} request.intelligence.credentials - The credentials object for the intelligence engine (e.g., { apiKey: "your-api-key" })
155
147
  * @param {object} request.intelligence.config - The configuration object for the intelligence engine (e.g., { agentId: "your-agent-id" })
156
148
  * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated application
157
149
  * @example
@@ -49,9 +49,6 @@ const utils_1 = require("./utils");
49
49
  * },
50
50
  * intelligence: {
51
51
  * productRef: "nlu.dialogflowcx",
52
- * credentials: {
53
- * apiKey: "your-api-key"
54
- * },
55
52
  * config: {
56
53
  * agentId: "your-agent-id"
57
54
  * }
@@ -87,7 +84,6 @@ class Applications {
87
84
  * @param {object} request.speechToText.config - The configuration object for the speech-to-text engine (e.g., { languageCode: "en-US" })
88
85
  * @param {Intelligence} request.intelligence - The intelligence configuration
89
86
  * @param {string} request.intelligence.productRef - The product reference of the intelligence engine (e.g., nlu.dialogflowcx)
90
- * @param {object} request.intelligence.credentials - The credentials object for the intelligence engine (e.g., { apiKey: "your-api-key" })
91
87
  * @param {object} request.intelligence.config - The configuration object for the intelligence engine (e.g., { agentId: "your-agent-id" })
92
88
  * @return {Promise<CreateAppResponse>} - The response object that contains the reference to the newly created application
93
89
  * @example
@@ -111,9 +107,6 @@ class Applications {
111
107
  * },
112
108
  * intelligence: {
113
109
  * productRef: "nlu.dialogflowcx",
114
- * credentials: {
115
- * apiKey: "your-api-key"
116
- * },
117
110
  * config: {
118
111
  * agentId: "your-agent-id"
119
112
  * }
@@ -187,7 +180,6 @@ class Applications {
187
180
  * @param {object} request.speechToText.config - The configuration object for the speech-to-text engine (e.g., { languageCode: "en-US" })
188
181
  * @param {Intelligence} request.intelligence - The intelligence configuration
189
182
  * @param {string} request.intelligence.productRef - The product reference of the intelligence engine (e.g., nlu.dialogflowcx)
190
- * @param {object} request.intelligence.credentials - The credentials object for the intelligence engine (e.g., { apiKey: "your-api-key" })
191
183
  * @param {object} request.intelligence.config - The configuration object for the intelligence engine (e.g., { agentId: "your-agent-id" })
192
184
  * @return {Promise<BaseApiObject>} - The response object that contains the reference to the updated application
193
185
  * @example
@@ -19,6 +19,7 @@ declare abstract class AbstractClient implements FonosterClient {
19
19
  loginWithRefreshToken(refreshToken: string): Promise<void>;
20
20
  loginWithApiKey(accessKeyId: string, accessKeySecret: string): Promise<void>;
21
21
  loginWithOauth2Code(provider: "GITHUB", username: string, code: string): Promise<void>;
22
+ setAccessToken(accessToken: string): Promise<void>;
22
23
  sendVerificationCode(contactType: ContactType, value: string): Promise<void>;
23
24
  verifyCode(request: {
24
25
  username: string;
@@ -67,13 +67,16 @@ class AbstractClient {
67
67
  this._refreshToken = refreshToken;
68
68
  this._accessToken = accessToken;
69
69
  }
70
+ async setAccessToken(accessToken) {
71
+ this._accessToken = accessToken;
72
+ }
70
73
  async sendVerificationCode(contactType, value) {
71
74
  await (0, makeRpcRequest_1.makeRpcRequest)({
72
75
  method: this.identityClient.sendVerificationCode.bind(this.identityClient),
73
76
  requestPBObjectConstructor: identity_pb_1.SendVerificationCodeRequest,
74
77
  metadata: {},
75
78
  request: {
76
- contactType: contactType,
79
+ contactType,
77
80
  value
78
81
  },
79
82
  enumMapping: [["contactType", identity_pb_1.ContactType]]
@@ -8,6 +8,7 @@ export declare class Client extends AbstractClient {
8
8
  endpoint?: string;
9
9
  accessKeyId: string;
10
10
  allowInsecure?: boolean;
11
+ withoutInterceptors?: boolean;
11
12
  });
12
13
  getMetadata(): Metadata;
13
14
  getApplicationsClient(): any;
@@ -47,9 +47,9 @@ class Client extends AbstractClient_1.AbstractClient {
47
47
  });
48
48
  this.channelCredentials = channelCredentials;
49
49
  this.endpoint = config?.endpoint || DEFAULT_ENDPOINT;
50
- this.tokenRefresherInterceptor = new TokenRefresherNode_1.TokenRefresherNode(this)
51
- .createInterceptor()
52
- .bind(this);
50
+ this.tokenRefresherInterceptor = config.withoutInterceptors
51
+ ? null
52
+ : new TokenRefresherNode_1.TokenRefresherNode(this).createInterceptor().bind(this);
53
53
  }
54
54
  getMetadata() {
55
55
  const metadata = new grpc_js_1.Metadata();
@@ -530,7 +530,7 @@ proto.fonoster.applications.v1beta2.Application.toObject = function(includeInsta
530
530
  endpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
531
531
  textToSpeech: (f = msg.getTextToSpeech()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
532
532
  speechToText: (f = msg.getSpeechToText()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
533
- conversation: (f = msg.getConversation()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
533
+ intelligence: (f = msg.getIntelligence()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
534
534
  createdAt: jspb.Message.getFieldWithDefault(msg, 8, 0),
535
535
  updatedAt: jspb.Message.getFieldWithDefault(msg, 9, 0)
536
536
  };
@@ -598,7 +598,7 @@ proto.fonoster.applications.v1beta2.Application.deserializeBinaryFromReader = fu
598
598
  case 7:
599
599
  var value = new proto.fonoster.applications.v1beta2.ProductContainer;
600
600
  reader.readMessage(value,proto.fonoster.applications.v1beta2.ProductContainer.deserializeBinaryFromReader);
601
- msg.setConversation(value);
601
+ msg.setIntelligence(value);
602
602
  break;
603
603
  case 8:
604
604
  var value = /** @type {number} */ (reader.readInt32());
@@ -681,7 +681,7 @@ proto.fonoster.applications.v1beta2.Application.serializeBinaryToWriter = functi
681
681
  proto.fonoster.applications.v1beta2.ProductContainer.serializeBinaryToWriter
682
682
  );
683
683
  }
684
- f = message.getConversation();
684
+ f = message.getIntelligence();
685
685
  if (f != null) {
686
686
  writer.writeMessage(
687
687
  7,
@@ -853,10 +853,10 @@ proto.fonoster.applications.v1beta2.Application.prototype.hasSpeechToText = func
853
853
 
854
854
 
855
855
  /**
856
- * optional ProductContainer conversation = 7;
856
+ * optional ProductContainer intelligence = 7;
857
857
  * @return {?proto.fonoster.applications.v1beta2.ProductContainer}
858
858
  */
859
- proto.fonoster.applications.v1beta2.Application.prototype.getConversation = function() {
859
+ proto.fonoster.applications.v1beta2.Application.prototype.getIntelligence = function() {
860
860
  return /** @type{?proto.fonoster.applications.v1beta2.ProductContainer} */ (
861
861
  jspb.Message.getWrapperField(this, proto.fonoster.applications.v1beta2.ProductContainer, 7));
862
862
  };
@@ -866,7 +866,7 @@ proto.fonoster.applications.v1beta2.Application.prototype.getConversation = func
866
866
  * @param {?proto.fonoster.applications.v1beta2.ProductContainer|undefined} value
867
867
  * @return {!proto.fonoster.applications.v1beta2.Application} returns this
868
868
  */
869
- proto.fonoster.applications.v1beta2.Application.prototype.setConversation = function(value) {
869
+ proto.fonoster.applications.v1beta2.Application.prototype.setIntelligence = function(value) {
870
870
  return jspb.Message.setWrapperField(this, 7, value);
871
871
  };
872
872
 
@@ -875,8 +875,8 @@ proto.fonoster.applications.v1beta2.Application.prototype.setConversation = func
875
875
  * Clears the message field making it undefined.
876
876
  * @return {!proto.fonoster.applications.v1beta2.Application} returns this
877
877
  */
878
- proto.fonoster.applications.v1beta2.Application.prototype.clearConversation = function() {
879
- return this.setConversation(undefined);
878
+ proto.fonoster.applications.v1beta2.Application.prototype.clearIntelligence = function() {
879
+ return this.setIntelligence(undefined);
880
880
  };
881
881
 
882
882
 
@@ -884,7 +884,7 @@ proto.fonoster.applications.v1beta2.Application.prototype.clearConversation = fu
884
884
  * Returns whether this field is set.
885
885
  * @return {boolean}
886
886
  */
887
- proto.fonoster.applications.v1beta2.Application.prototype.hasConversation = function() {
887
+ proto.fonoster.applications.v1beta2.Application.prototype.hasIntelligence = function() {
888
888
  return jspb.Message.getField(this, 7) != null;
889
889
  };
890
890
 
@@ -2645,7 +2645,8 @@ proto.fonoster.applications.v1beta2.DeleteApplicationResponse.prototype.setRef =
2645
2645
  * @enum {number}
2646
2646
  */
2647
2647
  proto.fonoster.applications.v1beta2.ApplicationType = {
2648
- EXTERNAL: 0
2648
+ EXTERNAL: 0,
2649
+ AUTOPILOT: 1
2649
2650
  };
2650
2651
 
2651
2652
  goog.object.extend(exports, proto.fonoster.applications.v1beta2);
@@ -56,10 +56,10 @@ export class Application extends jspb.Message {
56
56
  hasSpeechToText(): boolean;
57
57
  clearSpeechToText(): Application;
58
58
 
59
- getConversation(): ProductContainer | undefined;
60
- setConversation(value?: ProductContainer): Application;
61
- hasConversation(): boolean;
62
- clearConversation(): Application;
59
+ getIntelligence(): ProductContainer | undefined;
60
+ setIntelligence(value?: ProductContainer): Application;
61
+ hasIntelligence(): boolean;
62
+ clearIntelligence(): Application;
63
63
 
64
64
  getCreatedAt(): number;
65
65
  setCreatedAt(value: number): Application;
@@ -83,7 +83,7 @@ export namespace Application {
83
83
  endpoint: string,
84
84
  textToSpeech?: ProductContainer.AsObject,
85
85
  speechToText?: ProductContainer.AsObject,
86
- conversation?: ProductContainer.AsObject,
86
+ intelligence?: ProductContainer.AsObject,
87
87
  createdAt: number,
88
88
  updatedAt: number,
89
89
  }
@@ -319,4 +319,5 @@ export namespace DeleteApplicationResponse {
319
319
 
320
320
  export enum ApplicationType {
321
321
  EXTERNAL = 0,
322
+ AUTOPILOT = 1,
322
323
  }
@@ -530,7 +530,7 @@ proto.fonoster.applications.v1beta2.Application.toObject = function(includeInsta
530
530
  endpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
531
531
  textToSpeech: (f = msg.getTextToSpeech()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
532
532
  speechToText: (f = msg.getSpeechToText()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
533
- conversation: (f = msg.getConversation()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
533
+ intelligence: (f = msg.getIntelligence()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
534
534
  createdAt: jspb.Message.getFieldWithDefault(msg, 8, 0),
535
535
  updatedAt: jspb.Message.getFieldWithDefault(msg, 9, 0)
536
536
  };
@@ -598,7 +598,7 @@ proto.fonoster.applications.v1beta2.Application.deserializeBinaryFromReader = fu
598
598
  case 7:
599
599
  var value = new proto.fonoster.applications.v1beta2.ProductContainer;
600
600
  reader.readMessage(value,proto.fonoster.applications.v1beta2.ProductContainer.deserializeBinaryFromReader);
601
- msg.setConversation(value);
601
+ msg.setIntelligence(value);
602
602
  break;
603
603
  case 8:
604
604
  var value = /** @type {number} */ (reader.readInt32());
@@ -681,7 +681,7 @@ proto.fonoster.applications.v1beta2.Application.serializeBinaryToWriter = functi
681
681
  proto.fonoster.applications.v1beta2.ProductContainer.serializeBinaryToWriter
682
682
  );
683
683
  }
684
- f = message.getConversation();
684
+ f = message.getIntelligence();
685
685
  if (f != null) {
686
686
  writer.writeMessage(
687
687
  7,
@@ -853,10 +853,10 @@ proto.fonoster.applications.v1beta2.Application.prototype.hasSpeechToText = func
853
853
 
854
854
 
855
855
  /**
856
- * optional ProductContainer conversation = 7;
856
+ * optional ProductContainer intelligence = 7;
857
857
  * @return {?proto.fonoster.applications.v1beta2.ProductContainer}
858
858
  */
859
- proto.fonoster.applications.v1beta2.Application.prototype.getConversation = function() {
859
+ proto.fonoster.applications.v1beta2.Application.prototype.getIntelligence = function() {
860
860
  return /** @type{?proto.fonoster.applications.v1beta2.ProductContainer} */ (
861
861
  jspb.Message.getWrapperField(this, proto.fonoster.applications.v1beta2.ProductContainer, 7));
862
862
  };
@@ -866,7 +866,7 @@ proto.fonoster.applications.v1beta2.Application.prototype.getConversation = func
866
866
  * @param {?proto.fonoster.applications.v1beta2.ProductContainer|undefined} value
867
867
  * @return {!proto.fonoster.applications.v1beta2.Application} returns this
868
868
  */
869
- proto.fonoster.applications.v1beta2.Application.prototype.setConversation = function(value) {
869
+ proto.fonoster.applications.v1beta2.Application.prototype.setIntelligence = function(value) {
870
870
  return jspb.Message.setWrapperField(this, 7, value);
871
871
  };
872
872
 
@@ -875,8 +875,8 @@ proto.fonoster.applications.v1beta2.Application.prototype.setConversation = func
875
875
  * Clears the message field making it undefined.
876
876
  * @return {!proto.fonoster.applications.v1beta2.Application} returns this
877
877
  */
878
- proto.fonoster.applications.v1beta2.Application.prototype.clearConversation = function() {
879
- return this.setConversation(undefined);
878
+ proto.fonoster.applications.v1beta2.Application.prototype.clearIntelligence = function() {
879
+ return this.setIntelligence(undefined);
880
880
  };
881
881
 
882
882
 
@@ -884,7 +884,7 @@ proto.fonoster.applications.v1beta2.Application.prototype.clearConversation = fu
884
884
  * Returns whether this field is set.
885
885
  * @return {boolean}
886
886
  */
887
- proto.fonoster.applications.v1beta2.Application.prototype.hasConversation = function() {
887
+ proto.fonoster.applications.v1beta2.Application.prototype.hasIntelligence = function() {
888
888
  return jspb.Message.getField(this, 7) != null;
889
889
  };
890
890
 
@@ -2645,7 +2645,8 @@ proto.fonoster.applications.v1beta2.DeleteApplicationResponse.prototype.setRef =
2645
2645
  * @enum {number}
2646
2646
  */
2647
2647
  proto.fonoster.applications.v1beta2.ApplicationType = {
2648
- EXTERNAL: 0
2648
+ EXTERNAL: 0,
2649
+ AUTOPILOT: 1
2649
2650
  };
2650
2651
 
2651
2652
  goog.object.extend(exports, proto.fonoster.applications.v1beta2);