Skip to content

Commit

Permalink
Bundle type definitions with package
Browse files Browse the repository at this point in the history
  • Loading branch information
KadoBOT committed Jan 15, 2020
1 parent 2733ba9 commit 605e364
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@adyen/api-library",
"version": "2.2.0",
"version": "2.2.1-rc.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "dist/lib/src/index.js",
"types": "dist/lib/src/index.d.ts",
"types": "dist/lib/src/typings/index.d.ts",
"module": "dist/lib-esm/src/index.js",
"engines": {
"node": ">=8.1.1"
Expand Down Expand Up @@ -48,7 +48,6 @@
"@babel/runtime": "7.8.3",
"@types/jest": "24.0.25",
"@types/nock": "10.0.3",
"@types/node": "13.1.7",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"babel-loader": "8.0.6",
Expand All @@ -64,6 +63,7 @@
"webpack-cli": "3.3.10"
},
"dependencies": {
"@types/node": "13.1.7",
"https-proxy-agent": "4.0.0"
}
}
1 change: 1 addition & 0 deletions src/helpers/getJsonResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import Resource from "../services/resource";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "../services/exception/apiException";
import {IRequest} from "../typings/requestOptions";

async function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<string>;
async function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<R>;
Expand Down
1 change: 1 addition & 0 deletions src/httpClient/clientInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { AgentOptions } from "https";
import HttpClientException from "./httpClientException";
import ApiException from "../services/exception/apiException";
import {Config} from "../index";
import {IRequest} from "../typings/requestOptions";

interface ClientInterface {
request(
Expand Down
1 change: 1 addition & 0 deletions src/httpClient/httpURLConnectionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {ApiError} from "../typings/apiError";
import ApiException from "../services/exception/apiException";
import ClientInterface from "./clientInterface";
import {ApiConstants} from "../constants/apiConstants";
import {IRequest} from "../typings/requestOptions";

class HttpURLConnectionClient implements ClientInterface {
private static CHARSET = "utf-8";
Expand Down
1 change: 1 addition & 0 deletions src/services/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import PaymentSession from "./resource/checkout/paymentSession";
import PaymentsResult from "./resource/checkout/paymentsResult";
import PaymentLinks from "./resource/checkout/paymentLinks";
import setApplicationInfo from "../helpers/setApplicationInfo";
import {IRequest} from "../typings/requestOptions";

class Checkout extends ApiKeyAuthenticatedService {
private readonly _payments: Payments;
Expand Down
1 change: 1 addition & 0 deletions src/services/modification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Refund from "./resource/modification/refund";
import TechnicalCancel from "./resource/modification/technicalCancel";
import setApplicationInfo from "../helpers/setApplicationInfo";
import {ApplicationInfo} from "../typings/applicationInfo";
import {IRequest} from "../typings/requestOptions";

interface AppInfo { applicationInfo?: ApplicationInfo }
type GenericRequest<T> = T & AppInfo;
Expand Down
1 change: 1 addition & 0 deletions src/services/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Service from "../service";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "./exception/apiException";
import ClientInterface from "../httpClient/clientInterface";
import {IRequest} from "../typings/requestOptions";

abstract class Resource {
protected endpoint: string;
Expand Down
8 changes: 4 additions & 4 deletions src/typings/applicationInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ export class ApplicationInfo {
}
}

export interface CommonField {
declare interface CommonField {
name?: string;
version?: string;
}

export interface ExternalPlatform extends CommonField {
declare interface ExternalPlatform extends CommonField {
integrator?: string;
}

export interface MerchantDevice {
declare interface MerchantDevice {
os?: string;
osVersion?: string;
reference?: string;
}

export interface ShopperInteractionDevice {
declare interface ShopperInteractionDevice {
os?: string;
osVersion?: string;
locale?: string;
Expand Down
18 changes: 18 additions & 0 deletions src/typings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference path="amount.ts" />
/// <reference path="apiError.ts" />
/// <reference path="applicationInfo.ts" />
/// <reference path="binLookup.ts" />
/// <reference path="checkout.ts" />
/// <reference path="checkoutUtility.ts" />
/// <reference path="marketPayAccount.ts" />
/// <reference path="marketPayFund.ts" />
/// <reference path="marketPayHostedOnboardingPage.ts" />
/// <reference path="marketPayNotificationConfiguration.ts" />
/// <reference path="marketPayNotifications.ts" />
/// <reference path="nexo.ts" />
/// <reference path="notification.ts" />
/// <reference path="payments.ts" />
/// <reference path="payouts.ts" />
/// <reference path="recurring.ts" />
/// <reference path="requestOptions.ts" />
/// <reference path="terminal.ts" />
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
*/

// Generated using typescript-generator version 2.14.505 on 2019-06-03 16:13:35.
declare namespace IRequest {
export type Options = HttpsRequestOptions & {

/// <reference types="node"/>

import * as https from "https";

export namespace IRequest {
export type Options = https.RequestOptions & {
idempotencyKey?: string;
}
}
Expand Down

0 comments on commit 605e364

Please sign in to comment.