@gettestmail/typescript-sdk
Advanced tools
@@ -1,2 +0,2 @@ | ||
| import { CreateNewRequest, CreateNewResponse, WaitForMessageResponse } from "./models"; | ||
| import { CreateNewRequest, GetTestMail } from "./models"; | ||
| declare class GetTestMailClient { | ||
@@ -6,5 +6,5 @@ private apiKey; | ||
| constructor(apiKey: string, baseUrl?: string); | ||
| createNew(request?: CreateNewRequest): Promise<CreateNewResponse>; | ||
| waitForMessage(id: string): Promise<WaitForMessageResponse>; | ||
| createNew(request?: CreateNewRequest): Promise<GetTestMail>; | ||
| waitForMessage(id: string): Promise<GetTestMail>; | ||
| } | ||
| export default GetTestMailClient; |
@@ -12,2 +12,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const models_1 = require("./models"); | ||
| class GetTestMailClient { | ||
@@ -30,6 +31,6 @@ constructor(apiKey, baseUrl = 'https://gettestmail.com/api') { | ||
| const problem = yield response.json(); | ||
| throw new Error(problem.detail); | ||
| throw new models_1.APIError(problem); | ||
| } | ||
| const getTestMail = yield response.json(); | ||
| return { getTestMail }; | ||
| return getTestMail; | ||
| }); | ||
@@ -49,6 +50,6 @@ } | ||
| const problem = yield response.json(); | ||
| throw new Error(problem.detail); | ||
| throw new models_1.APIError(problem); | ||
| } | ||
| const getTestMail = yield response.json(); | ||
| return { getTestMail }; | ||
| return getTestMail; | ||
| }); | ||
@@ -55,0 +56,0 @@ } |
@@ -26,10 +26,11 @@ export interface GetTestMail { | ||
| } | ||
| export declare class APIError extends Error { | ||
| type: string; | ||
| title: string; | ||
| detail: string; | ||
| status: number; | ||
| constructor(problem: Problem); | ||
| } | ||
| export type CreateNewRequest = { | ||
| expiresAt?: string; | ||
| expiresAt: string; | ||
| }; | ||
| export interface CreateNewResponse { | ||
| getTestMail: GetTestMail; | ||
| } | ||
| export interface WaitForMessageResponse { | ||
| getTestMail: GetTestMail; | ||
| } |
+11
-0
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.APIError = void 0; | ||
| class APIError extends Error { | ||
| constructor(problem) { | ||
| super(problem.detail); | ||
| this.type = problem.type; | ||
| this.title = problem.title; | ||
| this.detail = problem.detail; | ||
| this.status = problem.status; | ||
| } | ||
| } | ||
| exports.APIError = APIError; |
+1
-1
| { | ||
| "name": "@gettestmail/typescript-sdk", | ||
| "version": "1.0.4", | ||
| "version": "1.0.5", | ||
| "description": "Typescript SDK for GetTestMail", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
6967
4.63%121
12.04%