@spree/sdk 0.4.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
  };
@@ -231,6 +278,9 @@ type StoreCountry = {
231
278
  name: string;
232
279
  states_required: boolean;
233
280
  zipcode_required: boolean;
281
+ currency: string | null;
282
+ default_locale: string | null;
283
+ supported_locales: Array<string>;
234
284
  states?: Array<StoreState>;
235
285
  };
236
286
 
@@ -245,6 +295,20 @@ type StoreCreditCard = {
245
295
  gateway_payment_profile_id: string | null;
246
296
  };
247
297
 
298
+ type StoreCurrency = {
299
+ iso_code: string;
300
+ name: string;
301
+ symbol: string;
302
+ };
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
+
248
312
  type StoreCustomer = {
249
313
  id: string;
250
314
  email: string;
@@ -270,6 +334,35 @@ type StoreDigitalLink = {
270
334
  access_limit_exceeded: boolean;
271
335
  };
272
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
+
273
366
  type StoreGiftCard = {
274
367
  id: string;
275
368
  code: string;
@@ -293,9 +386,10 @@ type StoreGiftCard = {
293
386
  type StoreImage = {
294
387
  id: string;
295
388
  viewable_id: string;
296
- position: number;
297
- alt: string | null;
389
+ type: string | null;
298
390
  viewable_type: string;
391
+ position: number | null;
392
+ alt: string | null;
299
393
  created_at: string;
300
394
  updated_at: string;
301
395
  original_url: string | null;
@@ -307,6 +401,48 @@ type StoreImage = {
307
401
  og_image_url: string | null;
308
402
  };
309
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
+
310
446
  type StoreLineItem = {
311
447
  id: string;
312
448
  variant_id: string;
@@ -340,15 +476,9 @@ type StoreLineItem = {
340
476
  digital_links: Array<StoreDigitalLink>;
341
477
  };
342
478
 
343
- type StoreMarket = {
344
- id: string;
479
+ type StoreLocale = {
480
+ code: string;
345
481
  name: string;
346
- currency: string;
347
- default_locale: string;
348
- tax_inclusive: boolean;
349
- default: boolean;
350
- supported_locales: Array<string>;
351
- countries: Array<StoreCountry>;
352
482
  };
353
483
 
354
484
  type StoreMetafield = {
@@ -359,6 +489,16 @@ type StoreMetafield = {
359
489
  value: any;
360
490
  };
361
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
+
362
502
  type StoreOptionType = {
363
503
  id: string;
364
504
  name: string;
@@ -394,6 +534,7 @@ type StoreOrder = {
394
534
  email: string | null;
395
535
  special_instructions: string | null;
396
536
  currency: string;
537
+ locale: string | null;
397
538
  item_count: number;
398
539
  shipment_state: string | null;
399
540
  payment_state: string | null;
@@ -484,7 +625,27 @@ type StorePaymentSetupSession = {
484
625
  type StorePaymentSource = {
485
626
  id: string;
486
627
  gateway_payment_profile_id: string | null;
487
- 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;
488
649
  };
489
650
 
490
651
  type StorePrice = {
@@ -528,6 +689,87 @@ type StoreProduct = {
528
689
  metafields?: Array<StoreMetafield>;
529
690
  };
530
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
+
531
773
  type StoreShipment = {
532
774
  id: string;
533
775
  number: string;
@@ -565,6 +807,16 @@ type StoreState = {
565
807
  name: string;
566
808
  };
567
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
+
568
820
  type StoreStockLocation = {
569
821
  id: string;
570
822
  state_abbr: string | null;
@@ -577,6 +829,28 @@ type StoreStockLocation = {
577
829
  state_text: string | null;
578
830
  };
579
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
+
580
854
  type StoreStoreCredit = {
581
855
  id: string;
582
856
  amount: string;
@@ -595,22 +869,16 @@ type StoreStore = {
595
869
  meta_description: string | null;
596
870
  meta_keywords: string | null;
597
871
  seo_title: string | null;
598
- default_currency: string;
599
872
  code: string;
600
- default: boolean;
601
873
  facebook: string | null;
602
874
  twitter: string | null;
603
875
  instagram: string | null;
604
876
  customer_support_email: string | null;
605
- default_locale: string;
606
877
  created_at: string;
607
878
  updated_at: string;
608
- default_country_iso: string | null;
609
- supported_currencies: Array<string>;
610
879
  favicon_image_url: string | null;
611
880
  logo_image_url: string | null;
612
881
  social_image_url: string | null;
613
- supported_locales: Array<string>;
614
882
  payment_methods: Array<StorePaymentMethod>;
615
883
  };
616
884
 
@@ -758,12 +1026,20 @@ interface OrderListParams extends ListParams {
758
1026
  'q[completed_at_gte]'?: string;
759
1027
  'q[completed_at_lte]'?: string;
760
1028
  }
1029
+ interface CreateCartParams {
1030
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1031
+ metadata?: Record<string, unknown>;
1032
+ }
761
1033
  interface AddLineItemParams {
762
1034
  variant_id: string;
763
1035
  quantity: number;
1036
+ /** Arbitrary key-value metadata (stored, not returned in responses) */
1037
+ metadata?: Record<string, unknown>;
764
1038
  }
765
1039
  interface UpdateLineItemParams {
766
- quantity: number;
1040
+ quantity?: number;
1041
+ /** Arbitrary key-value metadata (merged with existing) */
1042
+ metadata?: Record<string, unknown>;
767
1043
  }
768
1044
  interface AddressParams {
769
1045
  firstname: string;
@@ -784,7 +1060,10 @@ interface AddressParams {
784
1060
  interface UpdateOrderParams {
785
1061
  email?: string;
786
1062
  currency?: string;
1063
+ locale?: string;
787
1064
  special_instructions?: string;
1065
+ /** Arbitrary key-value metadata (merged with existing) */
1066
+ metadata?: Record<string, unknown>;
788
1067
  /** Existing address ID to use */
789
1068
  bill_address_id?: string;
790
1069
  /** Existing address ID to use */
@@ -869,4 +1148,4 @@ interface ProductFiltersParams {
869
1148
  q?: Record<string, unknown>;
870
1149
  }
871
1150
 
872
- 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, StoreCustomer, StoreDigitalLink, StoreGiftCard, StoreImage, StoreLineItem, StoreMarket, 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 };