Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add cartData to response #10

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`[] }
Loading