Initial commit

This commit is contained in:
2025-10-02 08:54:03 +02:00
commit ea54638227
1642 changed files with 53677 additions and 0 deletions

620
types/bigCommerceRestAPITypes.d.ts vendored Normal file
View File

@@ -0,0 +1,620 @@
interface OAuthConfig {
clientId: string
clientSecret: string
authCallback: string
loginHost?: string
}
interface RestClientConfig {
storeHash: string
accessToken: string
apiHost?: string
rateLimitConfig?: RateLimitConfig
}
interface RateLimitStatus {
msToReset: number
nextWindowTime: Date
windowSize: number
requestsRemaining: number
requestsQuota: number
}
type CallbackParams = {
[key: string]: unknown
}
interface RateLimitConfig {
minRequestsRemaining: number
enableWait: boolean
callbackParams?: CallbackParams
callback?(params?: CallbackParams): void
}
interface AuthCallbackQueryParams {
code: string
scope: string
context: string
}
interface AuthResponsePayload {
access_token: string
scope: string
user: User
context: string
account_uuid: string
}
interface User {
id: number
username: string
email: string
}
interface VerifiedJwt {
aud: string
iss: string
iat: number
nbf: number
exp: number
jti: string
sub: string
user: {
id: number
email: string
}
owner: {
id: number
email: string
}
url: string
}
interface FormField {
name: string
value: string
}
interface OrderProduct {
name: string
name_customer?: string
name_merchant?: string
quantity: number
price_inc_tax: number
price_ex_tax: number
upc?: string
sku?: string
}
interface OrderProductOptions {
id?: number
value?: string
display_name?: string
display_name_customer?: string
display_name_merchant?: string
display_value?: string
display_value_merchant?: string
display_value_customer?: string
}
interface OrderProductsProductOptions extends Required<OrderProductOptions> {
option_id: number
order_product_id: number
product_option_id: number
type: string
name: string
display_style: string
}
interface OrderProductsAppliedDiscounts {
id: string
amount: string
name: string
code: string | null
target: string
}
type OrderProductsUpdate = Partial<Omit<OrderProduct, "sku">> & {
id?: number
product_id?: number
product_options?: OrderProductOptions[]
variant_id?: number
wrapping_name?: string
wrapping_message?: string
wrapping_cost_ex_tax?: number
wrapping_cost_inc_tax?: number
}
interface OrderBillingAddress {
first_name?: string
last_name?: string
company?: string
street_1?: string
street_2?: string
city?: string
state?: string
zip: string
country?: string
country_iso2?: string
phone?: string
email?: string
form_fields?: FormField[]
}
interface OrderShipmentItem {
order_product_id: number
product_id: number
quantity: number
}
interface LinkedResource {
url: string
resource: string
}
interface OrderStatus extends V2OrderCountResponseBase {
id: number
name: string
system_label: string
custom_label: string
system_description: string
sort_order: number
}
interface OrderShippingAddress {
first_name?: string
last_name?: string
company?: string
street_1?: string
street_2?: string
city?: string
state?: string
zip?: string
country?: string
country_iso2?: string
phone?: string
email?: string
shipping_method?: string
}
interface V2OrderResponseBase {
id: number
statusSetAt: Date
tibiId?: string
status?: PrintfulStates
date_modified: string
date_shipped: string
cart_id: string
status: string
subtotal_tax: string
shipping_cost_tax: string
shipping_cost_tax_class_id: number
handling_cost_tax: string
handling_cost_tax_class_id: number
wrapping_cost_tax: string
wrapping_cost_tax_class_id: number
payment_status: string
store_credit_amount: string
gift_certificate_amount: string
currency_id: number
currency_code: string
currency_exchange_rate: string
default_currency_id: number
default_currency_code: string
store_default_currency_code: string
store_default_to_transactional_exchange_rate: string
coupon_discount: string
shipping_address_count: number
is_email_opt_in: boolean
order_source: string
products: LinkedResource
productObjs?: V2OrderProductsResponseBase[]
shipping_addresses: LinkedResource
shipping_addressObjs?: V2OrderShippingAddressesResponseBase[]
coupons: LinkedResource
status_id: number
base_handling_cost: string
base_shipping_cost: string
base_wrapping_cost: string
billing_address: Required<OrderBillingAddress>
channel_id: number
customer_id: number
customer_message: string
date_created: string
discount_amount: string
ebay_order_id: string
external_id: string
external_merchant_id: string
external_source: string
geoip_country: string
geoip_country_iso2: string
handling_cost_ex_tax: string
handling_cost_inc_tax: string
ip_address: string
ip_address_v6: string
is_deleted: boolean
items_shipped: number
items_total: number
order_is_digital: boolean
payment_method: string
payment_provider_id: string | number
refunded_amount: string
shipping_cost_ex_tax: string
shipping_cost_inc_tax: string
staff_notes: string
subtotal_ex_tax: string
subtotal_inc_tax: string
tax_provider_id: string
customer_locale: string
total_ex_tax: string
total_inc_tax: string
wrapping_cost_ex_tax: string
wrapping_cost_inc_tax: string
shipments?: PrintfulShipment[]
}
interface V2OrderRequestBase {
products: OrderProduct[]
shipping_addresses?: OrderShippingAddress[]
base_handling_cost?: string
base_shipping_cost?: string
base_wrapping_cost?: string
billing_address: OrderBillingAddress
channel_id?: number
customer_id?: number
customer_message?: string
date_created?: string
default_currency_code?: string
discount_amount?: string
ebay_order_id?: string
external_id?: string
external_merchant_id?: string
external_source?: string
geoip_country?: string
geoip_country_iso2?: string
handling_cost_ex_tax?: string
handling_cost_inc_tax?: string
ip_address?: string
ip_address_v6?: string
is_deleted?: boolean
items_shipped?: number
items_total?: number
order_is_digital?: boolean
payment_method?: string
payment_provider_id?: string
refunded_amount?: string
shipping_cost_ex_tax?: string
shipping_cost_inc_tax?: string
staff_notes?: string
status_id?: number
subtotal_ex_tax?: string
subtotal_inc_tax?: string
tax_provider_id?: string
customer_locale?: string
total_ex_tax?: string
total_inc_tax?: string
wrapping_cost_ex_tax?: string
wrapping_cost_inc_tax?: string
}
type V2OrderUpdateRequest = Partial<Omit<V2OrderRequestBase, "products" | "billing_address">> & {
products?: Partial<OrderProductsUpdate[]>
billing_address?: Partial<OrderBillingAddress>
}
interface V2OrderFiltersBase {
[key: string]: unknown
limit?: number
page?: number
}
interface V2OrdersListFilters extends V2OrderFiltersBase {
cart_id?: string
channel_id?: number
customer_id?: number
email?: string
is_deleted?: boolean
max_date_created?: string
max_date_modified?: string
max_id?: number
max_total?: number
min_date_created?: string
min_date_modified?: string
min_id?: number
min_total?: number
payment_method?: string
sort?: string
status_id?: number
}
interface V2OrderTaxesListFilters extends V2OrderFiltersBase {
details?: string
}
interface V2OrderMessagesListFilters extends V2OrderFiltersBase {
customer_id?: number
is_flagged?: boolean
max_date_created?: string
max_id?: number
min_date_created?: string
min_id?: number
status?: string
}
interface V2OrderCountResponseBase {
count: number
}
interface V2OrderCountResponse extends V2OrderCountResponseBase {
statuses: OrderStatus[]
}
interface V2OrderShipmentsResponseBase {
id: number
order_id: number
customer_id: number
order_address_id: number
date_created: string
tracking_number: string
shipping_method: string
shipping_provider: string
tracking_carrier: string
tracking_link: string
comments: string
billing_address: Required<OrderBillingAddress>
shipping_address: Required<OrderShippingAddress>
items: OrderShipmentItem[]
}
interface V2OrderShippingAddressesResponseBase extends Required<OrderShippingAddress> {
id: number
order_id: number
items_total: number
items_shipped: number
base_cost: string
cost_ex_tax: string
cost_inc_tax: string
cost_tax: string
cost_tax_class_id: number
base_handling_cost: string
handling_cost_ex_tax: string
handling_cost_inc_tax: string
handling_cost_tax: string
handling_cost_tax_class_id: number
shipping_zone_id: number
shipping_zone_name: string
form_fields: FormField[]
shipping_quotes: LinkedResource
}
interface V2OrderProductsResponseBase {
id: number
order_id: number
product_id: number
order_address_id: number
name: string
sku: string
type: string
base_price: string
price_ex_tax: string
price_inc_tax: string
price_tax: string
base_total: string
total_ex_tax: string
total_inc_tax: string
total_tax: string
quantity: number
base_cost_price: string
cost_price_inc_tax: string
cost_price_ex_tax: string
weight: number | string
cost_price_tax: string
is_refunded: boolean
refunded_amount: string
return_id: number
wrapping_name: string
base_wrapping_cost: string
wrapping_cost_ex_tax: string
wrapping_cost_inc_tax: string
wrapping_cost_tax: string
wrapping_message: string
quantity_shipped: number
event_name: string
event_date: string
fixed_shipping_cost: string
ebay_item_id: string
ebay_transaction_id: string
option_set_id: number
parent_order_product_id: number
is_bundled_product: boolean
bin_picking_number: string
applied_discounts: OrderProductsAppliedDiscounts[]
product_options: OrderProductsProductOptions[]
external_id: string
upc: string
variant_id: number
name_customer: string
name_merchant: string
}
interface V2OrderStatusResponseBase {
id: number
name: string
system_label: string
custom_label: string
system_description: string
}
interface V2OrderShipmentsRequestBodyBase {
order_address_id: number
tracking_number?: string
shiping_method?: string
shipping_provider?: string
tracking_carrier?: string
comments?: string
items: Omit<OrderShipmentItem, "product_id">[]
}
type V2OrderShipmentsUpdateRequest = Partial<Omit<V2OrderShipmentsRequestBodyBase, "items">>
interface V2OrderCouponsResponseBase {
id: number
coupon_id: number
order_id: number
code: string | null
amount: string | number
type: number
discount: number
}
interface V2OrderTaxesResponseBase {
id: number
order_id: number
order_address_id: number
tax_rate_id: number
tax_class_id: number
name: string
class: string
rate: string
priority: number
priority_amount: number
line_amount: string
order_product_id: string
line_item_type: "item" | "shipping" | "handling" | "gift-wrapping"
}
interface V2OrderMessagesResponseBase {
id: number
order_id: number
staff_id: number
customer_id: number
type: string
subject: string
message: string
status: string
is_flagged: boolean
date_created: string
customer: unknown
}
interface V2OrderShippingQuotesResponseBase {
id: string
uuid: string
timestamp: string
shipping_provider_id: string
shipping_provider_quote: [] | Record<string, unknown>[]
provider_code: string
carrier_code: string
rate_code: string
rate_id: string
method_id: number
}
interface ProductImage {
id: number
product_id: number
is_thumbnail: boolean
sort_order: number
description: string
image_file: string
url_zoom: string
url_standard: string
url_thumbnail: string
url_tiny: string
date_modified: string
}
interface RestApiCart {
id: string
parent_id: string | null
customer_id: number
email: string
currency: {
code: string
}
tax_included: boolean
base_amount: number
discount_amount: number
cart_amount: number
coupons: RestApiCoupon[]
discounts: RestApiDiscount[]
line_items: RestApiLineItems
created_time: string
updated_time: string
channel_id: number
locale: string
}
interface RestApiCoupon {
code: string
id: string
coupon_type: "0" | "1" | "2" | "3" | "4" | "5"
discounted_amount: number
}
interface RestApiDiscount {
id: string
discounted_amount: number
}
interface RestApiLineItems {
physical_items: RestApiPhysicalItem[]
digital_items: RestApiItem[]
gift_certificates: RestApiGiftCertificate[]
custom_items: RestApiCustomItem[]
}
interface RestApiPhysicalItem extends RestApiItem {
variant_id: number
product_id: number
weight: number
dimensions: {
height: number
width: number
depth: number
}
}
interface RestApiItem {
id: string
sku: string
name: string
quantity: number
is_taxable: boolean
image_url: string
discounts: RestApiDiscount[]
coupon_amount: number
discount_amount: number
original_price: number
list_price: number
sale_price: number
extended_list_price: number
extended_sale_price: number
options: RestApiOption[]
url: string
}
interface RestApiGiftCertificate {
// Add Gift Certificate specific fields here
}
interface RestApiCustomItem {
// Add Custom Item specific fields here
}
interface RestApiOption {
// Add Option specific fields here
gift_wrapping?: {
// Add Gift Wrapping details here
}
}
interface RestWishlistItem {
id?: number
product_id: number
variant_id: number
}
interface RestWishlist {
id: number
customer_id: number
is_public: boolean
name: string
items: RestWishlistItem[]
}

