mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-21 23:15:06 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -16,6 +16,7 @@ import * as ip from "./ip";
|
||||
import * as location from "./location";
|
||||
import * as otp from "./otp";
|
||||
import * as postcode from "./postcode";
|
||||
import * as qr from "./qr";
|
||||
import * as quran from "./quran";
|
||||
import * as routing from "./routing";
|
||||
import * as rss from "./rss";
|
||||
@@ -50,6 +51,7 @@ export class Client {
|
||||
this.locationService = new location.LocationService(token);
|
||||
this.otpService = new otp.OtpService(token);
|
||||
this.postcodeService = new postcode.PostcodeService(token);
|
||||
this.qrService = new qr.QrService(token);
|
||||
this.quranService = new quran.QuranService(token);
|
||||
this.routingService = new routing.RoutingService(token);
|
||||
this.rssService = new rss.RssService(token);
|
||||
@@ -83,6 +85,7 @@ export class Client {
|
||||
locationService: location.LocationService;
|
||||
otpService: otp.OtpService;
|
||||
postcodeService: postcode.PostcodeService;
|
||||
qrService: qr.QrService;
|
||||
quranService: quran.QuranService;
|
||||
routingService: routing.RoutingService;
|
||||
rssService: rss.RssService;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"./otp": "./dist/otp/index.js",
|
||||
"./pkg": "./dist/pkg/index.js",
|
||||
"./postcode": "./dist/postcode/index.js",
|
||||
"./qr": "./dist/qr/index.js",
|
||||
"./quran": "./dist/quran/index.js",
|
||||
"./routing": "./dist/routing/index.js",
|
||||
"./rss": "./dist/rss/index.js",
|
||||
@@ -57,5 +58,5 @@
|
||||
},
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "1.0.514"
|
||||
"version": "1.0.515"
|
||||
}
|
||||
29
clients/ts/qr/index.ts
Executable file
29
clients/ts/qr/index.ts
Executable file
@@ -0,0 +1,29 @@
|
||||
import * as m3o from "@m3o/m3o-node";
|
||||
|
||||
export class QrService {
|
||||
private client: m3o.Client;
|
||||
|
||||
constructor(token: string) {
|
||||
this.client = new m3o.Client({ token: token });
|
||||
}
|
||||
//
|
||||
generate(request: GenerateRequest): Promise<GenerateResponse> {
|
||||
return this.client.call(
|
||||
"qr",
|
||||
"Generate",
|
||||
request
|
||||
) as Promise<GenerateResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
export interface GenerateRequest {
|
||||
// the size (height and width) in pixels of the generated QR code. Defaults to 256
|
||||
size?: number;
|
||||
// the text to encode as a QR code (URL, phone number, email, etc)
|
||||
text?: string;
|
||||
}
|
||||
|
||||
export interface GenerateResponse {
|
||||
// link to the QR code image in PNG format
|
||||
qr?: string;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ export interface Result {
|
||||
// The associated arabic text
|
||||
text?: string;
|
||||
// The related translations to the text
|
||||
translations?: Translation[];
|
||||
translations?: Interpretation[];
|
||||
// The unique verse id across the Quran
|
||||
verseId?: number;
|
||||
// The verse key e.g 1:1
|
||||
@@ -161,7 +161,7 @@ export interface Verse {
|
||||
// The basic translation of the verse
|
||||
translatedText?: string;
|
||||
// The alternative translations for the verse
|
||||
translations?: Translation[];
|
||||
translations?: Interpretation[];
|
||||
// The phonetic transliteration from arabic
|
||||
transliteration?: string;
|
||||
// The individual words within the verse (Ayah)
|
||||
|
||||
Reference in New Issue
Block a user