Commit from GitHub Actions (Publish APIs & Clients)

This commit is contained in:
asim
2021-09-22 19:20:19 +00:00
parent 2d702178d3
commit 77c32acee8
9 changed files with 44 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ type PrayerService struct {
client *client.Client client *client.Client
} }
// // Get the prayer (salah) times for a location on a given date
func (t *PrayerService) Times(request *TimesRequest) (*TimesResponse, error) { func (t *PrayerService) Times(request *TimesRequest) (*TimesResponse, error) {
rsp := &TimesResponse{} rsp := &TimesResponse{}
return rsp, t.client.Call("prayer", "Times", request, rsp) return rsp, t.client.Call("prayer", "Times", request, rsp)

View File

@@ -61,5 +61,5 @@
}, },
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"version": "1.0.527" "version": "1.0.528"
} }

View File

@@ -6,7 +6,7 @@ export class PrayerService {
constructor(token: string) { constructor(token: string) {
this.client = new m3o.Client({ token: token }); this.client = new m3o.Client({ token: token });
} }
// // Get the prayer (salah) times for a location on a given date
times(request: TimesRequest): Promise<TimesResponse> { times(request: TimesRequest): Promise<TimesResponse> {
return this.client.call( return this.client.call(
"prayer", "prayer",

View File

@@ -11,10 +11,10 @@ func CreateArecord() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN")) dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{ rsp, err := dbService.Create(&db.CreateRequest{
Record: map[string]interface{}{ Record: map[string]interface{}{
"name": "Jane",
"age": 42,
"isActive": true, "isActive": true,
"id": "1", "id": "1",
"name": "Jane",
"age": 42,
}, },
Table: "users", Table: "users",
}) })

View File

@@ -6,7 +6,7 @@ import (
"os" "os"
) )
// // Get the prayer (salah) times for a location on a given date
func PrayerTimes() { func PrayerTimes() {
prayerService := prayer.NewPrayerService(os.Getenv("MICRO_API_TOKEN")) prayerService := prayer.NewPrayerService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := prayerService.Times(&prayer.TimesRequest{ rsp, err := prayerService.Times(&prayer.TimesRequest{

View File

@@ -1,6 +1,6 @@
import * as prayer from "m3o/prayer"; import * as prayer from "m3o/prayer";
// // Get the prayer (salah) times for a location on a given date
async function PrayerTimes() { async function PrayerTimes() {
let prayerService = new prayer.PrayerService(process.env.MICRO_API_TOKEN); let prayerService = new prayer.PrayerService(process.env.MICRO_API_TOKEN);
let rsp = await prayerService.times({ let rsp = await prayerService.times({

View File

@@ -0,0 +1,7 @@
curl "https://api.m3o.com/v1/weather/Forecast" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"days": 2,
"location": "London"
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/weather"
"os"
)
// Get the weather forecast for the next 1-10 days
func ForecastWeather() {
weatherService := weather.NewWeatherService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := weatherService.Forecast(&weather.ForecastRequest{
Days: 2,
Location: "London",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,13 @@
import * as weather from "m3o/weather";
// Get the weather forecast for the next 1-10 days
async function ForecastWeather() {
let weatherService = new weather.WeatherService(process.env.MICRO_API_TOKEN);
let rsp = await weatherService.forecast({
days: 2,
location: "London",
});
console.log(rsp);
}
await ForecastWeather();