feat: Add missing typings for the http layer and cleanup some (#7260)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { StoreRegion } from "@medusajs/types"
|
||||||
import { Client } from "../client"
|
import { Client } from "../client"
|
||||||
import { ClientHeaders } from "../types"
|
import { ClientHeaders } from "../types"
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ export class Store {
|
|||||||
queryParams?: Record<string, any>,
|
queryParams?: Record<string, any>,
|
||||||
headers?: ClientHeaders
|
headers?: ClientHeaders
|
||||||
) => {
|
) => {
|
||||||
return this.client.fetch<any>(`/store/regions/${id}`, {
|
return this.client.fetch<StoreRegion>(`/store/regions/${id}`, {
|
||||||
query: queryParams,
|
query: queryParams,
|
||||||
headers,
|
headers,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -233,48 +233,6 @@ export type RequestQueryFields = {
|
|||||||
order?: string
|
order?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @interface
|
|
||||||
*
|
|
||||||
* Fields included in the response if it's paginated.
|
|
||||||
*/
|
|
||||||
export type PaginatedResponse<T = unknown> = {
|
|
||||||
/**
|
|
||||||
* The limit applied on the retrieved items.
|
|
||||||
*/
|
|
||||||
limit: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of items skipped before retrieving the list of items.
|
|
||||||
*/
|
|
||||||
offset: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The total count of items.
|
|
||||||
*/
|
|
||||||
count: number
|
|
||||||
} & T
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The fields returned in the response of a DELETE request.
|
|
||||||
*/
|
|
||||||
export type DeleteResponse<T = string> = {
|
|
||||||
/**
|
|
||||||
* The ID of the item that was deleted.
|
|
||||||
*/
|
|
||||||
id: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of the item that was deleted.
|
|
||||||
*/
|
|
||||||
object: T
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the item was deleted successfully.
|
|
||||||
*/
|
|
||||||
deleted: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that don't accept any query parameters can use this type.
|
* Requests that don't accept any query parameters can use this type.
|
||||||
*/
|
*/
|
||||||
@@ -373,156 +331,6 @@ export interface NumericalComparisonOperator {
|
|||||||
lte?: number
|
lte?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Address fields used when creating/updating an address.
|
|
||||||
*/
|
|
||||||
export interface AddressPayload {
|
|
||||||
/**
|
|
||||||
* First name
|
|
||||||
*/
|
|
||||||
first_name?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last name
|
|
||||||
*/
|
|
||||||
last_name?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Phone Number
|
|
||||||
*/
|
|
||||||
phone?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds custom data in key-value pairs.
|
|
||||||
*/
|
|
||||||
metadata?: Record<string, unknown>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Company
|
|
||||||
*/
|
|
||||||
company?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Address line 1
|
|
||||||
*/
|
|
||||||
address_1?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Address line 2
|
|
||||||
*/
|
|
||||||
address_2?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* City
|
|
||||||
*/
|
|
||||||
city?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The 2 character ISO code of the country in lower case
|
|
||||||
*/
|
|
||||||
country_code?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Province
|
|
||||||
*/
|
|
||||||
province?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Postal Code
|
|
||||||
*/
|
|
||||||
postal_code?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Address fields used when creating an address.
|
|
||||||
*/
|
|
||||||
export interface AddressCreatePayload {
|
|
||||||
/**
|
|
||||||
* First name
|
|
||||||
*/
|
|
||||||
first_name: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last name
|
|
||||||
*/
|
|
||||||
last_name: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Phone Number
|
|
||||||
*/
|
|
||||||
phone: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds custom data in key-value pairs.
|
|
||||||
*/
|
|
||||||
metadata: object
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Company
|
|
||||||
*/
|
|
||||||
company: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Address line 1
|
|
||||||
*/
|
|
||||||
address_1: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Address line 2
|
|
||||||
*/
|
|
||||||
address_2: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* City
|
|
||||||
*/
|
|
||||||
city: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The 2 character ISO code of the country in lower case
|
|
||||||
*/
|
|
||||||
country_code: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Province
|
|
||||||
*/
|
|
||||||
province: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Postal Code
|
|
||||||
*/
|
|
||||||
postal_code: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parameters that can be used to configure how data is retrieved.
|
|
||||||
*/
|
|
||||||
export interface FindParams {
|
|
||||||
/**
|
|
||||||
* Comma-separated relations that should be expanded in the returned data.
|
|
||||||
*/
|
|
||||||
expand?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Comma-separated fields that should be included in the returned data.
|
|
||||||
*/
|
|
||||||
fields?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parameters that can be used to configure how a list of data is paginated.
|
|
||||||
*/
|
|
||||||
export interface FindPaginationParams {
|
|
||||||
/**
|
|
||||||
* The number of items to skip when retrieving a list.
|
|
||||||
*/
|
|
||||||
offset?: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Limit the number of items returned in the list.
|
|
||||||
*/
|
|
||||||
limit?: number
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { ApiKeyType } from "../../../api-key"
|
import { ApiKeyType } from "../../../api-key"
|
||||||
import { PaginatedResponse } from "../../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
interface ApiKeyResponse {
|
interface ApiKeyResponse {
|
||||||
id: string
|
id: string
|
||||||
token: string
|
token: string
|
||||||
@@ -17,16 +14,10 @@ interface ApiKeyResponse {
|
|||||||
revoked_at: Date | null
|
revoked_at: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminApiKeyResponse {
|
export interface AdminApiKeyResponse {
|
||||||
api_key: ApiKeyResponse
|
api_key: ApiKeyResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminApiKeyListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminApiKeyListResponse extends PaginatedResponse {
|
|
||||||
api_keys: ApiKeyResponse[]
|
api_keys: ApiKeyResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { CampaignBudgetTypeValues } from "../../../promotion"
|
import { CampaignBudgetTypeValues } from "../../../promotion"
|
||||||
import { PaginatedResponse } from "../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface CampaignResponse {
|
export interface CampaignResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@@ -20,16 +17,10 @@ export interface CampaignResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminCampaignListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCampaignListResponse extends PaginatedResponse {
|
|
||||||
campaigns: CampaignResponse[]
|
campaigns: CampaignResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCampaignResponse {
|
export interface AdminCampaignResponse {
|
||||||
campaign: CampaignResponse
|
campaign: CampaignResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { BaseProductCollection, BaseProductCollectionFilters } from "./common"
|
||||||
|
|
||||||
|
export interface AdminCollection extends BaseProductCollection {}
|
||||||
|
export interface AdminCollectionFilters extends BaseProductCollectionFilters {}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../dal"
|
||||||
|
import { BaseProduct } from "../product/common"
|
||||||
|
|
||||||
|
export interface BaseProductCollection {
|
||||||
|
id?: string
|
||||||
|
title?: string
|
||||||
|
handle?: string
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
products?: BaseProduct[]
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductCollectionFilters
|
||||||
|
extends BaseFilterable<BaseProductCollectionFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
handle?: string | string[]
|
||||||
|
title?: string | string[]
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./admin"
|
||||||
|
export * from "./store"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { BaseProductCollection, BaseProductCollectionFilters } from "./common"
|
||||||
|
|
||||||
|
export interface StoreCollection extends BaseProductCollection {}
|
||||||
|
export interface StoreCollectionFilters extends BaseProductCollectionFilters {}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* The fields returned in the response of a DELETE request.
|
|
||||||
*/
|
|
||||||
export type DeleteResponse<T = string> = {
|
|
||||||
/**
|
|
||||||
* The ID of the item that was deleted.
|
|
||||||
*/
|
|
||||||
id: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of the item that was deleted.
|
|
||||||
*/
|
|
||||||
object: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the item was deleted successfully.
|
|
||||||
*/
|
|
||||||
deleted: boolean
|
|
||||||
}
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
export * from "./paginated-response"
|
export * from "./request"
|
||||||
export * from "./deleted-response"
|
export * from "./response"
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
export interface PaginatedResponse {
|
|
||||||
limit: number
|
|
||||||
offset: number
|
|
||||||
count: number
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export interface SelectParams {
|
||||||
|
fields?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FindParams extends SelectParams {
|
||||||
|
limit?: number
|
||||||
|
offset?: number
|
||||||
|
order?: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
export type DeleteResponse<TObject extends string, TParent = {}> = {
|
||||||
|
/**
|
||||||
|
* The ID of the item that was deleted.
|
||||||
|
*/
|
||||||
|
id: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of the item that was deleted.
|
||||||
|
*/
|
||||||
|
object: TObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the item was deleted successfully.
|
||||||
|
*/
|
||||||
|
deleted: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The parent resource of the item that was deleted, if applicable.
|
||||||
|
*/
|
||||||
|
parent?: TParent
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PaginatedResponse<T> = {
|
||||||
|
limit: number
|
||||||
|
offset: number
|
||||||
|
count: number
|
||||||
|
} & T
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
import { PaginatedResponse } from "../../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface CustomerGroupResponse {
|
export interface CustomerGroupResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string | null
|
name: string | null
|
||||||
@@ -12,9 +9,6 @@ export interface CustomerGroupResponse {
|
|||||||
updated_at: string
|
updated_at: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface CustomerAddressResponse {
|
export interface CustomerAddressResponse {
|
||||||
id: string
|
id: string
|
||||||
address_name: string | null
|
address_name: string | null
|
||||||
@@ -36,9 +30,6 @@ export interface CustomerAddressResponse {
|
|||||||
updated_at: string
|
updated_at: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
interface CustomerResponse {
|
interface CustomerResponse {
|
||||||
id: string
|
id: string
|
||||||
email: string
|
email: string
|
||||||
@@ -58,30 +49,18 @@ interface CustomerResponse {
|
|||||||
updated_at?: Date | string
|
updated_at?: Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCustomerResponse {
|
export interface AdminCustomerResponse {
|
||||||
customer: CustomerResponse
|
customer: CustomerResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminCustomerListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCustomerListResponse extends PaginatedResponse {
|
|
||||||
customers: CustomerResponse[]
|
customers: CustomerResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCustomerGroupResponse {
|
export interface AdminCustomerGroupResponse {
|
||||||
customer_group: CustomerGroupResponse
|
customer_group: CustomerGroupResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminCustomerGroupListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminCustomerGroupListResponse extends PaginatedResponse {
|
|
||||||
customer_groups: CustomerGroupResponse[]
|
customer_groups: CustomerGroupResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentAddressResponse {
|
export interface AdminFulfillmentAddressResponse {
|
||||||
id: string
|
id: string
|
||||||
fulfillment_id: string | null
|
fulfillment_id: string | null
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentItemResponse {
|
export interface AdminFulfillmentItemResponse {
|
||||||
id: string
|
id: string
|
||||||
title: string
|
title: string
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentLabelResponse {
|
export interface AdminFulfillmentLabelResponse {
|
||||||
id: string
|
id: string
|
||||||
tracking_number: string
|
tracking_number: string
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentProviderResponse {
|
export interface AdminFulfillmentProviderResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { ServiceZoneResponse } from "./service-zone"
|
import { ServiceZoneResponse } from "./service-zone"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface FulfillmentSetResponse {
|
export interface FulfillmentSetResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@@ -14,9 +11,6 @@ export interface FulfillmentSetResponse {
|
|||||||
deleted_at: Date | null
|
deleted_at: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentSetResponse {
|
export interface AdminFulfillmentSetResponse {
|
||||||
fulfillment_set: FulfillmentSetResponse
|
fulfillment_set: FulfillmentSetResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { DeleteResponse } from "../../../common"
|
import { DeleteResponse } from "../../common"
|
||||||
import { AdminFulfillmentAddressResponse } from "./fulfillment-address"
|
import { AdminFulfillmentAddressResponse } from "./fulfillment-address"
|
||||||
import { AdminFulfillmentItemResponse } from "./fulfillment-item"
|
import { AdminFulfillmentItemResponse } from "./fulfillment-item"
|
||||||
import { AdminFulfillmentLabelResponse } from "./fulfillment-label"
|
import { AdminFulfillmentLabelResponse } from "./fulfillment-label"
|
||||||
import { AdminFulfillmentProviderResponse } from "./fulfillment-provider"
|
import { AdminFulfillmentProviderResponse } from "./fulfillment-provider"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentResponse {
|
export interface AdminFulfillmentResponse {
|
||||||
id: string
|
id: string
|
||||||
location_id: string
|
location_id: string
|
||||||
@@ -27,8 +24,5 @@ export interface AdminFulfillmentResponse {
|
|||||||
deleted_at: Date | null
|
deleted_at: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminFulfillmentSetsDeleteResponse
|
export interface AdminFulfillmentSetsDeleteResponse
|
||||||
extends DeleteResponse<"fulfillment_set"> {}
|
extends DeleteResponse<"fulfillment_set"> {}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { GeoZoneType } from "../../../fulfillment"
|
import { GeoZoneType } from "../../../fulfillment"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminGeoZoneResponse {
|
export interface AdminGeoZoneResponse {
|
||||||
id: string
|
id: string
|
||||||
type: GeoZoneType
|
type: GeoZoneType
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import { FulfillmentSetResponse } from "./fulfillment-set"
|
import { FulfillmentSetResponse } from "./fulfillment-set"
|
||||||
import { AdminGeoZoneResponse } from "./geo-zone"
|
import { AdminGeoZoneResponse } from "./geo-zone"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminServiceZoneResponse {
|
export interface AdminServiceZoneResponse {
|
||||||
service_zone: ServiceZoneResponse
|
service_zone: ServiceZoneResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminServiceZoneDeleteResponse {
|
export interface AdminServiceZoneDeleteResponse {
|
||||||
id: string
|
id: string
|
||||||
object: "service-zone"
|
object: "service-zone"
|
||||||
@@ -18,9 +12,6 @@ export interface AdminServiceZoneDeleteResponse {
|
|||||||
parent: FulfillmentSetResponse
|
parent: FulfillmentSetResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface ServiceZoneResponse {
|
export interface ServiceZoneResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingOptionRuleResponse {
|
export interface AdminShippingOptionRuleResponse {
|
||||||
id: string
|
id: string
|
||||||
attribute: string
|
attribute: string
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingOptionTypeResponse {
|
export interface AdminShippingOptionTypeResponse {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ import { AdminFulfillmentProviderResponse } from "./fulfillment-provider"
|
|||||||
import { AdminPriceSetPriceResponse } from "../../pricing"
|
import { AdminPriceSetPriceResponse } from "../../pricing"
|
||||||
import { DeleteResponse, PaginatedResponse } from "../../common"
|
import { DeleteResponse, PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
interface AdminShippingOptionResponse {
|
interface AdminShippingOptionResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@@ -31,22 +28,13 @@ interface AdminShippingOptionResponse {
|
|||||||
deleted_at: Date | null
|
deleted_at: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingOptionRetrieveResponse {
|
export interface AdminShippingOptionRetrieveResponse {
|
||||||
shipping_option: AdminShippingOptionResponse
|
shipping_option: AdminShippingOptionResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminShippingOptionListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingOptionListResponse extends PaginatedResponse {
|
|
||||||
shipping_options: AdminShippingOptionResponse[]
|
shipping_options: AdminShippingOptionResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingOptionDeleteResponse
|
export interface AdminShippingOptionDeleteResponse
|
||||||
extends DeleteResponse<"shipping_option"> {}
|
extends DeleteResponse<"shipping_option"> {}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { DeleteResponse, PaginatedResponse } from "../../../common"
|
import { DeleteResponse, PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface ShippingProfileResponse {
|
export interface ShippingProfileResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@@ -17,12 +14,9 @@ export interface AdminShippingProfileResponse {
|
|||||||
shipping_profile: ShippingProfileResponse
|
shipping_profile: ShippingProfileResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminShippingProfilesResponse extends PaginatedResponse {
|
export type AdminShippingProfilesResponse = PaginatedResponse<{
|
||||||
shipping_profiles: ShippingProfileResponse[]
|
shipping_profiles: ShippingProfileResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminShippingProfileDeleteResponse
|
export interface AdminShippingProfileDeleteResponse
|
||||||
extends DeleteResponse<"shipping_profile"> {}
|
extends DeleteResponse<"shipping_profile"> {}
|
||||||
|
|||||||
@@ -12,3 +12,7 @@ export * from "./stock-locations"
|
|||||||
export * from "./tax"
|
export * from "./tax"
|
||||||
export * from "./product-category"
|
export * from "./product-category"
|
||||||
export * from "./reservation"
|
export * from "./reservation"
|
||||||
|
export * from "./region"
|
||||||
|
export * from "./product"
|
||||||
|
export * from "./collection"
|
||||||
|
export * from "./common"
|
||||||
|
|||||||
@@ -11,16 +11,11 @@ interface InventoryLevelResponse {
|
|||||||
incoming_quantity: number
|
incoming_quantity: number
|
||||||
metadata?: Record<string, unknown> | null
|
metadata?: Record<string, unknown> | null
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminInventoryLevelResponse {
|
export interface AdminInventoryLevelResponse {
|
||||||
inventory_item: AdminInventoryItemResponse
|
inventory_item: AdminInventoryItemResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminInventoryLevelListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminInventoryLevelListResponse extends PaginatedResponse {
|
|
||||||
inventory_levels: InventoryLevelResponse[]
|
inventory_levels: InventoryLevelResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -17,16 +17,11 @@ interface InventoryItemResponse {
|
|||||||
thumbnail?: string | null
|
thumbnail?: string | null
|
||||||
metadata?: Record<string, unknown> | null
|
metadata?: Record<string, unknown> | null
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminInventoryItemResponse {
|
export interface AdminInventoryItemResponse {
|
||||||
inventory_item: InventoryItemResponse
|
inventory_item: InventoryItemResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminInventoryItemListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminInventoryItemListResponse extends PaginatedResponse {
|
|
||||||
inventory_items: InventoryItemResponse[]
|
inventory_items: InventoryItemResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -233,9 +233,6 @@ interface OrderTransaction {
|
|||||||
updated_at: Date | string
|
updated_at: Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface OrderResponse {
|
export interface OrderResponse {
|
||||||
id: string
|
id: string
|
||||||
version: number
|
version: number
|
||||||
@@ -299,16 +296,10 @@ export interface OrderResponse {
|
|||||||
raw_original_shipping_tax_total?: BigNumberRawValue
|
raw_original_shipping_tax_total?: BigNumberRawValue
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminOrderListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminOrderListResponse extends PaginatedResponse {
|
|
||||||
orders: OrderResponse[]
|
orders: OrderResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminOrderResponse {
|
export interface AdminOrderResponse {
|
||||||
order: OrderResponse
|
order: OrderResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import { PaginatedResponse } from "../../common"
|
import { PaginatedResponse } from "../common"
|
||||||
import { ProductCategoryResponse } from "./common"
|
import { ProductCategoryResponse } from "./common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminProductCategoryResponse {
|
export interface AdminProductCategoryResponse {
|
||||||
product_category: ProductCategoryResponse
|
product_category: ProductCategoryResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminProductCategoryListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminProductCategoryListResponse extends PaginatedResponse {
|
|
||||||
product_categories: ProductCategoryResponse[]
|
product_categories: ProductCategoryResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface ProductCategoryResponse {
|
export interface ProductCategoryResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import { PaginatedResponse } from "../../common"
|
import { PaginatedResponse } from "../common"
|
||||||
import { ProductCategoryResponse } from "./common"
|
import { ProductCategoryResponse } from "./common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface StoreProductCategoryResponse {
|
export interface StoreProductCategoryResponse {
|
||||||
product_category: ProductCategoryResponse
|
product_category: ProductCategoryResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type StoreProductCategoryListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface StoreProductCategoryListResponse extends PaginatedResponse {
|
|
||||||
product_categories: ProductCategoryResponse[]
|
product_categories: ProductCategoryResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import {
|
||||||
|
BaseProduct,
|
||||||
|
BaseProductCategory,
|
||||||
|
BaseProductCategoryFilters,
|
||||||
|
BaseProductFilters,
|
||||||
|
BaseProductImage,
|
||||||
|
BaseProductOption,
|
||||||
|
BaseProductOptionFilters,
|
||||||
|
BaseProductOptionValue,
|
||||||
|
BaseProductTag,
|
||||||
|
BaseProductTagFilters,
|
||||||
|
BaseProductType,
|
||||||
|
BaseProductTypeFilters,
|
||||||
|
BaseProductVariant,
|
||||||
|
BaseProductVariantFilters,
|
||||||
|
} from "./common"
|
||||||
|
|
||||||
|
export interface AdminProduct extends Omit<BaseProduct, "categories"> {
|
||||||
|
categories?: AdminProductCategory[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AdminProductCategory extends BaseProductCategory {
|
||||||
|
is_active?: boolean
|
||||||
|
is_internal?: boolean
|
||||||
|
}
|
||||||
|
export interface AdminProductVariant extends BaseProductVariant {}
|
||||||
|
export interface AdminProductTag extends BaseProductTag {}
|
||||||
|
export interface AdminProductType extends BaseProductType {}
|
||||||
|
export interface AdminProductOption extends BaseProductOption {}
|
||||||
|
export interface AdminProductImage extends BaseProductImage {}
|
||||||
|
export interface AdminProductOptionValue extends BaseProductOptionValue {}
|
||||||
|
|
||||||
|
export interface AdminProductFilters extends BaseProductFilters {}
|
||||||
|
export interface AdminProductTagFilters extends BaseProductTagFilters {}
|
||||||
|
export interface AdminProductTypeFilters extends BaseProductTypeFilters {}
|
||||||
|
export interface AdminProductOptionFilters extends BaseProductOptionFilters {}
|
||||||
|
export interface AdminProductVariantFilters extends BaseProductVariantFilters {}
|
||||||
|
export interface AdminProductCategoryFilters
|
||||||
|
extends BaseProductCategoryFilters {}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../dal"
|
||||||
|
import { BaseProductCollection } from "../collection/common"
|
||||||
|
|
||||||
|
export type ProductStatus = "draft" | "proposed" | "published" | "rejected"
|
||||||
|
|
||||||
|
export interface BaseProduct {
|
||||||
|
id?: string
|
||||||
|
title?: string
|
||||||
|
handle?: string
|
||||||
|
subtitle?: string | null
|
||||||
|
description?: string | null
|
||||||
|
is_giftcard?: boolean
|
||||||
|
status?: ProductStatus
|
||||||
|
thumbnail?: string
|
||||||
|
width?: number
|
||||||
|
weight?: number
|
||||||
|
length?: number
|
||||||
|
height?: number
|
||||||
|
origin_country?: string
|
||||||
|
hs_code?: string
|
||||||
|
mid_code?: string
|
||||||
|
material?: string
|
||||||
|
collection?: BaseProductCollection
|
||||||
|
collection_id?: string | null
|
||||||
|
categories?: BaseProductCategory[]
|
||||||
|
type?: BaseProductType | null
|
||||||
|
type_id?: string | null
|
||||||
|
tags?: BaseProductTag[]
|
||||||
|
variants?: BaseProductVariant[]
|
||||||
|
options?: BaseProductOption[]
|
||||||
|
images?: BaseProductImage[]
|
||||||
|
discountable?: boolean
|
||||||
|
external_id?: string | null
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductVariant {
|
||||||
|
id?: string
|
||||||
|
title?: string
|
||||||
|
sku?: string
|
||||||
|
barcode?: string
|
||||||
|
ean?: string
|
||||||
|
upc?: string
|
||||||
|
allow_backorder?: boolean
|
||||||
|
manage_inventory?: boolean
|
||||||
|
hs_code?: string
|
||||||
|
origin_country?: string
|
||||||
|
mid_code?: string
|
||||||
|
material?: string
|
||||||
|
weight?: number
|
||||||
|
length?: number
|
||||||
|
height?: number
|
||||||
|
width?: number
|
||||||
|
options?: BaseProductOptionValue[]
|
||||||
|
product?: BaseProduct
|
||||||
|
product_id?: string | null
|
||||||
|
variant_rank?: number
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductCategory {
|
||||||
|
id?: string
|
||||||
|
name?: string
|
||||||
|
description?: string | null
|
||||||
|
handle?: string
|
||||||
|
rank?: number
|
||||||
|
parent_category?: BaseProductCategory
|
||||||
|
parent_category_id?: string
|
||||||
|
category_children?: BaseProductCategory[]
|
||||||
|
products?: BaseProduct[]
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductTag {
|
||||||
|
id?: string
|
||||||
|
value?: string
|
||||||
|
products?: BaseProduct[]
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductType {
|
||||||
|
id?: string
|
||||||
|
value?: string
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductOption {
|
||||||
|
id?: string
|
||||||
|
title?: string
|
||||||
|
product?: BaseProduct
|
||||||
|
product_id?: string
|
||||||
|
values?: BaseProductOptionValue[]
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductImage {
|
||||||
|
id?: string
|
||||||
|
url?: string
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductOptionValue {
|
||||||
|
id?: string
|
||||||
|
value?: string
|
||||||
|
option?: BaseProductOption
|
||||||
|
option_id?: string
|
||||||
|
metadata?: Record<string, unknown> | null
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
deleted_at?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductFilters extends BaseFilterable<BaseProductFilters> {
|
||||||
|
q?: string
|
||||||
|
status?: ProductStatus | ProductStatus[]
|
||||||
|
title?: string | string[]
|
||||||
|
handle?: string | string[]
|
||||||
|
id?: string | string[]
|
||||||
|
is_giftcard?: boolean
|
||||||
|
tags?: {
|
||||||
|
value?: string[]
|
||||||
|
}
|
||||||
|
type_id?: string | string[]
|
||||||
|
category_id?: string | string[] | OperatorMap<string>
|
||||||
|
categories?: { id: OperatorMap<string> } | { id: OperatorMap<string[]> }
|
||||||
|
collection_id?: string | string[] | OperatorMap<string>
|
||||||
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductTagFilters
|
||||||
|
extends BaseFilterable<BaseProductTagFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
value?: string | string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductTypeFilters
|
||||||
|
extends BaseFilterable<BaseProductTypeFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
value?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductOptionFilters
|
||||||
|
extends BaseFilterable<BaseProductOptionFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
title?: string | string[]
|
||||||
|
product_id?: string | string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductVariantFilters
|
||||||
|
extends BaseFilterable<BaseProductVariantFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
sku?: string | string[]
|
||||||
|
product_id?: string | string[]
|
||||||
|
options?: Record<string, string>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseProductCategoryFilters
|
||||||
|
extends BaseFilterable<BaseProductCategoryFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string | string[]
|
||||||
|
name?: string | string[]
|
||||||
|
parent_category_id?: string | string[] | null
|
||||||
|
handle?: string | string[]
|
||||||
|
is_active?: boolean
|
||||||
|
is_internal?: boolean
|
||||||
|
include_descendants_tree?: boolean
|
||||||
|
include_ancestors_tree?: boolean
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./admin"
|
||||||
|
export * from "./store"
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import {
|
||||||
|
BaseProduct,
|
||||||
|
BaseProductCategory,
|
||||||
|
BaseProductCategoryFilters,
|
||||||
|
BaseProductFilters,
|
||||||
|
BaseProductImage,
|
||||||
|
BaseProductOption,
|
||||||
|
BaseProductOptionFilters,
|
||||||
|
BaseProductOptionValue,
|
||||||
|
BaseProductTag,
|
||||||
|
BaseProductTagFilters,
|
||||||
|
BaseProductType,
|
||||||
|
BaseProductTypeFilters,
|
||||||
|
BaseProductVariant,
|
||||||
|
BaseProductVariantFilters,
|
||||||
|
} from "./common"
|
||||||
|
|
||||||
|
export interface StoreProduct extends BaseProduct {}
|
||||||
|
export interface StoreProductCategory extends BaseProductCategory {}
|
||||||
|
export interface StoreProductVariant extends BaseProductVariant {}
|
||||||
|
export interface StoreProductTag extends BaseProductTag {}
|
||||||
|
export interface StoreProductType extends BaseProductType {}
|
||||||
|
export interface StoreProductOption extends BaseProductOption {}
|
||||||
|
export interface StoreProductImage extends BaseProductImage {}
|
||||||
|
export interface StoreProductOptionValue extends BaseProductOptionValue {}
|
||||||
|
|
||||||
|
export interface StoreProductFilters extends BaseProductFilters {}
|
||||||
|
export interface StoreProductTagFilters extends BaseProductTagFilters {}
|
||||||
|
export interface StoreProductTypeFilters extends BaseProductTypeFilters {}
|
||||||
|
export interface StoreProductOptionFilters extends BaseProductOptionFilters {}
|
||||||
|
export interface StoreProductVariantFilters extends BaseProductVariantFilters {}
|
||||||
|
export interface StoreProductCategoryFilters
|
||||||
|
extends BaseProductCategoryFilters {}
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface PromotionRuleResponse {
|
export interface PromotionRuleResponse {
|
||||||
id: string
|
id: string
|
||||||
attribute: string
|
attribute: string
|
||||||
@@ -13,9 +10,6 @@ export interface PromotionRuleResponse {
|
|||||||
required: boolean
|
required: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminPromotionRuleListResponse {
|
export interface AdminPromotionRuleListResponse {
|
||||||
attributes: PromotionRuleResponse[]
|
attributes: PromotionRuleResponse[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface RuleAttributeOptionsResponse {
|
export interface RuleAttributeOptionsResponse {
|
||||||
id: string
|
id: string
|
||||||
value: string
|
value: string
|
||||||
@@ -10,9 +7,6 @@ export interface RuleAttributeOptionsResponse {
|
|||||||
disguised: boolean
|
disguised: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminRuleAttributeOptionsListResponse {
|
export interface AdminRuleAttributeOptionsListResponse {
|
||||||
attributes: RuleAttributeOptionsResponse[]
|
attributes: RuleAttributeOptionsResponse[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface RuleOperatorOptionsResponse {
|
export interface RuleOperatorOptionsResponse {
|
||||||
id: string
|
id: string
|
||||||
value: string
|
value: string
|
||||||
label: string
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminRuleOperatorOptionsListResponse {
|
export interface AdminRuleOperatorOptionsListResponse {
|
||||||
operators: RuleOperatorOptionsResponse[]
|
operators: RuleOperatorOptionsResponse[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import {
|
||||||
|
BaseRegion,
|
||||||
|
BaseRegionCountry,
|
||||||
|
BaseRegionCountryFilters,
|
||||||
|
BaseRegionFilters,
|
||||||
|
} from "./common"
|
||||||
|
|
||||||
|
export interface AdminRegion extends BaseRegion {}
|
||||||
|
export interface AdminRegionCountry extends BaseRegionCountry {}
|
||||||
|
export interface AdminRegionFilters extends BaseRegionFilters {}
|
||||||
|
export interface AdminRegionCountryFilters extends BaseRegionCountryFilters {}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../dal"
|
||||||
|
|
||||||
|
export interface BaseRegion {
|
||||||
|
id?: string
|
||||||
|
name?: string
|
||||||
|
currency_code?: string
|
||||||
|
automatic_taxes?: boolean
|
||||||
|
countries?: BaseRegionCountry[]
|
||||||
|
metadata?: Record<string, any> | null
|
||||||
|
created_at?: string
|
||||||
|
updated_at?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseRegionCountry {
|
||||||
|
id?: string
|
||||||
|
iso_2?: string
|
||||||
|
iso_3?: string
|
||||||
|
num_code?: number
|
||||||
|
name?: string
|
||||||
|
display_name?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseRegionFilters extends BaseFilterable<BaseRegionFilters> {
|
||||||
|
q?: string
|
||||||
|
id?: string[] | string | OperatorMap<string | string[]>
|
||||||
|
name?: string | OperatorMap<string>
|
||||||
|
currency_code?: string | OperatorMap<string>
|
||||||
|
metadata?: Record<string, unknown> | OperatorMap<Record<string, unknown>>
|
||||||
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BaseRegionCountryFilters
|
||||||
|
extends BaseFilterable<BaseRegionCountryFilters> {
|
||||||
|
id?: string[] | string
|
||||||
|
iso_2?: string[] | string
|
||||||
|
iso_3?: string[] | string
|
||||||
|
num_code?: number[] | string
|
||||||
|
name?: string[] | string
|
||||||
|
display_name?: string[] | string
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./admin"
|
||||||
|
export * from "./store"
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import {
|
||||||
|
BaseRegion,
|
||||||
|
BaseRegionCountry,
|
||||||
|
BaseRegionCountryFilters,
|
||||||
|
BaseRegionFilters,
|
||||||
|
} from "./common"
|
||||||
|
|
||||||
|
export interface StoreRegion extends BaseRegion {}
|
||||||
|
export interface StoreRegionCountry extends BaseRegionCountry {}
|
||||||
|
export interface StoreRegionFilters extends BaseRegionFilters {}
|
||||||
|
export interface StoreRegionCountryFilters extends BaseRegionCountryFilters {}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
import { PaginatedResponse } from "../../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
interface ReservationResponse {
|
interface ReservationResponse {
|
||||||
id: string
|
id: string
|
||||||
line_item_id: string | null
|
line_item_id: string | null
|
||||||
@@ -19,16 +16,10 @@ interface ReservationResponse {
|
|||||||
updated_at?: Date | string
|
updated_at?: Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminReservationResponse {
|
export interface AdminReservationResponse {
|
||||||
reservation: ReservationResponse
|
reservation: ReservationResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminReservationListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminReservationListResponse extends PaginatedResponse {
|
|
||||||
reservations: ReservationResponse[]
|
reservations: ReservationResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { PaginatedResponse } from "../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
interface SalesChannelResponse {
|
interface SalesChannelResponse {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@@ -11,16 +8,10 @@ interface SalesChannelResponse {
|
|||||||
metadata: Record<string, unknown> | null
|
metadata: Record<string, unknown> | null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminSalesChannelListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminSalesChannelListResponse extends PaginatedResponse {
|
|
||||||
sales_channels: SalesChannelResponse[]
|
sales_channels: SalesChannelResponse[]
|
||||||
}
|
}>
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminSalesChannelResponse {
|
export interface AdminSalesChannelResponse {
|
||||||
sales_channel: SalesChannelResponse
|
sales_channel: SalesChannelResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { PaginatedResponse } from "../../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
import { TaxRegionResponse } from "./tax-regions"
|
import { TaxRegionResponse } from "./tax-regions"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface TaxRateResponse {
|
export interface TaxRateResponse {
|
||||||
id: string
|
id: string
|
||||||
rate: number | null
|
rate: number | null
|
||||||
@@ -24,16 +21,10 @@ export interface TaxRateResponse {
|
|||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminTaxRateResponse {
|
export interface AdminTaxRateResponse {
|
||||||
tax_rate: TaxRateResponse
|
tax_rate: TaxRateResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminTaxRateListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminTaxRateListResponse extends PaginatedResponse {
|
|
||||||
tax_rates: TaxRateResponse[]
|
tax_rates: TaxRateResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { PaginatedResponse } from "../../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
import { TaxRateResponse } from "./tax-rates"
|
import { TaxRateResponse } from "./tax-rates"
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface TaxRegionResponse {
|
export interface TaxRegionResponse {
|
||||||
id: string
|
id: string
|
||||||
rate: number | null
|
rate: number | null
|
||||||
@@ -26,16 +23,10 @@ export interface TaxRegionResponse {
|
|||||||
parent: TaxRegionResponse
|
parent: TaxRegionResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminTaxRegionResponse {
|
export interface AdminTaxRegionResponse {
|
||||||
tax_region: TaxRegionResponse
|
tax_region: TaxRegionResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export type AdminTaxRegionListResponse = PaginatedResponse<{
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
export interface AdminTaxRegionListResponse extends PaginatedResponse {
|
|
||||||
tax_regions: TaxRegionResponse[]
|
tax_regions: TaxRegionResponse[]
|
||||||
}
|
}>
|
||||||
|
|||||||
Reference in New Issue
Block a user