786
types/bigCommerceTypes.d.ts vendored Normal file
View File

@@ -0,0 +1,786 @@
type Connection<T> = {
edges: Array<Edge<T>>
}
type Edge<T> = {
node: T
}
interface Address {
firstName: string
lastName: string
address1: string
address2?: string
city: string
countryCode: string
stateOrProvince: string
phone: string
postalCode: string
}
interface BigCommerceAddress {
address1: string
address2: string
address_type: string
city: string
company: string
country: string
country_code: string
customer_id: number
first_name: string
id: number
last_name: string
phone: string
postal_code: string
state_or_province: string
form_fields: []
}
interface RegisterCustomerInput {
firstName?: string
lastName?: string
email: string
password: string
phone?: string
address?: Address
}
interface BigCommerceRegisterCustomerOperation {
customer: {
registerCustomer: {
input: RegisterCustomerInput
}
}
}
interface BigCommerceCartOperation {
data: {
site: {
cart: BigCommerceCart
}
}
variables: {
entityId: string
}
}
interface BigCommerceCreateCartOperation {
data: {
cart: {
createCart: {
cart: BigCommerceCart
}
}
}
variables: {
createCartInput: {
lineItems: CartItem[]
}
}
}
interface BigCommerceAddToCartOperation {
data: {
cart: {
addCartLineItems: {
cart: BigCommerceCart
}
}
}
variables: {
addCartLineItemsInput: {
cartEntityId: string
data: {
lineItems: CartItem[]
}
}
}
}
interface BigCommerceDeleteCartItemOperation {
data: {
cart: {
deleteCartLineItem: {
cart: BigCommerceCart
}
}
}
variables: {
deleteCartLineItemInput: {
cartEntityId: string
lineItemEntityId: string
}
}
}
interface BigCommerceUpdateCartItemOperation {
data: {
cart: {
updateCartLineItem: {
cart: BigCommerceCart
}
}
}
variables: {
updateCartLineItemInput: {
cartEntityId: string
lineItemEntityId: string
data: {
lineItem: CartItem
}
}
}
}
interface BigCommerceCheckoutOperation {
data: {
site: {
checkout: BigCommerceCheckout
}
}
variables: {
entityId: string
}
}
interface BigCommerceProductOperation {
data: {
site: {
product: BigCommerceProduct
}
}
variables: {
productId: number
}
}
interface BigCommerceProductByHandleOperation {
data: {
site: {
route: {
node: BigCommerceProduct
}
}
}
variables: {
path: string
}
}
interface BigCommerceProductsOperation {
data: {
site: {
products: Connection<BigCommerceProduct>
}
}
variables: {
entityIds: number[] | []
}
}
interface BigCommerceEntityIdOperation {
data: {
site: {
route: {
node: {
__typename:
| "Product"
| "Category"
| "Brand"
| "NormalPage"
| "ContactPage"
| "RawHtmlPage"
| "BlogIndexPage"
entityId: number
}
}
}
}
variables: {
path: string
}
}
interface WishlistProduct {
addToWishlistUrl: string
}
interface WishlistItem {
product: WishlistProduct
}
interface Wishlist {
items: {
edges: { node: WishlistItem }[]
}
}
interface Customer {
addressCount: number
phone: string
email: string
entityId: number
firstName: string
lastName: string
wishlists: {
edges: { node: Wishlist }[]
}
}
interface BigCommerceWishlistQueryOperation {
data: { customer: { wishlists: { edges: { node: Wishlist }[] } } }
variables: { customerEntityId: number }
}
interface BigCommerceCustomerQueryOperation {
data: { customer: Customer }
variables: { customerEntityId: number }
}
interface BigCommerceRecommendationsOperation {
data: {
site: {
product: {
relatedProducts: Connection<BigCommerceProduct>
}
}
}
variables: {
productId: number | string
}
}
interface BigCommerceSearchProductsOperation {
data: {
site: {
search: {
searchProducts: {
products: Connection<BigCommerceProduct>
}
}
}
}
variables: {
filters: {
searchTerm: string
}
sort: string | null
}
}
interface BigCommerceMenuOperation {
data: {
site: {
categoryTree: BigCommerceCategoryTreeItem[]
}
}
}
interface BigCommerceCategoryOperation {
data: {
site: {
categoryTree: BigCommerceCategory[]
}
}
variables: {
entityId: number
}
}
interface BigCommerceProductsCategoryOperation {
data: {
site: {
category: {
products: Connection<BigCommerceProduct>
}
}
}
variables: {
entityId: number
hideOutOfStock: boolean
sortBy: string
first: number
}
}
interface BigCommerceNewestProductsOperation {
data: {
site: {
newestProducts: Connection<BigCommerceProduct>
}
}
variables: {
first: number
}
}
interface BigCommerceFeaturedProductsOperation {
data: {
site: {
featuredProducts: Connection<BigCommerceProduct>
}
}
variables: {
first?: number
}
}
interface BigCommercePopularProductsOperation {
data: {
site: {
bestSellingProducts: Connection<BigCommerceProduct>
}
}
variables: {
first: number
}
}
interface Category {
name: string
path: string
entityId: number
description: string
children: Category[]
}
interface BigCommerceCategoryOperation {
data: {
site: {
categoryTree: Category[]
}
}
}
interface BigCommercePageOperation {
data: {
site: {
content: {
page: BigCommercePage
}
}
}
variables: { entityId: number }
}
interface BigCommercePagesOperation {
data: {
site: {
content: {
pages: Connection<BigCommercePage>
}
}
}
}
interface BigCommerceCheckout {
subtotal: BigCommerceMoney
grandTotal: BigCommerceMoney
taxTotal: BigCommerceMoney
}
interface BigCommerceSEO {
pageTitle: string
metaDescription: string
metaKeywords: string
}
interface BigCommerceCategory {
entityId: number
name: string
path: string
description: string
seo: BigCommerceSEO
children: BigCommerceCategory[]
}
interface BigCommerceCart {
entityId: string
currencyCode: string
isTaxIncluded: boolean
baseAmount: BigCommerceMoney
discountedAmount: BigCommerceMoney
amount: BigCommerceMoney
discounts: CartDiscount[]
lineItems: CartLineItems
createdAt: { utc: Date }
updatedAt: { utc: Date }
locale: string
}
interface CartLineItems {
physicalItems: PhysicalItem[]
digitalItems: PhysicalItem[]
customItems: CartCustomItem[]
giftCertificates: CartGiftCertificate[]
totalQuantity: number
}
interface CartItem {
quantity: number
productEntityId: number
variantEntityId?: number
}
interface BigCommerceCategoryTreeItem {
name: string
path: string
hasChildren: boolean
entityId: number
children?: BigCommerceCategoryTreeItem[]
}
interface BigCommercePage {
__typename: "NormalPage" | "ContactPage" | "RawHtmlPage" | "BlogIndexPage"
entityId: number
name: string
isVisibleInNavigation: boolean
seo: BigCommerceSEO
path: string
plainTextSummary?: string
htmlBody?: string
}
interface BigCommerceMoney {
value: number
currencyCode: string
}
interface CartDiscount {
entityId: string
discountedAmount: BigCommerceMoney
}
interface CartGiftCertificatePersonDetails {
name: string
email: string
}
interface PhysicalItem {
entityId: number
parentEntityId: number | null
productEntityId: number
variantEntityId: number | null
sku: string
name: string
url: string
imageUrl: string | null
brand: string | null
quantity: number
isTaxable: boolean
listPrice: BigCommerceMoney
extendedListPrice: BigCommerceMoney
selectedOptions: {
entityId: number
name: string
value?: string
date?: { utc: Date }
text?: string
number?: string
fileName?: ScrollSetting
}[]
isShippingRequired: boolean
}
interface CartCustomItem {
entityId: string
productEntityId: undefined
sku: string
name: string
quantity: number
listPrice: BigCommerceMoney
extendedListPrice: BigCommerceMoney
}
interface CartGiftCertificate {
entityId: number
productEntityId: undefined
name: string
amount: BigCommerceMoney
isTaxable: boolean
message: string
sender: CartGiftCertificatePersonDetails
recipient: CartGiftCertificatePersonDetails
}
interface BigCommerceProductVariant {
id: number
entityId: number
sku: string
upc: string | null
isPurchasable: boolean
defaultImage: {
url: string
altText: string
}
prices: {
price: BigCommerceMoney
priceRange: {
min: BigCommerceMoney
max: BigCommerceMoney
}
}
options: {
edges: Array<{
node: {
entityId: number
displayName: string
values: {
edges: Array<{
node: {
entityId: number
label: string
}
}>
}
}
}>
}
}
interface BigCommerceProductOption {
__typename: string
entityId: number
displayName: string
isRequired: boolean
displayStyle: string
values: {
edges: Array<{
node: {
entityId: number
label: string
isDefault: boolean
hexColors: string[]
imageUrl: string | null
isSelected: boolean
}
}>
}
}
interface BigCommerceProduct {
id: number
entityId: number
sku: string
categories: {
edges: {
node: {
name: string
description: string
path: string
entityId: number
}
}[]
}
upc: string | null
name: string
brand: {
name: string
} | null
plainTextDescription: string
description: string
availabilityV2: {
status: "Available" | "Unavailable" | "Preorder"
description: string
}
defaultImage: {
url: string
altText: string
}
images: {
edges: Array<{
node: {
url: string
altText: string
}
}>
}
reviews: {
edges: Array<{
node: {
rating: number
}
}>
}
seo: BigCommerceSEO
path: string
prices: {
price: BigCommerceMoney
salePrice: BigCommerceMoney | null
retailPrice: BigCommerceMoney | null
priceRange: {
min: BigCommerceMoney
max: BigCommerceMoney
}
}
createdAt: {
utc: Date
}
variants: Connection<BigCommerceProductVariant>
productOptions: Connection<BigCommerceProductOption>
}
interface BigCommerceCustomer {
id: number
company: string
first_name: string
last_name: string
email: string
phone: string
store_credit: string
registration_ip_address: string
customer_group_id: number
notes: string
tax_exempt_category: string
authentication?: {
force_password_reset: boolean
new_password: string
}
form_fields: (
| {
name: "birthday"
value: Date | string
customer_id?: number
}
| {
name: "gender"
value: "male" | "female"
customer_id?: number
}
| {
name: "username"
value: string
customer_id?: number
}
)[]
addresses: {
url: string
resource: string
}
}
type BigCommerceError = {
__typename: "EmailAlreadyInUseError"
message: string
}
interface BigCommerceRegisterCustomerOperation {
data: {
customer: {
registerCustomer: {
customer: BigCommerceCustomer
errors?: BigCommerceError[]
}
}
}
variables: {
registerCustomerInput: RegisterCustomerInput
}
}
interface AddWishlistItemsInput {
entityId: number
items: {
productEntityId: number
}[]
}
interface CreateWishlistInput {
name: string
isPublic: boolean
}
interface DeleteWishlistItemsInput {
entityId: number
itemEntityIds: number[]
}
interface DeleteWishlistsInput {
entityIds: number[]
}
interface UpdateWishlistInput {
entityId: number
data: {
name: string
}
}
interface BigCommerceWishlist {
entityId: number
name: string
items: {
edges: {
node: {
product: BigCommerceProduct
}
}[]
}
}
interface BigCommerceAddWishlistItemsOperation {
data: {
wishlist: {
addWishlistItems: {
result: BigCommerceWishlist
}
}
}
variables: {
addWishlistItemsInput: AddWishlistItemsInput
}
}
interface BigCommerceCreateWishlistOperation {
data: {
wishlist: {
createWishlist: {
result: {
entityId: number
name: string
}
}
}
}
variables: {
createWishlistInput: CreateWishlistInput
}
}
interface BigCommerceDeleteWishlistItemsOperation {
data: {
wishlist: {
deleteWishlistItems: {
result: BigCommerceWishlist
}
}
}
variables: {
deleteWishlistItemsInput: DeleteWishlistItemsInput
}
}
interface BigCommerceDeleteWishlistsOperation {
data: {
wishlist: {
deleteWishlists: {
result: boolean
}
}
}
variables: {
deleteWishlistsInput: DeleteWishlistsInput
}
}
interface BigCommerceUpdateWishlistOperation {
data: {
wishlist: {
updateWishlist: {
result: BigCommerceWishlist
}
}
}
variables: {
updateWishlistInput: UpdateWishlistInput
}
}

