@fonoster/sdk 0.9.16 → 0.9.19

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.
@@ -1,4 +1,4 @@
1
- import { BaseApiObject, CreateUserRequest, UpdateUserRequest, User } from "@fonoster/types";
1
+ import { BaseApiObject, CreateUserRequest, ResetPasswordRequest, UpdateUserRequest, User } from "@fonoster/types";
2
2
  import { FonosterClient } from "./client/types";
3
3
  /**
4
4
  * @classdesc Fonoster Users, part of the Fonoster Identity subsystem,
@@ -98,6 +98,45 @@ declare class Users {
98
98
  * .catch(console.error); // an error occurred
99
99
  */
100
100
  updateUser(request: UpdateUserRequest): Promise<BaseApiObject>;
101
+ /**
102
+ * Sends a reset password code to the User.
103
+ *
104
+ * @param {string} username - The username of the User
105
+ * @return {Promise<void>} - The response object that contains the reference to the User
106
+ * @example
107
+ * const users = new SDK.Users(client); // Existing client object
108
+ *
109
+ * const username = "john.doe@example.com";
110
+ *
111
+ * users
112
+ * .sendResetPasswordCode(username)
113
+ * .then(console.log) // successful response
114
+ * .catch(console.error); // an error occurred
115
+ */
116
+ sendResetPasswordCode(username: string): Promise<BaseApiObject>;
117
+ /**
118
+ * Resets the password of the User.
119
+ *
120
+ * @param {ResetPasswordRequest} request - The request object that contains the necessary information to reset the password of a User
121
+ * @param {string} request.username - The username of the User
122
+ * @param {string} request.password - The new password of the User
123
+ * @param {string} request.verificationCode - The verification code of the User
124
+ * @return {Promise<void>} - The response object that contains the reference to the User
125
+ * @example
126
+ * const users = new SDK.Users(client); // Existing client object
127
+ *
128
+ * const request = {
129
+ * username: "john.doe@example.com",
130
+ * password: "password",
131
+ * verificationCode: "123456"
132
+ * };
133
+ *
134
+ * users
135
+ * .resetPassword(request)
136
+ * .then(console.log) // successful response
137
+ * .catch(console.error); // an error occurred
138
+ */
139
+ resetPassword(request: ResetPasswordRequest): Promise<void>;
101
140
  /**
102
141
  * Deletes an existing User from Fonoster.
103
142
  * Note that this operation is irreversible.
@@ -127,6 +127,61 @@ class Users {
127
127
  request
128
128
  });
129
129
  }
130
+ /**
131
+ * Sends a reset password code to the User.
132
+ *
133
+ * @param {string} username - The username of the User
134
+ * @return {Promise<void>} - The response object that contains the reference to the User
135
+ * @example
136
+ * const users = new SDK.Users(client); // Existing client object
137
+ *
138
+ * const username = "john.doe@example.com";
139
+ *
140
+ * users
141
+ * .sendResetPasswordCode(username)
142
+ * .then(console.log) // successful response
143
+ * .catch(console.error); // an error occurred
144
+ */
145
+ async sendResetPasswordCode(username) {
146
+ const client = this.client.getIdentityClient();
147
+ return await (0, makeRpcRequest_1.makeRpcRequest)({
148
+ method: client.sendResetPasswordCode.bind(client),
149
+ requestPBObjectConstructor: identity_pb_1.SendResetPasswordCodeRequest,
150
+ metadata: this.client.getMetadata(),
151
+ request: { username }
152
+ });
153
+ }
154
+ /**
155
+ * Resets the password of the User.
156
+ *
157
+ * @param {ResetPasswordRequest} request - The request object that contains the necessary information to reset the password of a User
158
+ * @param {string} request.username - The username of the User
159
+ * @param {string} request.password - The new password of the User
160
+ * @param {string} request.verificationCode - The verification code of the User
161
+ * @return {Promise<void>} - The response object that contains the reference to the User
162
+ * @example
163
+ * const users = new SDK.Users(client); // Existing client object
164
+ *
165
+ * const request = {
166
+ * username: "john.doe@example.com",
167
+ * password: "password",
168
+ * verificationCode: "123456"
169
+ * };
170
+ *
171
+ * users
172
+ * .resetPassword(request)
173
+ * .then(console.log) // successful response
174
+ * .catch(console.error); // an error occurred
175
+ */
176
+ async resetPassword(request) {
177
+ const client = this.client.getIdentityClient();
178
+ return await (0, makeRpcRequest_1.makeRpcRequest)({
179
+ method: client.resetPassword.bind(client),
180
+ requestPBObjectConstructor: identity_pb_1.ResetPasswordRequest,
181
+ metadata: this.client.getMetadata(),
182
+ request
183
+ });
184
+ }
130
185
  /**
131
186
  * Deletes an existing User from Fonoster.
132
187
  * Note that this operation is irreversible.
@@ -1,4 +1,4 @@
1
- import { CreateApiKeyRequest, CreateApiKeyResponse, CreateUserRequest, CreateUserResponse, CreateWorkspaceRequest, DeleteApiKeyRequest, DeleteApiKeyResponse, DeleteUserRequest, DeleteUserResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, ExchangeApiKeyRequest, ExchangeApiKeyResponse, ExchangeCredentialsRequest, ExchangeCredentialsResponse, ExchangeOauth2CodeRequest, ExchangeOauth2CodeResponse, ExchangeRefreshTokenRequest, ExchangeRefreshTokenResponse, GetUserRequest, GetWorkspaceRequest, InviteUserToWorkspaceRequest, InviteUserToWorkspaceResponse, ListApiKeysRequest, ListApiKeysResponse, ListWorkspacesRequest, ListWorkspacesResponse, RegenerateApiKeyRequest, RegenerateApiKeyResponse, RemoveUserFromWorkspaceRequest, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationRequest, ResendWorkspaceMembershipInvitationResponse, ListWorkspaceMembersRequest, ListWorkspaceMembersResponse, SendVerificationCodeRequest, UpdateUserRequest, UpdateWorkspaceRequest, UpdateWorkspaceResponse, User, VerifyCodeRequest, Workspace } from "../../generated/web/identity_pb";
1
+ import { CreateApiKeyRequest, CreateApiKeyResponse, CreateUserRequest, CreateUserResponse, CreateWorkspaceRequest, DeleteApiKeyRequest, DeleteApiKeyResponse, DeleteUserRequest, DeleteUserResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, ExchangeApiKeyRequest, ExchangeApiKeyResponse, ExchangeCredentialsRequest, ExchangeCredentialsResponse, ExchangeOauth2CodeRequest, ExchangeOauth2CodeResponse, ExchangeRefreshTokenRequest, ExchangeRefreshTokenResponse, GetUserRequest, GetWorkspaceRequest, InviteUserToWorkspaceRequest, InviteUserToWorkspaceResponse, ListApiKeysRequest, ListApiKeysResponse, ListWorkspacesRequest, ListWorkspacesResponse, RegenerateApiKeyRequest, RegenerateApiKeyResponse, RemoveUserFromWorkspaceRequest, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationRequest, ResendWorkspaceMembershipInvitationResponse, ListWorkspaceMembersRequest, ListWorkspaceMembersResponse, SendVerificationCodeRequest, SendResetPasswordCodeRequest, ResetPasswordRequest, UpdateUserRequest, UpdateWorkspaceRequest, UpdateWorkspaceResponse, User, VerifyCodeRequest, Workspace } from "../../generated/web/identity_pb";
2
2
  import { ClientFunction } from "../types";
3
3
  type IdentityClient = {
4
4
  createApiKey: ClientFunction<CreateApiKeyRequest, CreateApiKeyResponse>;
@@ -15,6 +15,8 @@ type IdentityClient = {
15
15
  deleteUser: ClientFunction<DeleteUserRequest, DeleteUserResponse>;
16
16
  sendVerificationCode: ClientFunction<SendVerificationCodeRequest, never>;
17
17
  verifyCode: ClientFunction<VerifyCodeRequest, never>;
18
+ sendResetPasswordCode: ClientFunction<SendResetPasswordCodeRequest, never>;
19
+ resetPassword: ClientFunction<ResetPasswordRequest, never>;
18
20
  createWorkspace: ClientFunction<CreateWorkspaceRequest, CreateUserResponse>;
19
21
  getWorkspace: ClientFunction<GetWorkspaceRequest, Workspace>;
20
22
  listWorkspaces: ClientFunction<ListWorkspacesRequest, ListWorkspacesResponse>;
@@ -430,6 +430,17 @@ function deserialize_fonoster_identity_v1beta2_ResendWorkspaceMembershipInvitati
430
430
  return identity_pb.ResendWorkspaceMembershipInvitationResponse.deserializeBinary(new Uint8Array(buffer_arg));
431
431
  }
432
432
 
433
+ function serialize_fonoster_identity_v1beta2_ResetPasswordRequest(arg) {
434
+ if (!(arg instanceof identity_pb.ResetPasswordRequest)) {
435
+ throw new Error('Expected argument of type fonoster.identity.v1beta2.ResetPasswordRequest');
436
+ }
437
+ return Buffer.from(arg.serializeBinary());
438
+ }
439
+
440
+ function deserialize_fonoster_identity_v1beta2_ResetPasswordRequest(buffer_arg) {
441
+ return identity_pb.ResetPasswordRequest.deserializeBinary(new Uint8Array(buffer_arg));
442
+ }
443
+
433
444
  function serialize_fonoster_identity_v1beta2_RevokeTokenRequest(arg) {
434
445
  if (!(arg instanceof identity_pb.RevokeTokenRequest)) {
435
446
  throw new Error('Expected argument of type fonoster.identity.v1beta2.RevokeTokenRequest');
@@ -452,6 +463,17 @@ function deserialize_fonoster_identity_v1beta2_RevokeTokenResponse(buffer_arg) {
452
463
  return identity_pb.RevokeTokenResponse.deserializeBinary(new Uint8Array(buffer_arg));
453
464
  }
454
465
 
466
+ function serialize_fonoster_identity_v1beta2_SendResetPasswordCodeRequest(arg) {
467
+ if (!(arg instanceof identity_pb.SendResetPasswordCodeRequest)) {
468
+ throw new Error('Expected argument of type fonoster.identity.v1beta2.SendResetPasswordCodeRequest');
469
+ }
470
+ return Buffer.from(arg.serializeBinary());
471
+ }
472
+
473
+ function deserialize_fonoster_identity_v1beta2_SendResetPasswordCodeRequest(buffer_arg) {
474
+ return identity_pb.SendResetPasswordCodeRequest.deserializeBinary(new Uint8Array(buffer_arg));
475
+ }
476
+
455
477
  function serialize_fonoster_identity_v1beta2_SendVerificationCodeRequest(arg) {
456
478
  if (!(arg instanceof identity_pb.SendVerificationCodeRequest)) {
457
479
  throw new Error('Expected argument of type fonoster.identity.v1beta2.SendVerificationCodeRequest');
@@ -720,6 +742,28 @@ createUser: {
720
742
  responseSerialize: serialize_google_protobuf_Empty,
721
743
  responseDeserialize: deserialize_google_protobuf_Empty,
722
744
  },
745
+ sendResetPasswordCode: {
746
+ path: '/fonoster.identity.v1beta2.Identity/SendResetPasswordCode',
747
+ requestStream: false,
748
+ responseStream: false,
749
+ requestType: identity_pb.SendResetPasswordCodeRequest,
750
+ responseType: google_protobuf_empty_pb.Empty,
751
+ requestSerialize: serialize_fonoster_identity_v1beta2_SendResetPasswordCodeRequest,
752
+ requestDeserialize: deserialize_fonoster_identity_v1beta2_SendResetPasswordCodeRequest,
753
+ responseSerialize: serialize_google_protobuf_Empty,
754
+ responseDeserialize: deserialize_google_protobuf_Empty,
755
+ },
756
+ resetPassword: {
757
+ path: '/fonoster.identity.v1beta2.Identity/ResetPassword',
758
+ requestStream: false,
759
+ responseStream: false,
760
+ requestType: identity_pb.ResetPasswordRequest,
761
+ responseType: google_protobuf_empty_pb.Empty,
762
+ requestSerialize: serialize_fonoster_identity_v1beta2_ResetPasswordRequest,
763
+ requestDeserialize: deserialize_fonoster_identity_v1beta2_ResetPasswordRequest,
764
+ responseSerialize: serialize_google_protobuf_Empty,
765
+ responseDeserialize: deserialize_google_protobuf_Empty,
766
+ },
723
767
  // ApiKey actions
724
768
  createApiKey: {
725
769
  path: '/fonoster.identity.v1beta2.Identity/CreateApiKey',
@@ -63,8 +63,10 @@ goog.exportSymbol('proto.fonoster.identity.v1beta2.RemoveUserFromWorkspaceReques
63
63
  goog.exportSymbol('proto.fonoster.identity.v1beta2.RemoveUserFromWorkspaceResponse', null, global);
64
64
  goog.exportSymbol('proto.fonoster.identity.v1beta2.ResendWorkspaceMembershipInvitationRequest', null, global);
65
65
  goog.exportSymbol('proto.fonoster.identity.v1beta2.ResendWorkspaceMembershipInvitationResponse', null, global);
66
+ goog.exportSymbol('proto.fonoster.identity.v1beta2.ResetPasswordRequest', null, global);
66
67
  goog.exportSymbol('proto.fonoster.identity.v1beta2.RevokeTokenRequest', null, global);
67
68
  goog.exportSymbol('proto.fonoster.identity.v1beta2.RevokeTokenResponse', null, global);
69
+ goog.exportSymbol('proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest', null, global);
68
70
  goog.exportSymbol('proto.fonoster.identity.v1beta2.SendVerificationCodeRequest', null, global);
69
71
  goog.exportSymbol('proto.fonoster.identity.v1beta2.UpdateUserRequest', null, global);
70
72
  goog.exportSymbol('proto.fonoster.identity.v1beta2.UpdateUserResponse', null, global);
@@ -683,6 +685,48 @@ if (goog.DEBUG && !COMPILED) {
683
685
  */
