From 52eb7df2c87d43020c4c84bd52f44811f2f39246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marzec?= Date: Fri, 26 Feb 2021 08:38:58 +0100 Subject: [PATCH 1/2] fix: typescript exports & rebuild openapi --- src/fspiop/v1_1/openapi.ts | 87 +++++++++++--------------------------- src/index.ts | 13 ++---- src/thirdparty/openapi.ts | 34 +++++++-------- 3 files changed, 44 insertions(+), 90 deletions(-) diff --git a/src/fspiop/v1_1/openapi.ts b/src/fspiop/v1_1/openapi.ts index 6e2a6377..a1c8c405 100644 --- a/src/fspiop/v1_1/openapi.ts +++ b/src/fspiop/v1_1/openapi.ts @@ -5,7 +5,7 @@ export interface paths { "/interface": { - post: operations["Interface"]; + post: operations["test"]; }; "/participants/Type/ID": { post: operations["ParticipantsByIDAndType"]; @@ -301,7 +301,7 @@ export interface operations { /** * Essential path to include schema definitions that are not used so that these definitions get included into the openapi-cli bundle api definition so that they get converted into typescript definitions. */ - Interface: { + test: { requestBody: { "application/json": | components["schemas"]["BinaryString"] @@ -1798,13 +1798,7 @@ export interface components { * Data model for the complex type Extension. */ Extension: { - /** - * Extension key. - */ key: components["schemas"]["ExtensionKey"]; - /** - * Extension value. - */ value: components["schemas"]["ExtensionValue"]; }; /** @@ -1865,17 +1859,8 @@ export interface components { * Data model for the complex type PartyComplexName. */ PartyComplexName: { - /** - * Party’s first name. - */ firstName?: components["schemas"]["FirstName"]; - /** - * Party’s middle name. - */ middleName?: components["schemas"]["MiddleName"]; - /** - * Party’s last name. - */ lastName?: components["schemas"]["LastName"]; }; /** @@ -1886,13 +1871,7 @@ export interface components { * Data model for the complex type PartyPersonalInfo. */ PartyPersonalInfo: { - /** - * First, middle and last name for the Party. - */ complexName?: components["schemas"]["PartyComplexName"]; - /** - * Date of birth for the Party. - */ dateOfBirth?: components["schemas"]["DateOfBirth"]; }; /** @@ -2090,13 +2069,7 @@ export interface components { * Data model for the complex type Money. */ Money: { - /** - * Currency of the amount. - */ currency: components["schemas"]["Currency"]; - /** - * Amount of Money. - */ amount: components["schemas"]["Amount"]; }; /** @@ -2139,13 +2112,7 @@ export interface components { * Data model for the complex type Refund. */ Refund: { - /** - * Reference to the original transaction ID that is requested to be refunded. - */ originalTransactionId: components["schemas"]["CorrelationId"]; - /** - * Free text indicating the reason for the refund. - */ refundReason?: components["schemas"]["RefundReason"]; }; /** @@ -2156,29 +2123,11 @@ export interface components { * Data model for the complex type TransactionType. */ TransactionType: { - /** - * Deposit, withdrawal, refund, … - */ scenario: components["schemas"]["TransactionScenario"]; - /** - * Possible sub-scenario, defined locally within the scheme. - */ subScenario?: components["schemas"]["TransactionSubScenario"]; - /** - * Who is initiating the transaction - Payer or Payee. - */ initiator: components["schemas"]["TransactionInitiator"]; - /** - * Consumer, agent, business, … - */ initiatorType: components["schemas"]["TransactionInitiatorType"]; - /** - * Extra information specific to a refund scenario. Should only be populated if scenario is REFUND. - */ refundInfo?: components["schemas"]["Refund"]; - /** - * Balance of Payments code. - */ balanceOfPayments?: components["schemas"]["BalanceOfPayments"]; }; /** @@ -2238,13 +2187,7 @@ export interface components { * Data model for the complex type ErrorInformation. */ ErrorInformation: { - /** - * Specific error number. - */ errorCode: components["schemas"]["ErrorCode"]; - /** - * Error description string. - */ errorDescription: components["schemas"]["ErrorDescription"]; extensionList?: components["schemas"]["ExtensionList"]; }; @@ -2363,8 +2306,9 @@ export interface components { * Below are the allowed values for the enumeration AuthenticationType. * - OTP - One-time password generated by the Payer FSP. * - QRCODE - QR code used as One Time Password. + * - U2F - U2F is a new addition isolated to Thirdparty stream. */ - AuthenticationType: "OTP" | "QRCODE"; + AuthenticationType: "OTP" | "QRCODE" | "U2F"; /** * The API data type DateTime is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons. The format is according to [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html), expressed in a combined date, time and time zone format. A more readable version of the format is yyyy-MM-ddTHH:mm:ss.SSS[-HH:MM]. Examples are "2016-05-24T08:38:08.699-04:00", "2016-05-24T08:38:08.699Z" (where Z indicates Zulu time zone, same as UTC). */ @@ -2559,12 +2503,29 @@ export interface components { * QR code used as a One Time Password. */ QRCODE: string; + /** + * U2F challenge-response, where payer FSP verifies if the response provided by end-user device matches the previously registered key. + */ + U2FPIN: string; + /** + * U2F challenge-response, where payer FSP verifies if the response provided by end-user device matches the previously registered key. + */ + U2FPinValue: { + /** + * U2F challenge-response. + */ + pinValue: components["schemas"]["U2FPIN"]; + /** + * Sequential counter used for cloning detection. Present only for U2F authentication. + */ + counter: components["schemas"]["Integer"]; + }; /** * Contains the authentication value. The format depends on the authentication type used in the AuthenticationInfo complex type. */ - AuthenticationValue: - | components["schemas"]["OtpValue"] - | components["schemas"]["QRCODE"]; + AuthenticationValue: Partial & + Partial & + Partial; /** * Data model for the complex type AuthenticationInfo. */ diff --git a/src/index.ts b/src/index.ts index b020b491..a222be89 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,4 @@ -import * as v1_0 from './fspiop/v1_0' -import * as v1_1 from './fspiop/v1_1' -import * as thirdparty from './thirdparty' - -export default { - v1_0, - v1_1, - thirdparty -} +/* eslint-disable camelcase */ +export * as v1_0 from './fspiop/v1_0' +export * as v1_1 from './fspiop/v1_1' +export * as thirdparty from './thirdparty' diff --git a/src/thirdparty/openapi.ts b/src/thirdparty/openapi.ts index 33eea5d5..9e8ba2f6 100644 --- a/src/thirdparty/openapi.ts +++ b/src/thirdparty/openapi.ts @@ -627,19 +627,18 @@ export interface components { /** * Contains the authentication value. The format depends on the authentication type used in the AuthenticationInfo complex type. */ - AuthenticationValue: - | string - | string - | { + AuthenticationValue: Partial & + Partial & + Partial<{ /** - * U2F challenge-response. - */ + * U2F challenge-response. + */ pinValue: string; /** - * Sequential counter used for cloning detection. Present only for U2F authentication. - */ + * Sequential counter used for cloning detection. Present only for U2F authentication. + */ counter: string; - }; + }>; /** * Data model for the complex type AuthenticationInfo. */ @@ -654,19 +653,18 @@ export interface components { /** * Contains the authentication value. The format depends on the authentication type used in the AuthenticationInfo complex type. */ - authenticationValue: - | string - | string - | { + authenticationValue: Partial & + Partial & + Partial<{ /** - * U2F challenge-response. - */ + * U2F challenge-response. + */ pinValue: string; /** - * Sequential counter used for cloning detection. Present only for U2F authentication. - */ + * Sequential counter used for cloning detection. Present only for U2F authentication. + */ counter: string; - }; + }>; }; /** * Below are the allowed values for the enumeration AuthorizationChannelType. From 3d6de2b829c97e1589ea4bf5e62160e5a15d9e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marzec?= Date: Fri, 26 Feb 2021 08:43:17 +0100 Subject: [PATCH 2/2] fix: bring back default exports --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index a222be89..3d95d97e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,15 @@ /* eslint-disable camelcase */ + +import * as v1_0 from './fspiop/v1_0' +import * as v1_1 from './fspiop/v1_1' +import * as thirdparty from './thirdparty' + export * as v1_0 from './fspiop/v1_0' export * as v1_1 from './fspiop/v1_1' export * as thirdparty from './thirdparty' + +export default { + v1_0, + v1_1, + thirdparty +}