@fonoster/sdk 0.9.15 → 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.
- package/dist/node/Users.d.ts +40 -1
- package/dist/node/Users.js +55 -0
- package/dist/node/Workspaces.d.ts +23 -2
- package/dist/node/Workspaces.js +31 -1
- package/dist/node/client/types/IdentityClient.d.ts +4 -1
- package/dist/node/generated/node/identity_grpc_pb.js +44 -0
- package/dist/node/generated/node/identity_pb.js +446 -112
- package/dist/node/generated/web/IdentityServiceClientPb.ts +86 -0
- package/dist/node/generated/web/identity_pb.d.ts +63 -23
- package/dist/node/generated/web/identity_pb.js +446 -112
- package/dist/node/tsconfig.tsbuildinfo +1 -1
- package/dist/web/fonoster.min.js +1 -1
- package/dist/web/index.esm.js +1 -1
- package/package.json +4 -4
package/dist/node/Users.d.ts
CHANGED
|
@@ -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.
|
package/dist/node/Users.js
CHANGED
|
@@ -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 { BaseApiObject, CreateWorkspaceRequest, InviteUserToWorkspaceRequest, ListWorkspacesResponse, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationResponse, UpdateWorkspaceRequest, Workspace } from "@fonoster/types";
|
|
1
|
+
import { BaseApiObject, CreateWorkspaceRequest, InviteUserToWorkspaceRequest, ListWorkspacesResponse, ListWorkspaceMembersRequest, ListWorkspaceMembersResponse, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationResponse, UpdateWorkspaceRequest, Workspace } from "@fonoster/types";
|
|
2
2
|
import { FonosterClient } from "./client/types";
|
|
3
3
|
/**
|
|
4
4
|
* @classdesc Fonoster Workspaces, part of the Fonoster Identity subsystem,
|
|
@@ -117,7 +117,7 @@ declare class Workspaces {
|
|
|
117
117
|
*/
|
|
118
118
|
deleteWorkspace(ref: string): Promise<BaseApiObject>;
|
|
119
119
|
/**
|
|
120
|
-
* Retrieves a list of Workspaces
|
|
120
|
+
* Retrieves a list of all Workspaces for the logged in user.
|
|
121
121
|
*
|
|
122
122
|
* @return {Promise<ListWorkspacesResponse>} - The response object that contains the list of Workspaces
|
|
123
123
|
* @example
|
|
@@ -169,6 +169,27 @@ declare class Workspaces {
|
|
|
169
169
|
* .catch(console.error); // an error occurred
|
|
170
170
|
*/
|
|
171
171
|
resendWorkspaceMembershipInvitation(userRef: string): Promise<ResendWorkspaceMembershipInvitationResponse>;
|
|
172
|
+
/**
|
|
173
|
+
* List the members of a Workspace
|
|
174
|
+
*
|
|
175
|
+
* @param {ListWorkspaceMembersRequest} request - Request object to list the members of a Workspace
|
|
176
|
+
* @param {number} request.pageSize - The number of members to return in the response
|
|
177
|
+
* @param {string} request.pageToken - The page token to return the next page of members
|
|
178
|
+
* @return {Promise<ListWorkspaceMembersResponse>} - The response object that contains the list of members
|
|
179
|
+
* @example
|
|
180
|
+
* const workspaces = new SDK.Workspaces(client); // Existing client object
|
|
181
|
+
*
|
|
182
|
+
* const request = {
|
|
183
|
+
* pageSize: 10,
|
|
184
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
185
|
+
* };
|
|
186
|
+
*
|
|
187
|
+
* workspaces
|
|
188
|
+
* .listWorkspaceMembers(request)
|
|
189
|
+
* .then(console.log) // successful response
|
|
190
|
+
* .catch(console.error); // an error occurred
|
|
191
|
+
*/
|
|
192
|
+
listWorkspaceMembers(request: ListWorkspaceMembersRequest): Promise<ListWorkspaceMembersResponse>;
|
|
172
193
|
/**
|
|
173
194
|
* Removes a User from a Workspace.
|
|
174
195
|
*
|
package/dist/node/Workspaces.js
CHANGED
|
@@ -154,7 +154,7 @@ class Workspaces {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
|
-
* Retrieves a list of Workspaces
|
|
157
|
+
* Retrieves a list of all Workspaces for the logged in user.
|
|
158
158
|
*
|
|
159
159
|
* @return {Promise<ListWorkspacesResponse>} - The response object that contains the list of Workspaces
|
|
160
160
|
* @example
|
|
@@ -231,6 +231,36 @@ class Workspaces {
|
|
|
231
231
|
request: { userRef }
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* List the members of a Workspace
|
|
236
|
+
*
|
|
237
|
+
* @param {ListWorkspaceMembersRequest} request - Request object to list the members of a Workspace
|
|
238
|
+
* @param {number} request.pageSize - The number of members to return in the response
|
|
239
|
+
* @param {string} request.pageToken - The page token to return the next page of members
|
|
240
|
+
* @return {Promise<ListWorkspaceMembersResponse>} - The response object that contains the list of members
|
|
241
|
+
* @example
|
|
242
|
+
* const workspaces = new SDK.Workspaces(client); // Existing client object
|
|
243
|
+
*
|
|
244
|
+
* const request = {
|
|
245
|
+
* pageSize: 10,
|
|
246
|
+
* pageToken: "00000000-0000-0000-0000-000000000000"
|
|
247
|
+
* };
|
|
248
|
+
*
|
|
249
|
+
* workspaces
|
|
250
|
+
* .listWorkspaceMembers(request)
|
|
251
|
+
* .then(console.log) // successful response
|
|
252
|
+
* .catch(console.error); // an error occurred
|
|
253
|
+
*/
|
|
254
|
+
async listWorkspaceMembers(request) {
|
|
255
|
+
const client = this.client.getIdentityClient();
|
|
256
|
+
return await (0, makeRpcRequest_1.makeRpcRequest)({
|
|
257
|
+
method: client.listWorkspaceMembers.bind(client),
|
|
258
|
+
requestPBObjectConstructor: identity_pb_1.ListWorkspaceMembersRequest,
|
|
259
|
+
metadata: this.client.getMetadata(),
|
|
260
|
+
request,
|
|
261
|
+
repeatableObjectMapping: [["itemsList", identity_pb_1.WorkspaceMember]]
|
|
262
|
+
});
|
|
263
|
+
}
|
|
234
264
|
/**
|
|
235
265
|
* Removes a User from a Workspace.
|
|
236
266
|
*
|
|
@@ -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, 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,12 +15,15 @@ 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>;
|
|
21
23
|
updateWorkspace: ClientFunction<UpdateWorkspaceRequest, UpdateWorkspaceResponse>;
|
|
22
24
|
inviteUserToWorkspace: ClientFunction<InviteUserToWorkspaceRequest, InviteUserToWorkspaceResponse>;
|
|
23
25
|
resendWorkspaceMembershipInvitation: ClientFunction<ResendWorkspaceMembershipInvitationRequest, ResendWorkspaceMembershipInvitationResponse>;
|
|
26
|
+
listWorkspaceMembers: ClientFunction<ListWorkspaceMembersRequest, ListWorkspaceMembersResponse>;
|
|
24
27
|
removeUserFromWorkspace: ClientFunction<RemoveUserFromWorkspaceRequest, RemoveUserFromWorkspaceResponse>;
|
|
25
28
|
deleteWorkspace: ClientFunction<DeleteWorkspaceRequest, DeleteWorkspaceResponse>;
|
|
26
29
|
};
|
|
@@ -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',
|