Skip to content

Commit 605e364

Browse files
committed
Bundle type definitions with package
1 parent 2733ba9 commit 605e364

File tree

10 files changed

+38
-9
lines changed

10 files changed

+38
-9
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@adyen/api-library",
3-
"version": "2.2.0",
3+
"version": "2.2.1-rc.0",
44
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
55
"main": "dist/lib/src/index.js",
6-
"types": "dist/lib/src/index.d.ts",
6+
"types": "dist/lib/src/typings/index.d.ts",
77
"module": "dist/lib-esm/src/index.js",
88
"engines": {
99
"node": ">=8.1.1"
@@ -48,7 +48,6 @@
4848
"@babel/runtime": "7.8.3",
4949
"@types/jest": "24.0.25",
5050
"@types/nock": "10.0.3",
51-
"@types/node": "13.1.7",
5251
"@typescript-eslint/eslint-plugin": "2.16.0",
5352
"@typescript-eslint/parser": "2.16.0",
5453
"babel-loader": "8.0.6",
@@ -64,6 +63,7 @@
6463
"webpack-cli": "3.3.10"
6564
},
6665
"dependencies": {
66+
"@types/node": "13.1.7",
6767
"https-proxy-agent": "4.0.0"
6868
}
6969
}

src/helpers/getJsonResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import Resource from "../services/resource";
2323
import HttpClientException from "../httpClient/httpClientException";
2424
import ApiException from "../services/exception/apiException";
25+
import {IRequest} from "../typings/requestOptions";
2526

2627
async function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<string>;
2728
async function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<R>;

src/httpClient/clientInterface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { AgentOptions } from "https";
2222
import HttpClientException from "./httpClientException";
2323
import ApiException from "../services/exception/apiException";
2424
import {Config} from "../index";
25+
import {IRequest} from "../typings/requestOptions";
2526

2627
interface ClientInterface {
2728
request(

src/httpClient/httpURLConnectionClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {ApiError} from "../typings/apiError";
3333
import ApiException from "../services/exception/apiException";
3434
import ClientInterface from "./clientInterface";
3535
import {ApiConstants} from "../constants/apiConstants";
36+
import {IRequest} from "../typings/requestOptions";
3637

3738
class HttpURLConnectionClient implements ClientInterface {
3839
private static CHARSET = "utf-8";

src/services/checkout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import PaymentSession from "./resource/checkout/paymentSession";
2929
import PaymentsResult from "./resource/checkout/paymentsResult";
3030
import PaymentLinks from "./resource/checkout/paymentLinks";
3131
import setApplicationInfo from "../helpers/setApplicationInfo";
32+
import {IRequest} from "../typings/requestOptions";
3233

3334
class Checkout extends ApiKeyAuthenticatedService {
3435
private readonly _payments: Payments;

src/services/modification.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import Refund from "./resource/modification/refund";
2929
import TechnicalCancel from "./resource/modification/technicalCancel";
3030
import setApplicationInfo from "../helpers/setApplicationInfo";
3131
import {ApplicationInfo} from "../typings/applicationInfo";
32+
import {IRequest} from "../typings/requestOptions";
3233

3334
interface AppInfo { applicationInfo?: ApplicationInfo }
3435
type GenericRequest<T> = T & AppInfo;

src/services/resource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Service from "../service";
2424
import HttpClientException from "../httpClient/httpClientException";
2525
import ApiException from "./exception/apiException";
2626
import ClientInterface from "../httpClient/clientInterface";
27+
import {IRequest} from "../typings/requestOptions";
2728

2829
abstract class Resource {
2930
protected endpoint: string;

src/typings/applicationInfo.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ export class ApplicationInfo {
4040
}
4141
}
4242

43-
export interface CommonField {
43+
declare interface CommonField {
4444
name?: string;
4545
version?: string;
4646
}
4747

48-
export interface ExternalPlatform extends CommonField {
48+
declare interface ExternalPlatform extends CommonField {
4949
integrator?: string;
5050
}
5151

52-
export interface MerchantDevice {
52+
declare interface MerchantDevice {
5353
os?: string;
5454
osVersion?: string;
5555
reference?: string;
5656
}
5757

58-
export interface ShopperInteractionDevice {
58+
declare interface ShopperInteractionDevice {
5959
os?: string;
6060
osVersion?: string;
6161
locale?: string;

src/typings/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference path="amount.ts" />
2+
/// <reference path="apiError.ts" />
3+
/// <reference path="applicationInfo.ts" />
4+
/// <reference path="binLookup.ts" />
5+
/// <reference path="checkout.ts" />
6+
/// <reference path="checkoutUtility.ts" />
7+
/// <reference path="marketPayAccount.ts" />
8+
/// <reference path="marketPayFund.ts" />
9+
/// <reference path="marketPayHostedOnboardingPage.ts" />
10+
/// <reference path="marketPayNotificationConfiguration.ts" />
11+
/// <reference path="marketPayNotifications.ts" />
12+
/// <reference path="nexo.ts" />
13+
/// <reference path="notification.ts" />
14+
/// <reference path="payments.ts" />
15+
/// <reference path="payouts.ts" />
16+
/// <reference path="recurring.ts" />
17+
/// <reference path="requestOptions.ts" />
18+
/// <reference path="terminal.ts" />

src/typings/requestOptions.d.ts renamed to src/typings/requestOptions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@
2020
*/
2121

2222
// Generated using typescript-generator version 2.14.505 on 2019-06-03 16:13:35.
23-
declare namespace IRequest {
24-
export type Options = HttpsRequestOptions & {
23+
24+
/// <reference types="node"/>
25+
26+
import * as https from "https";
27+
28+
export namespace IRequest {
29+
export type Options = https.RequestOptions & {
2530
idempotencyKey?: string;
2631
}
2732
}

0 commit comments

Comments
 (0)