@spree/sdk 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,40 @@ type AdminCustomer = {
38
38
  orders?: Array<AdminOrder>;
39
39
  };
40
40
 
41
+ type AdminLineItem = {
42
+ id: string;
43
+ variant_id: string;
44
+ quantity: number;
45
+ currency: string;
46
+ name: string;
47
+ slug: string;
48
+ options_text: string;
49
+ price: string;
50
+ display_price: string;
51
+ total: string;
52
+ display_total: string;
53
+ adjustment_total: string;
54
+ display_adjustment_total: string;
55
+ additional_tax_total: string;
56
+ display_additional_tax_total: string;
57
+ included_tax_total: string;
58
+ display_included_tax_total: string;
59
+ promo_total: string;
60
+ display_promo_total: string;
61
+ pre_tax_amount: string;
62
+ display_pre_tax_amount: string;
63
+ discounted_amount: string;
64
+ display_discounted_amount: string;
65
+ display_compare_at_amount: string | null;
66
+ created_at: string;
67
+ updated_at: string;
68
+ compare_at_amount: string | null;
69
+ thumbnail_url: string | null;
70
+ option_values: Array<StoreOptionValue>;
71
+ digital_links: Array<StoreDigitalLink>;
72
+ metadata: Record<string, unknown> | null;
73
+ };
74
+
41
75
  type AdminMetafield = {
42
76
  id: string;
43
77
  name: string;
@@ -55,6 +89,7 @@ type AdminOrder = {
55
89
  email: string | null;
56
90
  special_instructions: string | null;
57
91
  currency: string;
92
+ locale: string | null;
58
93
  item_count: number;
59
94
  shipment_state: string | null;
60
95
  payment_state: string | null;
@@ -78,7 +113,7 @@ type AdminOrder = {
78
113
  created_at: string;
79
114
  updated_at: string;
80
115
  order_promotions: Array<StoreOrderPromotion>;
81
- line_items: Array<StoreLineItem>;
116
+ line_items: Array<AdminLineItem>;
82
117
  shipments: Array<StoreShipment>;
83
118
  payments: Array<StorePayment>;
84
119
  bill_address: StoreAddress | null;
@@ -93,6 +128,7 @@ type AdminOrder = {
93
128
  approver_id: string | null;
94
129
  canceled_at: string | null;
95
130
  approved_at: string | null;
131
+ metadata: Record<string, unknown> | null;
96
132
  canceler_id: string | null;
97
133
  created_by_id: string | null;
98
134
  user?: AdminCustomer;
@@ -221,6 +257,17 @@ type AdminVariant = {
221
257
  prices?: Array<AdminPrice>;
222
258
  };
223
259
 
260
+ type StoreAsset = {
261
+ id: string;
262
+ viewable_id: string;
263
+ type: string | null;
264
+ viewable_type: string;
265
+ position: number | null;
266
+ alt: string | null;
267
+ created_at: string;
268
+ updated_at: string;
269
+ };
270
+
224
271
  type StoreBase = {
225
272
  id: string;
226
273
  };
@@ -254,6 +301,14 @@ type StoreCurrency = {
254
301
  symbol: string;
255
302
  };
256
303
 
304
+ type StoreCustomerReturn = {
305
+ id: string;
306
+ number: string;
307
+ created_at: string;
308
+ updated_at: string;
309
+ stock_location_id: string | null;
310
+ };
311
+
257
312
  type StoreCustomer = {
258
313
  id: string;
259
314
  email: string;
@@ -279,6 +334,35 @@ type StoreDigitalLink = {
279
334
  access_limit_exceeded: boolean;
280
335
  };
281
336
 
337
+ type StoreDigital = {
338
+ id: string;
339
+ created_at: string;
340
+ updated_at: string;
341
+ variant_id: string | null;
342
+ };
343
+
344
+ type StoreExport = {
345
+ id: string;
346
+ number: string;
347
+ type: string | null;
348
+ format: string | null;
349
+ created_at: string;
350
+ updated_at: string;
351
+ user_id: string | null;
352
+ };
353
+
354
+ type StoreGiftCardBatch = {
355
+ id: string;
356
+ codes_count: number;
357
+ currency: string | null;
358
+ prefix: string | null;
359
+ created_at: string;
360
+ updated_at: string;
361
+ amount: string | null;
362
+ expires_at: string | null;
363
+ created_by_id: string | null;
364
+ };
365
+
282
366
  type StoreGiftCard = {
283
367
  id: string;
284
368
  code: string;
@@ -302,9 +386,10 @@ type StoreGiftCard = {
302
386
  type StoreImage = {
303
387
  id: string;
304
388
  viewable_id: string;
305
- position: number;
306
- alt: string | null;
389
+ type: string | null;
307
390
  viewable_type: string;
391
+ position: number | null;
392
+ alt: string | null;
308
393
  created_at: string;
309
394
  updated_at: string;
310
395
  original_url: string | null;
@@ -316,6 +401,48 @@ type StoreImage = {
316
401
  og_image_url: string | null;
317
402
  };
318
403
 
404
+ type StoreImportRow = {
405
+ id: string;
406
+ row_number: number;
407
+ status: string;
408
+ validation_errors: unknown;
409
+ item_type: string | null;
410
+ created_at: string;
411
+ updated_at: string;
412
+ import_id: string | null;
413
+ item_id: string | null;
414
+ };
415
+
416
+ type StoreImport = {
417
+ id: string;
418
+ number: string;
419
+ type: string | null;
420
+ rows_count: number;
421
+ created_at: string;
422
+ updated_at: string;
423
+ status: string;
424
+ owner_type: string | null;
425
+ owner_id: string | null;
426
+ user_id: string | null;
427
+ };
428
+
429
+ type StoreInvitation = {
430
+ id: string;
431
+ email: string;
432
+ resource_type: string | null;
433
+ inviter_type: string | null;
434
+ invitee_type: string | null;
435
+ created_at: string;
436
+ updated_at: string;
437
+ status: string;
438
+ resource_id: string | null;
439
+ inviter_id: string | null;
440
+ invitee_id: string | null;
441
+ role_id: string | null;
442
+ expires_at: string | null;
443
+ accepted_at: string | null;
444
+ };
445
+
319
446
  type StoreLineItem = {
320
447
  id: string;
321
448
  variant_id: string;
@@ -362,6 +489,16 @@ type StoreMetafield = {
362
489
  value: any;
363
490
  };
364
491
 
492
+ type StoreNewsletterSubscriber = {
493
+ id: string;
494
+ email: string;
495
+ created_at: string;
496
+ updated_at: string;
497
+ verified: boolean;
498
+ verified_at: string | null;
499
+ user_id: string | null;
500
+ };
501
+
365
502
  type StoreOptionType = {
366
503
  id: string;
367
504
  name: string;
@@ -397,6 +534,7 @@ type StoreOrder = {
397
534
  email: string | null;
398
535
  special_instructions: string | null;
399
536
  currency: string;
537
+ locale: string | null;
400
538
  item_count: number;
401
539
  shipment_state: string | null;
402
540
  payment_state: string | null;
@@ -487,7 +625,6 @@ type StorePaymentSetupSession = {
487
625
  type StorePaymentSource = {
488
626
  id: string;
489
627
  gateway_payment_profile_id: string | null;
490
- public_metadata: Record<string, unknown> | null;
491
628
  };
492
629
 
493
630
  type StorePrice = {
@@ -531,6 +668,87 @@ type StoreProduct = {
531
668
  metafields?: Array<StoreMetafield>;
532
669
  };
533
670
 
671
+ type StorePromotion = {
672
+ id: string;
673
+ name: string;
674
+ description: string | null;
675
+ code: string | null;
676
+ type: string | null;
677
+ kind: string | null;
678
+ path: string | null;
679
+ match_policy: string | null;
680
+ usage_limit: number | null;
681
+ advertise: boolean;
682
+ multi_codes: boolean;
683
+ code_prefix: string | null;
684
+ number_of_codes: number | null;
685
+ starts_at: string | null;
686
+ expires_at: string | null;
687
+ created_at: string;
688
+ updated_at: string;
689
+ promotion_category_id: string | null;
690
+ };
691
+
692
+ type StoreRefund = {
693
+ id: string;
694
+ transaction_id: string | null;
695
+ created_at: string;
696
+ updated_at: string;
697
+ amount: string | null;
698
+ payment_id: string | null;
699
+ refund_reason_id: string | null;
700
+ reimbursement_id: string | null;
701
+ };
702
+
703
+ type StoreReimbursement = {
704
+ id: string;
705
+ number: string;
706
+ reimbursement_status: string | null;
707
+ created_at: string;
708
+ updated_at: string;
709
+ total: string | null;
710
+ order_id: string | null;
711
+ customer_return_id: string | null;
712
+ };
713
+
714
+ type StoreReport = {
715
+ id: string;
716
+ type: string | null;
717
+ currency: string | null;
718
+ created_at: string;
719
+ updated_at: string;
720
+ user_id: string | null;
721
+ date_from: string | null;
722
+ date_to: string | null;
723
+ };
724
+
725
+ type StoreReturnAuthorization = {
726
+ id: string;
727
+ number: string;
728
+ created_at: string;
729
+ updated_at: string;
730
+ state: string;
731
+ order_id: string | null;
732
+ stock_location_id: string | null;
733
+ return_authorization_reason_id: string | null;
734
+ };
735
+
736
+ type StoreReturnItem = {
737
+ id: string;
738
+ reception_status: string | null;
739
+ acceptance_status: string | null;
740
+ created_at: string;
741
+ updated_at: string;
742
+ pre_tax_amount: string | null;
743
+ included_tax_total: string | null;
744
+ additional_tax_total: string | null;
745
+ inventory_unit_id: string | null;
746
+ return_authorization_id: string | null;
747
+ customer_return_id: string | null;
748
+ reimbursement_id: string | null;
749
+ exchange_variant_id: string | null;
750
+ };
751
+
534
752
  type StoreShipment = {
535
753
  id: string;
536
754
  number: string;
@@ -568,6 +786,16 @@ type StoreState = {
568
786
  name: string;
569
787
  };
570
788
 
789
+ type StoreStockItem = {
790
+ id: string;
791
+ count_on_hand: number;
792
+ backorderable: boolean;
793
+ created_at: string;
794
+ updated_at: string;
795
+ stock_location_id: string | null;
796
+ variant_id: string | null;
797
+ };
798
+
571
799
  type StoreStockLocation = {
572
800
  id: string;
573
801
  state_abbr: string | null;
@@ -580,6 +808,28 @@ type StoreStockLocation = {
580
808
  state_text: string | null;
581
809
  };
582
810
 
811
+ type StoreStockMovement = {
812
+ id: string;
813
+ quantity: number;
814
+ action: string | null;
815
+ originator_type: string | null;
816
+ created_at: string;
817
+ updated_at: string;
818
+ originator_id: string | null;
819
+ stock_item_id: string | null;
820
+ };
821
+
822
+ type StoreStockTransfer = {
823
+ id: string;
824
+ number: string | null;
825
+ type: string | null;
826
+ reference: string | null;
827
+ created_at: string;
828
+ updated_at: string;
829
+ source_location_id: string | null;
830
+ destination_location_id: string | null;
831
+ };
832
+
583
833
  type StoreStoreCredit = {
584
834
  id: string;
585
835
  amount: string;
@@ -598,22 +848,16 @@ type StoreStore = {
598
848
  meta_description: string | null;
599
849
  meta_keywords: string | null;
600
850
  seo_title: string | null;
601
- default_currency: string;
602
851
  code: string;
603
- default: boolean;
604
852
  facebook: string | null;
605
853
  twitter: string | null;
606
854
  instagram: string | null;
607
855
  customer_support_email: string | null;
608
- default_locale: string;
609
856
  created_at: string;
610
857
  updated_at: string;
611
- default_country_iso: string | null;
612
- supported_currencies: Array<string>;
613
858
  favicon_image_url: string | null;
614
859
  logo_image_url: string | null;
615
860
  social_image_url: string | null;
616
- supported_locales: Array<string>;
617
861
  payment_methods: Array<StorePaymentMethod>;
618
862
  };
619
863
 
@@ -702,6 +946,11 @@ type StoreWishlist = {
702
946
  items?: Array<StoreWishedItem>;
703
947
  };
704
948
 
949
+ interface LocaleDefaults {
950
+ locale?: string;
951
+ currency?: string;
952
+ country?: string;
953
+ }
705
954
  interface PaginationMeta {
706
955
  page: number;
707
956
  limit: number;
@@ -742,31 +991,67 @@ interface RegisterParams {
742
991
  interface ListParams {
743
992
  page?: number;
744
993
  per_page?: number;
745
- includes?: string;
994
+ /** Associations to include. Accepts array or comma-separated string. */
995
+ includes?: string[] | string;
746
996
  }
747
997
  interface ProductListParams extends ListParams {
748
- 'q[name_cont]'?: string;
749
- 'q[price_gte]'?: number;
750
- 'q[price_lte]'?: number;
751
- 'q[taxons_id_eq]'?: string;
998
+ /** Sort: 'price asc', 'price desc', 'best_selling', 'name asc', 'name desc', 'available_on desc', 'available_on asc' */
999
+ sort?: string;
1000
+ /** Full-text search across name and SKU */
1001
+ multi_search?: string;
1002
+ /** Filter: name contains */
1003
+ name_cont?: string;
1004
+ /** Filter: price >= value */
1005
+ price_gte?: number;
1006
+ /** Filter: price <= value */
1007
+ price_lte?: number;
1008
+ /** Filter by option value prefix IDs */
1009
+ with_option_value_ids?: string[];
1010
+ /** Filter: only in-stock products */
1011
+ in_stock?: boolean;
1012
+ /** Filter: only out-of-stock products */
1013
+ out_of_stock?: boolean;
1014
+ /** Filter: products in taxon */
1015
+ taxons_id_eq?: string;
1016
+ /** Any additional Ransack predicate */
1017
+ [key: string]: string | number | boolean | (string | number)[] | undefined;
752
1018
  }
753
1019
  interface TaxonListParams extends ListParams {
754
- 'q[taxonomy_id_eq]'?: string | number;
755
- 'q[parent_id_eq]'?: string | number;
756
- 'q[depth_eq]'?: number;
757
- 'q[name_cont]'?: string;
1020
+ /** Sort order, e.g. 'name asc', 'created_at desc' */
1021
+ sort?: string;
1022
+ /** Filter: name contains */
1023
+ name_cont?: string;
1024
+ taxonomy_id_eq?: string | number;
1025
+ parent_id_eq?: string | number;
1026
+ depth_eq?: number;
1027
+ /** Any additional Ransack predicate */
1028
+ [key: string]: string | number | boolean | (string | number)[] | undefined;
758
1029
  }
759
1030
  interface OrderListParams extends ListParams {
760
- 'q[state_eq]'?: string;
761
- 'q[completed_at_gte]'?: string;
762
- 'q[completed_at_lte]'?: string;
1031
+ /** Sort order, e.g. 'completed_at desc' */
1032
+ sort?: string;
1033
+ /** Full-text search across number, email, customer name */
1034
+ multi_search?: string;
1035
+ state_eq?: string;
1036
+ completed_at_gte?: string;
1037
+ completed_at_lte?: string;
1038
+ /** Any additional Ransack predicate */
1039
+ [key: string]: string | number | boolean | (string | number)[] | undefined;
1040
+ }
1041
+ interface CreateCartParams {
1042
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1043
+ metadata?: Record<string, unknown>;
763
1044
  }
764
1045
  interface AddLineItemParams {
765
1046
  variant_id: string;
766
1047
  quantity: number;
1048
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1049
+ metadata?: Record<string, unknown>;
767
1050
  }
768
1051
  interface UpdateLineItemParams {
769
- quantity: number;
1052
+ quantity?: number;
1053
+ /** Arbitrary key-value metadata (merged with existing) */
1054
+ metadata?: Record<string, unknown>;
770
1055
  }
771
1056
  interface AddressParams {
772
1057
  firstname: string;
@@ -787,7 +1072,10 @@ interface AddressParams {
787
1072
  interface UpdateOrderParams {
788
1073
  email?: string;
789
1074
  currency?: string;
1075
+ locale?: string;
790
1076
  special_instructions?: string;
1077
+ /** Arbitrary key-value metadata (merged with existing) */
1078
+ metadata?: Record<string, unknown>;
791
1079
  /** Existing address ID to use */
792
1080
  bill_address_id?: string;
793
1081
  /** Existing address ID to use */
@@ -819,20 +1107,22 @@ interface CompletePaymentSetupSessionParams {
819
1107
  }
820
1108
  interface FilterOption {
821
1109
  id: string;
822
- label: string;
823
1110
  count: number;
824
1111
  }
825
1112
  interface OptionFilterOption extends FilterOption {
826
1113
  name: string;
1114
+ presentation: string;
827
1115
  position: number;
828
1116
  }
829
- interface TaxonFilterOption extends FilterOption {
1117
+ interface TaxonFilterOption {
1118
+ id: string;
1119
+ name: string;
830
1120
  permalink: string;
1121
+ count: number;
831
1122
  }
832
1123
  interface PriceRangeFilter {
833
1124
  id: 'price';
834
1125
  type: 'price_range';
835
- label: string;
836
1126
  min: number;
837
1127
  max: number;
838
1128
  currency: string;
@@ -840,26 +1130,23 @@ interface PriceRangeFilter {
840
1130
  interface AvailabilityFilter {
841
1131
  id: 'availability';
842
1132
  type: 'availability';
843
- label: string;
844
1133
  options: FilterOption[];
845
1134
  }
846
1135
  interface OptionFilter {
847
1136
  id: string;
848
1137
  type: 'option';
849
- label: string;
850
1138
  name: string;
1139
+ presentation: string;
851
1140
  options: OptionFilterOption[];
852
1141
  }
853
1142
  interface TaxonFilter {
854
1143
  id: 'taxons';
855
1144
  type: 'taxon';
856
- label: string;
857
1145
  options: TaxonFilterOption[];
858
1146
  }
859
1147
  type ProductFilter = PriceRangeFilter | AvailabilityFilter | OptionFilter | TaxonFilter;
860
1148
  interface SortOption {
861
1149
  id: string;
862
- label: string;
863
1150
  }
864
1151
  interface ProductFiltersResponse {
865
1152
  filters: ProductFilter[];
@@ -872,4 +1159,4 @@ interface ProductFiltersParams {
872
1159
  q?: Record<string, unknown>;
873
1160
  }
874
1161
 
875
- export type { AddLineItemParams, AddressParams, AdminCustomer, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, ListParams, LoginCredentials, OptionFilter, OptionFilterOption, OrderListParams, PaginatedResponse, PaginationMeta, PriceRangeFilter, ProductFilter, ProductFiltersParams, ProductFiltersResponse, ProductListParams, RegisterParams, SortOption, StoreAddress, StoreBase, StoreCountry, StoreCreditCard, StoreCurrency, StoreCustomer, StoreDigitalLink, StoreGiftCard, StoreImage, StoreLineItem, StoreLocale, StoreMetafield, StoreOptionType, StoreOptionValue, StoreOrder, StoreOrderPromotion, StorePayment, StorePaymentMethod, StorePaymentSession, StorePaymentSetupSession, StorePaymentSource, StorePrice, StoreProduct, StoreShipment, StoreShippingMethod, StoreShippingRate, StoreState, StoreStockLocation, StoreStore, StoreStoreCredit, StoreTaxon, StoreTaxonomy, StoreVariant, StoreWishedItem, StoreWishlist, TaxonFilter, TaxonFilterOption, TaxonListParams, UpdateLineItemParams, UpdateOrderParams, UpdatePaymentSessionParams };
1162
+ export type { AddLineItemParams, AddressParams, AdminCustomer, AdminLineItem, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, ListParams, LocaleDefaults, LoginCredentials, OptionFilter, OptionFilterOption, OrderListParams, PaginatedResponse, PaginationMeta, PriceRangeFilter, ProductFilter, ProductFiltersParams, ProductFiltersResponse, ProductListParams, RegisterParams, SortOption, StoreAddress, StoreAsset, StoreBase, StoreCountry, StoreCreditCard, StoreCurrency, StoreCustomer, StoreCustomerReturn, StoreDigital, StoreDigitalLink, StoreExport, StoreGiftCard, StoreGiftCardBatch, StoreImage, StoreImport, StoreImportRow, StoreInvitation, StoreLineItem, StoreLocale, StoreMetafield, StoreNewsletterSubscriber, StoreOptionType, StoreOptionValue, StoreOrder, StoreOrderPromotion, StorePayment, StorePaymentMethod, StorePaymentSession, StorePaymentSetupSession, StorePaymentSource, StorePrice, StoreProduct, StorePromotion, StoreRefund, StoreReimbursement, StoreReport, StoreReturnAuthorization, StoreReturnItem, StoreShipment, StoreShippingMethod, StoreShippingRate, StoreState, StoreStockItem, StoreStockLocation, StoreStockMovement, StoreStockTransfer, StoreStore, StoreStoreCredit, StoreTaxon, StoreTaxonomy, StoreVariant, StoreWishedItem, StoreWishlist, TaxonFilter, TaxonFilterOption, TaxonListParams, UpdateLineItemParams, UpdateOrderParams, UpdatePaymentSessionParams };