286
types/content.d.ts vendored Normal file
View File

@@ -0,0 +1,286 @@
interface ContentEntry {
id: string
active: boolean
type: "page" | "block"
name: string
question?: string
path: string
alternativePaths?: {
path: string
}[]
blocks?: ContentBlock[]
meta?: ContentMeta
}
interface ContentMeta {
title: string
description: string
keywords: string
isArticle: boolean
hasFAQ: boolean
FAQ: {
question: string
answer: string
}[]
}
interface ColumnsBlock {
type: "columns"
columns: BlockColumn[]
}
interface CTACol {
upperHeadline: string
description: string
whiteHeadline: string
redHeadline: string
headlineArrangement: "row" | "column"
callToActionButtons: CallToActionButton[]
}
type BlockColumnTypes =
| {
type: "image"
images?: string[]
imageHoverEffect: boolean
imageMobileBackground: boolean
forceFullHeight: boolean
}
| {
type: "text"
text?: string
}
| {
type: "cta"
cta: CTACol
}
| {
type: "chapterDescription"
chapterDescription: {
title: string
description: string
type: number
}
}
type BlockColumn<T extends BlockColumnTypes["type"] | "unknown" = "unknown"> = T extends BlockColumnTypes["type"]
? Extract<BlockColumnTypes, { type: T }> & CommonBlockColumnProperties
: BlockColumnTypes & CommonBlockColumnProperties
type CommonBlockColumnProperties = {
colWidth?: 6 | 4 | -1
verticalAlign: "top" | "middle" | "bottom"
imageMobileBackground: boolean
links?: BlockLink[]
}
enum CTATypes {
PRIMARY = 0,
SECONDARY = 1,
}
interface CallToActionButton {
buttonText: string
page: string
ctaType: CTATypes
buttonTarget: "_self" | "_blank"
}
interface GoogleMapsBlock {
type: "googleMaps"
}
interface ProductSliderBlock {
type: "productSlider"
productSlider: { callToActionButtons: CallToAction[]; headline: string; topLine: string } & (
| { productSource: "manual"; productIds: string[] }
| { productSource: "category"; categoryId: string }
| { productSource: "bestseller" }
| { productSource: "newProducts" }
| { productSource: "featured" }
| { productSource: "discountend"; productIds: string[] }
)
}
interface ImproveYourselfDescriptionBlock {
type: "improveYourselfDescription"
improveYourselfDescription: {
upperDescription: string
lowerDescription: string
image: string
}
}
interface FormBlock {
type: "form"
form: DBFormObj
}
interface PredefinedBlock {
type: "predefinedBlock"
predefinedBlock?: {
id: string
}
}
interface BlockLink {
text: string
url?: string
file?: string
target: "_self" | "_blank"
style:
| "primary"
| "secondary"
| "tertiary"
| "internal"
| "external"
| "download"
| "cardReservation"
| "cardRegistration"
| "batteryService"
}
interface HomepageBlock {
type: "homepage"
mainHomepage: {
cta: CTACol
image: string
}
}
interface SplittedHomepageBlock {
chapters: string[]
type: "splittedHomepage"
}
interface ChapterPreview {
type: "selfImprovementChapterPreview"
selfImprovementChapterPreview: {
chapter: string
previewImage: string
}[]
}
interface BKDFChallenge {
slug: string
type: number
activeAt: Date
title: string
introduction: string[]
images: {
preview: string
detailed: string
}
howItWorks: {
invitation: string
steps: Steps
}
blog: {
blogId: string
thumbnail: string
sources: Source[]
}
}
interface Source {
source: string
url: string
}
interface RatingPreview {
type: "ratingPreview"
ratingPreview: {
ratings: {
rating: string
}[]
}
}
interface Steps {
type: "steps"
steps: {
color: "red"
items: {
nr: number
title: string
descriptions: string[]
image: string
}[]
}
}
type ContentBlockType =
| ColumnsBlock
| GoogleMapsBlock
| ProductSliderBlock
| FormBlock
| PredefinedBlock
| SplittedHomepageBlock
| selfImprovementChapterPreview
| ImproveYourselfDescriptionBlock
| HomepageBlock
| RatingPreview
| Steps
type ContentBlock<T extends ContentBlockType["type"] | "unknown" = "unknown"> = T extends ContentBlockType["type"]
? Extract<ContentBlockType, { type: T }> & CommonProperties
: ContentBlockType & CommonProperties
enum ContentWidth {
FULL = 0,
NARROW = 1,
NORMAL = 2,
}
interface CommonProperties {
headline: string
headlineH1: boolean
headlineLink: string
doublyLined: boolean
subline: string
crinkledSection: boolean
additionalHeightBottom: boolean
anchorId: string
background: {
color: "white" | "black"
image: string
minHeight: "none" | "normal" | "extended"
overlay: boolean
noVerticalPadding: boolean
headerHeightUp: boolean
}
callToActionButtons: CallToActionButton[]
contentWidth: ContentWidth
}
interface CallToAction {
buttonText: string
buttonLink: string
buttonTarget: "_self" | "_blank"
}
interface Overlay {
id: string
content: typeof SvelteComponent
title: typeof SvelteComponent | string
properties: any
closeOnParentOpen?: boolean
active?: boolean
hideTillDispatch?: boolean
}
interface HelpCenterQuestion {
priority: boolean
page: string
}
interface HelpCenterChapter {
title: string
slug: string
brightIcon: string
darkIcon: string
questions: HelpCenterQuestion[]
}
interface ContactRequest {
email: string
name: string
description: string
}
interface Contact {
status: "new" | "inProgress" | "done"
request: ContactRequest
}

