-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(internal): run layerfi migration (#895)
- Loading branch information
Showing
254 changed files
with
15,759 additions
and
0 deletions.
There are no files selected for viewing
4,859 changes: 4,859 additions & 0 deletions
4,859
clis/docs-migrator/src/__test__/fixtures/layerfi/OpenApiSpec.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
clis/docs-migrator/src/__test__/fixtures/layerfi/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Mintlify Starter Kit | ||
|
||
Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including | ||
|
||
- Guide pages | ||
- Navigation | ||
- Customizations | ||
- API Reference pages | ||
- Use of popular components | ||
|
||
### Development | ||
|
||
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command | ||
|
||
``` | ||
npm i -g mintlify | ||
``` | ||
|
||
Run the following command at the root of your documentation (where mint.json is) | ||
|
||
``` | ||
mintlify dev | ||
``` | ||
|
||
### Publishing Changes | ||
|
||
Install our Github App to autopropagate changes from youre repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard. | ||
|
||
#### Troubleshooting | ||
|
||
- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies. | ||
- Page loads as a 404 - Make sure you are running in a folder with `mint.json` |
3 changes: 3 additions & 0 deletions
3
clis/docs-migrator/src/__test__/fixtures/layerfi/_snippets/snippet-example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## My Snippet | ||
|
||
<Info>This is an example of a reusable snippet</Info> |
5 changes: 5 additions & 0 deletions
5
clis/docs-migrator/src/__test__/fixtures/layerfi/api-details/idempotency.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: 'Idempotency' | ||
--- | ||
|
||
Creation operations to the Layer API are idempotent when an external id is specified, such as the `external_id` field on a [Business](/api-reference/business/business) object. Others are indicated in the documentation. While these keys are not always required, use of idempotency keys is highly recommended whenever available. |
72 changes: 72 additions & 0 deletions
72
clis/docs-migrator/src/__test__/fixtures/layerfi/api-details/json-data.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
title: 'JSON Data' | ||
--- | ||
|
||
Layer uses a standardized json structure across all endpoints. There are only 3 possible top level fields. | ||
|
||
### Data | ||
Contains the requested data from the endpoint and can be either a JSON list or a JSON object. | ||
- Every top level object or item in an array will contain a `type` field indicating the entity type. | ||
- `data` will only be present if the result is successful, in which case there will be a `2**` status code and no `error` field. | ||
|
||
```json | ||
{ | ||
"data":[ | ||
{ | ||
"type":"Business", | ||
"id":"08cee9cc-389e-44ea-a42e-ffb12670f515", | ||
"external_id":"id-1", | ||
"legal_name":"Acme, Inc.", | ||
"tin":null, | ||
"us_state":"AZ", | ||
"entity_type":"LLC", | ||
"phone_number":"53924476123", | ||
"imported_at":"2023-07-13T17:25:59.292451Z", | ||
"updated_at":"2023-07-13T17:25:59.292451Z", | ||
"archived_at":null | ||
}, | ||
{ | ||
"type":"Business", | ||
"id":"e348d217-1788-494c-9c1c-d8be13b89aba", | ||
"external_id":"id-2", | ||
"legal_name":"Acme, Inc.", | ||
"tin":null, | ||
"us_state":"AZ", | ||
"entity_type":"LLC", | ||
"phone_number":"69565771257", | ||
"imported_at":"2023-07-13T17:25:59.720376Z", | ||
"updated_at":"2023-07-13T17:25:59.720376Z", | ||
"archived_at":null | ||
} | ||
], | ||
"meta":{ | ||
|
||
} | ||
} | ||
``` | ||
|
||
### Errors | ||
An array of `error` objects. `error` objects will contain the following fields. | ||
- `type`: One of a fixed set of categories. Helpful for categorizing & processing errors | ||
- `description`: A human readable error description. | ||
- `meta`: Optional additional information. | ||
`errors` will be present only if the request is unsuccessful, in which case there will be a `4**` or `5**` status code and no `data` field. | ||
|
||
```json | ||
{ | ||
"errors": [ | ||
{ | ||
"type": "Plaid", | ||
"description": "Plaid credentials must be set before you can add plaid items to businesses. See /v1/configure/plaid" | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
### Meta | ||
An optional object that may be used to communicate metadata about the request. | ||
Example use cases include: | ||
- Idempotency | ||
- Pagination | ||
- Rate limits |
34 changes: 34 additions & 0 deletions
34
clis/docs-migrator/src/__test__/fixtures/layerfi/api-details/pagination.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: 'Pagination' | ||
--- | ||
|
||
Listing endpoints, for example [List all Businesses](/api-reference/business/list) and [List all Bank Transactions](/api-reference/bank-transactions/list) support cursor-based pagination. Pagination can be controlled via query string parameters: | ||
- `sort_by` which supports some timestamp, integer and string keys. Valid sort keys are noted in documentation where applicable. Sort key is optional. | ||
- `sort_order` specifies either ASC or DESC ordering for the sort key. Optional, ASC by default. | ||
- `cursor` returned by the previous list request. Do not specify for the initial listing API call. | ||
- `limit` constrains the number of results to be returned. Defaults to 100 for most endpoints. | ||
|
||
```bash Request | ||
curl https://sandbox.layerfi.com/v1/businesses/:business_id/bank-transactions?sort_by=date&sort_order=DESC&limit=50 \ | ||
-H "Authorization: Bearer <access_token>" | ||
``` | ||
|
||
Responses to paginating endpoints will include pagination data in the meta response field. | ||
|
||
```json Response | ||
{ | ||
"data": [ | ||
// Data omitted | ||
], | ||
"meta": { | ||
"pagination": { | ||
"sort_by": "date", | ||
"sort_order": ASC, | ||
"cursor": "VGhhbmtzIGZvciByZWFsbHkgcmVhZGluZyB0aGUgZG9jdW1lbnRhdGlvbiE=" | ||
"has_more": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
When the `has_more` field is true, use the returned cursor in an additional request to fetch the next page of results. |
16 changes: 16 additions & 0 deletions
16
clis/docs-migrator/src/__test__/fixtures/layerfi/api-details/rate-limiting.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: 'Rate Limiting' | ||
--- | ||
|
||
Layer uses a single API-wide endpoint cost rate limiting system, where every endpoint contributes a cost towards a total budget. The budget follows a bucket model, where each API call uses tokens from a current bucket which is refilled every 1 second. | ||
|
||
Rate limits should never be approached for normal customer read operations, and are only intended to limit heavy data ingestion processes, such as en-masse backfills of data. Nonetheless, we recommend adding retries on all Layer API calls. To assist in retries, the following headers are included in every successful API request: | ||
- `X-RateLimit-Limit`: a specified bucket capacity. | ||
- `X-RateLimit-Remaining`: the number of tokens remaining in a bucket. | ||
- `X-RateLimit-Reset`: a UTC timestamp (in seconds) that specifies the time of refilling a bucket. | ||
|
||
Any API calls that are rate limited will receive a response with: | ||
- Error code `429: Too Many Requests` | ||
- `Retry-After` header indicating (in seconds) how long to wait before retrying the request. | ||
|
||
During normal operations, adding enough retries that requests will retry 1 second later should be sufficient to avoid any rate limiting. |
3 changes: 3 additions & 0 deletions
3
...src/__test__/fixtures/layerfi/api-reference/add-custom-account-for-business.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/custom-accounts/ | ||
--- |
3 changes: 3 additions & 0 deletions
3
...rfi/api-reference/apply-list-of-tags-to-list-of-invoice-payment-allocations.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/invoices/payments/allocations/tags | ||
--- |
3 changes: 3 additions & 0 deletions
3
...est__/fixtures/layerfi/api-reference/apply-list-of-tags-to-list-of-invoices.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/invoices/tags | ||
--- |
3 changes: 3 additions & 0 deletions
3
...test__/fixtures/layerfi/api-reference/apply-list-of-tags-to-list-of-payouts.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/payouts/tags | ||
--- |
3 changes: 3 additions & 0 deletions
3
..._/fixtures/layerfi/api-reference/apply-list-of-tags-to-list-of-transactions.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/bank-transactions/tags | ||
--- |
3 changes: 3 additions & 0 deletions
3
.../docs-migrator/src/__test__/fixtures/layerfi/api-reference/archive-business.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: put /v1/businesses/{businessId}/archive | ||
--- |
3 changes: 3 additions & 0 deletions
3
..._test__/fixtures/layerfi/api-reference/archive-custom-account-from-business.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/custom-accounts/{customAccountId}/archive | ||
--- |
3 changes: 3 additions & 0 deletions
3
...src/__test__/fixtures/layerfi/api-reference/archive-linked-external-account.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/external-accounts/{accountId}/archive | ||
--- |
3 changes: 3 additions & 0 deletions
3
...-migrator/src/__test__/fixtures/layerfi/api-reference/archive-plaid-account.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/plaid/accounts/{plaidAccountId}/archive | ||
--- |
135 changes: 135 additions & 0 deletions
135
.../docs-migrator/src/__test__/fixtures/layerfi/api-reference/bank-transaction.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
--- | ||
title: "Bank Transaction object" | ||
--- | ||
Bank transactions are transactions that have occurred within a bank account owned by a business. | ||
|
||
### Attributes | ||
|
||
<ParamField body="id" type="string"> | ||
Unique identifier for the bank transaction. | ||
</ParamField> | ||
<ParamField body="external_id" type="string"> | ||
Unique ID of the bank transaction in your system for linking purposes. **Idempotency key.** | ||
</ParamField> | ||
<ParamField body="type" type="string"> | ||
Resource type. Value will be "Bank_Transaction". | ||
</ParamField> | ||
<ParamField body="business_id" type="string"> | ||
Id for the Business this transaction belongs to. | ||
</ParamField> | ||
<ParamField body="source" type="enum"> | ||
The source that the bank transaction was imported from. | ||
Values can be: `UNIT`, `PLAID`, `API` | ||
</ParamField> | ||
<ParamField body="source_transaction_id" type="string"> | ||
Unique ID of the bank transaction in its source system. **Idempotency key.** | ||
</ParamField> | ||
<ParamField body="source_account_id" type="string"> | ||
Id of the source account in the source system. | ||
</ParamField> | ||
<ParamField body="date" type="ISO8601 timestamp"> | ||
Date the transaction occurred. | ||
</ParamField> | ||
<ParamField body="direction" type="enum"> | ||
The direction of the transaction relative to the source account. | ||
Values can be: `CREDIT`, `DEBIT` | ||
</ParamField> | ||
<ParamField body="amount" type="integer"> | ||
The amount of the transaction in cents. | ||
</ParamField> | ||
<ParamField body="counterparty_name" type="string"> | ||
The name of the merchant or counterparty associated with the transaction. | ||
</ParamField> | ||
<ParamField body="description" type="string"> | ||
Description of the transaction. | ||
</ParamField> | ||
<ParamField body="type" type="string"> | ||
The type of bank account transaction. | ||
Example values: `PURCHASE`, `BOOK`, `ATM`, `WIRE`, etc. | ||
</ParamField> | ||
<ParamField body="categorization_status" type="enum"> | ||
The status of the transaction's categorization in Layer's systems. | ||
Values can be: `PENDING`, `READY_FOR_INPUT`, `CATEGORIZED`, `LAYER_REVIEW` | ||
</ParamField> | ||
<ParamField body="categorization_method" type="enum"> | ||
How the transaction was categorized. | ||
Values can be: `SMS`, `API`, `LAYER_AUTO`, `LAYER_MANUAL` | ||
</ParamField> | ||
<ParamField body="category" type="Category object"> | ||
The category assigned to the transaction. Only populated for transactions that have a finalized category. | ||
<Expandable title="properties"> | ||
<ResponseField name="category" type="enum"> | ||
String enum for the category assigned to the transaction. The set of category enums will vary based on chart of account configured for the business. | ||
</ResponseField> | ||
<ResponseField name="display_name" type="string"> | ||
A human-readable string describing the category. This can be presented to the end user in your UI. | ||
</ResponseField> | ||
</Expandable> | ||
</ParamField> | ||
<ParamField body="categorization_flow" type="Categorization Flow object"> | ||
Layer's suggested categorization for the transaction. | ||
<Expandable title="properties"> | ||
<ResponseField name="type" type="string"> | ||
The type of categorization approach used. | ||
</ResponseField> | ||
<ParamField body="category" type="Category object"> | ||
The category assigned to the transaction. Only populated for transactions that have a finalized category. | ||
<Expandable title="properties"> | ||
<ResponseField name="category" type="enum"> | ||
String enum for the category assigned to the transaction. The set of category enums will vary based on chart of account configured for the business. | ||
</ResponseField> | ||
<ResponseField name="display_name" type="string"> | ||
A human-readable string describing the category. This can be presented to the end user in your UI. | ||
</ResponseField> | ||
</Expandable> | ||
</ParamField> | ||
<ResponseField name="suggestions" type="array of Category objects"> | ||
Layer's list of suggested categories for the transaction. | ||
<Expandable title="properties"> | ||
<ResponseField name="category" type="enum"> | ||
String enum for the category assigned to the transaction. The set of category enums will vary based on chart of account configured for the business. | ||
</ResponseField> | ||
<ResponseField name="display_name" type="string"> | ||
A human-readable string describing the category. This can be presented to the end user in your UI. | ||
</ResponseField> | ||
</Expandable> | ||
</ResponseField> | ||
</Expandable> | ||
</ParamField> | ||
|
||
|
||
|
||
<ResponseExample> | ||
|
||
```json Example | ||
{ | ||
"id":"67cee0d8-3b8e-4b4b-a857-78ce3bb1d895", | ||
"type":"Bank_Transaction", | ||
"transaction_type":"Purchase", | ||
"business_id":"cfee5365-dcc3-425e-b403-cc9568f7121e", | ||
"source":"API", | ||
"source_transaction_id":"11111113", | ||
"source_account_id":"111113", | ||
"imported_at":"2023-06-07T00:42:08.664543Z", | ||
"date":"2023-05-15T14:13:07Z", | ||
"direction":"Debit", | ||
"amount":8026, | ||
"counterparty_name":"SUNOCO", | ||
"description":null, | ||
"categorization_status":"CATEGORIZED", | ||
"category":{ | ||
"category":"FUEL", | ||
"display_name":"Fuel" | ||
}, | ||
"categorization_method":"LAYER_AUTO", | ||
"categorization_flow":{ | ||
"type":"AUTO", | ||
"category":{ | ||
"category":"FUEL", | ||
"display_name":"Fuel" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</ResponseExample> |
3 changes: 3 additions & 0 deletions
3
...igrator/src/__test__/fixtures/layerfi/api-reference/bulk-match-transactions.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
openapi: post /v1/businesses/{businessId}/bank-transactions/bulk-match | ||
--- |
Oops, something went wrong.