Commit from GitHub Actions (Generate Clients & Examples)

This commit is contained in:
asim
2021-11-17 20:27:43 +00:00
parent 5ea297aaa8
commit 09113b41a9
36 changed files with 59 additions and 59 deletions

View File

@@ -79,5 +79,5 @@
"prepare": "npm run build"
},
"types": "index.d.ts",
"version": "1.0.767"
"version": "1.0.769"
}

View File

@@ -12,9 +12,9 @@ func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "user",
})

View File

@@ -12,9 +12,9 @@ func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "events",
})

View File

@@ -3,7 +3,7 @@ curl "http://localhost:8080/user/Create" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"email": "joe@example.com",
"id": "usrid-1",
"password": "mySecretPass123",
"username": "usrname-1"
"id": "user-1",
"password": "Password1",
"username": "joe"
}'

View File

@@ -12,9 +12,9 @@ func CreateAnAccount() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Create(&user.CreateRequest{
Email: "joe@example.com",
Id: "usrid-1",
Password: "mySecretPass123",
Username: "usrname-1",
Id: "user-1",
Password: "Password1",
Username: "joe",
})
fmt.Println(rsp, err)
}

View File

@@ -5,9 +5,9 @@ async function createAnAccount() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.create({
email: "joe@example.com",
id: "usrid-1",
password: "mySecretPass123",
username: "usrname-1",
id: "user-1",
password: "Password1",
username: "joe",
});
console.log(rsp);
}

View File

@@ -2,5 +2,5 @@ curl "http://localhost:8080/user/Delete" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"id": "fdf34f34f34-f34f34-f43f43f34-f4f34f"
"id": "8b98acbe-0b6a-4d66-a414-5ffbf666786f"
}'

View File

@@ -11,7 +11,7 @@ import (
func DeleteUserAccount() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Delete(&user.DeleteRequest{
Id: "fdf34f34f34-f34f34-f43f43f34-f4f34f",
Id: "8b98acbe-0b6a-4d66-a414-5ffbf666786f",
})
fmt.Println(rsp, err)
}

View File

@@ -4,7 +4,7 @@ const { UserService } = require("m3o/user");
async function deleteUserAccount() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.delete({
id: "fdf34f34f34-f34f34-f43f43f34-f4f34f",
id: "8b98acbe-0b6a-4d66-a414-5ffbf666786f",
});
console.log(rsp);
}

View File

@@ -3,5 +3,5 @@ curl "http://localhost:8080/user/Login" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"email": "joe@example.com",
"password": "mySecretPass123"
"password": "Password1"
}'

View File

@@ -13,7 +13,7 @@ func LogAuserIn() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Login(&user.LoginRequest{
Email: "joe@example.com",
Password: "mySecretPass123",
Password: "Password1",
})
fmt.Println(rsp, err)
}

View File

@@ -6,7 +6,7 @@ async function logAuserIn() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.login({
email: "joe@example.com",
password: "mySecretPass123",
password: "Password1",
});
console.log(rsp);
}

View File

@@ -2,5 +2,5 @@ curl "http://localhost:8080/user/Logout" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"sessionId": "sds34s34s34-s34s34-s43s43s34-s4s34s"
"sessionId": "df91a612-5b24-4634-99ff-240220ab8f55"
}'

View File

@@ -11,7 +11,7 @@ import (
func LogAuserOut() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Logout(&user.LogoutRequest{
SessionId: "sds34s34s34-s34s34-s43s43s34-s4s34s",
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}

View File

@@ -4,7 +4,7 @@ const { UserService } = require("m3o/user");
async function logAuserOut() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.logout({
sessionId: "sds34s34s34-s34s34-s43s43s34-s4s34s",
sessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
});
console.log(rsp);
}

View File

@@ -2,5 +2,5 @@ curl "http://localhost:8080/user/Read" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"username": "usrname-1"
"username": "joe"
}'

View File

@@ -2,5 +2,5 @@ curl "http://localhost:8080/user/Read" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"id": "usrid-1"
"id": "user-1"
}'

View File

@@ -11,7 +11,7 @@ import (
func ReadAccountByUsernameOrEmail() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Read(&user.ReadRequest{
Username: "usrname-1",
Username: "joe",
})
fmt.Println(rsp, err)
}

View File

@@ -11,7 +11,7 @@ import (
func ReadAnAccountById() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Read(&user.ReadRequest{
Id: "usrid-1",
Id: "user-1",
})
fmt.Println(rsp, err)
}

View File

@@ -4,7 +4,7 @@ const { UserService } = require("m3o/user");
async function readAccountByUsernameOrEmail() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.read({
username: "usrname-1",
username: "joe",
});
console.log(rsp);
}

View File