3
types/events.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
interface EventCallbacks {
event: string
}

202
types/formComponent.d.ts vendored Normal file
View File

@@ -0,0 +1,202 @@
// Common Interfaces
interface StandardInputProperties {
emailTitle: string
placeholder: string
notRequired: boolean
fieldOrder: number
textTitle: string
groupTitle: string
}
interface TimeRange {
from: string
to: string
}
interface DateRange {
from: Date
to: Date
}
interface Block {
label: string
emailName: string
}
interface LabelNumberInput {
group: number
title: string
emailName: string
block: Block[]
}
type InputWidgets =
| "labelNumber"
| "times"
| "select"
| "defaultCalendar"
| "customCalendar"
| "number"
| "checkboxGroup"
| "text"
| "multiSelect"
| "timeSelect"
| "standardSelect"
// Form Related Interfaces
interface FormValues {
[key: string]: CustomHTMLElement
blockGroups?: Set<number>
}
interface FormObj {
formRows?: string[]
index?: number
formTitle?: string
formValues?: Writable<FormValues>
honey?: boolean
agreement?: boolean
}
interface TempFormBefore {
[rowName: string]: TempFormRowBefore
}
interface TempFormRowBefore {
[newKey: string]: [any, boolean, boolean]
}
interface TempFormAfter {
[rowName: string]: Array<[string, [any, boolean, boolean]]>
}
interface TempFormIndices {
[rowName: string]: {
[newKey: string]: number
}
}
// DB Related Interfaces
interface DBFormObj {
emailSubject: string
emailReciever: string
emailCC: string[]
emailIntroduction: string
sendFormBtnText: string
rows: DBFormRow[]
}
interface DBFormRow {
title: string
emailTitle: string
columns: FormColumn[]
}
// Input Widgets Interfaces
interface CheckboxGroupInput {
groupTitle: string
checkboxes: {
standardInputProperties: StandardInputProperties
emailTitle?: string
textTitle?: string
}[]
}
interface DateInput {
standardInputProperties: StandardInputProperties
}
interface DatePickerInput {
standardInputProperties: StandardInputProperties
props: {
allowedDateRanges: DateRange
excludeDates: string[]
}
}
interface MultiSelectInput {
standardInputProperties: StandardInputProperties
props: {
additionalAddableValues: boolean
}
options: {
name: string
}[]
}
interface NumberInput {
standardInputProperties: StandardInputProperties
}
interface TextInput {
standardInputProperties: StandardInputProperties
textArea: boolean
emailValidation: boolean
telValidation: boolean
}
interface TimesInput {
standardInputProperties: StandardInputProperties
times: TimeRange[]
}
interface TimeSelect {
selectEntries: {
leftSide: string
rightSide: string
}[]
standardInputProperties: StandardInputProperties
}
interface StandardSelect {
selectEntries: {
shownValue: string
value: string
defaultValue: boolean
}[]
standardInputProperties: StandardInputProperties
}
// Widget Interface
interface Widget {
text: (TextInput & StandardInputProperties)[]
number: NumberInput & StandardInputProperties
date: DateInput & StandardInputProperties
times: TimesInput & StandardInputProperties
checkboxGroup: CheckboxGroupInput
datepicker: DatePickerInput & StandardInputProperties
multiselect: MultiSelectInput & StandardInputProperties
labelNumber: LabelNumberInput[] & StandardInputProperties
timeSelect: TimeSelect & StandardInputProperties
standardSelect: StandardSelect & StandardInputProperties
}
interface FormColumn {
emailTitle: string
title: string
annotation: string
inputWidgets: InputWidgets[]
labelNumberInput: LabelNumberInput[]
checkboxGroupInput: CheckboxGroupInput
dateInput: DateInput
datePickerInput: DatePickerInput
multiSelectInput: MultiSelectInput
numberInput: NumberInput
timesInput: TimesInput
textInput: TextInput[]
timeSelect: TimeSelect
standardSelect: StandardSelect
}
type ValueEntry =
| [string, [boolean | string | any, boolean]]
| [string, [any, CustomHTMLElement, string | null, boolean]]
type ObjectEntry = [string, CustomHTMLElement]
interface FormValues {
[key: string]: CustomHTMLElement
blockGroups?: Set<number>
}
interface CustomHTMLElement extends HTMLElement {
checked?: boolean
value?: any
required?: boolean
getAttribute(attr: string): string | null
}

