Skip to content

Commit

Permalink
[DE-726] Set date and date-time formats, fix webhooks and endpoints m…
Browse files Browse the repository at this point in the history
…odels [DE-728] Remove deprecated authentication code (#57)

* Automated commit message

* Fix latest publish branch

---------

Co-authored-by: maxio-sdk <[email protected]>
Co-authored-by: Alberto Blacutt <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 8e3b976 commit d429009
Show file tree
Hide file tree
Showing 139 changed files with 767 additions and 401 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ The following parameters are configurable for the API Client:
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `30000` |
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
| `basicAuthUserName` | `string` | The username to use with basic authentication |
| `basicAuthPassword` | `string` | The password to use with basic authentication |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-typescript-sdk/tree/1.0.1/basic-authentication.md) | The credential object for basicAuth |

### HttpClientOptions

Expand All @@ -318,10 +317,12 @@ The API client can be initialized as follows:

```ts
const client = new Client({
basicAuthCredentials: {
username: 'BasicAuthUserName',
password: 'BasicAuthPassword'
},
timeout: 30000,
environment: Environment.Production,
basicAuthUserName: 'BasicAuthUserName',
basicAuthPassword: 'BasicAuthPassword',
});
```

Expand All @@ -338,7 +339,9 @@ The SDK can be configured to use a different environment for making API calls. A

## Authorization

This API uses `Basic Authentication`.
This API uses the following authentication schemes.

* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-typescript-sdk/tree/1.0.1/basic-authentication.md)

## List of APIs

Expand Down
34 changes: 34 additions & 0 deletions doc/auth/basic-authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# Basic Authentication



Documentation for accessing and setting credentials for BasicAuth.

## Auth Credentials

| Name | Type | Description | Setter |
| --- | --- | --- | --- |
| BasicAuthUserName | `string` | The username to use with basic authentication | `username` |
| BasicAuthPassword | `string` | The password to use with basic authentication | `password` |



**Note:** Auth credentials can be set using `basicAuthCredentials` object in the client.

## Usage Example

### Client Initialization

You must provide credentials in the client as shown in the following code snippet.

```ts
const client = new Client({
basicAuthCredentials: {
username: 'BasicAuthUserName',
password: 'BasicAuthPassword'
},
});
```


9 changes: 5 additions & 4 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ The following parameters are configurable for the API Client:
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `30000` |
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
| `basicAuthUserName` | `string` | The username to use with basic authentication |
| `basicAuthPassword` | `string` | The password to use with basic authentication |
| `basicAuthCredentials` | [`BasicAuthCredentials`]($a/basic-authentication.md) | The credential object for basicAuth |

## HttpClientOptions

Expand All @@ -39,10 +38,12 @@ The API client can be initialized as follows:

```ts
const client = new Client({
basicAuthCredentials: {
username: 'BasicAuthUserName',
password: 'BasicAuthPassword'
},
timeout: 30000,
environment: Environment.Production,
basicAuthUserName: 'BasicAuthUserName',
basicAuthPassword: 'BasicAuthPassword',
});
```

