From 77c32acee83cbdd982e347f8552b4aa0810d01f8 Mon Sep 17 00:00:00 2001 From: asim Date: Wed, 22 Sep 2021 19:20:19 +0000 Subject: [PATCH] Commit from GitHub Actions (Publish APIs & Clients) --- clients/go/prayer/prayer.go | 2 +- clients/ts/package.json | 2 +- clients/ts/prayer/index.ts | 2 +- examples/db/create/go/createARecord.go | 4 ++-- examples/prayer/times/go/prayerTimes.go | 2 +- examples/prayer/times/node/prayerTimes.js | 2 +- .../weather/forecast/curl/forecastWeather.sh | 7 +++++++ examples/weather/forecast/go/forecastWeather.go | 17 +++++++++++++++++ .../weather/forecast/node/forecastWeather.js | 13 +++++++++++++ 9 files changed, 44 insertions(+), 7 deletions(-) create mode 100755 examples/weather/forecast/curl/forecastWeather.sh create mode 100755 examples/weather/forecast/go/forecastWeather.go create mode 100755 examples/weather/forecast/node/forecastWeather.js diff --git a/clients/go/prayer/prayer.go b/clients/go/prayer/prayer.go index 053ed01..cfafcc7 100755 --- a/clients/go/prayer/prayer.go +++ b/clients/go/prayer/prayer.go @@ -16,7 +16,7 @@ type PrayerService struct { client *client.Client } -// +// Get the prayer (salah) times for a location on a given date func (t *PrayerService) Times(request *TimesRequest) (*TimesResponse, error) { rsp := &TimesResponse{} return rsp, t.client.Call("prayer", "Times", request, rsp) diff --git a/clients/ts/package.json b/clients/ts/package.json index bf96038..1037b54 100644 --- a/clients/ts/package.json +++ b/clients/ts/package.json @@ -61,5 +61,5 @@ }, "type": "module", "types": "dist/index.d.ts", - "version": "1.0.527" + "version": "1.0.528" } \ No newline at end of file diff --git a/clients/ts/prayer/index.ts b/clients/ts/prayer/index.ts index 673a2e2..db8a092 100755 --- a/clients/ts/prayer/index.ts +++ b/clients/ts/prayer/index.ts @@ -6,7 +6,7 @@ export class PrayerService { constructor(token: string) { this.client = new m3o.Client({ token: token }); } - // + // Get the prayer (salah) times for a location on a given date times(request: TimesRequest): Promise { return this.client.call( "prayer", diff --git a/examples/db/create/go/createARecord.go b/examples/db/create/go/createARecord.go index c582849..f9cc6bc 100755 --- a/examples/db/create/go/createARecord.go +++ b/examples/db/create/go/createARecord.go @@ -11,10 +11,10 @@ func CreateArecord() { dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN")) rsp, err := dbService.Create(&db.CreateRequest{ Record: map[string]interface{}{ - "name": "Jane", - "age": 42, "isActive": true, "id": "1", + "name": "Jane", + "age": 42, }, Table: "users", }) diff --git a/examples/prayer/times/go/prayerTimes.go b/examples/prayer/times/go/prayerTimes.go index 4a7d806..eaa4f58 100755 --- a/examples/prayer/times/go/prayerTimes.go +++ b/examples/prayer/times/go/prayerTimes.go @@ -6,7 +6,7 @@ import ( "os" ) -// +// Get the prayer (salah) times for a location on a given date func PrayerTimes() { prayerService := prayer.NewPrayerService(os.Getenv("MICRO_API_TOKEN")) rsp, err := prayerService.Times(&prayer.TimesRequest{ diff --git a/examples/prayer/times/node/prayerTimes.js b/examples/prayer/times/node/prayerTimes.js index b1b6b63..a4a3004 100755 --- a/examples/prayer/times/node/prayerTimes.js +++ b/examples/prayer/times/node/prayerTimes.js @@ -1,6 +1,6 @@ import * as prayer from "m3o/prayer"; -// +// Get the prayer (salah) times for a location on a given date async function PrayerTimes() { let prayerService = new prayer.PrayerService(process.env.MICRO_API_TOKEN); let rsp = await prayerService.times({ diff --git a/examples/weather/forecast/curl/forecastWeather.sh b/examples/weather/forecast/curl/forecastWeather.sh new file mode 100755 index 0000000..4fa63dd --- /dev/null +++ b/examples/weather/forecast/curl/forecastWeather.sh @@ -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" +}' \ No newline at end of file diff --git a/examples/weather/forecast/go/forecastWeather.go b/examples/weather/forecast/go/forecastWeather.go new file mode 100755 index 0000000..cb9f6de --- /dev/null +++ b/examples/weather/forecast/go/forecastWeather.go @@ -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) +} diff --git a/examples/weather/forecast/node/forecastWeather.js b/examples/weather/forecast/node/forecastWeather.js new file mode 100755 index 0000000..eca7227 --- /dev/null +++ b/examples/weather/forecast/node/forecastWeather.js @@ -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();