mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-15 20:44:46 +00:00
Generate clients (#206)
This commit is contained in:
12
examples/user/read/node/readAccountByEmail.js
Executable file
12
examples/user/read/node/readAccountByEmail.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as user from "m3o/user";
|
||||
|
||||
// Read an account by id, username or email. Only one need to be specified.
|
||||
async function ReadAccountByEmail() {
|
||||
let userService = new user.UserService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await userService.read({
|
||||
email: "joe@example.com",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ReadAccountByEmail();
|
||||
12
examples/user/read/node/readAccountByUsernameOrEmail.js
Executable file
12
examples/user/read/node/readAccountByUsernameOrEmail.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as user from "m3o/user";
|
||||
|
||||
// Read an account by id, username or email. Only one need to be specified.
|
||||
async function ReadAccountByUsernameOrEmail() {
|
||||
let userService = new user.UserService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await userService.read({
|
||||
username: "usrname-1",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ReadAccountByUsernameOrEmail();
|
||||
12
examples/user/read/node/readAnAccountById.js
Executable file
12
examples/user/read/node/readAnAccountById.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as user from "m3o/user";
|
||||
|
||||
// Read an account by id, username or email. Only one need to be specified.
|
||||
async function ReadAnAccountById() {
|
||||
let userService = new user.UserService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await userService.read({
|
||||
id: "usrid-1",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ReadAnAccountById();
|
||||
Reference in New Issue
Block a user