Skip to content

Commit

Permalink
docs: add cartData to response
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlee11 committed Jul 19, 2024
1 parent c1efff3 commit 3e4fc4d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/types/api/cart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ export interface CartBaseResponse {
* doing very custom order management.
*/
cart: string;
/** The cart object. See https://square.github.io/custom-sites-docs/resources/cart#cart */
// eslint-disable-next-line @typescript-eslint/naming-convention
cart_data: unknown;
/** Validation for scheduling. Empty if not pickup or delivery fulfillment. */
validation: CartValidation;
};
Expand Down
3 changes: 2 additions & 1 deletion src/types/api/cart/private.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import {
CartValidationErrors,
CartValidation
} from '.';
Expand All @@ -18,6 +18,7 @@ export interface CartBaseErrorResponse {
export interface CartFetchResponse extends CartBaseErrorResponse {
data?: {
cart: string;
cart_data: unknown;
validation: CartValidation;
};
}
Expand Down
4 changes: 1 addition & 3 deletions src/types/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

/** ResourcesRequest can take up to 5 keys (each representing a resource). */
export interface ResourcesRequest {
[key: string]: ResourceInput;
Expand All @@ -8,7 +6,7 @@ export interface ResourcesRequest {
/** `key` is the same key we used in the request object, and the value is the resource being returned. */
export interface ResourcesResponse {
[key: string]: {
data?: any;
data?: unknown;
errors: string[];
};
}
Expand Down
1 change: 1 addition & 0 deletions typedocs/interfaces/types_api_cart.CartBaseResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
| Name | Type | Description |
| :------ | :------ | :------ |
| `cart` | `string` | The `orderId` for the order. Only needed if you're doing very custom order management. |
| `cart_data` | `unknown` | The cart object. See https://square.github.io/custom-sites-docs/resources/cart#cart |
| `validation` | [`CartValidation`](types_api_cart.CartValidation.md) | Validation for scheduling. Empty if not pickup or delivery fulfillment. |
1 change: 1 addition & 0 deletions typedocs/interfaces/types_api_cart.CartResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
| Name | Type | Description |
| :------ | :------ | :------ |
| `cart` | `string` | The `orderId` for the order. Only needed if you're doing very custom order management. |
| `cart_data` | `unknown` | The cart object. See https://square.github.io/custom-sites-docs/resources/cart#cart |
| `validation` | [`CartValidation`](types_api_cart.CartValidation.md) | Validation for scheduling. Empty if not pickup or delivery fulfillment. |

#### Inherited from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

## Indexable

[key: `string`]: { `data?`: `any` ; `errors`: `string`[] }
[key: `string`]: { `data?`: `unknown` ; `errors`: `string`[] }

0 comments on commit 3e4fc4d

Please sign in to comment.