202
types/frontendCommerceTypes.d.ts vendored Normal file
View File

@@ -0,0 +1,202 @@
type Maybe<T> = T | null
interface Connection<T> {
edges: Array<Edge<T>>
}
interface Edge<T> {
node: T
}
interface BKDFPage {
id: string
title: string
handle: string
body: string
bodySummary: string
seo?: BKDFSEO
createdAt: string
updatedAt: string
}
interface BKDFMenu {
title: string
path: string
}
interface BKDFCollection {
handle: string
title: string
description: string
seo: BKDFSEO
updatedAt: string
path: string
}
interface BKDFMoney {
amount: string
currencyCode: string
}
interface Image {
url: string
altText: string
width: number
height: number
}
interface BKDFProduct {
id: string
sku: string
handle: string
availableForSale: boolean
title: string
description: string
descriptionHtml: string
options: BKDFProductOption[]
priceRange: {
maxVariantPrice: BKDFMoney
minVariantPrice: BKDFMoney
}
salePrice: BKDFMoney
retailPrice: BKDFMoney
variants: BKDFProductVariant[]
featuredImage: Image
images: Image[]
seo: BKDFSEO
tags: string[]
updatedAt: string
reviews: {
avgRating: number
}
categories: {
name: string
id: number
description: string
}[]
}
type OptionNames = "Farbe" | "Größe"
interface BKDFProductSelectedOption {
name: OptionNames
value: string
}
interface BKDFProductOption {
id: string
name: string
values: string[]
}
interface BKDFProductVariant {
parentId?: string
id: string
title: string
sku: string
availableForSale: boolean
selectedOptions: {
name: OptionNames
value: string
}[]
price: BKDFMoney
defaultImage: Image
}
interface BKDFSEO {
title: string
description: string
}
interface BKDFCartItem {
id: number
quantity: number
cost: {
totalAmount: BKDFMoney
}
merchandise: {
id: string
title: string
selectedOptions: {
name: string
value: string
}[]
product: BKDFProduct
}
}
interface BKDFCart {
id: string
checkoutUrl?: string
cost: {
baseAmount?: BKDFMoney
discountedAmount: BKDFMoney
couponDiscount?: BKDFMoney
amount: BKDFMoney
discounts?: {
entityId: string
discountedAmount: BKDFMoney
}[]
}
lines: BKDFCartItem[]
totalQuantity?: number
}
interface SortFilterItem {
title: string
slug: string | null
sortKey: keyof typeof BKDFSortKeys
reverse: boolean
}
interface BKDFCustomer {
id: string
email: string
telephone: string
firstName: string
lastName: string
}
interface Address {
firstName: string
lastName: string
address1: string
address2?: string
city: string
stateOrProvince: string
countryCode: string
phone: string
postalCode: string
}
interface RegisterCustomerInput {
firstName: string
lastName: string
email: string
password: string
phone: string
address: Address
}
interface DeleteCustomerAddressInput {
addressEntityId: number
}
interface ChangePasswordInput {
currentPassword: string
newPassword: string
}
interface RequestResetPasswordInput {
email: string
_s: string
_sId: string
}
interface ResetPasswordInput {
password: string
}
interface UpdateCustomerAddressInput {
addressEntityId: number
data: Address
}
interface LoginInput {
email: string
password: string
}

