@spree/sdk 0.5.0 → 0.6.0

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,27 @@ 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;
628
+ };
629
+
630
+ type StorePostCategory = {
631
+ id: string;
632
+ title: string;
633
+ slug: string;
634
+ created_at: string;
635
+ updated_at: string;
636
+ };
637
+
638
+ type StorePost = {
639
+ id: string;
640
+ title: string;
641
+ slug: string;
642
+ meta_title: string | null;
643
+ meta_description: string | null;
644
+ published_at: string | null;
645
+ created_at: string;
646
+ updated_at: string;
647
+ author_id: string | null;
648
+ post_category_id: string | null;
491
649
  };
492
650
 
493
651
  type StorePrice = {
@@ -531,6 +689,87 @@ type StoreProduct = {
531
689
  metafields?: Array<StoreMetafield>;
532
690
  };
533
691
 
692
+ type StorePromotion = {
693
+ id: string;
694
+ name: string;
695
+ description: string | null;
696
+ code: string | null;
697
+ type: string | null;
698
+ kind: string | null;
699
+ path: string | null;
700
+ match_policy: string | null;
701
+ usage_limit: number | null;
702
+ advertise: boolean;
703
+ multi_codes: boolean;
704
+ code_prefix: string | null;
705
+ number_of_codes: number | null;
706
+ starts_at: string | null;
707
+ expires_at: string | null;
708
+ created_at: string;
709
+ updated_at: string;
710
+ promotion_category_id: string | null;
711
+ };
712
+
713
+ type StoreRefund = {
714
+ id: string;
715
+ transaction_id: string | null;
716
+ created_at: string;
717
+ updated_at: string;
718
+ amount: string | null;
719
+ payment_id: string | null;
720
+ refund_reason_id: string | null;
721
+ reimbursement_id: string | null;
722
+ };
723
+
724
+ type StoreReimbursement = {
725
+ id: string;
726
+ number: string;
727
+ reimbursement_status: string | null;
728
+ created_at: string;
729
+ updated_at: string;
730
+ total: string | null;
731
+ order_id: string | null;
732
+ customer_return_id: string | null;
733
+ };
734
+
735
+ type StoreReport = {
736
+ id: string;
737
+ type: string | null;
738
+ currency: string | null;
739
+ created_at: string;
740
+ updated_at: string;
741
+ user_id: string | null;
742
+ date_from: string | null;
743
+ date_to: string | null;
744
+ };
745
+
746
+ type StoreReturnAuthorization = {
747
+ id: string;
748
+ number: string;
749
+ created_at: string;
750
+ updated_at: string;
751
+ state: string;
752
+ order_id: string | null;
753
+ stock_location_id: string | null;
754
+ return_authorization_reason_id: string | null;
755
+ };
756
+
757
+ type StoreReturnItem = {
758
+ id: string;
759
+ reception_status: string | null;
760
+ acceptance_status: string | null;
761
+ created_at: string;
762
+ updated_at: string;
763
+ pre_tax_amount: string | null;
764
+ included_tax_total: string | null;
765
+ additional_tax_total: string | null;
766
+ inventory_unit_id: string | null;
767
+ return_authorization_id: string | null;
768
+ customer_return_id: string | null;
769
+ reimbursement_id: string | null;
770
+ exchange_variant_id: string | null;
771
+ };
772
+
534
773
  type StoreShipment = {
535
774
  id: string;
536
775
  number: string;
@@ -568,6 +807,16 @@ type StoreState = {
568
807
  name: string;
569
808
  };
570
809
 
810
+ type StoreStockItem = {
811
+ id: string;
812
+ count_on_hand: number;
813
+ backorderable: boolean;
814
+ created_at: string;
815
+ updated_at: string;
816
+ stock_location_id: string | null;
817
+ variant_id: string | null;
818
+ };
819
+
571
820
  type StoreStockLocation = {
572
821
  id: string;
573
822
  state_abbr: string | null;
@@ -580,6 +829,28 @@ type StoreStockLocation = {
580
829
  state_text: string | null;
581
830
  };
582
831
 
832
+ type StoreStockMovement = {
833
+ id: string;
834
+ quantity: number;
835
+ action: string | null;
836
+ originator_type: string | null;
837
+ created_at: string;
838
+ updated_at: string;
839
+ originator_id: string | null;
840
+ stock_item_id: string | null;
841
+ };
842
+
843
+ type StoreStockTransfer = {
844
+ id: string;
845
+ number: string | null;
846
+ type: string | null;
847
+ reference: string | null;
848
+ created_at: string;
849
+ updated_at: string;
850
+ source_location_id: string | null;
851
+ destination_location_id: string | null;
852
+ };
853
+
583
854
  type StoreStoreCredit = {
584
855
  id: string;
585
856
  amount: string;
@@ -598,22 +869,16 @@ type StoreStore = {
598
869
  meta_description: string | null;
599
870
  meta_keywords: string | null;
600
871
  seo_title: string | null;
601
- default_currency: string;
602
872
  code: string;
603
- default: boolean;
604
873
  facebook: string | null;
605
874
  twitter: string | null;
606
875
  instagram: string | null;
607
876
  customer_support_email: string | null;
608
- default_locale: string;
609
877
  created_at: string;
610
878
  updated_at: string;
611
- default_country_iso: string | null;
612
- supported_currencies: Array<string>;
613
879
  favicon_image_url: string | null;
614
880
  logo_image_url: string | null;
615
881
  social_image_url: string | null;
616
- supported_locales: Array<string>;
617
882
  payment_methods: Array<StorePaymentMethod>;
618
883
  };
619
884
 
@@ -761,12 +1026,20 @@ interface OrderListParams extends ListParams {
761
1026
  'q[completed_at_gte]'?: string;
762
1027
  'q[completed_at_lte]'?: string;
763
1028
  }
1029
+ interface CreateCartParams {
1030
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1031
+ metadata?: Record<string, unknown>;
1032
+ }
764
1033
  interface AddLineItemParams {
765
1034
  variant_id: string;
766
1035
  quantity: number;
1036
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1037
+ metadata?: Record<string, unknown>;
767
1038
  }
768
1039
  interface UpdateLineItemParams {
769
- quantity: number;
1040
+ quantity?: number;
1041
+ /** Arbitrary key-value metadata (merged with existing) */
1042
+ metadata?: Record<string, unknown>;
770
1043
  }
771
1044
  interface AddressParams {
772
1045
  firstname: string;
@@ -787,7 +1060,10 @@ interface AddressParams {
787
1060
  interface UpdateOrderParams {
788
1061
  email?: string;
789
1062
  currency?: string;
1063
+ locale?: string;
790
1064
  special_instructions?: string;
1065
+ /** Arbitrary key-value metadata (merged with existing) */
1066
+ metadata?: Record<string, unknown>;
791
1067
  /** Existing address ID to use */
792
1068
  bill_address_id?: string;
793
1069
  /** Existing address ID to use */
@@ -872,4 +1148,4 @@ interface ProductFiltersParams {
872
1148
  q?: Record<string, unknown>;
873
1149
  }
874
1150
 
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 };
1151
+ export type { AddLineItemParams, AddressParams, AdminCustomer, AdminLineItem, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, ListParams, 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, StorePost, StorePostCategory, 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 };