@vality/swag-payments 0.1.3-7ad8748.0 → 0.1.3-92bb7f9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -35
- package/fesm2022/vality-swag-payments.mjs +1826 -5174
- package/fesm2022/vality-swag-payments.mjs.map +1 -1
- package/package.json +21 -10
- package/types/vality-swag-payments.d.ts +6324 -0
- package/index.d.ts +0 -5
- package/lib/api/api.d.ts +0 -29
- package/lib/api/categories.service.d.ts +0 -67
- package/lib/api/contracts.service.d.ts +0 -234
- package/lib/api/countries.service.d.ts +0 -67
- package/lib/api/customers.service.d.ts +0 -266
- package/lib/api/invoiceTemplates.service.d.ts +0 -183
- package/lib/api/invoices.service.d.ts +0 -267
- package/lib/api/parties.service.d.ts +0 -165
- package/lib/api/paymentInstitutions.service.d.ts +0 -125
- package/lib/api/payments.service.d.ts +0 -419
- package/lib/api/search.service.d.ts +0 -203
- package/lib/api/shops.service.d.ts +0 -229
- package/lib/api/tokens.service.d.ts +0 -44
- package/lib/api/tradeBlocs.service.d.ts +0 -67
- package/lib/api/webhooks.service.d.ts +0 -145
- package/lib/api.module.d.ts +0 -11
- package/lib/configuration.d.ts +0 -104
- package/lib/encoder.d.ts +0 -11
- package/lib/index.d.ts +0 -6
- package/lib/model/accessToken.d.ts +0 -17
- package/lib/model/allocationBodyAmount.d.ts +0 -16
- package/lib/model/allocationBodyAmountAllOf.d.ts +0 -21
- package/lib/model/allocationBodyTotal.d.ts +0 -22
- package/lib/model/allocationBodyTotalAllOf.d.ts +0 -27
- package/lib/model/allocationFee.d.ts +0 -26
- package/lib/model/allocationFeeFixed.d.ts +0 -12
- package/lib/model/allocationFeeFixedAllOf.d.ts +0 -17
- package/lib/model/allocationFeeShare.d.ts +0 -14
- package/lib/model/allocationFeeShareAllOf.d.ts +0 -19
- package/lib/model/allocationFeeTarget.d.ts +0 -23
- package/lib/model/allocationTarget.d.ts +0 -23
- package/lib/model/allocationTargetShop.d.ts +0 -23
- package/lib/model/allocationTargetShopAllOf.d.ts +0 -17
- package/lib/model/allocationTransaction.d.ts +0 -34
- package/lib/model/apiExtensionRequest.d.ts +0 -18
- package/lib/model/apiExtensionRequestAllOf.d.ts +0 -17
- package/lib/model/applePay.d.ts +0 -24
- package/lib/model/applePayAllOf.d.ts +0 -24
- package/lib/model/articlesOfAssociation.d.ts +0 -19
- package/lib/model/bankAccount.d.ts +0 -29
- package/lib/model/bankCard.d.ts +0 -26
- package/lib/model/bankCardAllOf.d.ts +0 -23
- package/lib/model/bankCardAllOfTokenProviderData.d.ts +0 -36
- package/lib/model/bankCardDetails.d.ts +0 -44
- package/lib/model/bankCardTokenProviderData.d.ts +0 -39
- package/lib/model/bankCardTokenizationMethod.d.ts +0 -19
- package/lib/model/browserGetRequest.d.ts +0 -18
- package/lib/model/browserGetRequestAllOf.d.ts +0 -17
- package/lib/model/browserPostRequest.d.ts +0 -23
- package/lib/model/browserPostRequestAllOf.d.ts +0 -22
- package/lib/model/browserRequest.d.ts +0 -17
- package/lib/model/cancelPayment400Response.d.ts +0 -32
- package/lib/model/captureParams.d.ts +0 -35
- package/lib/model/captureParamsAllOf.d.ts +0 -34
- package/lib/model/capturePayment400Response.d.ts +0 -37
- package/lib/model/cardData.d.ts +0 -32
- package/lib/model/cardDataAllOf.d.ts +0 -32
- package/lib/model/category.d.ts +0 -16
- package/lib/model/chargeback.d.ts +0 -60
- package/lib/model/clientInfo.d.ts +0 -28
- package/lib/model/contactInfo.d.ts +0 -60
- package/lib/model/contract.d.ts +0 -54
- package/lib/model/contractAdjustment.d.ts +0 -32
- package/lib/model/contractor.d.ts +0 -28
- package/lib/model/costAmountRange.d.ts +0 -21
- package/lib/model/country.d.ts +0 -22
- package/lib/model/createBinding400Response.d.ts +0 -34
- package/lib/model/createCustomer400Response.d.ts +0 -34
- package/lib/model/createInvoice400Response.d.ts +0 -38
- package/lib/model/createInvoiceTemplate400Response.d.ts +0 -34
- package/lib/model/createInvoiceWithTemplate400Response.d.ts +0 -31
- package/lib/model/createPayment400Response.d.ts +0 -38
- package/lib/model/createRefund400Response.d.ts +0 -41
- package/lib/model/createWebhook400Response.d.ts +0 -31
- package/lib/model/createWebhook429Response.d.ts +0 -17
- package/lib/model/cryptoCurrencyTransferRequest.d.ts +0 -26
- package/lib/model/cryptoCurrencyTransferRequestAllOf.d.ts +0 -25
- package/lib/model/cryptoWallet.d.ts +0 -20
- package/lib/model/cryptoWalletAllOf.d.ts +0 -17
- package/lib/model/cryptoWalletData.d.ts +0 -20
- package/lib/model/cryptoWalletDetails.d.ts +0 -17
- package/lib/model/customer.d.ts +0 -46
- package/lib/model/customerAndToken.d.ts +0 -17
- package/lib/model/customerBinding.d.ts +0 -37
- package/lib/model/customerBindingError.d.ts +0 -18
- package/lib/model/customerBindingInteractionCompleted.d.ts +0 -22
- package/lib/model/customerBindingInteractionCompletedAllOf.d.ts +0 -22
- package/lib/model/customerBindingInteractionRequested.d.ts +0 -22
- package/lib/model/customerBindingInteractionRequestedAllOf.d.ts +0 -22
- package/lib/model/customerBindingParams.d.ts +0 -19
- package/lib/model/customerBindingStarted.d.ts +0 -18
- package/lib/model/customerBindingStartedAllOf.d.ts +0 -15
- package/lib/model/customerBindingStatus.d.ts +0 -27
- package/lib/model/customerBindingStatusChanged.d.ts +0 -29
- package/lib/model/customerBindingStatusChangedAllOf.d.ts +0 -14
- package/lib/model/customerChange.d.ts +0 -23
- package/lib/model/customerEvent.d.ts +0 -17
- package/lib/model/customerParams.d.ts +0 -31
- package/lib/model/customerPayer.d.ts +0 -23
- package/lib/model/customerPayerAllOf.d.ts +0 -19
- package/lib/model/customersTopic.d.ts +0 -36
- package/lib/model/customersTopicAllOf.d.ts +0 -32
- package/lib/model/decimal.d.ts +0 -24
- package/lib/model/defaultLogicError.d.ts +0 -28
- package/lib/model/deleteCustomer400Response.d.ts +0 -30
- package/lib/model/digitalWallet.d.ts +0 -20
- package/lib/model/digitalWalletAllOf.d.ts +0 -17
- package/lib/model/digitalWalletData.d.ts +0 -28
- package/lib/model/digitalWalletDataAllOf.d.ts +0 -28
- package/lib/model/digitalWalletDetails.d.ts +0 -17
- package/lib/model/externalIDConflictError.d.ts +0 -25
- package/lib/model/fulfillInvoice400Response.d.ts +0 -31
- package/lib/model/generalError.d.ts +0 -14
- package/lib/model/googlePay.d.ts +0 -24
- package/lib/model/googlePayAllOf.d.ts +0 -24
- package/lib/model/internationalBankAccount.d.ts +0 -28
- package/lib/model/internationalBankDetails.d.ts +0 -36
- package/lib/model/internationalCorrespondentBankAccount.d.ts +0 -24
- package/lib/model/internationalLegalEntity.d.ts +0 -43
- package/lib/model/internationalLegalEntityAllOf.d.ts +0 -37
- package/lib/model/invoice.d.ts +0 -90
- package/lib/model/invoiceAmountRandomized.d.ts +0 -24
- package/lib/model/invoiceAndToken.d.ts +0 -17
- package/lib/model/invoiceBankAccount.d.ts +0 -26
- package/lib/model/invoiceChange.d.ts +0 -27
- package/lib/model/invoiceClientInfo.d.ts +0 -27
- package/lib/model/invoiceCreated.d.ts +0 -18
- package/lib/model/invoiceCreatedAllOf.d.ts +0 -15
- package/lib/model/invoiceEvent.d.ts +0 -17
- package/lib/model/invoiceLine.d.ts +0 -34
- package/lib/model/invoiceLineTaxMode.d.ts +0 -26
- package/lib/model/invoiceLineTaxVAT.d.ts +0 -30
- package/lib/model/invoiceLineTaxVATAllOf.d.ts +0 -32
- package/lib/model/invoiceParams.d.ts +0 -65
- package/lib/model/invoiceParamsWithTemplate.d.ts +0 -29
- package/lib/model/invoiceRandomizeAmount.d.ts +0 -48
- package/lib/model/invoiceRussianBankAccount.d.ts +0 -24
- package/lib/model/invoiceRussianBankAccountAllOf.d.ts +0 -24
- package/lib/model/invoiceStatus.d.ts +0 -30
- package/lib/model/invoiceStatusChanged.d.ts +0 -31
- package/lib/model/invoiceTemplate.d.ts +0 -47
- package/lib/model/invoiceTemplateAndToken.d.ts +0 -17
- package/lib/model/invoiceTemplateCreateParams.d.ts +0 -43
- package/lib/model/invoiceTemplateDetails.d.ts +0 -14
- package/lib/model/invoiceTemplateLineCost.d.ts +0 -17
- package/lib/model/invoiceTemplateLineCostFixed.d.ts +0 -22
- package/lib/model/invoiceTemplateLineCostFixedAllOf.d.ts +0 -21
- package/lib/model/invoiceTemplateLineCostRange.d.ts +0 -20
- package/lib/model/invoiceTemplateLineCostRangeAllOf.d.ts +0 -19
- package/lib/model/invoiceTemplateLineCostUnlim.d.ts +0 -14
- package/lib/model/invoiceTemplateMultiLine.d.ts +0 -23
- package/lib/model/invoiceTemplateMultiLineAllOf.d.ts +0 -22
- package/lib/model/invoiceTemplateSingleLine.d.ts +0 -22
- package/lib/model/invoiceTemplateSingleLineAllOf.d.ts +0 -21
- package/lib/model/invoiceTemplateUpdateParams.d.ts +0 -31
- package/lib/model/invoicesTopic.d.ts +0 -45
- package/lib/model/invoicesTopicAllOf.d.ts +0 -41
- package/lib/model/legalAgreement.d.ts +0 -28
- package/lib/model/legalEntity.d.ts +0 -20
- package/lib/model/legalEntityAllOf.d.ts +0 -24
- package/lib/model/lifetimeInterval.d.ts +0 -19
- package/lib/model/logicError.d.ts +0 -18
- package/lib/model/mobileCommerce.d.ts +0 -20
- package/lib/model/mobileCommerceAllOf.d.ts +0 -17
- package/lib/model/mobileCommerceData.d.ts +0 -6
- package/lib/model/mobileCommerceDataAllOf.d.ts +0 -18
- package/lib/model/mobileCommerceDetails.d.ts +0 -17
- package/lib/model/mobileCommercePhone.d.ts +0 -24
- package/lib/model/models.d.ts +0 -252
- package/lib/model/party.d.ts +0 -16
- package/lib/model/payer.d.ts +0 -19
- package/lib/model/payerSessionInfo.d.ts +0 -20
- package/lib/model/payment.d.ts +0 -73
- package/lib/model/paymentError.d.ts +0 -22
- package/lib/model/paymentFlow.d.ts +0 -24
- package/lib/model/paymentFlowHold.d.ts +0 -29
- package/lib/model/paymentFlowHoldAllOf.d.ts +0 -28
- package/lib/model/paymentFlowInstant.d.ts +0 -16
- package/lib/model/paymentInstitution.d.ts +0 -31
- package/lib/model/paymentInteractionCompleted.d.ts +0 -22
- package/lib/model/paymentInteractionCompletedAllOf.d.ts +0 -22
- package/lib/model/paymentInteractionRequested.d.ts +0 -22
- package/lib/model/paymentInteractionRequestedAllOf.d.ts +0 -22
- package/lib/model/paymentMethod.d.ts +0 -27
- package/lib/model/paymentParams.d.ts +0 -33
- package/lib/model/paymentRecurrentParent.d.ts +0 -24
- package/lib/model/paymentResource.d.ts +0 -28
- package/lib/model/paymentResourceClientInfo.d.ts +0 -25
- package/lib/model/paymentResourceParams.d.ts +0 -17
- package/lib/model/paymentResourcePayer.d.ts +0 -31
- package/lib/model/paymentResourcePayerAllOf.d.ts +0 -15
- package/lib/model/paymentResourceResult.d.ts +0 -36
- package/lib/model/paymentSearchResult.d.ts +0 -90
- package/lib/model/paymentSearchResultAllOf.d.ts +0 -73
- package/lib/model/paymentStarted.d.ts +0 -18
- package/lib/model/paymentStartedAllOf.d.ts +0 -15
- package/lib/model/paymentStatus.d.ts +0 -30
- package/lib/model/paymentStatusChanged.d.ts +0 -32
- package/lib/model/paymentStatusChangedAllOf.d.ts +0 -14
- package/lib/model/paymentTerminal.d.ts +0 -20
- package/lib/model/paymentTerminalAllOf.d.ts +0 -17
- package/lib/model/paymentTerminalData.d.ts +0 -24
- package/lib/model/paymentTerminalDataAllOf.d.ts +0 -24
- package/lib/model/paymentTerminalDetails.d.ts +0 -17
- package/lib/model/paymentTerminalReceipt.d.ts +0 -22
- package/lib/model/paymentTerminalReceiptAllOf.d.ts +0 -21
- package/lib/model/paymentTerms.d.ts +0 -15
- package/lib/model/paymentTool.d.ts +0 -28
- package/lib/model/paymentToolDetails.d.ts +0 -20
- package/lib/model/paymentToolDetailsBankCard.d.ts +0 -45
- package/lib/model/paymentToolDetailsCryptoWallet.d.ts +0 -18
- package/lib/model/paymentToolDetailsDigitalWallet.d.ts +0 -18
- package/lib/model/paymentToolDetailsMobileCommerce.d.ts +0 -18
- package/lib/model/paymentToolDetailsPaymentTerminal.d.ts +0 -18
- package/lib/model/powerOfAttorney.d.ts +0 -28
- package/lib/model/privateEntity.d.ts +0 -20
- package/lib/model/privateEntityAllOf.d.ts +0 -23
- package/lib/model/qrCodeDisplayRequest.d.ts +0 -18
- package/lib/model/qrCodeDisplayRequestAllOf.d.ts +0 -17
- package/lib/model/realmMode.d.ts +0 -19
- package/lib/model/reason.d.ts +0 -17
- package/lib/model/recurrentPayer.d.ts +0 -23
- package/lib/model/recurrentPayerAllOf.d.ts +0 -19
- package/lib/model/redirect.d.ts +0 -16
- package/lib/model/redirectAllOf.d.ts +0 -15
- package/lib/model/refund.d.ts +0 -61
- package/lib/model/refundError.d.ts +0 -24
- package/lib/model/refundParams.d.ts +0 -39
- package/lib/model/refundSearchResult.d.ts +0 -69
- package/lib/model/refundSearchResultAllOf.d.ts +0 -21
- package/lib/model/refundStarted.d.ts +0 -19
- package/lib/model/refundStartedAllOf.d.ts +0 -16
- package/lib/model/refundStatus.d.ts +0 -27
- package/lib/model/refundStatusChanged.d.ts +0 -30
- package/lib/model/refundStatusChangedAllOf.d.ts +0 -15
- package/lib/model/registeredUser.d.ts +0 -23
- package/lib/model/registeredUserAllOf.d.ts +0 -17
- package/lib/model/reportLink.d.ts +0 -17
- package/lib/model/reportParams.d.ts +0 -31
- package/lib/model/reportingPreferences.d.ts +0 -18
- package/lib/model/representative.d.ts +0 -26
- package/lib/model/representativeDocument.d.ts +0 -24
- package/lib/model/rescindInvoice400Response.d.ts +0 -32
- package/lib/model/russianLegalEntity.d.ts +0 -53
- package/lib/model/russianLegalEntityAllOf.d.ts +0 -47
- package/lib/model/russianPrivateEntity.d.ts +0 -33
- package/lib/model/russianPrivateEntityAllOf.d.ts +0 -27
- package/lib/model/samsungPay.d.ts +0 -24
- package/lib/model/samsungPayAllOf.d.ts +0 -24
- package/lib/model/schedule.d.ts +0 -19
- package/lib/model/searchInvoices200Response.d.ts +0 -19
- package/lib/model/searchPayments200Response.d.ts +0 -19
- package/lib/model/searchRefunds200Response.d.ts +0 -16
- package/lib/model/serviceAcceptanceActPreferences.d.ts +0 -22
- package/lib/model/serviceProvider.d.ts +0 -32
- package/lib/model/shop.d.ts +0 -48
- package/lib/model/shopDetails.d.ts +0 -21
- package/lib/model/shopLocation.d.ts +0 -20
- package/lib/model/shopLocationUrl.d.ts +0 -21
- package/lib/model/shopLocationUrlAllOf.d.ts +0 -17
- package/lib/model/subError.d.ts +0 -21
- package/lib/model/tokenizedCardData.d.ts +0 -17
- package/lib/model/tokenizedCardDataAllOf.d.ts +0 -26
- package/lib/model/tradeBloc.d.ts +0 -19
- package/lib/model/transactionInfo.d.ts +0 -24
- package/lib/model/updateInvoiceTemplate400Response.d.ts +0 -31
- package/lib/model/userInteraction.d.ts +0 -17
- package/lib/model/userInteractionFormInner.d.ts +0 -21
- package/lib/model/webhook.d.ts +0 -35
- package/lib/model/webhookScope.d.ts +0 -27
- package/lib/model/yandexPay.d.ts +0 -24
- package/lib/model/yandexPayAllOf.d.ts +0 -24
- package/lib/param.d.ts +0 -37
- package/lib/variables.d.ts +0 -8
- package/public-api.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,63 +1,185 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vality/swag-payments@0.1.2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Description API is designed for the merchants who accept payments via user interface such as a website or a mobile app and it is the only interaction point with the system for goods and services payment transactions. ## Interaction details Whenever an API is accessed, its unique ID must be passed in the header X-Request-ID of the corresponding request: ``` X-Request-ID: 37d735d4-0f42-4f05-89fa-eaa478fb5aa9 ``` ### Content type and coding The system accepts and returns data in JSON format and UTF-8 coding: ``` Content-Type: application/json; charset=utf-8 ``` ### Date formats The system accepts and returns timestamp values in the format date-time, described in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339): ``` 2017-01-01T00:00:00Z 2017-01-01T00:00:01+00:00 ``` ### Maximum request processing time Whenever an API is accessed, the time cutoff parameters, that define maximum request processing time of the transaction completion, can be passed in the header `X-Request-Deadline` of the corresponding request: ``` X-Request-Deadline: 10s ``` The system stops processing the request upon the specified time. It is recommended to specify a value that is not more than one minute and not less than three seconds. `X-Request-Deadline` can be: * specified in the format `date-time` according to [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339); * specified in relative values: in milliseconds (`150000ms`), in seconds (`540s`) or in minutes (`3.5m`).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The version of the OpenAPI document: 2.0.1
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Building
|
|
8
|
+
|
|
9
|
+
To install the required dependencies and to build the typescript sources run:
|
|
8
10
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
+
```console
|
|
12
|
+
npm install
|
|
13
|
+
npm run build
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
## Publishing
|
|
17
|
+
|
|
18
|
+
First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!)
|
|
19
|
+
|
|
20
|
+
## Consuming
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
Navigate to the folder of your consuming project and run one of next commands.
|
|
23
|
+
|
|
24
|
+
_published:_
|
|
25
|
+
|
|
26
|
+
```console
|
|
27
|
+
npm install @vality/swag-payments@0.1.2 --save
|
|
17
28
|
```
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
_without publishing (not recommended):_
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
```console
|
|
33
|
+
npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
|
|
37
|
+
|
|
38
|
+
_using `npm link`:_
|
|
22
39
|
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
In PATH_TO_GENERATED_PACKAGE/dist:
|
|
41
|
+
|
|
42
|
+
```console
|
|
43
|
+
npm link
|
|
25
44
|
```
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
In your project:
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
```console
|
|
49
|
+
npm link @vality/swag-payments
|
|
50
|
+
```
|
|
30
51
|
|
|
31
|
-
|
|
52
|
+
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
|
53
|
+
Please refer to this issue <https://github.com/angular/angular-cli/issues/8284> for a solution / workaround.
|
|
54
|
+
Published packages are not effected by this issue.
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd dist/swag-payments
|
|
36
|
-
```
|
|
56
|
+
### General usage
|
|
37
57
|
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm publish
|
|
41
|
-
```
|
|
58
|
+
In your Angular project:
|
|
42
59
|
|
|
43
|
-
|
|
60
|
+
```typescript
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
import { ApplicationConfig } from '@angular/core';
|
|
63
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
64
|
+
import { provideApi } from '@vality/swag-payments';
|
|
46
65
|
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
export const appConfig: ApplicationConfig = {
|
|
67
|
+
providers: [
|
|
68
|
+
// ...
|
|
69
|
+
provideHttpClient(),
|
|
70
|
+
provideApi()
|
|
71
|
+
],
|
|
72
|
+
};
|
|
49
73
|
```
|
|
50
74
|
|
|
51
|
-
|
|
75
|
+
**NOTE**
|
|
76
|
+
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
|
|
77
|
+
```typescript
|
|
78
|
+
import { ApiModule } from '@vality/swag-payments';
|
|
79
|
+
```
|
|
52
80
|
|
|
53
|
-
|
|
81
|
+
If different from the generated base path, during app bootstrap, you can provide the base path to your service.
|
|
54
82
|
|
|
55
|
-
```
|
|
56
|
-
|
|
83
|
+
```typescript
|
|
84
|
+
import { ApplicationConfig } from '@angular/core';
|
|
85
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
86
|
+
import { provideApi } from '@vality/swag-payments';
|
|
87
|
+
|
|
88
|
+
export const appConfig: ApplicationConfig = {
|
|
89
|
+
providers: [
|
|
90
|
+
// ...
|
|
91
|
+
provideHttpClient(),
|
|
92
|
+
provideApi('http://localhost:9999')
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// with a custom configuration
|
|
99
|
+
import { ApplicationConfig } from '@angular/core';
|
|
100
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
101
|
+
import { provideApi } from '@vality/swag-payments';
|
|
102
|
+
|
|
103
|
+
export const appConfig: ApplicationConfig = {
|
|
104
|
+
providers: [
|
|
105
|
+
// ...
|
|
106
|
+
provideHttpClient(),
|
|
107
|
+
provideApi({
|
|
108
|
+
withCredentials: true,
|
|
109
|
+
username: 'user',
|
|
110
|
+
password: 'password'
|
|
111
|
+
})
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// with factory building a custom configuration
|
|
118
|
+
import { ApplicationConfig } from '@angular/core';
|
|
119
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
120
|
+
import { provideApi, Configuration } from '@vality/swag-payments';
|
|
121
|
+
|
|
122
|
+
export const appConfig: ApplicationConfig = {
|
|
123
|
+
providers: [
|
|
124
|
+
// ...
|
|
125
|
+
provideHttpClient(),
|
|
126
|
+
{
|
|
127
|
+
provide: Configuration,
|
|
128
|
+
useFactory: (authService: AuthService) => new Configuration({
|
|
129
|
+
basePath: 'http://localhost:9999',
|
|
130
|
+
withCredentials: true,
|
|
131
|
+
username: authService.getUsername(),
|
|
132
|
+
password: authService.getPassword(),
|
|
133
|
+
}),
|
|
134
|
+
deps: [AuthService],
|
|
135
|
+
multi: false
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
};
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Using multiple OpenAPI files / APIs
|
|
142
|
+
|
|
143
|
+
In order to use multiple APIs generated from different OpenAPI files,
|
|
144
|
+
you can create an alias name when importing the modules
|
|
145
|
+
in order to avoid naming conflicts:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import { provideApi as provideUserApi } from 'my-user-api-path';
|
|
149
|
+
import { provideApi as provideAdminApi } from 'my-admin-api-path';
|
|
150
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
151
|
+
import { environment } from '../environments/environment';
|
|
152
|
+
|
|
153
|
+
export const appConfig: ApplicationConfig = {
|
|
154
|
+
providers: [
|
|
155
|
+
// ...
|
|
156
|
+
provideHttpClient(),
|
|
157
|
+
provideUserApi(environment.basePath),
|
|
158
|
+
provideAdminApi(environment.basePath),
|
|
159
|
+
],
|
|
160
|
+
};
|
|
57
161
|
```
|
|
58
162
|
|
|
59
|
-
|
|
163
|
+
### Customizing path parameter encoding
|
|
164
|
+
|
|
165
|
+
Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
|
|
166
|
+
and Dates for format 'date-time' are encoded correctly.
|
|
167
|
+
|
|
168
|
+
Other styles (e.g. "matrix") are not that easy to encode
|
|
169
|
+
and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
|
|
60
170
|
|
|
61
|
-
|
|
171
|
+
To implement your own parameter encoding (or call another library),
|
|
172
|
+
pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
|
|
173
|
+
(see [General Usage](#general-usage) above).
|
|
174
|
+
|
|
175
|
+
Example value for use in your Configuration-Provider:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
new Configuration({
|
|
179
|
+
encodeParam: (param: Param) => myFancyParamEncoder(param),
|
|
180
|
+
})
|
|
181
|
+
```
|
|
62
182
|
|
|
63
|
-
|
|
183
|
+
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
|
|
184
|
+
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
|
|
185
|
+
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
|