684
686
  proto.fonoster.identity.v1beta2.VerifyCodeRequest.displayName = 'proto.fonoster.identity.v1beta2.VerifyCodeRequest';
685
687
  }
688
+ /**
689
+ * Generated by JsPbCodeGenerator.
690
+ * @param {Array=} opt_data Optional initial data array, typically from a
691
+ * server response, or constructed directly in Javascript. The array is used
692
+ * in place and becomes part of the constructed object. It is not cloned.
693
+ * If no data is provided, the constructed object will be empty, but still
694
+ * valid.
695
+ * @extends {jspb.Message}
696
+ * @constructor
697
+ */
698
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest = function(opt_data) {
699
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
700
+ };
701
+ goog.inherits(proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest, jspb.Message);
702
+ if (goog.DEBUG && !COMPILED) {
703
+ /**
704
+ * @public
705
+ * @override
706
+ */
707
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.displayName = 'proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest';
708
+ }
709
+ /**
710
+ * Generated by JsPbCodeGenerator.
711
+ * @param {Array=} opt_data Optional initial data array, typically from a
712
+ * server response, or constructed directly in Javascript. The array is used
713
+ * in place and becomes part of the constructed object. It is not cloned.
714
+ * If no data is provided, the constructed object will be empty, but still
715
+ * valid.
716
+ * @extends {jspb.Message}
717
+ * @constructor
718
+ */
719
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest = function(opt_data) {
720
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
721
+ };
722
+ goog.inherits(proto.fonoster.identity.v1beta2.ResetPasswordRequest, jspb.Message);
723
+ if (goog.DEBUG && !COMPILED) {
724
+ /**
725
+ * @public
726
+ * @override
727
+ */
728
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.displayName = 'proto.fonoster.identity.v1beta2.ResetPasswordRequest';
729
+ }
686
730
  /**
687
731
  * Generated by JsPbCodeGenerator.
688
732
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -5956,6 +6000,326 @@ proto.fonoster.identity.v1beta2.VerifyCodeRequest.prototype.setVerificationCode
5956
6000
 
5957
6001
 
5958
6002
 
6003
+ if (jspb.Message.GENERATE_TO_OBJECT) {
6004
+ /**
6005
+ * Creates an object representation of this proto.
6006
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
6007
+ * Optional fields that are not set will be set to undefined.
6008
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
6009
+ * For the list of reserved names please see:
6010
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
6011
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
6012
+ * JSPB instance for transitional soy proto support:
6013
+ * http://goto/soy-param-migration
6014
+ * @return {!Object}
6015
+ */
6016
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.prototype.toObject = function(opt_includeInstance) {
6017
+ return proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.toObject(opt_includeInstance, this);
6018
+ };
6019
+
6020
+
6021
+ /**
6022
+ * Static version of the {@see toObject} method.
6023
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
6024
+ * the JSPB instance for transitional soy proto support:
6025
+ * http://goto/soy-param-migration
6026
+ * @param {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest} msg The msg instance to transform.
6027
+ * @return {!Object}
6028
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6029
+ */
6030
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.toObject = function(includeInstance, msg) {
6031
+ var f, obj = {
6032
+ username: jspb.Message.getFieldWithDefault(msg, 1, "")
6033
+ };
6034
+
6035
+ if (includeInstance) {
6036
+ obj.$jspbMessageInstance = msg;
6037
+ }
6038
+ return obj;
6039
+ };
6040
+ }
6041
+
6042
+
6043
+ /**
6044
+ * Deserializes binary data (in protobuf wire format).
6045
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
6046
+ * @return {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest}
6047
+ */
6048
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.deserializeBinary = function(bytes) {
6049
+ var reader = new jspb.BinaryReader(bytes);
6050
+ var msg = new proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest;
6051
+ return proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.deserializeBinaryFromReader(msg, reader);
6052
+ };
6053
+
6054
+
6055
+ /**
6056
+ * Deserializes binary data (in protobuf wire format) from the
6057
+ * given reader into the given message object.
6058
+ * @param {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest} msg The message object to deserialize into.
6059
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
6060
+ * @return {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest}
6061
+ */
6062
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.deserializeBinaryFromReader = function(msg, reader) {
6063
+ while (reader.nextField()) {
6064
+ if (reader.isEndGroup()) {
6065
+ break;
6066
+ }
6067
+ var field = reader.getFieldNumber();
6068
+ switch (field) {
6069
+ case 1:
6070
+ var value = /** @type {string} */ (reader.readString());
6071
+ msg.setUsername(value);
6072
+ break;
6073
+ default:
6074
+ reader.skipField();
6075
+ break;
6076
+ }
6077
+ }
6078
+ return msg;
6079
+ };
6080
+
6081
+
6082
+ /**
6083
+ * Serializes the message to binary data (in protobuf wire format).
6084
+ * @return {!Uint8Array}
6085
+ */
6086
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.prototype.serializeBinary = function() {
6087
+ var writer = new jspb.BinaryWriter();
6088
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.serializeBinaryToWriter(this, writer);
6089
+ return writer.getResultBuffer();
6090
+ };
6091
+
6092
+
6093
+ /**
6094
+ * Serializes the given message to binary data (in protobuf wire
6095
+ * format), writing to the given BinaryWriter.
6096
+ * @param {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest} message
6097
+ * @param {!jspb.BinaryWriter} writer
6098
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6099
+ */
6100
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.serializeBinaryToWriter = function(message, writer) {
6101
+ var f = undefined;
6102
+ f = message.getUsername();
6103
+ if (f.length > 0) {
6104
+ writer.writeString(
6105
+ 1,
6106
+ f
6107
+ );
6108
+ }
6109
+ };
6110
+
6111
+
6112
+ /**
6113
+ * optional string username = 1;
6114
+ * @return {string}
6115
+ */
6116
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.prototype.getUsername = function() {
6117
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
6118
+ };
6119
+
6120
+
6121
+ /**
6122
+ * @param {string} value
6123
+ * @return {!proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest} returns this
6124
+ */
6125
+ proto.fonoster.identity.v1beta2.SendResetPasswordCodeRequest.prototype.setUsername = function(value) {
6126
+ return jspb.Message.setProto3StringField(this, 1, value);
6127
+ };
6128
+
6129
+
6130
+
6131
+
6132
+
6133
+ if (jspb.Message.GENERATE_TO_OBJECT) {
6134
+ /**
6135
+ * Creates an object representation of this proto.
6136
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
6137
+ * Optional fields that are not set will be set to undefined.
6138
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
6139
+ * For the list of reserved names please see:
6140
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
6141
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
6142
+ * JSPB instance for transitional soy proto support:
6143
+ * http://goto/soy-param-migration
6144
+ * @return {!Object}
6145
+ */
6146
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.toObject = function(opt_includeInstance) {
6147
+ return proto.fonoster.identity.v1beta2.ResetPasswordRequest.toObject(opt_includeInstance, this);
6148
+ };
6149
+
6150
+
6151
+ /**
6152
+ * Static version of the {@see toObject} method.
6153
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
6154
+ * the JSPB instance for transitional soy proto support:
6155
+ * http://goto/soy-param-migration
6156
+ * @param {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} msg The msg instance to transform.
6157
+ * @return {!Object}
6158
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6159
+ */
6160
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.toObject = function(includeInstance, msg) {
6161
+ var f, obj = {
6162
+ username: jspb.Message.getFieldWithDefault(msg, 1, ""),
6163
+ password: jspb.Message.getFieldWithDefault(msg, 2, ""),
6164
+ verificationCode: jspb.Message.getFieldWithDefault(msg, 3, "")
6165
+ };
6166
+
6167
+ if (includeInstance) {
6168
+ obj.$jspbMessageInstance = msg;
6169
+ }
6170
+ return obj;
6171
+ };
6172
+ }
6173
+
6174
+
6175
+ /**
6176
+ * Deserializes binary data (in protobuf wire format).
6177
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
6178
+ * @return {!proto.fonoster.identity.v1beta2.ResetPasswordRequest}
6179
+ */
6180
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.deserializeBinary = function(bytes) {
6181
+ var reader = new jspb.BinaryReader(bytes);
6182
+ var msg = new proto.fonoster.identity.v1beta2.ResetPasswordRequest;
6183
+ return proto.fonoster.identity.v1beta2.ResetPasswordRequest.deserializeBinaryFromReader(msg, reader);
6184
+ };
6185
+
6186
+
6187
+ /**
6188
+ * Deserializes binary data (in protobuf wire format) from the
6189
+ * given reader into the given message object.
6190
+ * @param {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} msg The message object to deserialize into.
6191
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
6192
+ * @return {!proto.fonoster.identity.v1beta2.ResetPasswordRequest}
6193
+ */
6194
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.deserializeBinaryFromReader = function(msg, reader) {
6195
+ while (reader.nextField()) {
6196
+ if (reader.isEndGroup()) {
6197
+ break;
6198
+ }
6199
+ var field = reader.getFieldNumber();
6200
+ switch (field) {
6201
+ case 1:
6202
+ var value = /** @type {string} */ (reader.readString());
6203
+ msg.setUsername(value);
6204
+ break;
6205
+ case 2:
6206
+ var value = /** @type {string} */ (reader.readString());
6207
+ msg.setPassword(value);
6208
+ break;
6209
+ case 3:
6210
+ var value = /** @type {string} */ (reader.readString());
6211
+ msg.setVerificationCode(value);
6212
+ break;
6213
+ default:
6214
+ reader.skipField();
6215
+ break;
6216
+ }
6217
+ }
6218
+ return msg;
6219
+ };
6220
+
6221
+
6222
+ /**
6223
+ * Serializes the message to binary data (in protobuf wire format).
6224
+ * @return {!Uint8Array}
6225
+ */
6226
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.serializeBinary = function() {
6227
+ var writer = new jspb.BinaryWriter();
6228
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.serializeBinaryToWriter(this, writer);
6229
+ return writer.getResultBuffer();
6230
+ };
6231
+
6232
+
6233
+ /**
6234
+ * Serializes the given message to binary data (in protobuf wire
6235
+ * format), writing to the given BinaryWriter.
6236
+ * @param {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} message
6237
+ * @param {!jspb.BinaryWriter} writer
6238
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6239
+ */
6240
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.serializeBinaryToWriter = function(message, writer) {
6241
+ var f = undefined;
6242
+ f = message.getUsername();
6243
+ if (f.length > 0) {
6244
+ writer.writeString(
6245
+ 1,
6246
+ f
6247
+ );
6248
+ }
6249
+ f = message.getPassword();
6250
+ if (f.length > 0) {
6251
+ writer.writeString(
6252
+ 2,
6253
+ f
6254
+ );
6255
+ }
6256
+ f = message.getVerificationCode();
6257
+ if (f.length > 0) {
6258
+ writer.writeString(
6259
+ 3,
6260
+ f
6261
+ );
6262
+ }
6263
+ };
6264
+
6265
+
6266
+ /**
6267
+ * optional string username = 1;
6268
+ * @return {string}
6269
+ */
6270
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.getUsername = function() {
6271
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
6272
+ };
6273
+
6274
+
6275
+ /**
6276
+ * @param {string} value
6277
+ * @return {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} returns this
6278
+ */
6279
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.setUsername = function(value) {
6280
+ return jspb.Message.setProto3StringField(this, 1, value);
6281
+ };
6282
+
6283
+
6284
+ /**
6285
+ * optional string password = 2;
6286
+ * @return {string}
6287
+ */
6288
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.getPassword = function() {
6289
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
6290
+ };
6291
+
6292
+
6293
+ /**
6294
+ * @param {string} value
6295
+ * @return {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} returns this
6296
+ */
6297
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.setPassword = function(value) {
6298
+ return jspb.Message.setProto3StringField(this, 2, value);
6299
+ };
6300
+
6301
+
6302
+ /**
6303
+ * optional string verification_code = 3;
6304
+ * @return {string}
6305
+ */
6306
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.getVerificationCode = function() {
6307
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
6308
+ };
6309
+
6310
+
6311
+ /**
6312
+ * @param {string} value
6313
+ * @return {!proto.fonoster.identity.v1beta2.ResetPasswordRequest} returns this
6314
+ */
6315
+ proto.fonoster.identity.v1beta2.ResetPasswordRequest.prototype.setVerificationCode = function(value) {
6316
+ return jspb.Message.setProto3StringField(this, 3, value);
6317
+ };
6318
+
6319
+
6320
+
6321
+
6322
+
5959
6323
  if (jspb.Message.GENERATE_TO_OBJECT) {
5960
6324
  /**
5961
6325
  * Creates an object representation of this proto.
@@ -685,6 +685,92 @@ export class IdentityClient {
685
685
  this.methodDescriptorVerifyCode);
686
686
  }
687
687
 
688
+ methodDescriptorSendResetPasswordCode = new grpcWeb.MethodDescriptor(
689
+ '/fonoster.identity.v1beta2.Identity/SendResetPasswordCode',
690
+ grpcWeb.MethodType.UNARY,
691
+ identity_pb.SendResetPasswordCodeRequest,
692
+ google_protobuf_empty_pb.Empty,
693
+ (request: identity_pb.SendResetPasswordCodeRequest) => {
694
+ return request.serializeBinary();
695
+ },
696
+ google_protobuf_empty_pb.Empty.deserializeBinary
697
+ );
698
+
699
+ sendResetPasswordCode(
700
+ request: identity_pb.SendResetPasswordCodeRequest,
701
+ metadata?: grpcWeb.Metadata | null): Promise<google_protobuf_empty_pb.Empty>;
702
+
703
+ sendResetPasswordCode(
704
+ request: identity_pb.SendResetPasswordCodeRequest,
705
+ metadata: grpcWeb.Metadata | null,
706
+ callback: (err: grpcWeb.RpcError,
707
+ response: google_protobuf_empty_pb.Empty) => void): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
708
+
709
+ sendResetPasswordCode(
710
+ request: identity_pb.SendResetPasswordCodeRequest,
711
+ metadata?: grpcWeb.Metadata | null,
712
+ callback?: (err: grpcWeb.RpcError,
713
+ response: google_protobuf_empty_pb.Empty) => void) {
714
+ if (callback !== undefined) {
715
+ return this.client_.rpcCall(
716
+ this.hostname_ +
717
+ '/fonoster.identity.v1beta2.Identity/SendResetPasswordCode',
718
+ request,
719
+ metadata || {},
720
+ this.methodDescriptorSendResetPasswordCode,
721
+ callback);
722
+ }
723
+ return this.client_.unaryCall(
724
+ this.hostname_ +
725
+ '/fonoster.identity.v1beta2.Identity/SendResetPasswordCode',
726
+ request,
727
+ metadata || {},
728
+ this.methodDescriptorSendResetPasswordCode);
729
+ }
730
+
731
+ methodDescriptorResetPassword = new grpcWeb.MethodDescriptor(
732
+ '/fonoster.identity.v1beta2.Identity/ResetPassword',
733
+ grpcWeb.MethodType.UNARY,
734
+ identity_pb.ResetPasswordRequest,
735
+ google_protobuf_empty_pb.Empty,
736
+ (request: identity_pb.ResetPasswordRequest) => {
737
+ return request.serializeBinary();
738
+ },
739
+ google_protobuf_empty_pb.Empty.deserializeBinary
740
+ );
741
+
742
+ resetPassword(
743
+ request: identity_pb.ResetPasswordRequest,
744
+ metadata?: grpcWeb.Metadata | null): Promise<google_protobuf_empty_pb.Empty>;
745
+
746
+ resetPassword(
747
+ request: identity_pb.ResetPasswordRequest,
748
+ metadata: grpcWeb.Metadata | null,
749
+ callback: (err: grpcWeb.RpcError,
750
+ response: google_protobuf_empty_pb.Empty) => void): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
751
+
752
+ resetPassword(
753
+ request: identity_pb.ResetPasswordRequest,
754
+ metadata?: grpcWeb.Metadata | null,
755
+ callback?: (err: grpcWeb.RpcError,
756
+ response: google_protobuf_empty_pb.Empty) => void) {
757
+ if (callback !== undefined) {
758
+ return this.client_.rpcCall(
759
+ this.hostname_ +
760
+ '/fonoster.identity.v1beta2.Identity/ResetPassword',
761
+ request,
762
+ metadata || {},
763
+ this.methodDescriptorResetPassword,
764
+ callback);
765
+ }
766
+ return this.client_.unaryCall(
767
+ this.hostname_ +
768
+ '/fonoster.identity.v1beta2.Identity/ResetPassword',
769
+ request,
770
+ metadata || {},
771
+ this.methodDescriptorResetPassword);
772
+ }
773
+
688
774
  methodDescriptorCreateApiKey = new grpcWeb.MethodDescriptor(
689
775
  '/fonoster.identity.v1beta2.Identity/CreateApiKey',
690
776
  grpcWeb.MethodType.UNARY,