Skip to content

Commit c8a6caa

Browse files
authored
Merge pull request #26 from pagarme/CodeGen-NodeJS
Code gen node js
2 parents a8526a5 + 7d6d36a commit c8a6caa

File tree

48 files changed

+1139
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1139
-100
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ License:
33
The MIT License (MIT)
44
http://opensource.org/licenses/MIT
55

6-
Copyright (c) 2014 - 2023 APIMATIC Limited
6+
Copyright (c) 2014 - 2024 APIMATIC Limited
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ npm install
7171

7272
## Initialize the API Client
7373

74-
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/client.md)
74+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/client.md)
7575

7676
The following parameters are configurable for the API Client:
7777

@@ -81,8 +81,6 @@ The following parameters are configurable for the API Client:
8181
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` |
8282
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
8383
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
84-
| `basicAuthUserName` | `string` | The username to use with basic authentication |
85-
| `basicAuthPassword` | `string` | The password to use with basic authentication |
8684

8785
### HttpClientOptions
8886

@@ -111,45 +109,39 @@ The API client can be initialized as follows:
111109
const client = new Client({
112110
serviceRefererName: 'ServiceRefererName',
113111
timeout: 0,
114-
basicAuthUserName: 'BasicAuthUserName',
115-
basicAuthPassword: 'BasicAuthPassword',
116112
});
117113
```
118114

119-
## Authorization
120-
121-
This API uses `Basic Authentication`.
122-
123115
## API Errors
124116

125117
Here is the list of errors that the API might throw.
126118

127119
| HTTP Status Code | Error Description | Exception Class |
128120
| --- | --- | --- |
129-
| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
130-
| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
131-
| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
132-
| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
133-
| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
134-
| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/models/custom-error.md) |
121+
| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
122+
| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
123+
| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
124+
| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
125+
| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
126+
| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/models/custom-error.md) |
135127

136128
## List of APIs
137129

138-
* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/subscriptions.md)
139-
* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/orders.md)
140-
* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/plans.md)
141-
* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/invoices.md)
142-
* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/customers.md)
143-
* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/charges.md)
144-
* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/recipients.md)
145-
* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/tokens.md)
146-
* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/transactions.md)
147-
* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/transfers.md)
148-
* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/payables.md)
149-
* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/controllers/balance-operations.md)
130+
* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/subscriptions.md)
131+
* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/orders.md)
132+
* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/plans.md)
133+
* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/invoices.md)
134+
* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/customers.md)
135+
* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/charges.md)
136+
* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/recipients.md)
137+
* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/tokens.md)
138+
* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/transactions.md)
139+
* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/transfers.md)
140+
* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/payables.md)
141+
* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/controllers/balance-operations.md)
150142

151143
## Classes Documentation
152144

153-
* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/api-response.md)
154-
* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.1/doc/api-error.md)
145+
* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/api-response.md)
146+
* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.5/doc/api-error.md)
155147

doc/client.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ The following parameters are configurable for the API Client:
99
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` |
1010
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
1111
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
12-
| `basicAuthUserName` | `string` | The username to use with basic authentication |
13-
| `basicAuthPassword` | `string` | The password to use with basic authentication |
1412

1513
## HttpClientOptions
1614

@@ -39,8 +37,6 @@ The API client can be initialized as follows:
3937
const client = new Client({
4038
serviceRefererName: 'ServiceRefererName',
4139
timeout: 0,
42-
basicAuthUserName: 'BasicAuthUserName',
43-
basicAuthPassword: 'BasicAuthPassword',
4440
});
4541
```
4642