180
types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,180 @@
interface Ssr {
id?: string
path: string
content: string
}
interface ApiOptions {
method?: string
filter?: any
sort?: string
lookup?: string
limit?: number
offset?: number
projection?: string
noError?: boolean
headers?: {
[key: string]: string
}
params?: {
[key: string]: string
}
useJwt?: boolean
jwtToUse?: string
onDownloadProgress?: Function
onUploadProgress?: Function
}
type SidebarOverlay = {
type: "cart"
show: boolean
properties: {
blackArea: {
type: "recommendedProducts"
}
}
}
interface NotificationEntry {
html: string
class: "info" | "success" | "warning" | "error"
timeout?: number
removeOnNewLocation?: boolean
blockUI?: boolean
}
interface LocationStore {
path: string
search: string
hash: string
push: boolean
pop: boolean
url: string
previousLocation?: LocationStore
}
interface ApiResult<T> {
data: T
count: number
}
interface MedialibEntry {
id?: string
title: string
file: FileField
alt?: string
tags?: string[]
type?: "websiteContent"
}
interface FileField {
path: string
src: string
type: string
size: number
}
interface TagEntry {
id: string
name: string
color: string
}
interface DummyCartEndpoint {
operation: "add" | "update" | "delete"
cartId: string
entityId?: string
lineItem?: {
product_id: string
variant_id: string
quantity: number
}
lineItems?: {
product_id: string
variant_id: string
quantity: number
}[]
}
type CollectionName =
| "medialib"
| "content"
| "navigation"
| "tag"
| "dummyCartEndpoint"
| "bannerSlide"
| "productBenefit"
| "qrCode"
| "selfImprovementChapter"
| "rating"
| "bigCommerceProduct"
| "selfImprovementChallenge"
interface ProductBenefit {
title: string
description: string
id: string
}
interface MediaQueryInputObject {
[mediaQuery: string]: [SvelteComponent, Object]
}
interface SocialMediaLinks {
instagramLink?: string
facebookLink?: string
twitterLink?: string
tiktokLink?: string
youtubeLink?: string
}
interface Customer {
socialMediaAccounts: SocialMediaLinks
}
interface SocialMediaLink {
name: string
link: keyof SocialMediaLinks
icon: string
}
interface StateHistory {
state: string
date: Date
active: boolean
icon: any
note?: string
links?: {
link: string
text: string
}[]
}
interface Module {
type: "sizeLabel"
label: string
germanLabelTranslation: string
}
interface StoreStatus {
status: "open" | "login"
password: string
loggedIn?: boolean
}
interface SelfImprovementChapter {
type: number
title: string
alias: string
color: string
shortDescription: string
description: string
previewVideo: string
previewImage: string
locked: boolean
challengePosts: string[]
}
interface ActionApproval {
modalTitle: string
modalText: string
callback: () => void
}

