components
2 years ago
functions
3 years ago
global
4 years ago
services
3 years ago
store
2 years ago
testing
4 years ago
components.d.ts
2 years ago
global.d.ts
4 years ago
index.d.ts
3 years ago
stencil-public-runtime.d.ts
3 years ago
types.d.ts
2 years ago
types.d.ts
986 lines
| 1 | import { ObservableMap } from '@stencil/store'; |
| 2 | import { IconLibraryMutator, IconLibraryResolver } from './components/ui/icon/library'; |
| 3 | declare global { |
| 4 | interface Window { |
| 5 | grecaptcha: any; |
| 6 | surecart?: { |
| 7 | product?: { |
| 8 | store: ObservableMap<any>; |
| 9 | state: any; |
| 10 | update: Function; |
| 11 | }; |
| 12 | }; |
| 13 | wp: { |
| 14 | apiFetch: any; |
| 15 | blocks: any; |
| 16 | i18n: any; |
| 17 | }; |
| 18 | dataLayer: any; |
| 19 | gtag: any; |
| 20 | sc?: { |
| 21 | store?: { |
| 22 | product?: any; |
| 23 | }; |
| 24 | }; |
| 25 | scStore: any; |
| 26 | registerSureCartIconPath: (path: string) => void; |
| 27 | registerSureCartIconLibrary: (name: string, options: { |
| 28 | resolver: IconLibraryResolver; |
| 29 | mutator?: IconLibraryMutator; |
| 30 | }) => void; |
| 31 | scIcons: { |
| 32 | path: string; |
| 33 | }; |
| 34 | scData: { |
| 35 | cdn_root: string; |
| 36 | root_url: string; |
| 37 | page_id: string; |
| 38 | do_not_persist_cart: boolean; |
| 39 | nonce: string; |
| 40 | base_url: string; |
| 41 | nonce_endpoint: string; |
| 42 | recaptcha_site_key: string; |
| 43 | theme: string; |
| 44 | product_data: { |
| 45 | checkout_link: string; |
| 46 | mode: 'live' | 'test'; |
| 47 | form: { |
| 48 | ID: number; |
| 49 | }; |
| 50 | product: Product; |
| 51 | }; |
| 52 | pages: { |
| 53 | dashboard: string; |
| 54 | checkout: string; |
| 55 | }; |
| 56 | currency: string; |
| 57 | is_claimed: string; |
| 58 | claim_url: string; |
| 59 | admin_url: string; |
| 60 | user_permissions: { |
| 61 | manage_sc_shop_settings: boolean; |
| 62 | }; |
| 63 | }; |
| 64 | ceRegisterIconLibrary: any; |
| 65 | ResizeObserver: any; |
| 66 | } |
| 67 | } |
| 68 | export type RecursivePartial<T> = { |
| 69 | [P in keyof T]?: RecursivePartial<T[P]>; |
| 70 | }; |
| 71 | interface Model { |
| 72 | created_at: number; |
| 73 | updated_at: number; |
| 74 | } |
| 75 | export interface ChoiceItem extends Object { |
| 76 | value: string; |
| 77 | label: string; |
| 78 | disabled?: boolean; |
| 79 | checked?: boolean; |
| 80 | choices?: ChoiceItem[]; |
| 81 | suffix?: string; |
| 82 | icon?: string; |
| 83 | } |
| 84 | export type ChoiceType = 'all' | 'single' | 'multiple'; |
| 85 | export interface Price { |
| 86 | id: string; |
| 87 | name: string; |
| 88 | description?: string; |
| 89 | amount: number; |
| 90 | currency: string; |
| 91 | recurring: boolean; |
| 92 | recurring_interval?: 'week' | 'month' | 'year' | 'never'; |
| 93 | recurring_interval_count?: number; |
| 94 | trial_duration_days?: number; |
| 95 | ad_hoc: boolean; |
| 96 | ad_hoc_max_amount: number; |
| 97 | ad_hoc_min_amount: number; |
| 98 | scratch_amount: number; |
| 99 | setup_fee_enabled: boolean; |
| 100 | setup_fee_amount: number; |
| 101 | setup_fee_name: string; |
| 102 | setup_fee_trial_enabled: boolean; |
| 103 | recurring_period_count: number; |
| 104 | archived: boolean; |
| 105 | product_id?: string; |
| 106 | archived_at?: string; |
| 107 | created_at: number; |
| 108 | updated_at: number; |
| 109 | product?: Product | string; |
| 110 | position: number; |
| 111 | metadata: { |
| 112 | [key: string]: string; |
| 113 | }; |
| 114 | } |
| 115 | export interface Bump { |
| 116 | id: string; |
| 117 | object: 'bump'; |
| 118 | amount_off: number; |
| 119 | archived: boolean; |
| 120 | archived_at: number; |
| 121 | auto_apply: boolean; |
| 122 | filter_match_type: 'all' | 'any' | 'none'; |
| 123 | filters: any; |
| 124 | metadata: any; |
| 125 | name: string; |
| 126 | percent_off: number; |
| 127 | price: string | Price; |
| 128 | priority: 1 | 2 | 3 | 4 | 5; |
| 129 | created_at: number; |
| 130 | updated_at: number; |
| 131 | } |
| 132 | export type Prices = { |
| 133 | [id: string]: Price; |
| 134 | }; |
| 135 | export interface Media { |
| 136 | id: string; |
| 137 | object: 'media'; |
| 138 | byte_size: number; |
| 139 | content_type: string; |
| 140 | extension: string; |
| 141 | filename: string; |
| 142 | public_access: boolean; |
| 143 | release_json: any; |
| 144 | url?: string; |
| 145 | url_expires_at?: number; |
| 146 | updated_at: number; |
| 147 | created_at: number; |
| 148 | } |
| 149 | export interface Download { |
| 150 | id: string; |
| 151 | object: 'download'; |
| 152 | archived: boolean; |
| 153 | archived_at?: number; |
| 154 | media: string | Media; |
| 155 | name?: string; |
| 156 | product: string | Product; |
| 157 | update_at: number; |
| 158 | created_at: number; |
| 159 | url?: string; |
| 160 | } |
| 161 | export type FormState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalizing' | 'paying' | 'confirming' | 'confirmed' | 'paid' | 'failure' | 'expired' | 'redirecting'; |
| 162 | export type FormStateSetter = 'RESOLVE' | 'REJECT' | 'FINALIZE' | 'PAYING' | 'PAID' | 'EXPIRE' | 'FETCH'; |
| 163 | export interface License { |
| 164 | id: string; |
| 165 | object: 'license'; |
| 166 | activation_limit: number; |
| 167 | key: string; |
| 168 | activations?: { |
| 169 | object: 'list'; |
| 170 | pagination: Pagination; |
| 171 | data: Array<Activation>; |
| 172 | }; |
| 173 | status: 'inactive' | 'active' | 'revoked'; |
| 174 | purchase: string | Purchase; |
| 175 | created_at: number; |
| 176 | updated_at: number; |
| 177 | } |
| 178 | export interface CancellationReason { |
| 179 | id: string; |
| 180 | object: 'cancellation_reason'; |
| 181 | archived: boolean; |
| 182 | comment_enabled: false; |
| 183 | comment_prompt: string | null; |
| 184 | coupon_enabled: boolean; |
| 185 | label: string; |
| 186 | position: number; |
| 187 | archived_at: number; |
| 188 | discarded_at: number; |
| 189 | created_at: number; |
| 190 | updated_at: number; |
| 191 | } |
| 192 | export interface Period { |
| 193 | id: string; |
| 194 | object: 'period'; |
| 195 | ad_hoc_amount?: number; |
| 196 | checkout: string | Checkout; |
| 197 | customer_id: string | Customer; |
| 198 | end_at?: number; |
| 199 | next_payment_retry_at: number; |
| 200 | payment_retry_count: number; |
| 201 | price: string | Price; |
| 202 | purchase_id: string | Purchase; |
| 203 | quantity: number; |
| 204 | renewal: boolean; |
| 205 | skip_proration: boolean; |
| 206 | start_at: number; |
| 207 | status: 'draft'; |
| 208 | subscription: string | Subscription; |
| 209 | created_at: number; |
| 210 | updated_at: number; |
| 211 | } |
| 212 | export interface Activation { |
| 213 | id: string; |
| 214 | object: 'activation'; |
| 215 | name: string; |
| 216 | counted: boolean; |
| 217 | fingerprint: string; |
| 218 | license: string | License; |
| 219 | created_at: number; |
| 220 | updated_at: number; |
| 221 | } |
| 222 | export interface Product extends Object { |
| 223 | id: string; |
| 224 | name: string; |
| 225 | description: string; |
| 226 | archived: boolean; |
| 227 | archived_at: string; |
| 228 | metadata: any; |
| 229 | image_url: string; |
| 230 | recurring: boolean; |
| 231 | tax_category: string; |
| 232 | tax_enabled: boolean; |
| 233 | purchase_limit: number; |
| 234 | permalink: string; |
| 235 | weight: number; |
| 236 | weight_unit: 'kg' | 'lb' | 'g' | 'oz'; |
| 237 | prices: { |
| 238 | object: 'list'; |
| 239 | pagination: Pagination; |
| 240 | data: Array<Price>; |
| 241 | }; |
| 242 | product_medias: { |
| 243 | object: 'list'; |
| 244 | pagination: Pagination; |
| 245 | data: Array<ProductMedia>; |
| 246 | }; |
| 247 | downloads: { |
| 248 | object: 'list'; |
| 249 | pagination: Pagination; |
| 250 | data: Array<Download>; |
| 251 | }; |
| 252 | created_at: number; |
| 253 | updated_at: number; |
| 254 | } |
| 255 | export type Products = { |
| 256 | [id: string]: Product; |
| 257 | }; |
| 258 | export interface Collection extends Object { |
| 259 | id: string; |
| 260 | name: string; |
| 261 | description: string; |
| 262 | image_url: string; |
| 263 | created_at: number; |
| 264 | updated_at: number; |
| 265 | } |
| 266 | export interface Coupon extends Model { |
| 267 | id: string; |
| 268 | object: 'coupon'; |
| 269 | amount_off: number; |
| 270 | valid?: boolean; |
| 271 | expired: boolean; |
| 272 | currency: string; |
| 273 | duration: string; |
| 274 | duration_in_months: number; |
| 275 | max_redemptions: number; |
| 276 | metadata: Object; |
| 277 | name: string; |
| 278 | percent_off: number; |
| 279 | redeem_by: number; |
| 280 | times_redeemed: number; |
| 281 | } |
| 282 | export interface LineItemData extends Object { |
| 283 | id?: string; |
| 284 | price_id?: string; |
| 285 | bump?: string; |
| 286 | quantity: number; |
| 287 | ad_hoc_amount?: number; |
| 288 | } |
| 289 | export type LineItemsData = { |
| 290 | [id: string]: Array<LineItemData>; |
| 291 | }; |
| 292 | export interface LineItem extends Object { |
| 293 | id?: string; |
| 294 | ad_hoc_amount?: number; |
| 295 | name: string; |
| 296 | object: string; |
| 297 | quantity: number; |
| 298 | checkout: string | Checkout; |
| 299 | bump: string | Bump; |
| 300 | fees?: { |
| 301 | object: 'list'; |
| 302 | pagination: Pagination; |
| 303 | data: Array<Fee>; |
| 304 | }; |
| 305 | bump_amount: number; |
| 306 | discount_amount: number; |
| 307 | subtotal_amount: number; |
| 308 | total_amount: number; |
| 309 | scratch_amount: number; |
| 310 | total_savings_amount: number; |
| 311 | created_at: number; |
| 312 | updated_at: number; |
| 313 | price?: Price; |
| 314 | price_id: string; |
| 315 | } |
| 316 | export interface DeletedItem { |
| 317 | cache_status: string; |
| 318 | deleted: boolean; |
| 319 | id: string; |
| 320 | object: string; |
| 321 | } |
| 322 | export interface Fee { |
| 323 | id: string; |
| 324 | object: 'fee'; |
| 325 | amount: number; |
| 326 | description: string; |
| 327 | fee_type: 'manual' | 'bump' | 'setup'; |
| 328 | line_item: string | LineItem; |
| 329 | created_at: number; |
| 330 | updated_at: number; |
| 331 | } |
| 332 | export interface InvoiceItem extends LineItem { |
| 333 | } |
| 334 | export interface PriceChoice { |
| 335 | id: string; |
| 336 | product_id: string; |
| 337 | quantity: number; |
| 338 | enabled: boolean; |
| 339 | selected?: boolean; |
| 340 | } |
| 341 | export type CheckoutState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalized' | 'paid' | 'failure'; |
| 342 | export type TaxStatus = 'disabled' | 'address_invalid' | 'reverse_charged' | 'tax_registration_not_found' | 'tax_zone_not_found' | 'estimated' | 'calculated'; |
| 343 | export interface Invoice extends Object { |
| 344 | id: string; |
| 345 | object: 'invoice'; |
| 346 | currency: string; |
| 347 | amount_due: number; |
| 348 | invoice_items: { |
| 349 | object: 'list'; |
| 350 | pagination: Pagination; |
| 351 | data: Array<InvoiceItem>; |
| 352 | }; |
| 353 | discount_amount: number; |
| 354 | live_mode: boolean; |
| 355 | metadata: object; |
| 356 | number: string; |
| 357 | period_end_at: number; |
| 358 | period_start_at: number; |
| 359 | proration_amount: number; |
| 360 | processor_data: { |
| 361 | stripe: object; |
| 362 | }; |
| 363 | status: OrderStatus; |
| 364 | subtotal_amount: number; |
| 365 | tax_amount: number; |
| 366 | tax_status: TaxStatus; |
| 367 | tax_label: string; |
| 368 | total_amount: number; |
| 369 | billing_address: string | BillingAddress; |
| 370 | charge: string | Charge; |
| 371 | customer: string | Customer; |
| 372 | discount: string | object; |
| 373 | payment_intent: string | PaymentIntent; |
| 374 | payment_method: string | PaymentMethod; |
| 375 | shipping_address: string | ShippingAddress; |
| 376 | subscription: string | Subscription; |
| 377 | tax_identifier: string | object; |
| 378 | url: string; |
| 379 | created_at: number; |
| 380 | updated_at: number; |
| 381 | } |
| 382 | export interface BillingAddress extends Address { |
| 383 | } |
| 384 | export interface ShippingAddress extends Address { |
| 385 | } |
| 386 | export interface ProductGroup { |
| 387 | id: string; |
| 388 | object: 'product_group'; |
| 389 | archived: boolean; |
| 390 | archived_at: number; |
| 391 | metadata: object; |
| 392 | name: string; |
| 393 | created_at: number; |
| 394 | updated_at: number; |
| 395 | } |
| 396 | export interface ProductMedia { |
| 397 | id: string; |
| 398 | object: 'product_media'; |
| 399 | position: number; |
| 400 | url: null; |
| 401 | media: string | Media; |
| 402 | product: string | Product; |
| 403 | created_at: number; |
| 404 | updated_at: number; |
| 405 | } |
| 406 | export interface Charge extends Object { |
| 407 | amount: number; |
| 408 | created_at: number; |
| 409 | currency: string; |
| 410 | customer: string | Customer; |
| 411 | external_charge_id: string; |
| 412 | fully_refunded: boolean; |
| 413 | id: string; |
| 414 | invoice: string | Invoice; |
| 415 | live_mode: boolean; |
| 416 | object: 'charge'; |
| 417 | checkout: string | Checkout; |
| 418 | payment_method: string | PaymentMethod; |
| 419 | refunded_amount: number; |
| 420 | status: 'pending' | 'succeeded' | 'failed'; |
| 421 | updated_at: number; |
| 422 | } |
| 423 | export interface TaxIdentifier { |
| 424 | id: string; |
| 425 | number: string; |
| 426 | number_type: string; |
| 427 | object: 'tax_identifier'; |
| 428 | eu_vat_verified: boolean; |
| 429 | created_at: number; |
| 430 | updated_at: number; |
| 431 | } |
| 432 | export interface TaxProtocol { |
| 433 | id: string; |
| 434 | object: 'tax_protocol'; |
| 435 | ca_tax_enabled: boolean; |
| 436 | eu_micro_exemption_enabled: boolean; |
| 437 | eu_tax_enabled: boolean; |
| 438 | eu_vat_required: boolean; |
| 439 | eu_vat_unverified_behavior: 'error' | 'apply_reverse_charge' | 'skip_reverse_charge'; |
| 440 | eu_vat_local_reverse_charge: boolean; |
| 441 | tax_enabled: boolean; |
| 442 | address: string | Address; |
| 443 | ca_tax_identifier: string | TaxIdentifier; |
| 444 | eu_tax_identifier: string | TaxIdentifier; |
| 445 | created_at: number; |
| 446 | updated_at: number; |
| 447 | } |
| 448 | export interface Order extends Object { |
| 449 | id?: string; |
| 450 | object: 'order'; |
| 451 | number?: string; |
| 452 | order_type?: 'checkout' | 'subscription'; |
| 453 | statement_url?: string; |
| 454 | status?: OrderStatus; |
| 455 | shipment_status?: OrderShipmentStatus; |
| 456 | checkout?: Checkout | string; |
| 457 | created_at: number; |
| 458 | updated_at: number; |
| 459 | } |
| 460 | export interface ShippingChoice { |
| 461 | amount: number; |
| 462 | checkout: string | Checkout; |
| 463 | currency: string; |
| 464 | id: string; |
| 465 | object: 'shipping_choice'; |
| 466 | shipping_method: string | ShippingMethod; |
| 467 | created_at: number; |
| 468 | updated_at: number; |
| 469 | } |
| 470 | export interface ShippingMethod { |
| 471 | name: string; |
| 472 | description: string; |
| 473 | id: string; |
| 474 | object: 'shipping_method'; |
| 475 | position: number; |
| 476 | created_at: number; |
| 477 | updated_at: number; |
| 478 | } |
| 479 | export interface Checkout extends Object { |
| 480 | id?: string; |
| 481 | status?: 'canceled' | 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'processing'; |
| 482 | staged_payment_intents: { |
| 483 | object: 'list'; |
| 484 | pagination: Pagination; |
| 485 | data: Array<PaymentIntent>; |
| 486 | }; |
| 487 | abandoned_checkout_enabled: boolean; |
| 488 | bump_amount: number; |
| 489 | payment_method_required?: boolean; |
| 490 | manual_payment: boolean; |
| 491 | manual_payment_method?: string | ManualPaymentMethod; |
| 492 | reusable_payment_method_required?: boolean; |
| 493 | number?: string; |
| 494 | amount_due?: number; |
| 495 | trial_amount?: number; |
| 496 | charge?: string | Charge; |
| 497 | name?: string; |
| 498 | first_name?: string; |
| 499 | last_name?: string; |
| 500 | email?: string; |
| 501 | phone?: string; |
| 502 | live_mode?: boolean; |
| 503 | currency?: string; |
| 504 | total_amount?: number; |
| 505 | subtotal_amount?: number; |
| 506 | full_amount?: number; |
| 507 | proration_amount?: number; |
| 508 | total_savings_amount?: number; |
| 509 | applied_balance_amount?: number; |
| 510 | discounts?: number; |
| 511 | tax_enabled: boolean; |
| 512 | tax_amount: number; |
| 513 | email_exists: boolean; |
| 514 | tax_inclusive_amount: number; |
| 515 | tax_exclusive_amount: number; |
| 516 | tax_status: 'disabled' | 'address_invalid' | 'estimated' | 'calculated'; |
| 517 | tax_label: string; |
| 518 | tax_percent: number; |
| 519 | line_items: lineItems; |
| 520 | recommended_bumps?: { |
| 521 | object: 'list'; |
| 522 | pagination: Pagination; |
| 523 | data: Array<Bump>; |
| 524 | }; |
| 525 | metadata?: any; |
| 526 | payment_intent?: PaymentIntent; |
| 527 | payment_method?: PaymentMethod; |
| 528 | order?: string | Order; |
| 529 | customer: string | Customer; |
| 530 | subscriptions: { |
| 531 | object: 'list'; |
| 532 | pagination: Pagination; |
| 533 | data: Array<Subscription>; |
| 534 | }; |
| 535 | purchases: { |
| 536 | object: 'list'; |
| 537 | pagination: Pagination; |
| 538 | data: Array<Purchase>; |
| 539 | }; |
| 540 | discount_amount?: number; |
| 541 | discount?: DiscountResponse; |
| 542 | billing_address?: string | Address; |
| 543 | shipping_amount?: number; |
| 544 | shipping_address?: string | Address; |
| 545 | shipping_enabled?: boolean; |
| 546 | shipping_choices?: { |
| 547 | object: 'list'; |
| 548 | pagination: Pagination; |
| 549 | data: Array<ShippingChoice>; |
| 550 | }; |
| 551 | selected_shipping_choice?: string | ShippingChoice; |
| 552 | selected_shipping_choice_required: boolean; |
| 553 | processor_data?: ProcessorData; |
| 554 | tax_identifier?: { |
| 555 | number: string; |
| 556 | number_type: string; |
| 557 | }; |
| 558 | url: string; |
| 559 | created_at?: number; |
| 560 | } |
| 561 | export interface ShippingMethod { |
| 562 | id: string; |
| 563 | object: 'shipping_method'; |
| 564 | description: string | null; |
| 565 | name: string; |
| 566 | position: number; |
| 567 | created_at: number; |
| 568 | updated_at: number; |
| 569 | } |
| 570 | export interface ShippingChoice { |
| 571 | id: string; |
| 572 | object: 'shipping_choice'; |
| 573 | amount: number; |
| 574 | currency: string; |
| 575 | checkout: string | Checkout; |
| 576 | shipping_method: string | ShippingMethod; |
| 577 | created_at: number; |
| 578 | updated_at: number; |
| 579 | } |
| 580 | export interface ProcessorData { |
| 581 | stripe: { |
| 582 | account_id: string; |
| 583 | publishable_key: string; |
| 584 | client_secret?: string; |
| 585 | type: 'payment' | 'setup'; |
| 586 | }; |
| 587 | paypal: { |
| 588 | account_id: string; |
| 589 | client_id: string; |
| 590 | merchant_initiated: boolean; |
| 591 | }; |
| 592 | mollie?: { |
| 593 | account_id: 'string'; |
| 594 | checkout_url: 'string'; |
| 595 | }; |
| 596 | paystack: { |
| 597 | account_id: string; |
| 598 | public_key: string; |
| 599 | access_code: string; |
| 600 | }; |
| 601 | } |
| 602 | export interface ManualPaymentMethod { |
| 603 | id: string; |
| 604 | object: 'manual_payment_method'; |
| 605 | archived: boolean; |
| 606 | archived_at: number; |
| 607 | description: string; |
| 608 | instructions: string; |
| 609 | name: string; |
| 610 | created_at: number; |
| 611 | updated_at: number; |
| 612 | } |
| 613 | export interface PaymentMethodType { |
| 614 | id: string; |
| 615 | description: string; |
| 616 | image: string; |
| 617 | } |
| 618 | export interface Processor { |
| 619 | id: string; |
| 620 | live_mode: boolean; |
| 621 | processor_data: { |
| 622 | account_id: string; |
| 623 | recurring_enabled: boolean; |
| 624 | client_id: string; |
| 625 | merchant_initiated?: boolean; |
| 626 | }; |
| 627 | recurring_enabled: boolean; |
| 628 | supported_currencies: Array<string>; |
| 629 | processor_type: 'paypal' | 'stripe' | 'mollie'; |
| 630 | } |
| 631 | export interface Purchase { |
| 632 | id: string; |
| 633 | object: 'purchase'; |
| 634 | live_mode: boolean; |
| 635 | quantity: number; |
| 636 | revoked: boolean; |
| 637 | revoked_at: number; |
| 638 | customer: string | Customer; |
| 639 | invoice_item: string | InvoiceItem; |
| 640 | invoice: string | Invoice; |
| 641 | line_item: string | LineItem; |
| 642 | order: string | Order; |
| 643 | product: string | Product; |
| 644 | refund: string | Refund; |
| 645 | subscription: string | Subscription; |
| 646 | license: string | License; |
| 647 | created_at: number; |
| 648 | updated_at: number; |
| 649 | } |
| 650 | export interface Refund { |
| 651 | id: string; |
| 652 | object: 'refund'; |
| 653 | amount: number; |
| 654 | currency: string; |
| 655 | external_refund_id: string; |
| 656 | live_mode: boolean; |
| 657 | metadata: object; |
| 658 | reason: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'expired_uncaptured_charge'; |
| 659 | status: 'pending' | 'succeeded' | 'failed' | 'canceled'; |
| 660 | charge: string | Charge; |
| 661 | customer: string | Customer; |
| 662 | revoked_purchases: null | Array<Purchase>; |
| 663 | created_at: number; |
| 664 | updated_at: number; |
| 665 | } |
| 666 | export interface Subscription extends Object { |
| 667 | id: string; |
| 668 | object: 'subscription'; |
| 669 | currency?: string; |
| 670 | status: SubscriptionStatus; |
| 671 | live_mode: boolean; |
| 672 | external_subscription_id: string; |
| 673 | current_cancellation_act: string | CancellationAct; |
| 674 | trial_end_at: number; |
| 675 | processor_type: 'stripe' | 'paypal'; |
| 676 | order: Order; |
| 677 | customer: Customer; |
| 678 | discount: DiscountResponse; |
| 679 | finite: boolean; |
| 680 | pending_update: { |
| 681 | ad_hoc_amount?: number; |
| 682 | price?: string; |
| 683 | quantity?: number; |
| 684 | }; |
| 685 | purchase: Purchase | string; |
| 686 | cancel_at_period_end: number | false; |
| 687 | current_period: string | Period; |
| 688 | current_period_end_at: number | false; |
| 689 | current_period_start_at: number | false; |
| 690 | remaining_period_count: number | null; |
| 691 | ended_at: number; |
| 692 | end_behavior: 'cancel' | 'complete'; |
| 693 | payment_method: PaymentMethod | string; |
| 694 | price: Price; |
| 695 | ad_hoc_amount: number; |
| 696 | created_at: number; |
| 697 | updated_at: number; |
| 698 | restore_at?: number; |
| 699 | } |
| 700 | export interface CancellationAct { |
| 701 | id: string; |
| 702 | object: 'cancellation_act'; |
| 703 | cancellation_reason: string | CancellationReason; |
| 704 | comment: string; |
| 705 | coupon_applied: boolean; |
| 706 | preserved: boolean; |
| 707 | subscription: string | Subscription; |
| 708 | performed_at: number; |
| 709 | created_at: number; |
| 710 | updated_at: number; |
| 711 | } |
| 712 | export interface SubscriptionProtocol { |
| 713 | id: string; |
| 714 | object: 'subscription_protocol'; |
| 715 | cancel_behavior: 'pending' | 'immediate'; |
| 716 | downgrade_behavior: 'pending' | 'immediate'; |
| 717 | payment_retry_window_weeks: number; |
| 718 | upgrade_behavior: 'pending' | 'immediate'; |
| 719 | preservation_enabled: boolean; |
| 720 | preservation_locales: { |
| 721 | reasons_title: string; |
| 722 | reasons_description: string; |
| 723 | skip_link: string; |
| 724 | preserve_title: string; |
| 725 | preserve_description: string; |
| 726 | preserve_button: string; |
| 727 | cancel_link: string; |
| 728 | }; |
| 729 | preservation_coupon: Coupon | string; |
| 730 | created_at: number; |
| 731 | updated_at: number; |
| 732 | } |
| 733 | export type SubscriptionStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'completed'; |
| 734 | export type CheckoutStatus = 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'requires_approval'; |
| 735 | export type OrderStatus = 'paid' | 'payment_failed' | 'processing' | 'void' | 'canceled'; |
| 736 | export type OrderFulFillmentStatus = 'fulfilled' | 'unfulfilled' | 'partially_fulfilled' | 'scheduled' | 'on_hold'; |
| 737 | export type OrderShipmentStatus = 'unshipped' | 'shipped' | 'partially_shipped' | 'delivered' | 'unshippable'; |
| 738 | export type FulfillmentStatus = 'unshipped' | 'shipped' | 'delivered' | 'unshippable'; |
| 739 | export interface PaymentMethod extends Object { |
| 740 | id: string; |
| 741 | object: 'payment_method'; |
| 742 | live_mode: boolean; |
| 743 | external_payment_method_id: string; |
| 744 | processor_type: 'stripe' | 'paypal'; |
| 745 | paypal_account: any; |
| 746 | type: string; |
| 747 | bank_account: BankAccount | string; |
| 748 | payment_instrument: PaymentInstrument | string; |
| 749 | payment_intent: PaymentIntent | string; |
| 750 | billing_agreement?: BillingAgreement | string; |
| 751 | card: any; |
| 752 | customer: Customer | string; |
| 753 | created_at: number; |
| 754 | updated_at: number; |
| 755 | } |
| 756 | export interface BankAccount { |
| 757 | id: string; |
| 758 | account_type: 'checking' | 'savings'; |
| 759 | account_holder_type: 'individual' | 'company'; |
| 760 | bank_name: string; |
| 761 | last4: string; |
| 762 | created_at: number; |
| 763 | updated_at: number; |
| 764 | } |
| 765 | export interface PaymentInstrument { |
| 766 | id: string; |
| 767 | instrument_type: string; |
| 768 | metadata: any; |
| 769 | object: 'payment_instrument'; |
| 770 | created_at: number; |
| 771 | updated_at: number; |
| 772 | } |
| 773 | export interface BillingAgreement { |
| 774 | email: string; |
| 775 | external_customer_id: string; |
| 776 | first_name: string; |
| 777 | id: string; |
| 778 | last_name: string; |
| 779 | phone: string; |
| 780 | object: 'billing_agreement'; |
| 781 | created_at: number; |
| 782 | updated_at: number; |
| 783 | } |
| 784 | export interface Pagination { |
| 785 | count: number; |
| 786 | limit: number; |
| 787 | page: number; |
| 788 | url: string; |
| 789 | } |
| 790 | export interface lineItems extends Object { |
| 791 | object: 'list'; |
| 792 | pagination: Pagination; |
| 793 | data: Array<LineItem>; |
| 794 | } |
| 795 | export interface Promotion extends Object { |
| 796 | code: string; |
| 797 | created_at: number; |
| 798 | expired: boolean; |
| 799 | id: string; |
| 800 | max_redemptions: number; |
| 801 | metadata: Object; |
| 802 | object: 'promotion'; |
| 803 | redeem_by: string; |
| 804 | times_redeemed: number; |
| 805 | } |
| 806 | export interface DiscountResponse { |
| 807 | coupon?: Coupon; |
| 808 | id: string; |
| 809 | object: 'discount'; |
| 810 | promotion: Promotion; |
| 811 | } |
| 812 | export interface ResponseError { |
| 813 | code?: string; |
| 814 | message: string; |
| 815 | data?: { |
| 816 | http_status: string; |
| 817 | status?: number; |
| 818 | type: string; |
| 819 | }; |
| 820 | additional_errors?: Array<{ |
| 821 | code: string; |
| 822 | message: string; |
| 823 | data: { |
| 824 | attribute: string; |
| 825 | options: Array<string>; |
| 826 | type: string; |
| 827 | }; |
| 828 | }>; |
| 829 | } |
| 830 | export type ProcessorName = 'stripe' | 'paypal' | 'paypal-card'; |
| 831 | export interface VerificationCode { |
| 832 | id: string; |
| 833 | object: 'verification_code'; |
| 834 | code: number; |
| 835 | verified: boolean; |
| 836 | verified_at: number | null; |
| 837 | created_at: number; |
| 838 | updated_at: number; |
| 839 | } |
| 840 | export interface PaymentIntent extends Object { |
| 841 | id: string; |
| 842 | object: 'payment_intent'; |
| 843 | amount: number; |
| 844 | currency: string; |
| 845 | processor_type: 'stripe' | 'paypal'; |
| 846 | status: 'pending' | 'succeeded' | 'canceled'; |
| 847 | external_intent_id: string; |
| 848 | live_mode: boolean; |
| 849 | processor_data: ProcessorData; |
| 850 | customer: Customer | string; |
| 851 | created_at: number; |
| 852 | updated_at: number; |
| 853 | } |
| 854 | export interface PaymentIntents { |
| 855 | stripe?: PaymentIntent; |
| 856 | paypal?: PaymentIntent; |
| 857 | } |
| 858 | export interface SetupIntent extends Object { |
| 859 | id: string; |
| 860 | object: 'setup_intent'; |
| 861 | processor_type: 'stripe' | 'paypal'; |
| 862 | status: 'pending' | 'succeeded' | 'canceled'; |
| 863 | external_intent_id: string; |
| 864 | live_mode: boolean; |
| 865 | processor_data: ProcessorData; |
| 866 | customer: Customer | string; |
| 867 | created_at: number; |
| 868 | updated_at: number; |
| 869 | } |
| 870 | export interface WordPressUser { |
| 871 | id: number; |
| 872 | display_name: string; |
| 873 | first_name: string; |
| 874 | last_name: string; |
| 875 | email: string; |
| 876 | } |
| 877 | export interface Customer extends Object { |
| 878 | id: string; |
| 879 | email: string; |
| 880 | name?: string; |
| 881 | first_name?: string; |
| 882 | last_name?: string; |
| 883 | phone?: string; |
| 884 | billing_address?: string | Address; |
| 885 | shipping_address?: string | Address; |
| 886 | billing_matches_shipping: boolean; |
| 887 | live_mode: boolean; |
| 888 | unsubscribed: boolean; |
| 889 | default_payment_method: string | PaymentMethod; |
| 890 | tax_identifier: { |
| 891 | number: string; |
| 892 | number_type: string; |
| 893 | }; |
| 894 | created_at: number; |
| 895 | updated_at: number; |
| 896 | } |
| 897 | export interface Address extends Object { |
| 898 | name?: string; |
| 899 | line_1?: string; |
| 900 | line_2?: string; |
| 901 | city?: string; |
| 902 | state?: string; |
| 903 | postal_code?: string; |
| 904 | country?: string; |
| 905 | } |
| 906 | export interface Fulfillment { |
| 907 | id: string; |
| 908 | object: 'fulfillment'; |
| 909 | number: string; |
| 910 | shipment_status: FulfillmentStatus; |
| 911 | trackings: { |
| 912 | object: 'list'; |
| 913 | pagination: Pagination; |
| 914 | data: Array<Tracking>; |
| 915 | }; |
| 916 | fulfillment_items: { |
| 917 | object: 'list'; |
| 918 | pagination: Pagination; |
| 919 | data: Array<FulfillmentItem>; |
| 920 | }; |
| 921 | } |
| 922 | export interface FulfillmentItem { |
| 923 | id: string; |
| 924 | line_item: LineItem; |
| 925 | quantity: number; |
| 926 | fulfillment: string | Fulfillment; |
| 927 | } |
| 928 | export interface Tracking { |
| 929 | courier_name?: string; |
| 930 | number: string; |
| 931 | url: string; |
| 932 | } |
| 933 | export interface PriceData extends Object { |
| 934 | price_id: string; |
| 935 | quantity: number; |
| 936 | removeable: boolean; |
| 937 | } |
| 938 | export type TaxZone = { |
| 939 | label: string; |
| 940 | label_small: string; |
| 941 | }; |
| 942 | export type TaxZones = { |
| 943 | [key in 'ca_gst' | 'au_abn' | 'gb_vat' | 'eu_vat' | 'other']: TaxZone; |
| 944 | }; |
| 945 | export type RuleName = 'total' | 'coupons' | 'products' | 'shipping_country' | 'billing_country' | 'processors'; |
| 946 | export type ArrayOperators = 'all' | 'any' | 'none' | 'exist' | 'not_exist'; |
| 947 | export type NumberOperators = '==' | '!=' | '<' | '>' | '<=' | '>='; |
| 948 | export interface RuleGroup { |
| 949 | group_id: string; |
| 950 | rules: Rule[]; |
| 951 | } |
| 952 | export interface Rule { |
| 953 | condition: RuleName; |
| 954 | operator: NumberOperators | ArrayOperators; |
| 955 | value: string | string[] | { |
| 956 | value: string; |
| 957 | }[]; |
| 958 | } |
| 959 | export interface ProductCollection { |
| 960 | id: string; |
| 961 | object: string; |
| 962 | name: string; |
| 963 | description?: string; |
| 964 | position?: number; |
| 965 | slug: string; |
| 966 | image?: string; |
| 967 | products_count: number; |
| 968 | products?: Product[]; |
| 969 | } |
| 970 | export interface GoogleAnalyticsItem { |
| 971 | item_id: string; |
| 972 | item_name: string; |
| 973 | item_variant?: string; |
| 974 | item_category?: string; |
| 975 | item_category2?: string; |
| 976 | item_category3?: string; |
| 977 | item_category4?: string; |
| 978 | item_category5?: string; |
| 979 | price: number; |
| 980 | quantity: number; |
| 981 | coupon?: string; |
| 982 | currency: string; |
| 983 | discount?: number; |
| 984 | } |
| 985 | export {}; |
| 986 |