doc/controllers/customers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ async getCustomers(
586586
| --- | --- | --- | --- |
587587
| `name` | `string \| undefined` | Query, Optional | Name of the Customer |
588588
| `document` | `string \| undefined` | Query, Optional | Document of the Customer |
589-
| `page` | `number \| undefined` | Query, Optional | Current page the the search<br>**Default**: `1` |
590-
| `size` | `number \| undefined` | Query, Optional | Quantity pages of the search<br>**Default**: `10` |
589+
| `page` | `number \| undefined` | Query, Optional | Current page the the search |
590+
| `size` | `number \| undefined` | Query, Optional | Quantity pages of the search |
591591
| `email` | `string \| undefined` | Query, Optional | Customer's email |
592592
| `code` | `string \| undefined` | Query, Optional | Customer's code |
593593
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

doc/controllers/recipients.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,11 +1030,6 @@ async createRecipient(
10301030

10311031
```ts
10321032
const request: CreateRecipientRequest = {
1033-
name: 'name6',
1034-
email: 'email0',
1035-
description: 'description6',
1036-
document: 'document0',
1037-
type: 'type4',
10381033
defaultBankAccount: {
10391034
holderName: 'holder_name4',
10401035
holderType: 'holder_type0',

doc/controllers/tokens.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ const tokensController = new TokensController(client);
1616

1717
# Create Token
1818

19-
:information_source: **Note** This endpoint does not require authentication.
20-
2119
```ts
2220
async createToken(
2321
publicKey: string,
@@ -82,8 +80,6 @@ try {
8280

8381
Gets a token from its id
8482

85-
:information_source: **Note** This endpoint does not require authentication.
86-
8783
```ts
8884
async getToken(
8985
id: string,
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
# Create Managing Partner Request
3+
4+
Managing Partner Request
5+
6+
## Structure
7+
8+
`CreateManagingPartnerRequest`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `name` | `string` | Required | - |
15+
| `email` | `string` | Required | - |
16+
| `document` | `string` | Required | - |
17+
| `motherName` | `string` | Required | - |
18+
| `birthdate` | `string` | Required | - |
19+
| `monthlyIncome` | `number` | Required | - |
20+
| `professionalOccupation` | `string` | Required | - |
21+
| `selfDeclaredLegalRepresentative` | `boolean` | Required | - |
22+
| `address` | [`CreateRegisterInformationAddressRequest`](../../doc/models/create-register-information-address-request.md) | Required | - |
23+
| `phoneNumbers` | [`CreateRegisterInformationPhoneRequest[]`](../../doc/models/create-register-information-phone-request.md) | Required | - |
24+
25+
## Example (as JSON)
26+
27+
```json
28+
{
29+
"name": "name4",
30+
"email": "email2",
31+
"document": "document2",
32+
"mother_name": "mother_name0",
33+
"birthdate": "birthdate8",
34+
"monthly_income": 70,
35+
"professional_occupation": "professional_occupation8",
36+
"self_declared_legal_representative": false,
37+
"address": {
38+
"street": "street6",
39+
"complementary": "complementary8",
40+
"street_number": "street_number6",
41+
"neighborhood": "neighborhood2",
42+
"city": "city6",
43+
"state": "state2",
44+
"zip_code": "zip_code0",
45+
"reference_point": "reference_point0"
46+
},
47+
"phone_numbers": [
48+
{
49+
"ddd": "ddd4",
50+
"number": "number2",
51+
"type": "type0"
52+
}
53+
]
54+
}
55+
```
56+

doc/models/create-recipient-request.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,22 @@ Request for creating a recipient
1111

1212
| Name | Type | Tags | Description |
1313
| --- | --- | --- | --- |
14-
| `name` | `string` | Required | Recipient name |
15-
| `email` | `string` | Required | Recipient email |
16-
| `description` | `string` | Required | Recipient description |
17-
| `document` | `string` | Required | Recipient document number |
18-
| `type` | `string` | Required | Recipient type |
14+
| `name` | `string \| null \| undefined` | Optional | Recipient name. Required if the register_information field isn't populated. |
15+
| `email` | `string \| null \| undefined` | Optional | Recipient email. Required if the register_information field isn't populated. |
16+
| `description` | `string \| null \| undefined` | Optional | Recipient description |
17+
| `document` | `string \| null \| undefined` | Optional | Recipient document number. Required if the register_information field isn't populated. |
18+
| `type` | `string \| null \| undefined` | Optional | Recipient type. Required if the register_information field isn't populated. |
1919
| `defaultBankAccount` | [`CreateBankAccountRequest`](../../doc/models/create-bank-account-request.md) | Required | Bank account |
2020
| `metadata` | `Record<string, string>` | Required | Metadata |
2121
| `transferSettings` | [`CreateTransferSettingsRequest \| undefined`](../../doc/models/create-transfer-settings-request.md) | Optional | Receiver Transfer Information |
2222
| `code` | `string` | Required | Recipient code |
2323
| `paymentMode` | `string` | Required | Payment mode<br>**Default**: `'bank_transfer'` |
24+
| `registerInformation` | [`CreateRegisterInformationBaseRequest \| null \| undefined`](../../doc/models/create-register-information-base-request.md) | Optional | Register Information |
2425

2526
## Example (as JSON)
2627

2728
```json
2829
{
29-
"name": "name6",
30-
"email": "email0",
31-
"description": "description6",
32-
"document": "document0",
33-
"type": "type4",
3430
"default_bank_account": {
3531
"holder_name": "holder_name4",
3632
"holder_type": "holder_type0",
@@ -53,11 +49,11 @@ Request for creating a recipient
5349
},
5450
"code": "code4",
5551
"payment_mode": "bank_transfer",
56-
"transfer_settings": {
57-
"transfer_enabled": false,
58-
"transfer_interval": "transfer_interval4",
59-
"transfer_day": 10
60-
}
52+
"name": "name6",
53+
"email": "email0",
54+
"description": "description6",
55+
"document": "document0",
56+
"type": "type4"
6157
}
6258
```
6359

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Create Register Information Address Request
3+
4+
Register Information Address
5+
6+
## Structure
7+
8+
`CreateRegisterInformationAddressRequest`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `street` | `string` | Required | - |
15+
| `complementary` | `string` | Required | - |
16+
| `streetNumber` | `string` | Required | - |
17+
| `neighborhood` | `string` | Required | - |
18+
| `city` | `string` | Required | - |
19+
| `state` | `string` | Required | - |
20+
| `zipCode` | `string` | Required | - |
21+
| `referencePoint` | `string` | Required | - |
22+
23+
## Example (as JSON)
24+
25+
```json
26+
{
27+
"street": "street8",
28+
"complementary": "complementary0",
29+
"street_number": "street_number8",
30+
"neighborhood": "neighborhood4",
31+
"city": "city8",
32+
"state": "state4",
33+
"zip_code": "zip_code2",
34+
"reference_point": "reference_point2"
35+
}
36+
```
37+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Create Register Information Base Request
3+
4+
Request object for RegisterInformation.
5+
6+
## Structure
7+
8+
`CreateRegisterInformationBaseRequest`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `email` | `string` | Required | - |
15+
| `document` | `string` | Required | - |
16+
| `type` | `string` | Required | "individual" ou "corporation" |
17+
| `siteUrl` | `string \| null \| undefined` | Optional | - |
18+
| `phoneNumbers` | [`CreateRegisterInformationPhoneRequest[]`](../../doc/models/create-register-information-phone-request.md) | Required | - |
19+
20+
## Example (as JSON)
21+
22+
```json
23+
{
24+
"email": "email4",
25+
"document": "document6",
26+
"type": "type8",
27+
"phone_numbers": [
28+
{
29+
"ddd": "ddd4",
30+
"number": "number2",
31+
"type": "type0"
32+
}
33+
],
34+
"site_url": "site_url4"
35+
}
36+
```
37+

0 commit comments

Comments
 (0)