19
types/lighthouse.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
interface lighthouse {
analyzedPaths: string[]
performance: number
accessibility: number
bestPractices: number
seo: number
lighthouseMetrics: {
FCPS: number
FCPV: number
FMPV: number
FMPS: number
SIS: number
SIV: number
TTIS: number
TTIV: number
FPIDS: number
FPIDV: number
}
}

20
types/navigation.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
enum NavigationType {
MainNavigation = 0,
ServiceNavigation = 1,
LegalNavigation = 2,
}
interface NavigationEntry {
type: NavigationType
elements: NavElement[]
}
interface NavigationElement {
name: string
page?: string
hash?: string
external?: boolean
externalUrl?: string
type: "content" | "bigcommerce"
elements?: NavigationElement[]
}

168
types/tibiCommerceRelated.d.ts vendored Normal file
View File

@@ -0,0 +1,168 @@
interface LocalProduct {
id: string
bigCommerceSKU: string
bigCommerceId: number
previewImage: FileField
printfulProductId?: string
sizingChart: TSizeChart
forcedWarning: string
ratings?: ProductRating[]
}
type TSizeChart = SizeChart
interface SizeChart {
id: string
imageURL: string
imageDescription: string
generalDescription: string
availableSizes: string[]
columns: {
germanLabelTranslation?: string
label: string
sizes: string[]
}[]
}
interface CompleteYourLook {
id: string
products: {
productImage: string
productReference: string
imageWidth: number
imageHeight: number
imageTop: number
imageLeft: number
}
}
interface ProductRatingObject {
quality: number
priceQualityRatio: number
comfort: number
overall: number
}
interface ProductRating {
id?: string
bigcommerceOrderId: number
bigCommerceProductId: number
rating: ProductRatingObject
comment: string
title: string
review_date: Date
status: "pending" | "approved" | "rejected"
bigcommerceReviewId?: string
}
interface Login {
created: Date
tokenString: string
tokenData: JWTLoginClaims
customer: Customer
}
interface ServerLogin {
status: 403 | 500 | 200
customer: Customer
created: Date
token: string
log: boolean
}
interface SocialMediaLinks {
instagramLink: string
facebookLink: string
twitterLink: string
youtubeLink: string
tiktokLink: string
}
interface PersonalRecord {
title: string
description: string
priority: number
ageAtRecording: number
recording: string | FileField
thumbnail: string | FileField
}
interface Customer {
username: string
id: string
bigCommerceId: number
email: string
locked: boolean
currentToken: string
socialMediaAccounts: SocialMediaLinks
personalRecords: PersonalRecord[]
}
interface JWTLoginClaims {
exp?: number
bigCommerceId: number
tibiId: string
email: string
}
interface JWTPwResetClaims {
exp?: number
bigCommerceId: number
tibiId: string
check: string
}
interface JWTRefreshClaims {
bigCommerceId: number
tibiId: string
r: 1
}
type PrintfulStates = "draft" | "pending" | "failed" | "canceled" | "inprocess" | "onhold" | "partial" | "fulfilled"
interface PrintfulShipment {
trackingUrl: string
trackingNumber: string
carrier: string
sentAt: Date
}
interface Order {
status: PrintfulStates
statusSetAt: Date
id: string
cost?: string
bigCommerceId: number
customerBigCommerceId: number
customerTibiId: string
products: {
bigCommerceId: number
tibiId: string
}[]
shipments: PrintfulShipment[]
}
interface OrderReturnRequest {
updateTime: Date
insertTime: Date
bigCommerceId: number
id?: string
status: "pending" | "approved" | "rejected" | "refunded" | "failed"
returnShppingLabels: {
cost: number
label: FileField
}[]
products: OrderReturnRequestProduct[]
}
interface OrderReturnRequestProduct {
productId: numberOrderReturnRequestProduct
baseProductId: number
quantity: number
attachedImages: string[]
returnReason: string
}
interface OrderRevokeRequest {
status: "pending" | "refunded"
bigCommerceId: number
printfulId?: string
}
interface QRCode {
customer: string
}