Expand Down
10 changes: 5 additions & 5 deletions doc/controllers/coupons.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ try {
"amount_in_cents": 0,
"product_family_id": 0,
"product_family_name": "string",
"start_date": "string",
"end_date": "string",
"start_date": "2021-05-03T16:00:21-04:00",
"end_date": "2023-05-05T16:00:21-04:00",
"percentage": "10",
"recurring": true,
"recurring_scheme": "do_not_recur",
Expand All @@ -715,13 +715,13 @@ try {
"duration_interval_unit": "string",
"duration_interval_span": "string",
"allow_negative_balance": true,
"archived_at": "string",
"archived_at": null,
"conversion_limit": "string",
"stackable": true,
"compounding_strategy": "compound",
"use_site_exchange_rate": true,
"created_at": "string",
"updated_at": "string",
"created_at": "2021-05-05T16:00:21-04:00",
"updated_at": "2021-05-05T16:00:21-04:00",
"discount_type": "amount",
"exclude_mid_period_allocations": true,
"apply_on_cancel_at_end_of_period": true,
Expand Down
16 changes: 6 additions & 10 deletions doc/controllers/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ async recordPaymentForSubscription(
subscriptionId: number,
body?: RecordPaymentRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<PaymentResponse>>
): Promise<ApiResponse<RecordPaymentResponse>>
```

## Parameters
Expand All @@ -2028,7 +2028,7 @@ async recordPaymentForSubscription(

## Response Type

[`PaymentResponse`](../../doc/models/payment-response.md)
[`RecordPaymentResponse`](../../doc/models/record-payment-response.md)

## Example Usage

Expand All @@ -2040,7 +2040,7 @@ const body: RecordPaymentRequest = {
amount: '10.0',
memo: 'to pay the bills',
paymentDetails: 'check number 8675309',
paymentMethod: 'check',
paymentMethod: InvoicePaymentMethodType.Check,
},
};

Expand Down Expand Up @@ -2069,23 +2069,19 @@ try {
{
"paid_invoices": [
{
"invoice_uid": "xyz_012345678",
"invoice_id": "inv_bchyhr6z5grby",
"status": "paid",
"due_amount": "0.0",
"paid_amount": "50.0"
},
{
"invoice_uid": "xyz_012345678",
"invoice_id": "inv_bchyhrgvyb6vm",
"status": "paid",
"due_amount": "0.0",
"paid_amount": "50.0"
}
],
"prepayment": {
"subscription_id": "123456",
"amount_in_cents": "5000",
"ending_balance_in_cents": "5000"
}
"prepayment": null
}
```

Expand Down
4 changes: 2 additions & 2 deletions doc/controllers/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ try {
"handle": "string",
"accounting_code": null,
"description": "string",
"created_at": "string",
"updated_at": "string"
"created_at": "2021-05-05T16:00:21-04:00",
"updated_at": "2021-05-05T16:00:21-04:00"
},
"public_signup_pages": [
{
Expand Down
12 changes: 6 additions & 6 deletions doc/controllers/subscription-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ try {
"created_at": "2022-02-22T14:07:00-05:00",
"updated_at": "2022-02-22T14:07:00-05:00",
"component_handle": "string",
"archived_at": "string"
"archived_at": null
}
}
]
Expand Down Expand Up @@ -401,8 +401,8 @@ try {
"last_name": "esse",
"organization": null,
"email": "ex eiusmod",
"created_at": "ad occaecat cillum",
"updated_at": "ut aute proident est",
"created_at": "2021-05-05T16:00:21-04:00",
"updated_at": "2021-05-05T16:00:21-04:00",
"reference": "laboris ea cupidatat",
"address": null,
"address_2": null,
Expand All @@ -412,8 +412,8 @@ try {
"country": null,
"phone": null,
"portal_invite_last_sent_at": null,
"portal_invite_last_accepted_at": "reprehenderit labore voluptate",
"portal_customer_created_at": "nisi aute reprehenderit Excepteur Duis",
"portal_invite_last_accepted_at": "2021-05-05T20:00:21-04:00",
"portal_customer_created_at": "2021-05-05T16:00:21-04:00",
"cc_emails": "eiusmod sunt",
"tax_exempt": true
},
Expand Down Expand Up @@ -1061,7 +1061,7 @@ const allocationId = 24;

const body: UpdateAllocationExpirationDate = {
allocation: {
expiresAt: '05/07/2021',
expiresAt: '2021-05-05T16:00:00',
},
};

Expand Down
2 changes: 1 addition & 1 deletion doc/controllers/subscription-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ try {
82370782
],
"primary_subscription_id": 69844395,
"next_assessment_at": "Sun, 09 Aug 2020 15:59:06 EDT -04:00",
"next_assessment_at": "2021-05-05T16:00:21-04:00",
"state": "active",
"cancel_at_end_of_period": false,
"account_balances": {
Expand Down
2 changes: 1 addition & 1 deletion doc/controllers/subscription-invoice-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const body: CreatePrepaymentRequest = {
amount: 100,
details: 'John Doe signup for $100',
memo: 'Signup for $100',
method: PrepaymentMethod.Check,
method: CreatePrepaymentMethod.Check,
},
};

Expand Down
16 changes: 8 additions & 8 deletions doc/controllers/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ async replayWebhooks(
```ts
const body: ReplayWebhooksRequest = {
ids: [
123456789,
123456788
BigInt(123456789),
BigInt(123456788)
],
};

Expand Down Expand Up @@ -250,7 +250,7 @@ You can check available events here.

```ts
async createEndpoint(
body?: UpdateEndpointRequest,
body?: CreateOrUpdateEndpointRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<EndpointResponse>>
```
Expand All @@ -259,7 +259,7 @@ async createEndpoint(

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `body` | [`UpdateEndpointRequest \| undefined`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint |
| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

## Response Type
Expand All @@ -269,7 +269,7 @@ async createEndpoint(
## Example Usage

```ts
const body: UpdateEndpointRequest = {
const body: CreateOrUpdateEndpointRequest = {
endpoint: {
url: 'https://your.site/webhooks',
webhookSubscriptions: [
Expand Down Expand Up @@ -402,7 +402,7 @@ If you want unsubscribe from specific event, just send a list of `webhook_subscr
```ts
async updateEndpoint(
endpointId: number,
body?: UpdateEndpointRequest,
body?: CreateOrUpdateEndpointRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<EndpointResponse>>
```
Expand All @@ -412,7 +412,7 @@ async updateEndpoint(
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `endpointId` | `number` | Template, Required | The Chargify id for the endpoint that should be updated |
| `body` | [`UpdateEndpointRequest \| undefined`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint |
| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

## Response Type
Expand All @@ -424,7 +424,7 @@ async updateEndpoint(
```ts
const endpointId = 42;

const body: UpdateEndpointRequest = {
const body: CreateOrUpdateEndpointRequest = {
endpoint: {
url: 'https://yout.site/webhooks/1/json.',
webhookSubscriptions: [
Expand Down
2 changes: 1 addition & 1 deletion doc/models/allocation-expiration-date.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

```json
{
"expires_at": "expires_at0"
"expires_at": "2016-03-13T12:52:32.123Z"
}
```

4 changes: 2 additions & 2 deletions doc/models/allocation-preview-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
```json
{
"allocation_preview": {
"start_date": "start_date0",
"end_date": "end_date6",
"start_date": "2016-03-13T12:52:32.123Z",
"end_date": "2016-03-13T12:52:32.123Z",
"subtotal_in_cents": 240,
"total_tax_in_cents": 108,
"total_discount_in_cents": 142
Expand Down
4 changes: 2 additions & 2 deletions doc/models/allocation-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

```json
{
"start_date": "start_date2",
"end_date": "end_date8",
"start_date": "2016-03-13T12:52:32.123Z",
"end_date": "2016-03-13T12:52:32.123Z",
"subtotal_in_cents": 4,
"total_tax_in_cents": 128,
"total_discount_in_cents": 122
Expand Down
4 changes: 2 additions & 2 deletions doc/models/batch-job-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
{
"batchjob": {
"id": 54,
"finished_at": "finished_at4",
"finished_at": "2016-03-13T12:52:32.123Z",
"row_count": 62,
"created_at": "created_at0",
"created_at": "2016-03-13T12:52:32.123Z",
"completed": "completed4"
}
}
Expand Down
4 changes: 2 additions & 2 deletions doc/models/batch-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
```json
{
"id": 246,
"finished_at": "finished_at0",
"finished_at": "2016-03-13T12:52:32.123Z",
"row_count": 254,
"created_at": "created_at6",
"created_at": "2016-03-13T12:52:32.123Z",
"completed": "completed0"
}
```
Expand Down
4 changes: 2 additions & 2 deletions doc/models/chargify-ebb.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

```json
{
"timestamp": "timestamp8",
"timestamp": "2016-03-13T12:52:32.123Z",
"id": "id4",
"created_at": "created_at8",
"created_at": "2016-03-13T12:52:32.123Z",
"uniqueness_token": "uniqueness_token0",
"subscription_id": 200
}
Expand Down
13 changes: 13 additions & 0 deletions doc/models/containers/record-payment-response-prepayment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Record Payment Response Prepayment

## Class Name

`RecordPaymentResponsePrepayment`

## Cases

| Type |
| --- |
| [`InvoicePrePayment`](../../../doc/models/invoice-pre-payment.md) |

Loading

0 comments on commit d429009

Please sign in to comment.