@@ -4,7 +4,7 @@ const { UserService } = require("m3o/user");
async function readAnAccountById() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.read({
id: "usrid-1",
id: "user-1",
});
console.log(rsp);
}

View File

@@ -2,5 +2,5 @@ curl "http://localhost:8080/user/ReadSession" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"sessionId": "sds34s34s34-s34s34-s43s43s34-s4s34s"
"sessionId": "df91a612-5b24-4634-99ff-240220ab8f55"
}'

View File

@@ -11,7 +11,7 @@ import (
func ReadAsessionByTheSessionId() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.ReadSession(&user.ReadSessionRequest{
SessionId: "sds34s34s34-s34s34-s43s43s34-s4s34s",
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}

View File

@@ -4,7 +4,7 @@ const { UserService } = require("m3o/user");
async function readAsessionByTheSessionId() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.readSession({
sessionId: "sds34s34s34-s34s34-s43s43s34-s4s34s",
sessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
});
console.log(rsp);
}

View File

@@ -2,8 +2,8 @@ curl "http://localhost:8080/user/ResetPassword" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"code": "some-code-from-email",
"confirmPassword": "newpass123",
"code": "012345",
"confirmPassword": "NewPassword1",
"email": "joe@example.com",
"newPassword": "newpass123"
"newPassword": "NewPassword1"
}'

View File

@@ -11,10 +11,10 @@ import (
func ResetPassword() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
Code: "some-code-from-email",
ConfirmPassword: "newpass123",
Code: "012345",
ConfirmPassword: "NewPassword1",
Email: "joe@example.com",
NewPassword: "newpass123",
NewPassword: "NewPassword1",
})
fmt.Println(rsp, err)
}

View File

@@ -4,10 +4,10 @@ const { UserService } = require("m3o/user");
async function resetPassword() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.resetPassword({
code: "some-code-from-email",
confirmPassword: "newpass123",
code: "012345",
confirmPassword: "NewPassword1",
email: "joe@example.com",
newPassword: "newpass123",
newPassword: "NewPassword1",
});
console.log(rsp);
}

View File

@@ -2,6 +2,6 @@ curl "http://localhost:8080/user/Update" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"email": "joeotheremail@example.com",
"id": "usrid-1"
"email": "joe+2@example.com",
"id": "user-1"
}'

View File

@@ -11,8 +11,8 @@ import (
func UpdateAnAccount() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.Update(&user.UpdateRequest{
Email: "joeotheremail@example.com",
Id: "usrid-1",
Email: "joe+2@example.com",
Id: "user-1",
})
fmt.Println(rsp, err)
}

View File

@@ -4,8 +4,8 @@ const { UserService } = require("m3o/user");
async function updateAnAccount() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.update({
email: "joeotheremail@example.com",
id: "usrid-1",
email: "joe+2@example.com",
id: "user-1",
});
console.log(rsp);
}

View File

@@ -2,8 +2,8 @@ curl "http://localhost:8080/user/UpdatePassword" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"confirmPassword": "myEvenMoreSecretPass123",
"id": "usrid-1",
"newPassword": "myEvenMoreSecretPass123",
"oldPassword": "mySecretPass123"
"confirmPassword": "Password2",
"id": "user-1",
"newPassword": "Password2",
"oldPassword": "Password1"
}'

View File

@@ -11,9 +11,9 @@ import (
func UpdateTheAccountPassword() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.UpdatePassword(&user.UpdatePasswordRequest{
ConfirmPassword: "myEvenMoreSecretPass123",
NewPassword: "myEvenMoreSecretPass123",
OldPassword: "mySecretPass123",
ConfirmPassword: "Password2",
NewPassword: "Password2",
OldPassword: "Password1",
})
fmt.Println(rsp, err)
}

View File

@@ -4,10 +4,10 @@ const { UserService } = require("m3o/user");
async function updateTheAccountPassword() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.updatePassword({
confirmPassword: "myEvenMoreSecretPass123",
id: "usrid-1",
newPassword: "myEvenMoreSecretPass123",
oldPassword: "mySecretPass123",
confirmPassword: "Password2",
id: "user-1",
newPassword: "Password2",
oldPassword: "Password1",
});
console.log(rsp);
}

View File

@@ -3,5 +3,5 @@ curl "http://localhost:8080/user/VerifyEmail" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"email": "joe@example.com",
"token": "t2323t232t"
"token": "012345"
}'

View File

@@ -12,7 +12,7 @@ func VerifyEmail() {
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
Email: "joe@example.com",
Token: "t2323t232t",
Token: "012345",
})
fmt.Println(rsp, err)
}

View File

@@ -5,7 +5,7 @@ async function verifyEmail() {
let userService = new UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.verifyEmail({
email: "joe@example.com",
token: "t2323t232t",
token: "012345",
});
console.log(rsp);
}