mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-21 15:05:01 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -17,6 +17,7 @@ import * as ip from "./ip";
|
||||
import * as location from "./location";
|
||||
import * as otp from "./otp";
|
||||
import * as postcode from "./postcode";
|
||||
import * as prayer from "./prayer";
|
||||
import * as qr from "./qr";
|
||||
import * as quran from "./quran";
|
||||
import * as routing from "./routing";
|
||||
@@ -54,6 +55,7 @@ export class Client {
|
||||
this.locationService = new location.LocationService(token);
|
||||
this.otpService = new otp.OtpService(token);
|
||||
this.postcodeService = new postcode.PostcodeService(token);
|
||||
this.prayerService = new prayer.PrayerService(token);
|
||||
this.qrService = new qr.QrService(token);
|
||||
this.quranService = new quran.QuranService(token);
|
||||
this.routingService = new routing.RoutingService(token);
|
||||
@@ -90,6 +92,7 @@ export class Client {
|
||||
locationService: location.LocationService;
|
||||
otpService: otp.OtpService;
|
||||
postcodeService: postcode.PostcodeService;
|
||||
prayerService: prayer.PrayerService;
|
||||
qrService: qr.QrService;
|
||||
quranService: quran.QuranService;
|
||||
routingService: routing.RoutingService;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"./otp": "./dist/otp/index.js",
|
||||
"./pkg": "./dist/pkg/index.js",
|
||||
"./postcode": "./dist/postcode/index.js",
|
||||
"./prayer": "./dist/prayer/index.js",
|
||||
"./qr": "./dist/qr/index.js",
|
||||
"./quran": "./dist/quran/index.js",
|
||||
"./routing": "./dist/routing/index.js",
|
||||
@@ -60,5 +61,5 @@
|
||||
},
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "1.0.526"
|
||||
"version": "1.0.527"
|
||||
}
|
||||
63
clients/ts/prayer/index.ts
Executable file
63
clients/ts/prayer/index.ts
Executable file
@@ -0,0 +1,63 @@
|
||||
import * as m3o from "@m3o/m3o-node";
|
||||
|
||||
export class PrayerService {
|
||||
private client: m3o.Client;
|
||||
|
||||
constructor(token: string) {
|
||||
this.client = new m3o.Client({ token: token });
|
||||
}
|
||||
//
|
||||
times(request: TimesRequest): Promise<TimesResponse> {
|
||||
return this.client.call(
|
||||
"prayer",
|
||||
"Times",
|
||||
request
|
||||
) as Promise<TimesResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
export interface PrayerTime {
|
||||
// asr time
|
||||
asr?: string;
|
||||
// date for prayer times in YYYY-MM-DD format
|
||||
date?: string;
|
||||
// fajr time
|
||||
fajr?: string;
|
||||
// isha time
|
||||
isha?: string;
|
||||
// maghrib time
|
||||
maghrib?: string;
|
||||
// time of sunrise
|
||||
sunrise?: string;
|
||||
// zuhr time
|
||||
zuhr?: string;
|
||||
}
|
||||
|
||||
export interface TimesRequest {
|
||||
// optional date in YYYY-MM-DD format, otherwise uses today
|
||||
date?: string;
|
||||
// number of days to request times for
|
||||
days?: number;
|
||||
// optional latitude used in place of location
|
||||
latitude?: number;
|
||||
// location to retrieve prayer times for.
|
||||
// this can be a specific address, city, etc
|
||||
location?: string;
|
||||
// optional longitude used in place of location
|
||||
longitude?: number;
|
||||
}
|
||||
|
||||
export interface TimesResponse {
|
||||
// date of request
|
||||
date?: string;
|
||||
// number of days
|
||||
days?: number;
|
||||
// latitude of location
|
||||
latitude?: number;
|
||||
// location for the request
|
||||
location?: string;
|
||||
// longitude of location
|
||||
longitude?: number;
|
||||
// prayer times for the given location
|
||||
times?: PrayerTime[];
|
||||
}
|
||||
Reference in New Issue
Block a user